import { CheckClashResult, CompareModelsResult, DataTree, GroupByResult, type ViralutionParameter, type ViralutionInformation, type ViralutionTrackingModel, type ViralViewerApi } from "../..";
import type { IFCPropertyResult } from "./ifc-property-mapper";
import type { SpatialTreeNode } from "./ifc-spatial-tree";
export type { IFCPropertyResult } from "./ifc-property-mapper";
export type { SpatialTreeNode } from "./ifc-spatial-tree";
export declare class ViralDataManager {
    viralViewerApi: ViralViewerApi;
    dataTree: DataTree[];
    trackingData: Map<number, ViralutionTrackingModel>;
    private fetchDataWorker;
    private buildTreeNodeWorker;
    private _boundingBoxWorker;
    private _boundingBoxIntersectWorker;
    private _checkClashWorker;
    constructor(viralViewerApi: ViralViewerApi);
    addTrackingData(modelId: number, data: ViralutionTrackingModel): void;
    normalFetch(url: string, byteRangeStart?: number, byteRangeEnd?: number): Promise<Response>;
    gzipFetch(url: string): Promise<Response>;
    /**
     * worker fetch can only return json or arraybuffer value
     * @param url
     * @param callbackOnSuccess
     * @param byteRangeStart
     * @param byteRangeEnd
     */
    workerFetch(url: string, callbackOnSuccess?: (response: ArrayBuffer) => void, byteRangeStart?: number, byteRangeEnd?: number): void;
    /**
     * Add BIM element data to the data tree
     * Uses optimized flat Map storage for O(1) element lookup
     * Search index is built lazily on first search (saves memory until needed)
     *
     * @param data Object with elementId as key, nested properties as value
     */
    addData(data: ViralutionInformation): void;
    getElementData(modelId: number, elementId: number): {
        [key: string]: ViralutionParameter;
    } | null;
    getLinkedElements(modelId: number, elementId: number): number[] | null;
    /**
     * Get element count for a model
     */
    getElementCount(modelId: number): number;
    /**
     * Get all element IDs for a model
     */
    getElementIds(modelId: number): number[];
    /**
     * Get all elements with their data for a model
     * @param modelId Model index
     * @returns Array of { elementId, data } objects
     */
    getAllElementsData(modelId: number): {
        elementId: number;
        data: {
            [key: string]: {
                [key: string]: string;
            };
        };
    }[];
    /**
     * Get all elements in BIM World
     */
    getAllElements(): {
        modelId: string;
        elementId: string;
    }[];
    /**
     * Get all elements as a Map for a model (more memory efficient)
     * @param modelId Model index
     * @returns Map<elementId, elementData>
     */
    getAllElementsMap(modelId: number): Map<number, {
        [key: string]: {
            [key: string]: string;
        };
    }>;
    /**
     * Iterate over all elements without creating intermediate arrays
     * Most memory efficient for large datasets
     * @param modelId Model index
     * @param callback Function to call for each element
     */
    forEachElement(modelId: number, callback: (elementId: number, data: {
        [key: string]: {
            [key: string]: string;
        };
    }) => void): void;
    /**
     * Get full IFC BIM data for an element using on-demand extraction via the worker.
     * Returns structured property data: attributes, property sets, quantity sets.
     *
     * Returns null if the loader worker is not alive or the query fails.
     *
     * @param modelId Model index in bimWorld.bimModels
     * @param elementId IFC expressId of the element
     */
    getIFCProperties(modelId: number, elementId: number): Promise<IFCPropertyResult | null>;
    getAllIFCProperties(modelId: number, elementIds: number[]): Promise<Map<number, IFCPropertyResult>>;
    /**
     * Populate DataTree for an IFC model from its IfcDataStore.
     * Adds entity attributes (Name, ObjectType, GlobalId) as ViralutionParameter groups
     * so that existing search() and getElementData() APIs work with IFC models.
     *
     * Called automatically when an IFC model finishes loading.
     */
    populateIFCDataTree(modelId: number): void;
    searchValue: string;
    searchElementData(prefix?: string): {
        modelId: string;
        elementId: string;
    }[];
    /**
     *
     * @param oldModelIndex old model, default is 0
     * @param newModelIndex current model, default is 1
     * @returns
     */
    compareModels(oldModelIndex?: number, newModelIndex?: number): CompareModelsResult;
    uncompareModels(): void;
    private _getDiffKeys;
    private _areListsEqual;
    private _areObjectsEqual;
    firstElementId: string;
    secondElementId: string;
    checkClash(firstElementId?: string, secondElementId?: string): void;
    /**
     * Check model it self or check with other model
     * @param firstModelIndex
     * @param secondModelIndex
     */
    checkClashModels(firstModelIndex?: number, secondModelIndex?: number): Promise<CheckClashResult>;
    /**
     * group element by property keyword, ex: if keyword is 'Category' it will group element follow category value.
     * @param keyword
     */
    groupByKeyword: string;
    groupBy(keyword?: string): GroupByResult[];
    unGroupBy(): void;
    private _shallowCompare;
    /**
     * Get all level/storey IDs for a model
     */
    getLevels(modelId: number): number[];
    /**
     * Get all room/space IDs for a model
     */
    getRooms(modelId: number): number[];
    /**
     * Get all element IDs on a specific level
     */
    getElementsByLevel(modelId: number, levelId: number): number[];
    /**
     * Get all room IDs on a specific level
     */
    getRoomsByLevel(modelId: number, levelId: number): number[];
    /**
     * Isolate all elements belonging to a specific level
     */
    isolateByLevel(modelId: number, levelId: number): {
        modelId: string;
        elementId: string;
    }[];
    /**
     * Get the IFC spatial hierarchy as a consumer-friendly tree structure.
     * Returns a SpatialTreeNode tree (Project > Site > Building > Storey)
     * with elements grouped by IFC type under each node.
     *
     * Returns null if the model has no IFC data store or no spatial hierarchy.
     *
     * @param modelId Model index in bimWorld.bimModels
     */
    getSpatialTree(modelId: number): SpatialTreeNode | null;
    /**
     * Get all element IDs contained in a specific storey.
     * Uses ifc-lite's SpatialHierarchy.getStoreyElements() for efficient lookup.
     *
     * Returns empty array if the model has no IFC data store or the storeyId is invalid.
     *
     * @param modelId Model index in bimWorld.bimModels
     * @param storeyId expressId of the IfcBuildingStorey
     */
    getElementsByStorey(modelId: number, storeyId: number): number[];
    private _findNode;
    private _collectElementIds;
    /**
     * Get the containing storey expressId for a given element.
     * Uses ifc-lite's SpatialHierarchy.elementToStorey map for O(1) lookup.
     *
     * Returns null if the model has no IFC data store or the element has no storey assignment.
     *
     * @param modelId Model index in bimWorld.bimModels
     * @param elementId expressId of the element
     */
    getStoreyForElement(modelId: number, elementId: number): number | null;
    private _findStoreyForElement;
}
