import { type Cs2MaterialBundleManifest, type Cs2MaterialEntry, type Cs2MaterialRecord, type Cs2TextureRecord } from './types'; /** Share of opaque pixels that are fully on or fully off, and share with a wide channel spread. */ export declare const IDENTITY_MAP_PURITY = 0.85; export declare const IDENTITY_MAP_CHROMA = 0.25; export type Cs2TextureRole = 'baseColor' | 'normal' | 'emissive' | 'mask'; export interface Cs2MaterialBundle { manifest: Cs2MaterialBundleManifest; /** The folder the manifest sits in; `textures[].file` is relative to it. */ dir: string; entriesByPrefab: Map; materialsById: Map; texturesById: Map; /** prefab -> "meshIndex:subMeshIndex" -> materialId. The key is a CSM2 group. */ bindings: Map>; } export interface Cs2SelectedTexture { parameter: string; texture: Cs2TextureRecord; score: number; } /** Reads one `prefab-materials.json` / `road-materials.json`; both carry the same schema. */ export declare function readCs2MaterialBundle(file: string): Promise; /** * A material bundle with nothing in it: every road slot falls back to its family palette. A bundle whose capture shipped no * `road-materials/` still bakes the game's road geometry; the restyle replaces every slot material with the engine's anyway. */ export declare function emptyCs2MaterialBundle(dir: string): Cs2MaterialBundle; export declare function bindingKey(meshIndex: number, subMeshIndex: number): string; export declare function materialForGroup(bundle: Cs2MaterialBundle, prefab: string, meshIndex: number, subMeshIndex: number): Cs2MaterialRecord | null; /** * Caches key on content, never on `materialId`: 6,572 Granit records collapse to 1,569 by (shader, texture files, * properties). Texture ids differ between records that reference the same bytes, so the FILE is what identifies them. */ export declare function contentKey(bundle: Cs2MaterialBundle, material: Cs2MaterialRecord): string; /** * Role scoring from the reference library (`prefab-material-library.ts:1013-1057`). CS2 binds both an HDRP packed mask * and a colour-variation control mask as `data` textures, so `_MaskMap` must beat `_ControlMask`. */ export declare function textureRoleScore(parameter: string, semantic: string, role: Cs2TextureRole): number; export declare function resolveTextureRoles(bundle: Cs2MaterialBundle, material: Cs2MaterialRecord): Partial>; /** A colour map whose pixels are effectively an index palette rather than a photograph. */ export declare function isIdentityMap(texture: Cs2TextureRecord): boolean; /** `textures[].bytes` is the PRE-TRANSCODE PNG size and sums to 2.95 GB against 1.2 GB on disk; measure the file. */ export declare function textureFileBytes(bundle: Cs2MaterialBundle, texture: Cs2TextureRecord): Promise; /** Distinct `textures[].file` values: the content-addressed set, which is smaller than the record count. */ export declare function distinctTextureFiles(bundle: Cs2MaterialBundle): Set; /** Projector and decal prefabs are identified by SHADER, never by name. */ export declare function isDecalShader(shader: string): boolean;