zorigami
Version:
a package for managing web workers
20 lines (19 loc) • 1.02 kB
TypeScript
import { ICustomWorkerPort, Maybe, PromisedPostMessage, Dictionary } from '../zorigami_types';
export declare class WorkerSiblingPortProvider {
private sibling_worker_ports;
private sibling_worker_interfaces;
private sibling_worker_api;
constructor();
storePort: (sibling_worker_name: string, port: MessagePort) => undefined;
getPort: (worker_name: string) => Maybe<MessagePort>;
listPorts: () => Dictionary<MessagePort>;
storePortInterface: (sibling_worker_name: string, port: MessagePort) => undefined;
getPortInterface: (sibling_worker_name: string) => Maybe<ICustomWorkerPort>;
listPortInterface: () => Dictionary<ICustomWorkerPort>;
storePortAPI: (worker_name: string, worker_api_config: string[]) => void;
getPortAPI: (thread_name: string, action_name: string) => Maybe<PromisedPostMessage>;
listPortAPI: () => Dictionary<Dictionary<PromisedPostMessage>>;
private makePortApiCall;
}
declare const provider: WorkerSiblingPortProvider;
export default provider;