import type { GLTFLoaderOptions } from "../../gltf-loader.js"; import type { GLTF } from "../types/gltf-json-schema.js"; import type { GLTFWithBuffers } from "../types/gltf-types.js"; /** * Exact extension identifiers accepted by the shared meshopt decoder. * * The two extensions deliberately remain separate capabilities even though their JSON layouts are * compatible: KHR adds version 1 attribute streams and the `COLOR` filter, while existing EXT * assets continue to require the EXT identifier. */ export type MeshoptCompressionExtensionName = 'KHR_meshopt_compression' | 'EXT_meshopt_compression'; /** * Decompresses every buffer view that uses one meshopt extension. * * The Khronos and vendor extensions share their buffer-view layout, but the Khronos extension * additionally permits version 1 attribute streams and the `COLOR` filter. A buffer view or * fallback buffer cannot opt into both extensions because the specifications define them as * mutually exclusive. The extension object identifies the compressed source range; the parent * buffer view identifies the destination range that will contain `count * byteStride` * decompressed bytes. * * Extension objects, fallback-buffer markers, and top-level `extensionsUsed` and * `extensionsRequired` declarations are removed only after every matching buffer view decodes * successfully. Source buffers containing compressed bytes remain in `gltfData.buffers`; the * loader does not compact or renumber buffers. * * @param gltfData Parsed glTF JSON and its resolved buffers. * @param options glTF loader options controlling buffer loading and mesh decompression. * @param extensionName Meshopt extension to process. * @returns A promise that resolves after all matching buffer views are decoded and their extension * declarations are removed. * @throws If KHR and EXT declarations are mixed on the same buffer view or buffer, or if a * compressed stream cannot be decoded. */ export declare function decodeMeshoptCompression(gltfData: GLTFWithBuffers, options: GLTFLoaderOptions, extensionName: MeshoptCompressionExtensionName): Promise; /** * Enforces the KHR/EXT capability invariant before any compressed bytes are decoded. * * Khronos specifies the two extension identifiers as mutually exclusive on both compressed buffer * views and fallback buffers. Validating the whole document before decoding prevents traversal * order from turning an invalid mixed declaration into partially decoded output. * * @param gltf Parsed glTF document. * @throws If one buffer view or buffer declares both `KHR_meshopt_compression` and * `EXT_meshopt_compression`. */ export declare function validateMeshoptCompressionExclusivity(gltf: GLTF): void; //# sourceMappingURL=meshopt-compression.d.ts.map