import { AsmRuntimeType } from './constructModule'; /** * Asynchronously load and initialize asm module. * * @returns {T} Factory function manages lifecycle of hunspell and virtual files. */ declare type moduleLoaderType = () => Promise; /** * Initialization options given to `getModuleLoader` */ interface ModuleInitOption { binaryRemoteEndpoint: string; timeout: number; } /** * Type of runtime module function. This is node.js asm module loaded via plain `require`, * internally emscripten should compile with MODULARIZE=1 option to loaded module via require returns * function to construct wasm module internally. * * For example, * ``` * const asmLoader: runtimeModuleType = require('./lib/wasm/hunspell') * asmLoader(); //actually construct wasm module * ``` */ declare type runtimeModuleType = (moduleObject: Record) => AsmRuntimeType; declare type getModuleLoaderType = (factoryLoader: (runtime: R) => T, runtimeModule: runtimeModuleType, module?: Record, moduleInitOption?: Partial) => moduleLoaderType; /** * Creates loader function to load and initialize wasm module. * * @param {(runtime: R) => T} factoryLoader Factory to create actual instance of implementation using loaded & initialized wasm runtime. * * @param {runtimeModuleType} runtimeModule Actual runtime to initialize. * It is wasm runtime loaded via plain `require` but compiled with MODULARIZED=1 preamble with SINGLE_FILE option * which should be function to accept asm module object to override. * * @param {Record} [module] Record object to be injected into wasm runtime for override/set additional value in asm module. * * @param {ModuleInitOption} [initOptions] Configuration used to initialize the module * * @returns {moduleLoaderType} Loader function */ declare const getModuleLoader: getModuleLoaderType; export { ModuleInitOption, runtimeModuleType, moduleLoaderType, getModuleLoaderType, getModuleLoader }; //# sourceMappingURL=getModuleLoader.d.ts.map