/**
 * @module vim-loader
 */
import * as THREE from 'three';
import { G3d, MeshSection } from 'vim-format';
export type MergeArgs = {
    matrix: THREE.Matrix4;
    section: MeshSection;
    legacyInstances: number[];
    legacyLoadRooms: boolean;
    transparent: boolean;
};
export declare namespace Transparency {
    /**
     * Determines how to draw (or not) transparent and opaque objects
     */
    type Mode = 'opaqueOnly' | 'transparentOnly' | 'allAsOpaque' | 'all';
    /**
     * Returns true if the transparency mode is one of the valid values
     */
    function isValid(value: string | undefined | null): value is Mode;
    /**
     * Returns true if the transparency mode requires to use RGBA colors
     */
    function requiresAlpha(mode: Mode): mode is "all" | "transparentOnly";
}
export declare namespace Geometry {
    /**
     * Creates a BufferGeometry with all given instances merged
     * @param instances indices of the instances from the g3d to merge
     * @returns a BufferGeometry
     */
    function createGeometryFromInstances(g3d: G3d, args: MergeArgs): THREE.BufferGeometry<THREE.NormalBufferAttributes>;
    /**
     * Creates a BufferGeometry from a given mesh index in the g3d
     * @param mesh g3d mesh index
     * @param transparent specify to use RGB or RGBA for colors
     */
    function createGeometryFromMesh(g3d: G3d, mesh: number, section: MeshSection, transparent: boolean): THREE.BufferGeometry;
    /**
     * Returns a THREE.Matrix4 from the g3d for given instance
     * @param instance g3d instance index
     * @param target matrix where the data will be copied, a new matrix will be created if none provided.
     */
    function getInstanceMatrix(g3d: G3d, instance: number, target?: THREE.Matrix4): THREE.Matrix4;
    /**
     * Creates a BufferGeometry from given geometry data arrays
     * @param vertices vertex data with 3 number per vertex (XYZ)
     * @param indices index data with 3 indices per face
     * @param vertexColors color data with 3 or 4 number per vertex. RBG or RGBA
     * @param colorSize specify whether to treat colors as RGB or RGBA
     * @returns a BufferGeometry
     */
    function createGeometryFromArrays(vertices: Float32Array, indices: Uint32Array, vertexColors?: Float32Array | undefined, colorSize?: number): THREE.BufferGeometry;
    /**
     * Returns a merged mesh of all meshes related to given instances along with picking related metadata
     * Returns undefined if mesh would be empty
     * @param section mesh sections to include in the merged mesh.
     * @param transparent true to use a transparent material.
     * @param instances instances for which to merge meshes.
     */
    function mergeInstanceMeshes(g3d: G3d, mergeArgs: MergeArgs): MergeResult;
    /**
     * Returns a merged mesh of all unique meshes along with picking related metadata
     * @param section mesh sections to include in the merged mesh.
     * @param transparent true to use a transparent material.
     * @param instances instances for which to merge meshes.
     */
    function mergeUniqueMeshes(g3d: G3d, args: MergeArgs): MergeResult;
    /**
     * Holds the info that needs to be precomputed for a merge.
     */
    class MergeInfo {
        section: MeshSection;
        transparent: boolean;
        instances: number[];
        indexCount: number;
        vertexCount: number;
        constructor(section: MeshSection, transparent: boolean, instance: number[], indexCount: number, vertexCount: number);
        createBuffer(): MergeBuffer;
    }
    /**
     * Allocates and holds all arrays needed to merge meshes.
     */
    class MergeBuffer {
        indices: Uint32Array;
        vertices: Float32Array;
        colors: Float32Array;
        groups: number[];
        colorSize: number;
        boxes: THREE.Box3[];
        constructor(info: MergeInfo, positionSize: number, colorSize: number);
        toBufferGeometry(): THREE.BufferGeometry<THREE.NormalBufferAttributes>;
    }
    /**
     * Holds the result from a merge operation.
     */
    class MergeResult {
        geometry: THREE.BufferGeometry;
        instances: number[];
        submeshes: number[];
        boxes: THREE.Box3[];
        constructor(geometry: THREE.BufferGeometry, instance: number[], submeshes: number[], boxes: THREE.Box3[]);
    }
}
