Skip to content

Commit 43aa302

Browse files
committed
🔨 fix typing, add default interop
1 parent 00e0c54 commit 43aa302

File tree

4 files changed

+33
-16
lines changed

4 files changed

+33
-16
lines changed

packages/demo/webpack.config.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import * as path from "path";
2-
// @ts-ignore
3-
import * as HtmlWebpackPlugin from "html-webpack-plugin";
1+
import path from "path";
2+
import HtmlWebpackPlugin from "html-webpack-plugin";
43

54
import type { Configuration } from "webpack";
65

packages/gif-creator/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as fs from "fs";
2-
import * as path from "path";
1+
import fs from "fs";
2+
import path from "path";
33
import { createCanvas } from "canvas";
44
import { Grid, copyGrid, Color } from "@snk/types/grid";
55
import { Snake } from "@snk/types/snake";
@@ -9,8 +9,8 @@ import {
99
getCanvasWorldSize,
1010
} from "@snk/draw/drawWorld";
1111
import { step } from "@snk/compute/step";
12-
import * as tmp from "tmp";
13-
import * as execa from "execa";
12+
import tmp from "tmp";
13+
import execa from "execa";
1414

1515
const withTmpDir = async <T>(
1616
handler: (dir: string) => Promise<T>

packages/types/__fixtures__/grid.ts

+25-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// @ts-ignore
2-
import * as ParkMiller from "park-miller";
1+
import ParkMiller from "park-miller";
32
import { Color, createEmptyGrid, setColor } from "../grid";
43
import { randomlyFillGrid } from "../randomlyFillGrid";
54

@@ -64,14 +63,32 @@ setColor(enclaveK, 3, 5, 3 as Color);
6463
setColor(enclaveK, 1, 5, 3 as Color);
6564
setColor(enclaveK, 2, 2, 1 as Color);
6665

66+
export const enclaveU = createEmptyGrid(17, 9);
67+
setColor(enclaveU, 1, 1, 3 as Color);
68+
setColor(enclaveU, 2, 1, 3 as Color);
69+
setColor(enclaveU, 3, 1, 3 as Color);
70+
setColor(enclaveU, 0, 1, 3 as Color);
71+
setColor(enclaveU, 0, 2, 3 as Color);
72+
setColor(enclaveU, 0, 3, 3 as Color);
73+
setColor(enclaveU, 3, 1, 3 as Color);
74+
setColor(enclaveU, 3, 2, 3 as Color);
75+
setColor(enclaveU, 3, 3, 3 as Color);
76+
setColor(enclaveU, 1, 4, 3 as Color);
77+
setColor(enclaveU, 3, 4, 3 as Color);
78+
setColor(enclaveU, 3, 5, 3 as Color);
79+
setColor(enclaveU, 1, 5, 3 as Color);
80+
setColor(enclaveU, 2, 2, 1 as Color);
81+
setColor(enclaveU, 1, 2, 1 as Color);
82+
setColor(enclaveU, 2, 3, 1 as Color);
83+
setColor(enclaveU, 1, 3, 1 as Color);
84+
setColor(enclaveU, 2, 4, 1 as Color);
85+
setColor(enclaveU, 16, 8, 1 as Color);
86+
6787
const create = (width: number, height: number, emptyP: number) => {
6888
const grid = createEmptyGrid(width, height);
69-
const random = new ParkMiller(10);
70-
randomlyFillGrid(
71-
grid,
72-
{ colors, emptyP },
73-
random.integerInRange.bind(random)
74-
);
89+
const pm = new ParkMiller(10);
90+
const random = pm.integerInRange.bind(pm);
91+
randomlyFillGrid(grid, { colors, emptyP }, random);
7592
return grid;
7693
};
7794

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"skipLibCheck": true,
66
"noUnusedLocals": true,
77
"noUnusedParameters": true,
8-
"forceConsistentCasingInFileNames": true
8+
"forceConsistentCasingInFileNames": true,
9+
"esModuleInterop": true
910
},
1011
"exclude": ["node_modules"]
1112
}

0 commit comments

Comments
 (0)