import { Document, type NodeIO, type Texture } from '@gltf-transform/core'; import type { SplitCell } from './types'; /** A texture lifted out of the chunks into one content-addressed KTX2 file shared by every chunk that uses it. */ export type SharedTexture = { /** `tex-.ktx2`: the name the GLBs reference and the runtime resolves. */ name: string; sha256: string; bytes: Uint8Array; }; export type ChunkStats = { triangles: number; nodes: number; fragments: number; textures: number; /** Everything the chunk holds when resident, every texture counted in full. */ decodedBytes: number; /** The geometry part of `decodedBytes`. */ geometryBytes: number; /** * Decoded bytes per texture, keyed by the shared file name, or `embedded:` * for a texture that lives inside this chunk alone. A shared texture is one * GPU image however many chunks name it, so the budget charges it once. */ textureBytes: Map; }; export type Chunk = { bytes: Uint8Array; sha256: string; stats: ChunkStats; textures: SharedTexture[]; }; /** Quantization depth: 16-bit positions in a cell-local frame resolve better than a millimetre across a 64 m cell. */ export declare const POSITION_BITS = 16; /** * What the runtime HOLDS for a chunk, not what it downloads: accessor arrays * once plus every texture decoded to RGBA8 with a mip chain. This is the same * accounting the multi-asset packager uses, so a split's budget and the * original's are comparable. */ export declare function decodedBytesOf(document: Document): { bytes: number; textures: number; }; /** * Builds one cell's chunk GLB. * * The bytes depend only on the cell: its grid index fixes the local frame, the * content is sorted by stable source order, and nothing about the other cells, * the run, or the clock enters the file. A re-split after an edit elsewhere * therefore leaves this file's hash unchanged. */ export declare function buildChunk(io: NodeIO, cell: SplitCell, cellSizeM: number, options: { encoding: 'meshopt' | 'none'; share?: ReadonlyMap; }): Promise;