/** * Initializes the decoder used to load glTF files compressed with the `EXT_meshopt_compression` * or `KHR_meshopt_compression` extensions, such as files produced by gltfpack or glTF-Transform. * Without a decoder, these files fail to load unless they also contain uncompressed fallback * data. * * The decoder is the meshoptimizer JavaScript decoder (`meshopt_decoder.mjs`). Pass the decoder * object itself, or the URL of the decoder module, which is then imported the first time a * compressed file loads. Files using `KHR_meshopt_compression` need meshoptimizer 1.0 or later. * * @param {object} config - The decoder configuration. * @param {object} [config.decoder] - The decoder object, such as the `MeshoptDecoder` exported by * the meshoptimizer package. * @param {string} [config.url] - The URL of the decoder module. Ignored when `decoder` is set. * @param {number} [config.numWorkers] - The number of web workers to decode on. Defaults to 0, * which decodes on the main thread. * @example * import { MeshoptDecoder } from 'meshoptimizer'; * * pc.meshoptInitialize({ decoder: MeshoptDecoder }); * @example * pc.meshoptInitialize({ url: 'lib/meshopt_decoder.mjs' }); */ export function meshoptInitialize(config: { decoder?: object; url?: string; numWorkers?: number; }): void; /** * Returns whether a decoder was supplied with {@link meshoptInitialize}. * * @returns {boolean} True if compressed data can be decoded. * @ignore */ export function isMeshoptConfigured(): boolean; /** * Decodes a buffer view compressed with `EXT_meshopt_compression` or `KHR_meshopt_compression`. * * @param {Uint8Array} source - The compressed data. * @param {number} count - The number of elements. * @param {number} stride - The size of each element in bytes. * @param {string} mode - The compression mode: 'ATTRIBUTES', 'TRIANGLES' or 'INDICES'. * @param {string} filter - The filter applied after decompression, such as 'OCTAHEDRAL'. * @returns {Promise} The decoded data. * @ignore */ export function meshoptDecode(source: Uint8Array, count: number, stride: number, mode: string, filter: string): Promise;