/** * WASM bindings loader with support for both browser and Node.js environments. * Handles lazy loading and caching of WASM modules. */ export declare const DEFAULT_WASM_FILENAME = "assets/wasm/web/zerc20_wasm_bg.wasm"; /** * Absolute URL for the bundled browser WASM binary (resolved relative to this package). */ export declare const BUNDLED_WASM_URL: string; type WebWasmBindings = typeof import("../assets/wasm/web/zerc20_wasm.js"); type CommonWasmBindings = Omit & Partial>; export type WasmBindings = CommonWasmBindings; export type WebInitFn = NonNullable; /** * Options for creating a WasmBindingsLoader. */ export interface WasmBindingsLoaderOptions { /** Custom resolver function for loading bindings (for testing) */ resolver?: () => Promise; } /** * Detects if the current runtime is Node.js. */ export declare function isNodeRuntime(): boolean; /** * Loader for WASM bindings with caching support. * Manages lazy loading and caching of WASM modules for both browser and Node.js. */ export declare class WasmBindingsLoader { private cache; private promise; private readonly resolver; constructor(options?: WasmBindingsLoaderOptions); /** * Gets or loads the WASM bindings with caching. * Returns cached bindings if available, otherwise loads them. */ getOrLoad(): Promise; /** * Returns true if bindings are already cached. */ isCached(): boolean; /** * Resets the loader to its initial state. * Useful for testing to ensure clean state between tests. */ reset(): void; /** * Primes the cache with pre-loaded bindings. * Useful for testing or when bindings are loaded externally. */ prime(bindings: WasmBindings): void; } /** * Checks if the bindings require explicit initialization (browser environment). */ export declare function requiresExplicitInit(bindings: WasmBindings): bindings is WasmBindings & { default: WebInitFn; }; /** * Gets or loads the WASM bindings with caching. * Returns cached bindings if available, otherwise loads them. */ export declare function getOrLoadBindings(): Promise; /** * Resets the default WASM bindings loader to its initial state. * Useful for testing to ensure clean state between tests. */ export declare function resetBindingsLoader(): void; /** * Returns the default WASM bindings loader instance. * Useful when you need direct access to the loader. */ export declare function getDefaultBindingsLoader(): WasmBindingsLoader; export {}; //# sourceMappingURL=loader.d.ts.map