Skip to content

Commit 445eaf4

Browse files
committed
more type annotations to please the eslint god
1 parent 274dac4 commit 445eaf4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/context/workerContext.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface ProgressItem {
1212

1313
interface WorkerMessage {
1414
type: "load" | "check" | "generate";
15+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1516
data?: any;
1617
}
1718

@@ -34,7 +35,7 @@ export function useWorker() {
3435
return context;
3536
}
3637

37-
export function WorkerProvider({ children }) {
38+
export function WorkerProvider({ children }: { children: React.ReactNode }) {
3839
const worker = useRef<Worker | null>(null);
3940
const [status, setStatus] = useState<"loading" | "ready" | null>(null);
4041
const [loadingMessage, setLoadingMessage] = useState<string>("");
@@ -49,7 +50,7 @@ export function WorkerProvider({ children }) {
4950
worker.current.postMessage({ type: "check" });
5051
}
5152

52-
const onMessageReceived = (e) => {
53+
const onMessageReceived = (e: MessageEvent) => {
5354
switch (e.data.status) {
5455
case "loading":
5556
setStatus("loading");

0 commit comments

Comments
 (0)