import type { ISimpleEvent } from 'ste-simple-events';
import type { InputHandler } from '../shared';
import { ICamera } from './camera';
import { ColorManager } from './colorManager';
import { IDecoder } from './decoder';
import { ILoadRequest } from './loadRequest';
import { ILogger } from './logger';
import { IUltraRaycaster } from './raycaster';
import { IRenderer } from './renderer';
import { RpcSafeClient, VimSource } from './rpcSafeClient';
import { SectionBox } from './sectionBox';
import { ISelection } from './selection';
import { ClientState, ConnectionSettings } from './socketClient';
import { IViewport } from './viewport';
import { Vim } from './vim';
import { IReadonlyVimCollection } from './vimCollection';
export declare const INVALID_HANDLE = 4294967295;
/**
 * The main Viewer class responsible for managing VIM files,
 * handling connections, and coordinating various components like the camera, decoder, and inputs.
 */
export declare class Viewer {
    private readonly _decoder;
    private readonly _socketClient;
    private readonly _input;
    private readonly _logger;
    private readonly _canvas;
    private readonly _renderer;
    private readonly _viewport;
    private readonly _camera;
    private readonly _selection;
    private readonly _raycaster;
    private readonly _vims;
    private _disposed;
    /**
     * The camera API for controlling camera movements and settings.
     */
    get camera(): ICamera;
    /**
     * The RPC client for making remote procedure calls.
     */
    readonly rpc: RpcSafeClient;
    /**
     * The input API for handling user input events.
     */
    get inputs(): InputHandler;
    get vims(): IReadonlyVimCollection;
    /**
     * The viewport API for managing the rendering viewport.
     */
    get viewport(): IViewport;
    get renderer(): IRenderer;
    get decoder(): IDecoder;
    get raycaster(): IUltraRaycaster;
    get selection(): ISelection;
    /**
     * API to create, manage, and destroy colors.
     */
    readonly colors: ColorManager;
    /**
     * Gets the current URL to which the viewer is connected.
     * @returns The URL as a string, or undefined if not connected.
     */
    get serverUrl(): string | undefined;
    /**
     * Event that is triggered when the viewer's connection status changes.
     * @returns An event that emits the current ClientStatus.
     */
    get onStateChanged(): ISimpleEvent<ClientState>;
    /**
     * Gets the current connection status of the viewer.
     * @returns The current ClientStatus.
     */
    get connectionState(): ClientState;
    /**
     * The section box API for controlling the section box.
     */
    readonly sectionBox: SectionBox;
    /**
     * Creates a Viewer instance with a new canvas element appended to the given parent element.
     * @param parent - The parent HTML element to which the canvas will be appended.
     * @param logger - Optional logger for logging messages.
     * @returns A new instance of the Viewer class.
     */
    static createWithCanvas(parent: HTMLElement, logger?: ILogger): Viewer;
    /**
     * Constructs a new Viewer instance.
     * @param canvas - The HTML canvas element for rendering.
     * @param logger - Optional logger for logging messages.
     */
    constructor(canvas: HTMLCanvasElement, logger?: ILogger);
    /**
     * Handles connection logic when the viewer connects to the server.
     * Initializes components and checks for API version compatibility.
     */
    private onConnect;
    private validateConnection;
    private checkAPIVersion;
    /**
     * Handles disconnection logic when the viewer disconnects from the server.
     * Cleans up resources and stops tracking.
     */
    private onDisconnect;
    /**
     * Connects to a VIM Ultra server.
     * @param url - The server URL to connect to. Defaults to 'ws://localhost:8123'.
     * @returns A promise that resolves when the connection is established.
     */
    connect(settings?: ConnectionSettings): Promise<boolean>;
    /**
     * Disconnects from the current VIM Ultra server.
     */
    disconnect(): void;
    /**
     * Requests the server to load the given URL or file path.
     * @param source - The path or URL to the VIM file.
     * @returns A load request object that can be used to wait for the load to complete.
     */
    loadVim(source: VimSource): ILoadRequest;
    /**
     * Unloads the given VIM from the viewer.
     * @param vim - The VIM instance to unload.
     */
    unloadVim(vim: Vim): void;
    /**
     * Clears all loaded VIMs from the viewer.
     */
    clearVims(): void;
    getElement3Ds(): Promise<number>;
    /**
     * Disposes all resources used by the viewer and disconnects from the server.
     */
    dispose(): void;
}
