@lynx-js/web-core
Version:
This is an internal experimental package, do not use
23 lines (22 loc) • 895 B
TypeScript
import type { dispatchCoreContextOnBackgroundEndpoint } from './endpoints.js';
import type { LynxContextEventTarget } from '../types/index.js';
import type { Rpc } from '@lynx-js/web-worker-rpc';
export declare const DispatchEventResult: {
readonly NotCanceled: 0;
readonly CanceledByEventHandler: 1;
readonly CanceledByDefaultEventHandler: 2;
readonly CanceledBeforeDispatch: 3;
};
type LynxCrossThreadContextConfig = {
rpc: Rpc;
receiveEventEndpoint: typeof dispatchCoreContextOnBackgroundEndpoint;
sendEventEndpoint: typeof dispatchCoreContextOnBackgroundEndpoint;
};
export declare class LynxCrossThreadContext extends EventTarget implements LynxContextEventTarget {
#private;
constructor(config: LynxCrossThreadContextConfig);
postMessage(...args: any[]): void;
dispatchEvent(event: ContextCrossThreadEvent): 3;
__start(): void;
}
export {};