kelda-js
Version:
A thread pool for the browser, built on top of Web Workers
26 lines (20 loc) • 524 B
TypeScript
declare module 'kelda-js' {
type Work<T> = (...args: any[]) => T;
interface KeldaOptions {
threadPoolDepth: number;
}
interface RemoteWorkParams {
url: string;
exportName?: string;
}
class Kelda {
constructor(options?: KeldaOptions);
public orderWork<T>(
source: Work<T> | RemoteWorkParams | number,
...args: any[]
): Promise<T>;
public load(params: RemoteWorkParams): Promise<number>;
public lazy(params: RemoteWorkParams): number;
}
export default Kelda;
}