export { }


declare module 'three' {
    interface SkinnedMesh {
        staticGenerator?: StaticGeometryGenerator;
        staticGeometry?: BufferGeometry;
        staticGeometryLastUpdate?: number;
    }
    interface Mesh {
        acceleratedRaycast?: any;
    }
    interface SkinnedMesh {
        /** @deprecated use autoUpdateMeshBvhInterval */
        autoUpdateMeshBVH?: boolean;
        /**
         * Interval in milliseconds to automatically update the mesh BVH. When set to >= 0 the BVH will be updated every x milliseconds.
         * @default undefined (disabled)
         */
        autoUpdateMeshBvhInterval?: number;
        bvhNeedsUpdate?: boolean;
    }
}


declare module 'three/examples/jsm/controls/OrbitControls.js' {
    interface OrbitControls {
        _sphericalDelta: import("three").Spherical;
        _rotateLeft: (angleInRadians: number) => void;
        _rotateUp: (angleInRadians: number) => void;
        _pan: (dx: number, dy: number) => void;
        _dollyIn: (dollyScale: number) => void;
        _dollyOut: (dollyScale: number) => void;
    }
    interface OrbitControlsEventMap {
        endMovement: Event;
    }
}


declare module 'three' {
    interface Object3D {
        get guid(): string | undefined;
        set guid(value: string | undefined);
        /**
         * Allows to control e.g. if an object should be exported
         */
        hideFlags: HideFlags;
        /**
         * If false the object will be ignored for raycasting (e.g. pointer events). Default is true.
         * @default true
         */
        raycastAllowed: boolean;
        /**
         * Set a raycast preference for the object:
         * - `lod` will use the raycast mesh lod if available (default). This is usually a simplified mesh for raycasting.
         * - `bounds` will use the bounding box of the object for raycasting. This is very fast but not very accurate.
         * - `full` will use the full mesh for raycasting. This is the most accurate but also the slowest option.
         *
         * **NOTE:** Needle Engine's Raycast system will use Mesh BVH by default - so event 'full' is usually faster than default three.js raycasting.
         */
        raycastPreference?: 'lod' | 'bounds' | 'full';
        /**
         * Add a Needle Engine component to the {@link Object3D}.
         * @param comp The component instance or constructor to add.
         * @param init Optional initialization data for the component.
         * @returns The added component instance.
         * @example Directly pass in constructor and properties:
         * ```ts
         * const obj = new Object3D();
         * obj.addComponent(MyComponent, { myProperty: 42 });
         * ```
         * @example Create a component instance, assign properties and then add it:
         * ```ts
         * const obj = new Object3D();
         * const comp = new MyComponent();
         * comp.myProperty = 42;
         * obj.addComponent(comp);
         * ```
         */
        addComponent<T extends IComponent>(comp: T | ConstructorConcrete<T>, init?: ComponentInit<T>): T;
        /**
         * Remove a Needle Engine component from the {@link Object3D}.
         */
        removeComponent(inst: IComponent): IComponent;
        /**
         * Get or add a Needle Engine component to the Object3D.
         * If the component already exists, it will be returned. Otherwise, a new component will be added.
         * @param typeName The component constructor to get or add.
         * @param init Optional initialization data for the component.
         * @returns The component instance.
         */
        getOrAddComponent<T extends IComponent>(typeName: ConstructorConcrete<T>, init?: ComponentInit<T>): T;
        /**
         * Get a Needle Engine component from the {@link Object3D}.
         * @returns The component instance or null if not found.
         */
        getComponent<T extends IComponent>(type: Constructor<T>): T | null;
        /**
         * Get all components of a specific type from the {@link Object3D}.
         * @param arr Optional array to fill with the found components.
         * @returns An array of components.
         */
        getComponents<T extends IComponent>(type: Constructor<T>, arr?: []): T[];
        /**
         * Get a Needle Engine component from the {@link Object3D} or its children. This will search on the current Object and all its children.
         * @returns The component instance or null if not found.
         */
        getComponentInChildren<T extends IComponent>(type: Constructor<T>): T | null;
        /**
         * Get all components of a specific type from the {@link Object3D} or its children. This will search on the current Object and all its children.
         * @param arr Optional array to fill with the found components.
         * @returns An array of components.
         */
        getComponentsInChildren<T extends IComponent>(type: Constructor<T>, arr?: []): T[];
        /**
         * Get a Needle Engine component from the {@link Object3D} or its parents. This will search on the current Object and all its parents.
         * @returns The component instance or null if not found.
         */
        getComponentInParent<T extends IComponent>(type: Constructor<T>): T | null;
        /**
         * Get all Needle Engine components of a specific type from the {@link Object3D} or its parents. This will search on the current Object and all its parents.
         * @param arr Optional array to fill with the found components.
         * @returns An array of components.
         */
        getComponentsInParent<T extends IComponent>(type: Constructor<T>, arr?: []): T[];
        /**
         * Destroys the {@link Object3D} and all its Needle Engine components.
         */
        destroy(): void;
        /**
         * Get or set the world position of the {@link Object3D}.
         * Added by Needle Engine.
         */
        worldPosition: Vector3;
        /**
         * Get or set the world quaternion of the {@link Object3D}.
         * Added by Needle Engine.
         */
        worldQuaternion: Quaternion;
        /**
         * Get or set the world rotation of the {@link Object3D}.
         * Added by Needle Engine.
         */
        worldRotation: Vector3;
        /**
         * Get or set the world scale of the {@link Object3D}.
         * Added by Needle Engine.
         */
        worldScale: Vector3;
        /**
         * Get the world forward vector of the {@link Object3D}.
         * Added by Needle Engine.
         */
        get worldForward(): Vector3;
        set worldForward(v: Vector3);
        /**
         * Get the world right vector of the {@link Object3D}.
         * Added by Needle Engine.
         */
        get worldRight(): Vector3;
        /**
         * Get the world up vector of the {@link Object3D}.
         * Added by Needle Engine.
         */
        get worldUp(): Vector3;
    }
}


declare module 'three' {
    interface Vector3 {
        slerp(end: Vector3, t: number): Vector3;
    }
}
