import { type Document } from '@gltf-transform/core'; /** * Replaces every imported material and texture in one GLB with a small shared * HELIX default material set. * * A pack of N individually placed meshes can carry hundreds of source materials * and embedded textures that all render as noise at streaming distance, and * every duplicate is wire bytes the package cap has to pay for. Swapping them * for a handful of shared PBR defaults — matched by material-name heuristics — * keeps N assets on a few dozen flat kilobytes while real texturing is decided * separately (this pass is opt-in per import so it can be A/B'd against baked * originals). Output remains valid glTF: orphaned source materials and textures * are pruned, so each asset's GLB only declares the default materials it uses. */ export type HelixDefaultMaterialName = 'wood' | 'metal' | 'glass' | 'foliage' | 'concrete' | 'fallback'; export type HelixDefaultMaterialDefinition = { baseColorFactor: [number, number, number, number]; roughnessFactor: number; metallicFactor: number; alphaMode?: 'BLEND'; doubleSided?: boolean; }; export declare const HELIX_DEFAULT_MATERIALS: Record; export type DefaultMaterialMapping = ReadonlyArray<{ /** Case-insensitive regex source tested against each source material name. */ pattern: string; material: HelixDefaultMaterialName; }>; export declare function classifyMaterialName(name: string, mapping?: DefaultMaterialMapping): HelixDefaultMaterialName; export type DefaultMaterialSummary = { replacedMaterials: number; removedTextures: number; /** Primitives whose COLOR_0 attribute was dropped — see the note on the pass. */ strippedVertexColorPrimitives: number; countsByMaterial: Record; }; /** * Rewrites every primitive in `document` onto the shared default set and prunes * the orphaned source materials/textures before returning, so the document is * ready to serialize. Returns per-bucket replacement counts so the receipt can * say what was swapped, not just that something happened. */ export declare function applyHelixDefaultMaterials(document: Document, options?: { mapping?: DefaultMaterialMapping; }): Promise;