import * as THREE from "three";
import { CSS2DRenderer } from "three/examples/jsm/renderers/CSS2DRenderer.js";
import { ViewerName } from "./Constants";
import type { Plugin } from "./Plugin";
import { ViewerEvent } from "./ViewerEvent";
import { Spinner } from "../components";
import { type ViewerI18nLanguage } from "../../Locale";
import { BaseViewerConfig, CameraInfo, CameraProjection, ModelConfig, Viewpoint } from "../../core/Configs";
import { CameraManager } from "../../core/camera";
import { CanvasRender } from "../../core/canvas";
import { Container } from "../../core/components/Container";
import { EffectManager } from "../../core/effect";
import { FontManager } from "../../core/font";
import { InputManager } from "../../core/input-manager";
import { Interaction } from "../../core/interactions/Interaction";
import { BaseModelLoader } from "../../core/loaders";
import { Model } from "../../core/model";
import { PickManager } from "../../core/pick";
import { SceneManager } from "../../core/scene/SceneManager";
import { UndoManager } from "../../core/undo";
import { Event } from "../../core/utils";
type ViewerEvents = {
    [K in ViewerEvent]: any;
};
export declare abstract class BaseViewer<BaseViewerEvents extends ViewerEvents = Record<ViewerEvent, any>> extends Event<BaseViewerEvents> {
    name: ViewerName;
    container: Container;
    /**
     * A map to store model file and id.
     */
    loadedModels: Model[];
    protected inputManager: InputManager;
    /**
     * When true, mesh geometry is quantized after load for supported 3D formats (Viewer3d)
     * when {@link ModelConfig.quantize} is omitted. Per-model `quantize` overrides this.
     * Defaults to `false`; set at runtime (e.g. `viewer.enableQuantization = true`) or pass `quantize` on each {@link ModelConfig}.
     */
    enableQuantization: boolean;
    /**
     * Enables selecting an object
     */
    protected _enableSelection: boolean;
    constructor(viewerCfg: BaseViewerConfig);
    /**
     * Current viewer UI language (shared {@link i18n} instance for core, plugins, and UI).
     */
    getLanguage(): ViewerI18nLanguage;
    /**
     * Switch viewer UI language and notify plugins via {@link ViewerEvent.LanguageChange}.
     */
    setLanguage(language: ViewerI18nLanguage): void;
    get viewerContainer(): HTMLElement;
    get widgetContainer(): HTMLElement;
    getUndoManager(): UndoManager;
    getInputManager(): InputManager;
    getCssRender(): CSS2DRenderer;
    getCameraManager(): CameraManager;
    getOverlayRender(): CanvasRender;
    getSceneManager(): SceneManager;
    /**
     * The WebGLRenderer.
     */
    get renderer(): THREE.WebGLRenderer;
    /**
     * Current camera.
     */
    get camera(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
    /**
     * Current Scene.
     */
    get scene(): THREE.Scene<THREE.Object3DEventMap>;
    /**
     * Gets if selection is enabled.
     */
    abstract get enableSelection(): boolean;
    /**
     * Sets if selection is enabled.
     * A derived class may need to clean up selected object if any.
     */
    abstract set enableSelection(enable: boolean);
    abstract setObjectHighlight(object: THREE.Object3D): void;
    abstract clearHighlight(): void;
    getRaycaster(): THREE.Raycaster;
    getPickManager(): PickManager;
    /** Visual effects / composer (same instance as {@link BaseViewer.effect}). */
    get effectManager(): EffectManager;
    getViewerConfig(): BaseViewerConfig;
    getSpinner(): Spinner;
    getFontManager(): FontManager | undefined;
    setInteraction(interaction: Interaction): void;
    /**
     * In order to have a better performance, it should only render when necessary.
     * Usually, we should enable render for these cases:
     *  - Anything added to, removed from scene, or objects' position, scale, rotation, opacity, material, etc. changed
     *  - Anything selected/unselected
     *  - Camera changed
     *  - Render area resized
     * @hidden
     */
    enableRender: (time?: number) => void;
    resize(): void;
    /**
     * Fills {@link ModelConfig.quantize} from {@link enableQuantization} when omitted, without mutating `modelCfg`.
     */
    protected modelConfigForLoader(modelCfg: ModelConfig): ModelConfig;
    abstract loadModel(modelCfg: ModelConfig, onProgress?: (event: ProgressEvent) => void): Promise<void>;
    addModel(model: Model): void;
    removeModelById(modelId: string): void;
    setFont(urls: string[]): Promise<void>;
    /**
     *
     * @description 2d ignore position z.
     */
    is3d(): boolean;
    /**
     * Gets how long a pixel represents in world coordinate.
     * This works fine for OrthographicCamera.
     * As for PerspectiveCamera, a pixel represents different size for different position,
     * depends on how far the camera is and its fov, etc. We'll simply take the camera target as the position to calculate.
     * @hidden
     */
    getPixelSizeInWorldCoord(): number;
    /**
     * Lets the user box-select a region on screen, then zooms the camera to that region.
     * @example
     * ``` typescript
     * viewer.zoomToRect();
     * ```
     */
    zoomToRect(): void;
    /**
     * Gets all objects' bounding box.
     */
    getBBox(): THREE.Box3;
    /**
     * Bounding box used by camera fit helpers. Falls back to a 1×1×1 box at the
     * origin when the scene has no valid content.
     */
    private getBBoxForFit;
    /**
     * Flies to given object and keep current view direction unchanged.
     */
    flyToObject(object: THREE.Object3D): void;
    flyToObjectFront(object: THREE.Object3D): Promise<unknown>;
    flyToObjects(objects: THREE.Object3D[]): void;
    /**
     * Make camera fly to target position with given lookAt position
     * @param position camera's target position
     * @param lookAt camera's new lookAt position
     */
    flyTo(position: THREE.Vector3, lookAt: THREE.Vector3, enableTransition?: boolean): void;
    /**
     * Views objects by given direction.
     */
    flyToDirection(direction: THREE.Vector3): void;
    /**
     * Goes to home view.
     */
    goToHomeView(): void;
    /**
     * Fits the camera to view all objects in scene, keeps current view
     * direction unchanged.
     */
    viewFitAll(): void;
    /**
     * Zooms to given bounding box.
     */
    zoomToBBox(bbox: THREE.Box3): void;
    /**
     * Picks the closest object by mouse position.
     */
    pickObject(mousePosition: THREE.Vector2, layerChannels?: number[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | undefined;
    /**
     * Picks objects by mouse position.
     */
    pickObjects(mousePosition: THREE.Vector2, layerChannels?: number[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>>[];
    getRaycastableObjects(): THREE.Object3D<THREE.Object3DEventMap>[];
    /**
     * @description {en} Sets background color.
     * @param r Red channel value between 0 and 1.
     * @param g Green channel value between 0 and 1.
     * @param b Blue channel value between 0 and 1.
     * @example
     * ``` typescript
     * // Sets background to gray
     * viewer.setBackgroundColor(0.5, 0.5, 0.5);
     * ```
     */
    setBackgroundColor(r: number, g: number, b: number): void;
    /**
     * Sets global clip planes.
     * This is mainly used by 3d viewers.
     */
    setGlobalClipPlanes(planes: THREE.Plane[]): void;
    getCameraProjection(): CameraProjection;
    setCameraProjection(proj: CameraProjection): void;
    enableControl(enable: boolean): void;
    enableRotate(enable: boolean): void;
    enableZoom(enable: boolean): void;
    enablePan(enable: boolean): void;
    getHomeView(): Viewpoint | undefined;
    setHomeView(viewpoint: Viewpoint): void;
    getCameraInfo(): CameraInfo;
    goToViewpoint(vp: Viewpoint): void;
    getCameraDirection(): THREE.Vector3;
    getRenderInfo(): {
        drawCalls: number;
        lines: number;
        points: number;
        triangles: number;
        geometries: number;
        textures: number;
        materials: number;
    };
    /**
     *
     */
    destroy(): void;
    /**
     * Installs a Plugin.
     */
    addPlugin(plugin: Plugin): void;
    /**
     * Uninstalls a Plugin, clearing content from it first.
     */
    removePlugin(plugin: Plugin): void;
    /**
     * Clears all plugins.
     * A plugin is not created by viewer, thus, won't be destroyed by viewer.
     */
    clearPlugins(): void;
    /**
     * Finds a Plugin.
     */
    findPlugin(id: string): Plugin | undefined;
    /**
     * Adds a model format loader (typically from a plugin).
     * Extension loaders are kept when the viewer refreshes built-in loaders (font / loading manager changes).
     */
    addModelLoader(loader: BaseModelLoader): void;
    /**
     * Removes a previously added extension loader by id.
     */
    removeModelLoader(id: string): void;
    /**
     * Extension tokens (e.g. `glb`, `dxf`) supported by the current model loader stack, including plugins.
     */
    getSupportedModelFormats(): string[];
}
export {};
