/** * Initialize the WebAssembly module * * @param options - Initialization options * @param options.wasmPath - Path to WASM files directory or .js file * NOTE: Only used in browser environments. Ignored in Node.js. * In Node.js, the package structure is fixed after npm install. * @param options.locateFile - Custom function to locate WASM binary files (advanced use) * Overrides the default Emscripten path resolution. * * @example * // Node.js - auto-initialization (no parameters needed): * await initialize(); * * // Browser - simple path (recommended): * await initialize({ wasmPath: '/wasm' }); * * // Browser - with CDN: * await initialize({ * wasmPath: 'https://cdn.jsdelivr.net/npm/texture2ddecoder-wasm@1.2.1/wasm' * }); * * // Advanced - custom locateFile (both Node.js and Browser): * await initialize({ * locateFile: (path, scriptDirectory) => { * // Custom logic to locate the .wasm binary * return '/custom-path/' + path; * } * }); * * // Or auto-initialize on first decode call (Node.js only): * const result = await decode_bc1(data, width, height); */ export declare function initialize(options?: { wasmPath?: string; locateFile?: (path: string, prefix: string) => string; }): Promise; /** * Decode BC1 (DXT1) compressed texture to BGRA */ export declare function decode_bc1(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode BC3 (DXT5) compressed texture to BGRA */ export declare function decode_bc3(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode BC4 compressed texture to BGRA */ export declare function decode_bc4(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode BC5 compressed texture to BGRA */ export declare function decode_bc5(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode BC6 compressed texture to BGRA */ export declare function decode_bc6(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode BC7 compressed texture to BGRA */ export declare function decode_bc7(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode PVRTC compressed texture to BGRA */ export declare function decode_pvrtc(data: Uint8Array | ArrayBuffer, width: number, height: number, is2bpp?: boolean): Promise; /** * Decode ETC1 compressed texture to BGRA */ export declare function decode_etc1(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode ETC2 compressed texture to BGRA */ export declare function decode_etc2(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode ETC2 with 1-bit alpha compressed texture to BGRA */ export declare function decode_etc2a1(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode ETC2 with 8-bit alpha compressed texture to BGRA */ export declare function decode_etc2a8(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode EAC R11 compressed texture to BGRA */ export declare function decode_eacr(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode EAC R11 signed compressed texture to BGRA */ export declare function decode_eacr_signed(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode EAC RG11 compressed texture to BGRA */ export declare function decode_eacrg(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode EAC RG11 signed compressed texture to BGRA */ export declare function decode_eacrg_signed(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode ATC RGB4 compressed texture to BGRA */ export declare function decode_atc_rgb4(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode ATC RGBA8 compressed texture to BGRA */ export declare function decode_atc_rgba8(data: Uint8Array | ArrayBuffer, width: number, height: number): Promise; /** * Decode ASTC compressed texture to BGRA * @param blockWidth - Block width (typically 4, 5, 6, 8, 10, or 12) * @param blockHeight - Block height (typically 4, 5, 6, 8, 10, or 12) */ export declare function decode_astc(data: Uint8Array | ArrayBuffer, width: number, height: number, blockWidth: number, blockHeight: number): Promise; /** * Unpack Crunch compressed data * Uses typed array for binary-safe data transfer */ export declare function unpack_crunch(data: Uint8Array | ArrayBuffer): Promise; /** * Unpack Unity Crunch compressed data * Uses typed array for binary-safe data transfer */ export declare function unpack_unity_crunch(data: Uint8Array | ArrayBuffer): Promise; declare const _default: { initialize: typeof initialize; decode_bc1: typeof decode_bc1; decode_bc3: typeof decode_bc3; decode_bc4: typeof decode_bc4; decode_bc5: typeof decode_bc5; decode_bc6: typeof decode_bc6; decode_bc7: typeof decode_bc7; decode_pvrtc: typeof decode_pvrtc; decode_etc1: typeof decode_etc1; decode_etc2: typeof decode_etc2; decode_etc2a1: typeof decode_etc2a1; decode_etc2a8: typeof decode_etc2a8; decode_eacr: typeof decode_eacr; decode_eacr_signed: typeof decode_eacr_signed; decode_eacrg: typeof decode_eacrg; decode_eacrg_signed: typeof decode_eacrg_signed; decode_atc_rgb4: typeof decode_atc_rgb4; decode_atc_rgba8: typeof decode_atc_rgba8; decode_astc: typeof decode_astc; unpack_crunch: typeof unpack_crunch; unpack_unity_crunch: typeof unpack_unity_crunch; }; export default _default; //# sourceMappingURL=index.d.ts.map