comlink
Version:
Comlink makes WebWorkers enjoyable
14 lines (13 loc) • 484 B
TypeScript
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Endpoint } from "./protocol";
export interface NodeEndpoint {
postMessage(message: any, transfer?: any[]): void;
on(type: string, listener: EventListenerOrEventListenerObject, options?: {}): void;
off(type: string, listener: EventListenerOrEventListenerObject, options?: {}): void;
start?: () => void;
}
export default function nodeEndpoint(nep: NodeEndpoint): Endpoint;