z-ipc
Version:
Z-IPC is an easy-to-use, extensible and fully type-safe IPC solution for JavaScript environments.
22 lines (19 loc) • 910 B
text/typescript
import { A as Adapter } from '../adapter-6ny_hedX.cjs';
/**
* Adapter for communicating with a child Web Worker.
* Allows sending and receiving messages of type TMessage.
*
* @typeparam TMessage - The type of messages to exchange with the worker.
* @param worker - The Web Worker instance to communicate with.
* @returns An adapter with publish/subscribe/unsubscribe methods.
*/
declare function createChildWebWorkerAdapter<TMessage>(worker: Worker): Adapter<TMessage>;
/**
* Adapter for communicating with the parent thread from a Web Worker.
* Allows sending and receiving messages of type TMessage.
*
* @typeparam TMessage - The type of messages to exchange with the parent.
* @returns An adapter with publish/subscribe/unsubscribe methods.
*/
declare function createParentWebWorkerAdapter<TMessage>(): Adapter<TMessage>;
export { createChildWebWorkerAdapter, createParentWebWorkerAdapter };