Fix #1766 - Ensure correct hooks types (#1772)

This commit is contained in:
Andrea Giammarchi
2023-09-29 14:01:35 +02:00
committed by GitHub
parent 7a23e355b9
commit 5c4e400d32
5 changed files with 29 additions and 12 deletions

View File

@@ -1,21 +1,28 @@
import { typedSet } from "type-checked-collections";
const SetFunction = typedSet({ typeof: "function" });
const SetString = typedSet({ typeof: "string" });
export default {
/** @type {Set<function>} */
onBeforeRun: new Set(),
onInterpreterReady: new SetFunction(),
/** @type {Set<function>} */
onBeforeRunAsync: new Set(),
onBeforeRun: new SetFunction(),
/** @type {Set<function>} */
onAfterRun: new Set(),
onBeforeRunAsync: new SetFunction(),
/** @type {Set<function>} */
onAfterRunAsync: new Set(),
onAfterRun: new SetFunction(),
/** @type {Set<function>} */
onInterpreterReady: new Set(),
onAfterRunAsync: new SetFunction(),
/** @type {Set<function>} */
onWorkerReady: new SetFunction(),
/** @type {Set<string>} */
codeBeforeRunWorker: new Set(),
codeBeforeRunWorker: new SetString(),
/** @type {Set<string>} */
codeBeforeRunWorkerAsync: new Set(),
codeBeforeRunWorkerAsync: new SetString(),
/** @type {Set<string>} */
codeAfterRunWorker: new Set(),
codeAfterRunWorker: new SetString(),
/** @type {Set<string>} */
codeAfterRunWorkerAsync: new Set(),
codeAfterRunWorkerAsync: new SetString(),
};