import { BimCamera } from './BimCamera';
import { BimContainer } from './loader/bim-api-client';
import { BimIfcLoader, TwinInputResolver } from './loader/bim-ifc-loader';
import { TwinfinityViewer, GridOptions, RunRenderLoopHandler } from './loader/twinfinity-viewer';
import { Intersection } from './loader/bim-format-types';
import { BimProductAndMesh } from './loader/BimProductAndMesh';
import { BimIfcObject, BimIfcObjectForEachAction, BimIfcObjectForEachPredicate } from './loader/bim-ifc-object';
import { Vertex3 } from './math';
import { Vector3, Mesh, Color3 } from './loader/babylonjs-import';
import { CoordinateTracker } from './tools/CoordinateTracker';
import { BimApiLoadOptions } from './BimApiLoadOptions';
import { Selectables } from './loader/Selectables';
import { BimCoreApiClient } from './loader/client/BimCoreApiClient';
import { ColoredHighlightIndexes } from './loader/CustomBabylonMaterials/IfcMaterial';
import type { MeshStoreLoaderOptions } from '@twinfinity/geometry';
/**
 * Options for {@link BimCoreApi} constructor.
 */
export interface BimCoreApiOptions {
    wasmLoaderOptions?: MeshStoreLoaderOptions;
    /**
     * If `true` (default), automatically disposes resources when the page is unloaded.
     * Set to `false` for SPAs with manual lifecycle management.
     */
    autoDisposeOnUnload?: boolean;
    /** Resolver for loading twins via {@link BimIfcLoader.add}. Provided by {@link BimApi}. */
    twinInputResolver?: TwinInputResolver;
}
/**
 * Click event handler
 * @deprecated
 */
export interface ClickEventHandler {
    (object?: BimProductAndMesh, hitInfo?: Intersection[], mesh?: Mesh): void;
}
/**
 * @deprecated Use `Color3` or `Color4` instead.
 */
type Color = [number, number, number];
export type BimIfcChangeLoader = BimIfcLoader;
/**
 * BimCoreApi is a generic API class. It is completely unaware about the Twinfinity API backend
 * and can therefore be used as a base for integration with a completely different backend. This must be used
 * in conjunction with a specialized implementation of {@link BimCoreApiClient}. {@link BimApi} is an actual
 * example of such an implementation.
 */
