@loaders.gl/worker-utils
Version:
Utilities for running tasks on worker threads
35 lines • 1.4 kB
TypeScript
export type LoadLibraryOptions<ModulesT extends Record<string, any> = Record<string, any>> = {
useLocalLibraries?: boolean;
CDN?: string | null;
modules?: ModulesT;
core?: never;
};
type ExtractableLoadLibraryOptions<ModulesT extends Record<string, any> = Record<string, any>> = {
useLocalLibraries?: boolean;
CDN?: string | null;
modules?: ModulesT;
core?: {
useLocalLibraries?: boolean;
CDN?: string | null;
} | null;
};
export declare function extractLoadLibraryOptions<ModulesT extends Record<string, any> = Record<string, any>>(options?: ExtractableLoadLibraryOptions<ModulesT>): LoadLibraryOptions<ModulesT>;
/**
* Dynamically loads a library ("module")
*
* - wasm library: Array buffer is returned
* - js library: Parse JS is returned
*
* Method depends on environment
* - browser - script element is created and installed on document
* - worker - eval is called on global context
* - node - file is required
*
* @param libraryUrl
* @param moduleName
* @param options
*/
export declare function loadLibrary(libraryUrl: string, moduleName?: string | null, options?: LoadLibraryOptions, libraryName?: string | null): Promise<any>;
export declare function getLibraryUrl(library: string, moduleName?: string, options?: LoadLibraryOptions, libraryName?: string | null): string;
export {};
//# sourceMappingURL=library-utils.d.ts.map