import { Box3, Mesh } from "three";
import { type BufferElement } from "../..";
import { WorkerThreadPool } from "../worker/base/worker-pool";
import { ViralBatchedMesh } from "./viral-batched-mesh";
import type { ViralBatchedMeshV3 } from "./viral-batched-mesh-v3";
import type { ViralBIMModel } from "./viral-bim.model";
import { ViralInstancedMeshV2 } from "./viral-instanced-mesh-v2";
/**
 * this class is a wrapper, it stand for a world of bim models
 * it merge geometries follow material or using instanced mesh.
 *
 */
export declare class ViralBIMWorld extends Mesh {
    private static readonly _tempMatrix4A;
    private static readonly _tempVec3A;
    workerPool: WorkerThreadPool | null;
    bimModels: ViralBIMModel[];
    private _workerBlobUrl;
    private _cachedBounds;
    private _boundsDirty;
    constructor();
    private _initializeWorkerPool;
    get bounds(): Box3;
    /**
     * Mark bounds as dirty so they will be recomputed on next access.
     * Call this after geometry changes (add/remove meshes, transforms).
     */
    invalidateBounds(): void;
    isReady: boolean;
    setReady(value: boolean): void;
    protected _batchedMeshes: ViralBatchedMesh[];
    addBatchedMesh(mesh: ViralBatchedMesh): void;
    getBatchedMesh(globalMaterialIndex: number): ViralBatchedMesh | undefined;
    removeBatchedMesh(mesh: ViralBatchedMesh): void;
    getBatchedMeshes(): ViralBatchedMesh[];
    protected _batchedMeshesV3: ViralBatchedMeshV3[];
    addBatchedMeshV3(mesh: ViralBatchedMeshV3): void;
    getBatchedMeshV3(globalMaterialIndex: number): ViralBatchedMeshV3 | undefined;
    getBatchedMeshesV3(): ViralBatchedMeshV3[];
    /**
     * Get diagnostic info about merged model structure
     */
    getDiagnostics(): {
        totalChildren: number;
        batchedMeshesInChildren: number;
        batchedMeshesInArray: number;
        instancedMeshes: number;
        totalVertices: number;
        childrenTypes: string[];
    };
    protected _instancedMeshes: ViralInstancedMeshV2[];
    addInstancedMesh(mesh: ViralInstancedMeshV2): void;
    getInstancedMesh(globalMaterialIndex: number): ViralInstancedMeshV2 | undefined;
    getInstancedMeshes(): ViralInstancedMeshV2[];
    removeInstancedMesh(mesh: ViralInstancedMeshV2): void;
    hide(elements?: {
        modelId: string;
        elementId: string;
    }[]): void;
    protected _isolatingElements: {
        modelId: string;
        elementId: string;
    }[];
    isolate(elements?: {
        modelId: string;
        elementId: string;
    }[]): void;
    getIsolatingElements(): {
        modelId: string;
        elementId: string;
    }[];
    getHidingElements(): {
        modelId: string;
        elementId: string;
    }[];
    /**
     * Isolate whole model
     * @param modelIds
     */
    isolateModel(modelIds: string[]): void;
    /**
     *
     * @param elements
     * @param excepts exeception list
     */
    select(elements: {
        modelId: string;
        elementId: string;
    }[], excepts?: {
        elements: {
            modelId: string;
            elementId: string;
        }[];
        color: {
            r: number;
            g: number;
            b: number;
        };
    }[]): void;
    unselect(): void;
    /**
     * get bufferEleemnts from given ids
     * @param elements
     * @returns
     */
    getElements(elements: {
        modelId: string;
        elementId: string;
    }[]): BufferElement[];
    getElementsByModel(modelIndex: number): BufferElement[];
    getSelectedElements(): {
        modelId: string;
        elementId: string;
    }[];
    /**
     * Get merged position buffer for selected elements (for outline rendering)
     * Returns all vertex positions merged into a single Float32Array
     * Handles both batched meshes (direct buffer) and instanced meshes (applies transforms)
     * @returns Float32Array of positions or null if no selection
     */
    getSelectedElementsPositions(): Float32Array | null;
    /**
     * Changes the color of multiple elements in the merged mesh.
     * Works with RGBA color buffer (preserves existing alpha values)
     * @param elements - An array of elements, each containing `modelId` and `elementId`.
     * @param color - The new RGB color to apply
     * @param isTemporary - Override for temporary, if element has temporary color it will turn back this color, otherwise will turn back to original - default is false
     */
    changeColor(elements: {
        modelId: string;
        elementId: string;
    }[], color: {
        r: number;
        g: number;
        b: number;
    }, isTemporary?: boolean): void;
    getElementBoxs(elements: {
        modelId: string;
        elementId: string;
    }[]): Box3;
    /**
     * reset visibility/ geometries only not reset color
     */
    resetVisibility(): void;
    resetColor(): void;
    /**
     * Set opacity for specific elements
     * @param elements - Elements to set opacity for
     * @param opacity - Opacity value (0-1)
     */
    setElementOpacity(elements: {
        modelId: string;
        elementId: string;
    }[], opacity: number): void;
    /**
     * Set elements to "ghost" mode (semi-transparent)
     * @param elements - Elements to ghost
     * @param ghostOpacity - Opacity for ghosted elements (default 0.1)
     * @param ghostColor - Optional custom color for ghosted elements (e.g., {r: 1, g: 1, b: 1} for white)
     */
    setElementGhost(elements: {
        modelId: string;
        elementId: string;
    }[], ghostOpacity?: number, ghostColor?: {
        r: number;
        g: number;
        b: number;
    }): void;
    /**
     * Ghost all elements EXCEPT the specified ones
     * @param elements - Elements to keep fully opaque
     * @param ghostOpacity - Opacity for all other elements (default 0.1)
     * @param ghostColor - Optional custom color for ghosted elements (e.g., {r: 1, g: 1, b: 1} for white)
     */
    ghostExcept(elements: {
        modelId: string;
        elementId: string;
    }[], ghostOpacity?: number, ghostColor?: {
        r: number;
        g: number;
        b: number;
    }): void;
    /**
     * Reset all elements to full opacity
     */
    resetElementOpacity(): void;
    /**
     * @deprecated No longer needed - visibility is now alpha-based (GPU-accelerated)
     * Kept for backward compatibility but does nothing
     */
    optimizeVertices(): void;
    /**
     * *everytime add new model in scene this model will be regenerated again, for that reason we should dispose this model
     * *then regenerate again
     */
    dispose(): void;
    /**
     * [INFRA-09] Cooperative async dispose — yields to event loop between mesh disposals.
     * Prevents UI freezes when disposing large scenes with hundreds of meshes.
     * Use this instead of synchronous `dispose()` when called from user-initiated actions.
     */
    disposeCooperative(): Promise<void>;
}
