import type { ComboBox, BoxelDefinition, Material, Node, Pattern, Primitive, Texture } from './types';
export interface PrimitiveDependencySets {
    primitives: Set<string>;
    materials: Set<string>;
    textures: Set<string>;
    patterns: Set<string>;
}
export declare const buildPrimitiveLookup: (entity: BoxelDefinition) => Map<string, Primitive>;
export declare const buildMaterialLookup: (entity: BoxelDefinition) => Map<string, Material>;
export declare const buildTextureLookup: (entity: BoxelDefinition) => Map<string, Texture>;
export declare const buildPatternLookup: (entity: BoxelDefinition) => Map<string, Pattern>;
export declare function findNodeById(root: Node, targetId: string): Node | null;
export declare function findNode(root: Node, targetId: string): Node | undefined;
export declare function applyNodeDimensions(node: Node, primitive: {
    size: [number, number, number];
}, originalSize: [number, number, number], originalCenter: [number, number, number]): void;
export declare function applyNodeDimensionsAxis(node: Node, primitive: {
    size: [number, number, number];
}, originalSize: [number, number, number], originalCenter: [number, number, number], axis: 'x' | 'y'): void;
export declare function updateChildPosition(parent: Node, childId: string, offsetY: number): void;
export declare function updateChildPositionAxis(parent: Node, childId: string, axis: 'x' | 'y', value: number): void;
export declare function anchorCenter(originalCenter: number, originalSize: number, newSize: number, orientation: 1 | -1): number;
export declare function collectPrimitiveUsage(entity: BoxelDefinition, primitiveId: string): {
    nodeIds: string[];
    comboIds: string[];
};
export declare function computeComboBoundingSize(combo: ComboBox, primitiveLookup: Map<string, Primitive>): [number, number, number];
/**
 * Estimate the pixel-per-meter scale of an entity using its root scale vector.
 * Returns an integer value (e.g. 16 for classic avatars, 32 for HD avatars) or null when it cannot be derived.
 */
export declare function computeEntityPixelsPerMeter(entity: BoxelDefinition): number | null;
export declare function collectPrimitiveDependencies(entity: BoxelDefinition, rootPrimitiveId: string): PrimitiveDependencySets;
export declare function ensureNoIdCollisions<T extends {
    id: string;
}>(existing: readonly T[], incomingIds: Set<string>, entitySection: string): void;
export declare function selectByIdOrder<T extends {
    id: string;
}>(items: readonly T[], ids: Set<string>): T[];
export interface MaterialMergeOutcome {
    additions: Material[];
    rewrites: Map<string, string>;
}
export declare function mergeIncomingMaterials(existingMaterials: readonly Material[], incomingMaterials: readonly Material[]): MaterialMergeOutcome;
export declare function applyMaterialRewriteToPrimitive(primitive: Primitive, rewrite: (id: string) => string): Primitive;
export declare function applyMaterialRewriteToTexture(texture: Texture, rewrite: (id: string) => string): Texture;
export declare function cloneEntity<T>(value: T): T;
