import { type Material } from "three";
import type { ViralBIMWorld } from "../custom-objects/viral-bim-world";
/**
 * Post-load draw call budget enforcement.
 *
 * After all chunks have loaded, counts the total instanced draw calls,
 * ranks instanced mesh types by vertex-savings efficiency, and demotes
 * low-value types to batched meshes so the total stays within budget.
 *
 * The swap is atomic: the replacement batched mesh is added to the scene
 * before the old instanced mesh is removed, so there is never a frame
 * with missing geometry.
 */
declare class DrawCallRebalancer {
    private readonly bimWorld;
    private readonly useBatchedMeshV3;
    private readonly materialManager;
    private static readonly _tempMatrix;
    private static readonly _tempVec3;
    private readonly DEFAULT_DRAW_CALL_BUDGET;
    private readonly DEFAULT_V1_VERTEX_LIMIT;
    private readonly MAX_V1_VERTEX_LIMIT;
    constructor(bimWorld: ViralBIMWorld, useBatchedMeshV3: boolean, materialManager: {
        materials: Material[];
        mergeMaterials: Material[];
    });
    /**
     * Analyse all instanced mesh types and demote low-value ones to
     * batched meshes if the total instanced draw call count exceeds
     * the budget.
     *
     * Yields to the main thread between demotions to avoid blocking
     * the render loop.
     */
    rebalance(budget?: number): Promise<void>;
    private static yieldToMain;
    private collectStats;
    private replacementMeshCount;
    private determineDemotions;
    private demoteInstancedMesh;
    private buildAndSwapV1;
    private splitByVertexLimit;
    private buildAndSwapV3;
    private captureState;
    private applyState;
    private applyTransformToBuffer;
    private createOptimizedMaterial;
    private createOptimizedMaterialV3;
}
export { DrawCallRebalancer };
