web-background
Version:
Running background in browser Worker
12 lines (11 loc) • 369 B
TypeScript
interface WorkerConstructor<Worker> {
new (scriptURL: string | URL, options?: WorkerOptions): Worker;
prototype: Worker;
}
interface Options extends WorkerOptions {
module: (...args: any[]) => any;
}
export declare class WorkerBuilder {
static fromModule<W extends Worker>(Worker: WorkerConstructor<W>, { module, ...options }: Options): W;
}
export {};