🔨 fix typing, add default interop
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import * as path from "path";
|
||||
// @ts-ignore
|
||||
import * as HtmlWebpackPlugin from "html-webpack-plugin";
|
||||
import path from "path";
|
||||
import HtmlWebpackPlugin from "html-webpack-plugin";
|
||||
|
||||
import type { Configuration } from "webpack";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { createCanvas } from "canvas";
|
||||
import { Grid, copyGrid, Color } from "@snk/types/grid";
|
||||
import { Snake } from "@snk/types/snake";
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
getCanvasWorldSize,
|
||||
} from "@snk/draw/drawWorld";
|
||||
import { step } from "@snk/compute/step";
|
||||
import * as tmp from "tmp";
|
||||
import * as execa from "execa";
|
||||
import tmp from "tmp";
|
||||
import execa from "execa";
|
||||
|
||||
const withTmpDir = async <T>(
|
||||
handler: (dir: string) => Promise<T>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// @ts-ignore
|
||||
import * as ParkMiller from "park-miller";
|
||||
import ParkMiller from "park-miller";
|
||||
import { Color, createEmptyGrid, setColor } from "../grid";
|
||||
import { randomlyFillGrid } from "../randomlyFillGrid";
|
||||
|
||||
@@ -64,14 +63,32 @@ setColor(enclaveK, 3, 5, 3 as Color);
|
||||
setColor(enclaveK, 1, 5, 3 as Color);
|
||||
setColor(enclaveK, 2, 2, 1 as Color);
|
||||
|
||||
export const enclaveU = createEmptyGrid(17, 9);
|
||||
setColor(enclaveU, 1, 1, 3 as Color);
|
||||
setColor(enclaveU, 2, 1, 3 as Color);
|
||||
setColor(enclaveU, 3, 1, 3 as Color);
|
||||
setColor(enclaveU, 0, 1, 3 as Color);
|
||||
setColor(enclaveU, 0, 2, 3 as Color);
|
||||
setColor(enclaveU, 0, 3, 3 as Color);
|
||||
setColor(enclaveU, 3, 1, 3 as Color);
|
||||
setColor(enclaveU, 3, 2, 3 as Color);
|
||||
setColor(enclaveU, 3, 3, 3 as Color);
|
||||
setColor(enclaveU, 1, 4, 3 as Color);
|
||||
setColor(enclaveU, 3, 4, 3 as Color);
|
||||
setColor(enclaveU, 3, 5, 3 as Color);
|
||||
setColor(enclaveU, 1, 5, 3 as Color);
|
||||
setColor(enclaveU, 2, 2, 1 as Color);
|
||||
setColor(enclaveU, 1, 2, 1 as Color);
|
||||
setColor(enclaveU, 2, 3, 1 as Color);
|
||||
setColor(enclaveU, 1, 3, 1 as Color);
|
||||
setColor(enclaveU, 2, 4, 1 as Color);
|
||||
setColor(enclaveU, 16, 8, 1 as Color);
|
||||
|
||||
const create = (width: number, height: number, emptyP: number) => {
|
||||
const grid = createEmptyGrid(width, height);
|
||||
const random = new ParkMiller(10);
|
||||
randomlyFillGrid(
|
||||
grid,
|
||||
{ colors, emptyP },
|
||||
random.integerInRange.bind(random)
|
||||
);
|
||||
const pm = new ParkMiller(10);
|
||||
const random = pm.integerInRange.bind(pm);
|
||||
randomlyFillGrid(grid, { colors, emptyP }, random);
|
||||
return grid;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"skipLibCheck": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user