/** @internal NOTE: Internal APIs. Subject to change. Use of these APIs in production applications is not supported. */ /** */
import { BimIfcIndex } from './BimIfcIndex';
import { BimProductMeshDescriptor, BimVertexData, TypedArray } from './bim-format-types';
import { BimVertexDataReader } from './bim-vertex-data-reader';
import { T8gdReader } from '@twinfinity/geometry';
/**
 * Represents a memory block for storing geometry data. That is vertices, normals and indices.
 */
export declare class GeometryMemoryBlock {
    private static readonly _memoryBlockOptions;
    private _vertexDatacache;
    private _byteSize;
    private _importId;
    private _v2MeshSources;
    /**
     * Gets the size of the memory block in bytes.
     * @returns The size of the memory block in bytes.
     */
    get byteSize(): number;
    /**
     * Imports packed vertex data into the geometry memory block.
     *
     * @param reader - The {@link BimVertexDataReader} used to read the vertex data.
     * @param meshDescriptors - The mesh descriptors containing information about the vertex data in {@link BimVertexDataReader}.
     * Mesh descriptors that are already imported are ignored (so we never store duplicated data).
     * @returns A Promise that resolves when the vertex data is imported.
     */
    importPackedVertexData(reader: BimVertexDataReader, meshDescriptors: BimIfcIndex['meshDescriptors']): Promise<void>;
    /**
     * Imports packed vertex data from V2 (.t8gd) format into the geometry memory block.
     *
     * @param fileReader - The {@link T8gdReader} for file-level operations (hash lookup).
     * @param meshDescriptors - The mesh descriptors containing information about which meshes to load.
     * Mesh descriptors that are already imported are ignored (so we never store duplicated data).
     * @returns A Promise that resolves when the vertex data is imported.
     */
    importPackedVertexDataV2(fileReader: T8gdReader, meshDescriptors: BimIfcIndex['meshDescriptors']): Promise<void>;
    /**
     * Checks if the given {@link BimProductMeshDescriptor} exists in the geometry memory block.
     * @param meshDescriptor - The {@link BimProductMeshDescriptor} to check.
     * @returns `true` if the {@link BimProductMeshDescriptor} exists, `false` otherwise.
     */
    has(meshDescriptor: BimProductMeshDescriptor): boolean;
    /**
     * Retrieves the vertex data for a given BimProductMeshDescriptor.
     *
     * @param meshDescriptor - The BimProductMeshDescriptor object.
     * @returns The BimVertexData associated with the given mesh descriptor. `undefined` if the mesh descriptor is not found.
     */
    getVertexData(meshDescriptor: BimProductMeshDescriptor): BimVertexData | undefined;
    /**
     * Removes a cached vertex data entry by hash so it can be re-imported with better data.
     * The old data remains allocated in the parent MemoryBlock buffer but becomes unreachable
     * through the cache. This only happens during initial loading when welded geometry replaces
     * unwelded geometry for the same hash, so the leaked allocations are bounded and small
     * relative to the total geometry budget. Compacting the MemoryBlock is not worth the cost.
     */
    removeVertexData(hash: string): boolean;
    /**
     * Lazily reads edge indices for a mesh from the retained V2 geometry buffer.
     * Returns undefined if the mesh has no edges or was not loaded via V2 format.
     */
    readEdgeIndices(hash: string): TypedArray | undefined;
    /**
     * Releases retained V2 geometry buffers used for lazy edge reads.
     * Call after all edges have been read to free the underlying ArrayBuffer memory.
     */
    releaseV2MeshSources(): void;
    /**
     * Releases V2 geometry buffer references for a specific set of mesh hashes only.
     * Use this when several loader elements share one repository: each element should
     * release only the meshes it consumed so concurrent peers can still resolve their edges.
     */
    releaseV2MeshSourcesFor(hashes: ReadonlySet<string>): void;
    /**
     * Resets the GeometryMemoryBlock freeing all the used memory.
     * It is safe to call {@link importPackedVertexData} after calling this method.
     */
    reset(): void;
    private updateDeduplicationStats;
}
//# sourceMappingURL=GeometryMemoryBlock.d.ts.map