import type * as THREE from 'three'; import type { Args, EventHandlers, InstanceProps, ConstructorRepresentation } from "./core/index.js"; import type { Overwrite, Mutable } from "./core/utils.js"; type MutableOrReadonlyParameters any> = Parameters | Readonly>; export interface MathRepresentation { set(...args: number[]): any; } export interface VectorRepresentation extends MathRepresentation { setScalar(value: number): any; } export type MathTypes = MathRepresentation | THREE.Euler | THREE.Color; export type MathType = T extends THREE.Color ? Args | THREE.ColorRepresentation : T extends VectorRepresentation | THREE.Layers | THREE.Euler ? T | MutableOrReadonlyParameters | number : T | MutableOrReadonlyParameters; export type MathProps

= { [K in keyof P as P[K] extends MathTypes ? K : never]: P[K] extends MathTypes ? MathType : never; }; export type Vector2 = MathType; export type Vector3 = MathType; export type Vector4 = MathType; export type Color = MathType; export type Layers = MathType; export type Quaternion = MathType; export type Euler = MathType; export type Matrix3 = MathType; export type Matrix4 = MathType; export interface RaycastableRepresentation { raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void; } export type EventProps

= P extends RaycastableRepresentation ? Partial : {}; export interface ReactProps

{ children?: React.ReactNode; ref?: React.Ref

; key?: React.Key; } export type ElementProps> = Partial & ReactProps

& EventProps

>>; export type ThreeElement = Mutable, Omit, T>, 'object'>>>; export type ThreeToJSXElements> = { [K in keyof T & string as Uncapitalize]: T[K] extends ConstructorRepresentation ? ThreeElement : never; }; type ThreeExports = typeof THREE; type ThreeElementsImpl = ThreeToJSXElements; export interface ThreeElements extends Omit { primitive: Omit, 'args'> & { object: object; }; threeAudio: ThreeElementsImpl['audio']; threeSource: ThreeElementsImpl['source']; threeLine: ThreeElementsImpl['line']; threePath: ThreeElementsImpl['path']; } declare module 'react' { namespace JSX { interface IntrinsicElements extends ThreeElements { } } } declare module 'react/jsx-runtime' { namespace JSX { interface IntrinsicElements extends ThreeElements { } } } declare module 'react/jsx-dev-runtime' { namespace JSX { interface IntrinsicElements extends ThreeElements { } } } export {};