export declare class BimCoreApi {
    private readonly _bimBackendApi;
    private readonly _bimVertexDataRepository;
    private readonly _bimIfc;
    private _beforeUnloadHandler?;
    /**
     * Extension point for applications that need to run the renderloop outside their own
     * change handling (AngularJs is one such example). Assignment should be done before creation of
     * a {@link BimCoreApi} instance.
     * @example Example for Angular JS
     * ```typescript
     *  const bimApi: BimApi;
     *  BimCoreApi.runRenderLoop = this.ngZone.runOutSideAngular;
     * ```
     *  @beta
     * @param renderLoop Renderloop function will be provided by the viewer. Simply call it in your provided function
     */
    static runRenderLoop: RunRenderLoopHandler;
    /**
     * Exposes viewer internals. Use this to access BabylonJS API.
     * Disclaimer! Accessing BabylonJS internals is considered advanced usage and you are effectively bypassing {@link BimCoreApi} (and subclasses).
     * We cannot make guarantees that:
     *  * BabylonJS APIs will remain backwards compatible. Therefore, your application may break when BabylonJS is updated to a new version.
     *  * Babylonjs data that {@link BimCoreApi} creates, such as scene hierarchy, lights, camera etc., will remain backwards compatible between versions. Relying on this may break your application.
     *  * Your modifications to BabylonJS data (such as scene hierarchy, lights, cameras etc.) will not be changed by code in this package.
     *  * Other bugs will not occur as a result of direct usage of BabylonJS APIs.
     * {@link https://doc.babylonjs.com/api/classes/babylon.scene}
     * @example
     * ```typescript
     * api.viewer.scene.ambientColor = new Color3(1, 0, 0);
     * ```
     */
    readonly viewer: TwinfinityViewer;
    /**
     * Creates a new instance of {@link BimCoreApi} or subclass of {@link BimCoreApi}.
     * @param _htmlElementOrId ID of the HTML element where the viewer should be created.
     * @param apiFactory Factory function to create the API instance.
     * @example
     * ```typescript
     * // Create an API instance.
     * const bimCoreApi = await BimCoreApi.create('viewer', canvas => new BimCoreApi(canvas, new BimApiClientTwinfinity()));
     * const bimApi = await BimCoreApi.create('viewer', canvas => new BimApi(canvas, new BimApiClientTwinfinity()));
     * ```
     */
    static createApi<TBimApi extends BimCoreApi>(_htmlElementOrId: string | HTMLElement, apiFactory: (canvas: HTMLCanvasElement) => TBimApi): Promise<TBimApi>;
    /** Constructor. Use {@link createApi} instead. */
    constructor(htmlCanvasElement: HTMLCanvasElement, _bimBackendApi: BimCoreApiClient, options?: BimCoreApiOptions);
    /**
     * @internal Returns an IFC structure.
     */
    get ifc(): BimIfcChangeLoader;
    /** Direct access to the methods for communicating with the backend. */
    get backend(): BimCoreApiClient;
    /** Exposes methods related to selection operations.
     *  For example, what the user actually clicked on.
     */
    get selectables(): Selectables;
    /**
     * Subscribe to get access to pointer events (mouse, touchpad etc) and to determine
     * what (if anything) a mouse click interacted with (what object was 'picked' in the 3D scene).
     */
    get onPointerObservable(): TwinfinityViewer['onPointerObservable'];
    /**
     * Sets the container of the current BimApi instance.
     * @param containerOrUrl Container object or absolute URL Example: https://bim.foo.com/sites/portal/projects/\{project name\}
     * @param options Loading options
     * @remarks This method previously returned a `BimQuery` instance. Use {@link foreach}, {@link products}, {@link filter} instead.
     */
    setContainer(containerOrUrl: BimContainer | URL, options?: BimApiLoadOptions): Promise<void>;
    /**
     * Clears api (any loaded IFC files etc are unloaded).
     */
    clear(): void;
    /**
     * Disposes the API and releases all resources including WASM memory and Babylon.js resources.
     * After calling this method, the API instance should not be used.
     */
    protected dispose(): void;
    /**
     * Iterate the {@link BimIfcObject} instances and return those that match the specified predicate.
     * @param predicate Predicate. Items matching this will be returned in array format.
     * @returns Array with {@link BimIfcObject} instances matched by the specified _predicate_.
     */
    filter(predicate: BimIfcObjectForEachPredicate): BimIfcObject[];
    /**
     * Intersects all visible BIM objects using ray from origin towards direction
     * @param origin Vector3
     * @param direction Vector3
     * @param objects BimIfcObject[]
     * @returns Intersection[] | undefined
     * @example
     * ```typescript
     * // GetIntersections makes a hit test on all visible BIM objects, from origin in direction and return first object intersection.
     * const intersections = this.api.getIntersections([0, 0, 0], [1, 1, 1]);
     * ```
     * @example
     * ```typescript
     * // GetIntersections makes a hit test on a subset of  BIM objects, from origin in direction and return first object intersection.
     * const intersections = this.api.withSelection(myVisibleObjects, objects => this.api.getIntersections([0, 0, 0], [1, 1, 1]);
     * ```
     * @example
     * ```typescript
     * // GetIntersections makes a hit test on a subset of visible BIM objects, from origin in direction and return first object intersection.
     * const intersections = this.api.getIntersections([0, 0, 0], [1, 1, 1], myObjects);
     * ```
     */
    getIntersections(origin: Vector3, direction: Vector3, objects?: BimIfcObject[]): Intersection[] | undefined;
    /**
     * Makes it possible to perform API operations, that operate on the set of visible BIM objects, on a smaller set
     * of (still visible) BIM objects
     * @param visibleBimObjects - Visible objects to run operation on
     * @param action - Operation
     * @example
     * ```typescript
     * // GetIntersections makes a hit test on a subset of visible BIM objects, from origin in direction and return first object intersection.
     * const intersections = this.api.withVisibleBimObjects(myVisibleBimObjects, objects => api.getIntersections([0, 0, 0], [1, 1, 1]));
     * ```
     */
    withVisibleBimObjects<T>(visibleBimObjects: BimIfcObject[], action: (objects: BimIfcObject[]) => T): T;
    /**
     * Loads all BIM property sets for all loaded files.
     * @deprecated Call {@link BimIfcLoader.loadPropertySets} on {@link ifc} instead.
     */
    loadPropertySets(): Promise<void>;
    /**
     * This function zooms the camera to contain BIM objects in view frustum.
     * @param products Array of BIM objects.
     */
    zoomToExtent(products: BimIfcObject[]): void;
    /**
     * Use this function to iterate over all BIM objects.
     * @param action This is a lambda function to evaluate on each BimIfcObject.
     * @example
     * ```typescript
     * api.foreach((o, recursionOptions) => {
     *     if (o.hasGeometry && o.class.id !== "IfcFlowSegment") {
     *         console.log(o.gid);
     *         o.visible(true);
     *     } else {
     *         o.visible(false);
     *     }
     * });
     *
     * ```
     */
    foreach(action: BimIfcObjectForEachAction): void;
    /**
     * Create a iterator that can be used to iterate over all {@link BimIfcObject}'s.
     * Same as foreach but with a iterator instead.
     * @returns Iterator that can be used to iterate over all {@link BimIfcObject}'s.
     * @example
     * ```typescript
     * for(const o of api.products()) {
     *     if (o.hasGeometry && o.class.id !== "IfcFlowSegment") {
     *         console.log(o.gid);
     *         o.visible(true);
     *     } else {
     *         o.visible(false);
     *     }
     * };
     *
     * ```
     */
    products(): IterableIterator<BimIfcObject>;
    /**
     * Updates the viewer with the latest visual changes on BIM objects. See {@link foreach} for an example.
     */
    applyVisualChanges(): Promise<void>;
    /**
     * Sets a handler to event of given type
     * @deprecated Use {@link onPointerObservable} instead.
     * @param type Type of event. For now only "click" is supported
     * @param clickEventHandler Function that gets called when the event occurs
     */
    on(type: 'click', clickEventHandler: ClickEventHandler): void;
    /** Gets a {@link CoordinateTracker} instance. */
    createCoordinateTracker<Tracked3D extends Vertex3 = any>(): CoordinateTracker<Tracked3D>;
    /**
     * Camera is an instance of BimCamera and used for manipulating the 3D camera view of the BIM viewer.
     */
    readonly camera: BimCamera;
    /**
     * Sets background color in viewer
     * @param color RGB in range 0-1
     * @example
     * ```typescript
     * api.setBackgroundColor([0.95, 0.95, 0.95]);
     * ```
     */
    setBackgroundColor(color: Color | Color3): void;
    /**
     * Sets highlight color in viewer
     * @param color RGB in range 0-1
     * @param highlightIndex The highlight index tgo change, it's restricted to One, Two and Three
     * because it makes no sense to change the color of the Empty index (since it's only there to denote that a productMesh has no highlight).
     * The highlight index defaults to One
     * @example
     * ```typescript
     * api.setHighlightColor([1.0, 0.0, 0.0]); <-- Sets the color of the first highlight index to solid red
     * api.setHighlightColor([0.0, 1.0, 0.0], HighlightIndex.Two); <-- Sets the color of the second highlight index to solid green
     * ```
     */
    setHighlightColor(color: Color3, highlightIndex: ColoredHighlightIndexes): void;
    /**
     * Gets or sets a value indicating whether to show or hide skybox.
     */
    get isSkyboxEnabled(): boolean;
    set isSkyboxEnabled(enabled: boolean);
    /**
     * Gets or sets a value indicating whether to hide or show coordinate system axes.
     */
    get axes(): boolean;
    set axes(isEnabled: boolean);
    /**
     * Gets or sets options for 3D help grid visualization.
     */
    get grid(): GridOptions;
    /** Called from {@link createApi}. Subclasses can implement if they need to initialize more data during API creation in {@link createApi} */
    protected initialize(): Promise<void>;
}
export {};
//# sourceMappingURL=BimCoreApi.d.ts.map