import * as RpcTypes from "./rpcTypes";
import { MaterialHandle, RpcClient } from "./rpcClient";
import { VisibilityState } from "./visibility";
/**
 * Describes the source location and optional authentication for loading a VIM file.
 */
export type VimSource = {
    /**
     * URL to the VIM file.
     * Can be a local path (file://) or remote URL (http:// or https://).
     */
    url: string;
    /**
     * Optional authentication token for accessing protected resources.
     */
    authToken?: string;
};
/**
 * Represents the loading state and progress for a single vim.
 */
export type VimLoadingState = {
    /**
     * Current loading status.
     */
    status: VimLoadingStatus;
    /**
     * Loading progress as a percentage from 0 to 100.
     */
    progress: number;
};
/**
 * Defines supported input modes for camera control in the viewer.
 */
export declare enum InputMode {
    /**
     * Orbit mode — rotates around a fixed point.
     */
    Orbit = "orbit",
    /**
     * Free mode — allows unrestricted movement.
     */
    Free = "free"
}
/**
 * Scene-wide rendering and lighting configuration options.
 */
export type SceneSettings = {
    /**
     * White point for tone mapping (clamped between 0 and 1).
     */
    toneMappingWhitePoint: number;
    /**
     * Global HDR intensity multiplier (floored to 0).
     */
    hdrScale: number;
    /**
     * HDR scale for the background (clamped between 0 and 1).
     */
    hdrBackgroundScale: number;
    /**
     * Background saturation (clamped between 0 and 1).
     */
    hdrBackgroundSaturation: number;
    /**
     * Background blur strength (clamped between 0 and 1).
     */
    backgroundBlur: number;
    /**
     * Background color in linear RGBA format.
     */
    backgroundColor: RpcTypes.RGBA;
};
/**
 * Default scene settings used when none are explicitly provided.
 */
export declare const defaultSceneSettings: SceneSettings;
/**
 * Enumerates the possible states of VIM file loading.
 */
export declare enum VimLoadingStatus {
    /**
     * No known loading activity.
     */
    Unknown = 0,
    /**
     * Actively loading VIM data.
     */
    Loading = 1,
    /**
     * Downloading VIM file from a remote source.
     */
    Downloading = 2,
    /**
     * Load completed successfully.
     */
    Done = 3,
    /**
     * Download failed (e.g., due to network or permission issues).
     */
    FailedToDownload = 4,
    /**
     * VIM file could not be parsed or initialized correctly.
     */
    FailedToLoad = 5
}
/**
 * Provides safe, validated methods to interact with the RpcClient.
 * This class wraps low-level RPC calls with input validation, error handling,
 * and batching support to ensure robustness and performance when dealing with large data.
 */
