import { NodeIO, type Material, type Texture } from '@gltf-transform/core'; import { type FacadeLook } from '../buildingsLook'; export declare const RESTYLE_SCHEMA = "helix.cs2-building-look/1"; export interface RestyleOptions { /** The shared `granit-data/public` folder. Read only. */ data: string; /** The overlay folder to write. */ out: string; log?: (message: string) => void; } export interface TextureFile { /** `tex-.ktx2`: the name a GLB references and the file under `buildings/hlod/textures/`. */ name: string; sha256: string; bytes: number; width: number; height: number; } export interface PrototypeVariant { k: number; /** Relative to `buildings/`, e.g. `hlod/prototypes/.glb`. */ uri: string; sha256: string; bytes: number; scheme: string; /** Linear-light mean tint of the body materials: the far meshes' vertex colour. */ ratio: [number, number, number]; coverage: number; facade: FacadeLook; /** The shared KTX2 files this GLB references, by content. */ textures: TextureFile[]; } export interface PrototypeRecord { /** The data folder's own prototype uri: the key every document resource is matched by. */ sourceUri: string; prefab: string; zone: string; /** Buildings that wear this prototype, and every building that wears a prototype sharing its albedo (the colourway pool). */ instances: number; groupInstances: number; group: string; variants: PrototypeVariant[]; /** Prototypes whose materials had no control mask: tinted nothing, only re-encoded. */ masked: boolean; } interface DocResource { id: string; kind: string; source: { kind: string; assetId?: string; uri: string; }; integrity: { sha256: string; }; bytes: number; mimeType?: string; required?: boolean; } export declare const textureFileName: (digest: string) => string; interface MaterialBundle { dir: string; byAssetName: Map; }>; files: Map; } /** The albedo pool a prototype belongs to: prototypes whose body albedo and control mask are the same bytes (L1..L5 of one model) share colourways. */ export declare function prototypeGroup(io: NodeIO, bundle: MaterialBundle, file: string): Promise; /** `prototypes` stage: writes GLBs and shared KTX2 files for this shard's colourway pools and `/restyle/prototypes.shard-.json`. */ export declare function restylePrototypes(options: RestyleOptions & { shard?: { index: number; count: number; }; limit?: number; only?: string[]; }): Promise; /** * The engine's material pool (`load/materialPool.ts`) keys on every enumerable state of a freshly parsed material, `name` * included, so two prototypes whose materials draw identically but carry their own prefab-hash names never merge. A material * is named for what it draws with: its factors and the shared texture files it samples. Equal appearance, equal name. */ export declare function nameMaterialsByContent(materials: Material[], files: Map): void; export interface ClustersReport { parts: { id: string; file: string; documentBytes: number; nodes: number; resources: number; remappedNodes: number; newResources: number; }[]; clusters: { mass: number; refinement: number; carriers: number; }; massVertices: number; refinementVertices: number; estimatedBytesAdded: { mass: number; refinement: number; }; documentCapBytes: number; prototypes: { count: number; variants: number; sourceBytes: number; geometryBytes: number; }; /** Distinct shared KTX2 files across every colourway, their bytes, and their transcoded GPU size (8 bpp with mips, once each). */ textures: { files: number; bytes: number; gpuBytes: number; }; } /** `clusters` stage: needs every `prototypes.shard-*.json` under `/restyle`. Writes the cluster GLBs, carriers, documents and index. */ export declare function restyleClusters(options: RestyleOptions): Promise; /** Adds `COLOR_0` (u8 normalised RGB, per vertex from its source building) to every primitive of one cluster GLB and writes it. */ export declare function recolourCluster(io: NodeIO, dir: string, outDir: string, resource: DocResource, colourOf: (sourceIndex: number) => [number, number, number]): Promise<{ vertices: number; addedEstimate: number; }>; export {};