/**
* Callback invoked when the worker has started successfully.
+ *
+ * @typeParam Worker - Type of worker.
*/
export type OnlineHandler<Worker extends IWorker> = (this: Worker) => void
/**
* Callback invoked if the worker has received a message.
+ *
+ * @typeParam Worker - Type of worker.
*/
export type MessageHandler<Worker extends IWorker> = (
this: Worker,
/**
* Callback invoked if the worker raised an error.
+ *
+ * @typeParam Worker - Type of worker.
*/
export type ErrorHandler<Worker extends IWorker> = (
this: Worker,
/**
* Callback invoked when the worker exits successfully.
+ *
+ * @typeParam Worker - Type of worker.
*/
export type ExitHandler<Worker extends IWorker> = (
this: Worker,
/**
* Task synchronous function that can be executed.
*
+ * @param data - Data sent to the worker.
+ *
* @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
* @typeParam Response - Type of execution response. This can only be structured-cloneable data.
*/
* Task asynchronous function that can be executed.
* This function must return a promise.
*
+ * @param data - Data sent to the worker.
+ *
* @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
* @typeParam Response - Type of execution response. This can only be structured-cloneable data.
*/