UNPKG

xcore-casino

Version:

Casino Core module

91 lines 2.84 kB
import type { XCoreCasino } from './types'; /** * WASM module loader class * Handles loading and initialization of the WASM module and its dependencies */ export declare class WasmLoader { private static isLoading; private static loadPromise; private static wasmExecLoaded; private static wasmInstance; private static casinoInstance; private static readonly logger; private static wasmResponseCache; private static wasmBufferCache; private static _wasmPath; static debug: boolean; static onInitialized: ((casino: XCoreCasino) => void) | null; static timeoutDuration: number; /** * Get the path to the WASM file */ static get wasmPath(): string; /** * Set the path to the WASM file * Setting this will disable auto-detection */ static set wasmPath(path: string); /** * Get the casino WASM instance * @throws Error if the WASM module is not loaded */ static getCasino(): XCoreCasino; /** * Check if the WASM module is loaded * @returns True if the WASM module is loaded, false otherwise */ static isLoaded(): boolean; /** * Force reload the WASM module, even if it's already loaded * @returns Promise that resolves when the WASM module is loaded * @throws Error if loading fails */ static forceReload(): Promise<void>; /** * Check if the WASM file is accessible * @returns Promise that resolves to a boolean indicating if the file is accessible */ static checkWasmFileAvailability(): Promise<{ available: boolean; status?: number; contentType?: string; }>; /** * Load the WASM module asynchronously * @returns Promise that resolves when the WASM module is loaded * @throws Error if loading fails */ static asyncLoad(): Promise<void>; /** * Load the WASM module and its dependencies * @throws Error if WebAssembly is not supported or if loading fails */ private static loadWasmModule; /** * Clear the WASM cache * This is useful if you need to force a fresh fetch of the WASM module */ static clearCache(): void; /** * Get diagnostic information about the WasmLoader's state * Useful for debugging issues with WASM loading */ static getDiagnostics(): { isLoaded: boolean; isLoading: boolean; hasLoadPromise: boolean; wasmExecLoaded: boolean; hasWasmInstance: boolean; wasmPath: string; debug: boolean; timeoutDuration: number; hasCachedResponse: boolean; hasCachedBuffer: boolean; }; /** * Load the wasm_exec.js script * @throws Error if loading fails */ private static loadWasmExec; } //# sourceMappingURL=loader.d.ts.map