import * as THREE from "three"; import type { Vector3Tuple, QuaternionTuple } from "three"; import type { LineSegments2 } from "three/examples/jsm/lines/LineSegments2.js"; import type { Axis } from "../core/types.js"; /** Unit vectors for each axis */ export declare const AXIS_VECTORS: Readonly>; /** * Flatten a nested array of numbers to a 1D array. * The cast is necessary because TypeScript's flat() return type * is a complex union that doesn't simplify to number[]. */ declare function flatten(arr: number[][] | number[][][] | number[][][][], depth?: number): number[]; /** * Convert an array to Vector3Tuple with validation. * Throws if the input is not a 3-element array. */ declare function toVector3Tuple(arr: number[]): Vector3Tuple; /** * Convert an array to QuaternionTuple with validation. * Throws if the input is not a 4-element array. */ declare function toQuaternionTuple(arr: number[]): QuaternionTuple; declare function isEqual(obj1: unknown, obj2: unknown, tol?: number): boolean; declare function sceneTraverse(obj: THREE.Object3D | null | undefined, fn: (obj: THREE.Object3D) => void): void; interface GeometryLike { dispose: () => void; attributes: Record; } declare function disposeGeometry(geometry: GeometryLike | null | undefined): void; interface Disposable { dispose: () => void; } interface MaterialLike { dispose: () => void; map?: Disposable | null; normalMap?: Disposable | null; roughnessMap?: Disposable | null; metalnessMap?: Disposable | null; aoMap?: Disposable | null; emissiveMap?: Disposable | null; alphaMap?: Disposable | null; bumpMap?: Disposable | null; transmissionMap?: Disposable | null; clearcoatMap?: Disposable | null; clearcoatRoughnessMap?: Disposable | null; clearcoatNormalMap?: Disposable | null; thicknessMap?: Disposable | null; specularIntensityMap?: Disposable | null; specularColorMap?: Disposable | null; sheenColorMap?: Disposable | null; sheenRoughnessMap?: Disposable | null; anisotropyMap?: Disposable | null; } interface MeshLike { geometry?: GeometryLike | null; material?: MaterialLike | MaterialLike[] | null; isMesh?: boolean; isLine?: boolean; isPoints?: boolean; } interface DisposableTree extends MeshLike { children?: DisposableTree[]; dispose?: () => void; } declare function deepDispose(tree: DisposableTree | DisposableTree[] | null | undefined): void; declare function prettyPrintVector(v: number[], a: number, b: number): string; type KeyEventLike = { ctrlKey: boolean; shiftKey: boolean; altKey: boolean; metaKey: boolean; }; type KeyEventKey = keyof KeyEventLike; type MappedKey = "shift" | "ctrl" | "meta" | "alt"; interface KeyMappingConfig { shift: KeyEventKey; ctrl: KeyEventKey; meta: KeyEventKey; alt: KeyEventKey; } declare class _KeyMapper { private keyMapping; private actionShortcuts; private reverseActionShortcuts; constructor(); getshortcuts: (key: MappedKey) => string; get_config(): Record; get: (event: KeyEventLike, key: MappedKey) => boolean; set: (config: Partial) => void; setActionShortcuts: (shortcuts: Record) => void; getActionForKey: (key: string) => string | undefined; getShortcutForAction: (action: string) => string | undefined; getActionShortcuts: () => Record; } declare function scaleLight(intensity: number): number; /** * Type guard to check if an Object3D is a Mesh. */ declare function isMesh(obj: THREE.Object3D): obj is THREE.Mesh; /** * Type guard to check if an Object3D is a Line. */ declare function isLine(obj: THREE.Object3D): obj is THREE.Line; /** * Type guard to check if an Object3D is a Points. */ declare function isPoints(obj: THREE.Object3D): obj is THREE.Points; /** * Type guard to check if an object is an OrthographicCamera. * Accepts Object3D to allow use in controls where camera type is broader. */ declare function isOrthographicCamera(obj: THREE.Object3D): obj is THREE.OrthographicCamera; /** * Type guard to check if an object is a PerspectiveCamera. * Accepts Object3D to allow use in controls where camera type is broader. */ declare function isPerspectiveCamera(obj: THREE.Object3D): obj is THREE.PerspectiveCamera; /** * Type guard to check if an Object3D is a LineSegments2 (fat line). */ declare function isLineSegments2(obj: THREE.Object3D): obj is LineSegments2; /** * Type guard to check if a material has a color property. */ declare function hasColor(material: THREE.Material): material is THREE.Material & { color: THREE.Color; }; /** * Type guard to check if a material has emissive property. */ declare function hasEmissive(material: THREE.Material): material is THREE.Material & { emissive: THREE.Color; }; /** * Type guard to check if a material is a MeshStandardMaterial. */ declare function isMeshStandardMaterial(material: THREE.Material): material is THREE.MeshStandardMaterial; declare const KeyMapper: _KeyMapper; declare class EventListenerManager { private listeners; constructor(); add: (target: EventTarget, event: string, handler: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void; dispose(): void; } export { flatten, isEqual, sceneTraverse, prettyPrintVector, KeyMapper, scaleLight, deepDispose, disposeGeometry, EventListenerManager, isMesh, isLine, isPoints, isOrthographicCamera, isPerspectiveCamera, isLineSegments2, hasColor, hasEmissive, isMeshStandardMaterial, toVector3Tuple, toQuaternionTuple, }; export type { KeyEventKey, KeyMappingConfig, DisposableTree };