import { RPCSession } from "./session"; /** * Represents a constructor function for a Conduit-based WebWorker. */ type Constructor = { new (): T; }; /** * Decorate a class as a Conduit-based Web Worker. * * This overload is compatible with Webpack and other bundlers which * use static code analysis to enable the worker to be placed in its own chunk. * * @unstable Caution: This API may change in minor or patch releases until it is marked as stable. * @environment Browser only * @param workerFactory A function which creates the Worker object. For instance, `() => new Worker(new URL('./my-worker', import.meta.url))`. */ export declare function WebWorker(workerFactory: () => Worker): any; /** * Decorate a class as a Conduit-based Web Worker. * * Caution: This overload is not compatible with Webpack and other bundlers which use static code analysis to * enable the worker to be placed in its own chunk. Instead, use the overload which accepts a `workerFactory` * * @unstable Caution: This API may change in minor or patch releases until it is marked as stable. * @environment Browser only * @param url The URL where this worker can be found when it is loaded from within the browser context. You may be * able to use `import.meta.url` for this depending on your build system. * @param options The options to use when constructing the `Worker` instance. */ export declare function WebWorker(url: string, options?: WorkerOptions): any; export declare namespace WebWorker { var start: (workerClass: Constructor) => import("./proxied").MethodsOf & import("./proxied").EventsOf & { /** * The Conduit RPCSession object associated with this web worker. */ $session: RPCSession; /** * The Web Platform `Worker` instance, which can be used for low level control of the web worker. */ $webWorker: Worker; /** * Aborts worker's associated global environment. * @returns */ $terminate: () => void; }; } export {};