import { type HelixSceneV2 } from '@hypersoniclabs/helix-manifest'; import { type LibraryCutReport } from './phoneLibrary'; import { type TerrainSplatCutReport } from './phoneTerrainSplat'; import { type TerrainNormalCutReport } from './phoneTerrainNormal'; import { type ObjectTextureCutReport } from './phoneObjectTextures'; import { type ComposeProfile, type MountPromisePolicy } from './tierProfiles'; export declare const MOUNT_CAPABILITY = "helix.scene-mount/1"; /** A tier's compose policy (`TIER_PROFILES[tier].compose`): budgets, radii, how the shared HLOD is declared, group cut, skyline atlas. */ export type ComposeTier = ComposeProfile; export declare const COMPOSE_TIERS: Record<'desktop' | 'mobile', ComposeTier>; export declare function reseal(scene: HelixSceneV2): HelixSceneV2; /** How `retargetPart` reads the HLOD files it declares (the engine's own accounting of what they hold once decoded). */ export interface HlodDeclarations { /** Decoded bytes of a distant-mass cluster resource; `undefined`: keep the bake's figure. */ geometryBytes?: (resource: HelixSceneV2['resources'][number] | undefined) => number | undefined; /** GPU bytes of a shared-appearance resource (KTX2 headers, transcoded 8 bpp, mips, twice); `undefined`: scale the bake's RGBA worst case. */ atlasBytes?: (resource: HelixSceneV2['resources'][number] | undefined) => number | undefined; } /** The part with its own allowance and near radius, sealed again. */ export declare function retargetPart(part: HelixSceneV2, tier: ComposeTier, declarations?: HlodDeclarations): HelixSceneV2; type Box = { min: [number, number, number]; max: [number, number, number]; }; /** The world box of a local box under a Scene v2 node transform (position, quaternion rotation, scale). */ export declare function transformedBounds(local: Box, transform: { position: number[]; rotation: number[]; scale: number[]; }): Box; /** What a near model costs resident and the box it fills, by Scene resource id (`res.proto.`), from the prototype index. */ export interface NearResidency { resident: Map; bounds: Map; } /** The same accounting `parts` declared each group with (`prototypeResidentBytes`), per model, so a group can be cut again. `null` when the data root has no index. */ export declare function readNearResidency(data: string): NearResidency | null; export interface SplitReport { groupsBefore: number; groups: number; cellM: number | null; capMiB: number; } /** * Cuts a part's near stream groups the way Granit's compose does: a stream group per `cellM` square of the map (nearest-first * admission then fills the allowance in small steps and what does not fit stays on its HLOD), each cell cut again, recursively at the * median of its longer axis, until it costs at most `capMiB`. The declared cost of a piece is what its distinct models cost resident. * Each group's cell is the tight 3D box of its buildings (the bake leaves cells as wide as its source group, so the planner's * distance was to a box far larger than the buildings it holds). A part whose cut would exceed `maxGroups` coarsens the grid * (`cellM` x2 up to no grid), then raises the cost cap, so it still fits the document's group cap. HLOD clusters name the cells they * cover: each is expanded to the pieces and its source hash re-derived. */ export declare function splitNearGroups(part: HelixSceneV2, residency: NearResidency, options: { capMiB: number; cellM: number; maxGroups?: number; }): SplitReport; /** * What a part promises its parent (the mount's `budgetMiB`): never below the part's own profile commitment (its largest single activation) or the * tier's floor, and where the tier says so, what the part keeps resident: its complete HLOD level at `hlodResidentShare` of the declared bytes plus * its share of the near-model pool (`parts` is how many parts share it). */ export declare function mountCommitmentMiB(child: HelixSceneV2, policy?: MountPromisePolicy, parts?: number): number; export declare function mountParts(base: HelixSceneV2, children: HelixSceneV2[], options: { id: string; title: string; tier: ComposeTier; mountMode?: 'eager' | 'distance'; }): HelixSceneV2; export interface ComposeOptions { /** The landscape package (`scene create city` output). */ land: string; /** The data root holding the baked `part..scene.json`, `buildings/` and `hlod-complete/`. */ data: string; out: string; name: string; tier: 'desktop' | 'mobile'; /** Root scene id; omitted, the landscape's. */ id?: string; title?: string; /** Explicit values that win over `TIER_PROFILES[tier].compose` (CLI flags). */ overrides?: Partial; /** `eager` (default) mounts the parts with the root; `distance` makes `stream.city` a distance group, which perf rule P05 refuses. */ mountMode?: 'eager' | 'distance'; log?: (line: string) => void; } export interface ComposeReport { root: { dir: string; id: string; revision: string; documentBytes: number; documentCapBytes: number; }; parts: Array<{ id: string; dir: string; revision: string; nodes: number; clusters: number; groups: number; largestGroupMiB: number; commitmentMiB: number; allowanceMiB: number; }>; /** The policy actually applied (profile + overrides). */ policy: ComposeTier; /** Per part: stream groups before and after the cell cut, the grid and cost cap the cut ended at. Empty when the data root has no prototype index. */ split: SplitReport[]; /** The shared atlas lowering: carriers lowered, bytes before and after (all parts). */ atlas: { lowered: number; bytesBefore: number; bytesAfter: number; dir: string | null; }; /** The city-material library slots cut for this tier (src/cs2/convert/phoneLibrary.ts); absent when none was asked for. */ library?: LibraryCutReport; /** The placement objects' textures cut for this tier (src/cs2/convert/phoneObjectTextures.ts); absent when none was asked for or none qualified. */ objectTextures?: ObjectTextureCutReport; /** The coarse terrain normal map halved for this tier (src/cs2/convert/phoneTerrainNormal.ts); absent when not asked for or not cut. */ terrainNormal?: TerrainNormalCutReport; /** The coarse terrain splat map halved for this tier (src/cs2/convert/phoneTerrainSplat.ts). */ terrainSplat?: TerrainSplatCutReport; } export declare function composeWorld(options: ComposeOptions): ComposeReport; export {};