export declare class RpcSafeClient {
    private readonly rpc;
    private readonly batchSize;
    /**
     * The URL used by the underlying RPC connection.
     */
    get url(): string;
    /**
     * Indicates whether the RPC client is currently connected.
     */
    get connected(): boolean;
    /**
     * Creates a new RpcSafeClient instance.
     * @param rpc - The underlying RpcClient used for communication
     * @param batchSize - Maximum size of batched data for operations (default: 10000)
     */
    constructor(rpc: RpcClient, batchSize?: number);
    /*******************************************************************************
     * SCENE MANAGEMENT METHODS
     * Methods for managing the overall scene, including initialization, lighting,
     * and scene-wide settings.
     ******************************************************************************/
    /**
     * Initializes and starts the scene with the given settings.
     * @param settings - Optional partial scene settings to override defaults
     * @returns Promise resolving to true if the scene started successfully, false otherwise
     * @remarks Missing values will be filled from {@link defaultSceneSettings}
     */
    RPCStartScene(settings?: Partial<SceneSettings>): Promise<boolean>;
    /**
     * Updates the scene’s lighting configuration.
     * @param settings - The complete lighting and background settings to apply
     */
    RPCSetLighting(settings: SceneSettings): void;
    /**
     * Retrieves the total number of elements across the entire scene.
     * @returns Promise resolving to the total number of elements (0 on failure).
     */
    RPCGetElementCountForScene(): Promise<number>;
    /**
     * Retrieves the number of elements within a specific loaded vim.
     * @param vimIndex - Index of the loaded vim to query
     * @returns Promise resolving to the element count (0 on failure)
     */
    RPCGetElementCountForVim(vimIndex: number): Promise<number>;
    /*******************************************************************************
     * ELEMENTS VISIBILITY METHODS
     * Methods for controlling element visibility, including show/hide, ghosting,
     * and highlighting functionality.
     ******************************************************************************/
    /**
     * Sets a single visibility state for given elements within a loaded vim.
     * The operation is automatically split into batches if the array is large.
     *
     * @param vimIndex - The index of the loaded vim containing the elements
     * @param vimElementIndices - Array of vim-based element indices to apply the state to
     * @param state - The visibility state to apply (e.g., VISIBLE, HIDDEN)
     */
    RPCSetStateElements(vimIndex: number, vimElementIndices: number[], state: VisibilityState): void;
    /**
     * Sets individual visibility states for multiple elements in a vim.
     * Each element receives a corresponding visibility state from the input array.
     * The operation is automatically split into batches if the array is large.
     *
     * @param vimIndex - The index of the loaded vim
     * @param vimElementIndices - Array of vim-based element indices
     * @param states - Array of visibility states to apply, one per element
     */
    RPCSetStatesElements(vimIndex: number, vimElementIndices: number[], states: VisibilityState[]): void;
    /**
     * Applies a single visibility state to all elements of a loaded vim.
     *
     * @param vimIndex - The index of the loaded vim
     * @param state - The visibility state to apply (e.g., VISIBLE, HIDDEN)
     */
    RPCSetStateVim(vimIndex: number, state: VisibilityState): void;
    /*******************************************************************************
     * TEXT AND UI METHODS
     * Methods for creating and managing 3D text elements in the scene.
     ******************************************************************************/
    /**
     * Creates a 3D text element in the scene.
     * @param position - The world-space position for the text
     * @param color - The color of the text
     * @param text - The content to display
     * @returns Promise resolving to the handle of the created text component
     */
    RPCCreateText(position: RpcTypes.Vector3, color: RpcTypes.RGBA32, text: string): Promise<number>;
    /**
     * Destroys a text component, removing it from the scene.
     * @param componentHandle - The handle of the text component to destroy
     */
    RPCDestroyText(componentHandle: number): void;
    /*******************************************************************************
     * SECTION BOX METHODS
     * Methods for controlling section box visibility and position.
     ******************************************************************************/
    /**
     * Enables or disables the section box.
     * @param enable - True to enable the section box, false to disable it
     */
    RPCEnableSectionBox(enable: boolean): void;
    /**
     * Sets the parameters of the section box.
     * @param state - The new section box state, including visibility and bounding box
     */
    RPCSetSectionBox(state: RpcTypes.SectionBoxState): void;
    /**
     * Retrieves the current section box state.
     * @returns Promise resolving to the section box state or undefined on failure
     */
    RPCGetSectionBox(): Promise<RpcTypes.SectionBoxState | undefined>;
    /*******************************************************************************
     * CAMERA AND VIEW METHODS
     * Methods for controlling camera position, movement, framing, and view settings.
     ******************************************************************************/
    /**
     * Retrieves the current camera position and orientation.
     * @returns Promise resolving to a segment representing the camera's current position and target
     */
    RPCGetCameraView(): Promise<RpcTypes.Segment | undefined>;
    /**
     * Sets the camera position and orientation.
     * @param segment - The desired camera position and target
     * @param blendTime - Duration of the camera transition in seconds (non-negative)
     */
    RPCSetCameraView(segment: RpcTypes.Segment, blendTime: number): void;
    /**
     * Sets the camera's position without changing its target.
     * The camera will move to the specified position while maintaining its current look-at direction.
     *
     * @param position - The new position of the camera in world space
     * @param blendTime - Duration of the camera transition in seconds (non-negative)
     */
    RPCSetCameraPosition(position: RpcTypes.Vector3, blendTime: number): void;
    /**
     * Sets the camera's look-at target without changing its position.
     * The camera will rotate to face the specified target while remaining at its current position.
     *
     * @param target - The new look-at target of the camera in world space
     * @param blendTime - Duration of the camera transition in seconds (non-negative)
     */
    RPCSetCameraTarget(target: RpcTypes.Vector3, blendTime: number): void;
    /**
     * Retrieves the axis-aligned bounding box (AABB) that encompasses the entire scene.
     * This includes all loaded geometry across all loaded vims.
     *
     * @returns Promise resolving to the global AABB of the scene, or undefined on failure
     */
    RPCGetAABBForScene(): Promise<RpcTypes.Box3 | undefined>;
    /**
     * Retrieves the axis-aligned bounding box (AABB) for a specific loaded vim.
     * This bounding box represents the spatial bounds of all geometry within the given loaded vim.
     *
     * @param vimIndex - The index of the loaded vim to query
     * @returns Promise resolving to the vim bounding box, or undefined on failure
     */
    RPCGetAABBForVim(vimIndex: number): Promise<RpcTypes.Box3 | undefined>;
    /**
     * Calculates the bounding box for specified elements of a loaded vim.
     * Large element arrays are automatically processed in batches.
     * @param vimIndex - The index of the loaded vim
     * @param vimElementIndices - Array of vim-based element indices to calculate bounds for
     * @returns Promise resolving to the combined bounding box or undefined on failure
     */
    RPCGetAABBForElements(vimIndex: number, vimElementIndices: number[]): Promise<RpcTypes.Box3 | undefined>;
    private RPCGetAABBForElementsBatched;
    /**
     * Frames the camera to show all elements in the scene.
     * @param blendTime - Duration of the camera transition in seconds (non-negative)
     * @returns Promise resolving to camera segment representing the final position
     */
    RPCFrameScene(blendTime: number): Promise<RpcTypes.Segment | undefined>;
    /**
     * Frames a specific vim in the scene.
     * @param vimIndex - The index of the loaded vim to frame
     * @param blendTime - Duration of the camera transition in seconds (non-negative)
     * @returns Promise resolving to camera segment representing the final position
     */
    RPCFrameVim(vimIndex: number, blendTime: number): Promise<RpcTypes.Segment | undefined>;
    /**
     * Frames specific elements of a loaded vim.
     * Automatically batches large arrays of elements.
     * @param vimIndex - The index of the loaded vim
     * @param vimElementIndices - Array of vim-based element indices to frame
     * @param blendTime - Duration of the camera transition in seconds (non-negative)
     * @returns Promise resolving to camera segment representing the final position
     */
    RPCFrameElements(vimIndex: number, vimElementIndices: number[], blendTime: number): Promise<RpcTypes.Segment | undefined>;
    /**
     * Frames the camera to show a specific bounding box.
     * @param box - The bounding box to frame
     * @param blendTime - Duration of the camera transition in seconds (non-negative)
     */
    RPCFrameAABB(box: RpcTypes.Box3, blendTime: number): Promise<RpcTypes.Segment | undefined>;
    /*******************************************************************************
     * INPUT HANDLING METHODS
     * Methods for handling user input including mouse, keyboard, and camera controls.
     ******************************************************************************/
    /**
     * Sets the camera movement speed.
     * @param speed - The desired movement speed (must be positive)
     */
    RPCSetCameraSpeed(speed: number): void;
    /**
     * Sets the camera control mode.
     * @param mode - The desired input mode (e.g., {@link InputMode.Orbit} or {@link InputMode.Free})
     */
    RPCSetCameraMode(mode: InputMode): void;
    /**
     * Sets the viewer's aspect ratio.
     * @param width - The width of the desired aspect ratio
     * @param height - The height of the desired aspect ratio
     */
    RPCSetCameraAspectRatio(width: number, height: number): void;
    /*******************************************************************************
     * VIM FILE MANAGEMENT METHODS
     * Methods for loading, unloading, and managing VIM files.
     ******************************************************************************/
    /**
     * Loads a VIM file from the local filesystem.
     * @param source - The path to the VIM file (supports file:// protocol)
     * @returns Promise resolving to the index of the loaded vim
     */
    RPCLoadVim(source: VimSource): Promise<number>;
    /**
     * Loads a VIM file from a remote URL.
     * @param source - The URL or file path of the VIM file to load
     * @returns Promise resolving to the index of the loaded vim
     */
    RPCLoadVimURL(source: VimSource): Promise<number>;
    /**
     * Retrieves the current loading state and progress of a vim.
     * @param vimIndex - The index of the vim being loaded
     * @returns Promise resolving to the current loading state and progress
     */
    RPCGetVimLoadingState(vimIndex: number): Promise<VimLoadingState>;
    /**
     * Clears the entire scene, unloading all vims and resetting to initial state.
     */
    RPCUnloadAll(): void;
    /**
     * Sets the color used for ghosted geometry.
     * @param ghostColor - The RGBA color to use for ghosted elements
     */
    RPCSetGhostColor(ghostColor: RpcTypes.RGBA): void;
    /**
     * Performs hit testing at a specified screen position.
     * @param pos - Normalized screen coordinates (0-1, 0-1)
     * @returns Promise resolving to hit test result if a valid hit was detected, undefined otherwise
     */
    RPCPerformHitTest(pos: RpcTypes.Vector2): Promise<RpcTypes.HitCheckResult | undefined>;
    /**
     * Sends a mouse button event to the viewer.
     * @param position - The normalized screen coordinates (0-1, 0-1)
     * @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
     * @param down - True if button is pressed down, false if released
     */
    RPCMouseButtonEvent(position: RpcTypes.Vector2, mouseButton: number, down: boolean): void;
    /**
     * Sends a mouse double-click event to the viewer.
     * @param position - The normalized screen coordinates (0-1, 0-1)
     * @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
     */
    RPCMouseDoubleClickEvent(position: RpcTypes.Vector2, mouseButton: number): void;
    /**
     * Sends a mouse movement event to the viewer.
     * @param position - The normalized screen coordinates (0-1, 0-1)
     */
    RPCMouseMoveEvent(position: RpcTypes.Vector2): void;
    /**
     * Sends a mouse scroll wheel event to the viewer.
     * @param scrollValue - The scroll amount (-1 to 1)
     */
    RPCMouseScrollEvent(scrollValue: number): void;
    /**
     * Sends a mouse selection event to the viewer.
     * @param position - The normalized screen coordinates (0-1, 0-1)
     * @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
     */
    RPCMouseSelectEvent(position: RpcTypes.Vector2, mouseButton: number): void;
    /**
     * Sends a keyboard event to the viewer.
     * @param keyCode - The key code of the event
     * @param down - True if key is pressed down, false if released
     */
    RPCKeyEvent(keyCode: number, down: boolean): void;
    /*******************************************************************************
     * MATERIAL MANAGEMENT METHODS
     * Methods for creating and managing materials and material instances.
     ******************************************************************************/
    /**
     * Creates multiple material instances with the same smoothness but different colors.
     * Large color arrays are automatically processed in batches for better performance.
     * @param materialHandle - The base material to create instances from
     * @param smoothness - The smoothness value to apply (clamped between 0 and 1)
     * @param colors - Array of colors for each material instance
     * @returns Array of handles for the created material instances
     */
    RPCCreateMaterialInstances(materialHandle: MaterialHandle, smoothness: number, colors: RpcTypes.RGBA32[]): Promise<number[] | undefined>;
    private createMaterialInstancesBatched;
    /**
     * Destroys multiple material instances, freeing associated resources.
     * @param materialInstanceHandles - Array of handles for material instances to destroy
     */
    RPCDestroyMaterialInstances(materialInstanceHandles: number[]): void;
    /**
     * Sets material overrides for specific elements in a loaded vim.
     * Large arrays are automatically processed in batches.
     * @param vimIndex - The index of the loaded vim
     * @param vimElementIndices - Array of vim-based element indices to override
     * @param materialInstanceHandles - Array of material instance handles to apply (must match element length)
     */
    RPCSetMaterialOverridesForElements(vimIndex: number, vimElementIndices: number[], materialInstanceHandles: number[]): void;
    private setMaterialOverridesBatched;
    /**
     * Clears all material overrides for the entire scene.
     */
    RPCClearMaterialOverridesForScene(): void;
    /**
     * Clears all material overrides for a specific loaded vim.
     * @param vimIndex - The index of the loaded vim
     */
    RPCClearMaterialOverridesForVim(vimIndex: number): void;
    /**
     * Clears all material overrides for specific elements in a loaded vim.
     * @param vimIndex - The index of the loaded vim
     * @param vimElementIndices - Array of vim-based element indices to clear overrides for
     */
    RPCClearMaterialOverridesForElements(vimIndex: number, vimElementIndices: number[]): void;
    /*******************************************************************************
     * DEBUG AND UTILITY METHODS
     * Utility methods for debugging, error handling, and misc functionality.
     ******************************************************************************/
    /**
     * Retrieves the current API version from the RPC client.
     * @returns Promise resolving to the API version string
     */
    RPCGetAPIVersion(): Promise<string>;
    /**
     * Gets the API version of the underlying RPC client.
     * @returns The API version string.
     */
    get API_VERSION(): string;
    /**
     * Retrieves the last error message from the RPC client.
     * @returns Promise resolving to the last error message string
     */
    RPCGetLastError(): Promise<string>;
    /**
     * Pauses or resumes the rendering loop.
     * @param pause - True to pause rendering, false to resume
     */
    RPCPauseRendering(pause: boolean): void;
    /**
     * Triggers a RenderDoc frame capture if RenderDoc is attached.
     */
    RPCTriggerRenderDocCapture(): void;
    private safeCall;
}
