import { ReactNode, MutableRefObject, JSX, DependencyList } from 'react';
import { Matrix4, Vector3, Euler, Camera, OrthographicCamera, PerspectiveCamera, WebGLRenderer, Scene, Object3D } from 'three';
import { D as Destructor, N as NoReturnType } from './types-CTCdwkaN.js';

declare function Three({ children, autoResize, canvasRef, }: {
    children?: ReactNode;
    autoResize?: boolean;
    canvasRef?: MutableRefObject<HTMLCanvasElement | null> | ((e: HTMLCanvasElement) => void);
}): JSX.Element;

declare class ThreeViewControl {
    protected _xOffset: number | ((width: number) => number);
    protected _yOffset: number | ((height: number) => number);
    protected _width: number | ((width: number) => number);
    protected _height: number | ((width: number) => number);
    protected _forceUpdate: boolean;
    protected _projectionMatrix: Matrix4;
    protected _position: Vector3;
    protected _rotation: Euler;
    constructor(xOffset: ThreeViewControl["_xOffset"], yOffset: ThreeViewControl["_yOffset"], width: ThreeViewControl["_width"], height: ThreeViewControl["_height"]);
    getXOffset(width: number): number;
    getYOffset(height: number): number;
    getWidth(width: number): number;
    getHeight(height: number): number;
    update(camera: Camera): boolean;
    forceUpdate(): void;
}

declare function ThreeView({ children, mode, xOffset, yOffset, width, height, }: {
    mode: "perspective" | "orthographic";
    xOffset?: ThreeViewControl["_xOffset"];
    yOffset?: ThreeViewControl["_yOffset"];
    width?: ThreeViewControl["_width"];
    height?: ThreeViewControl["_height"];
    children?: ReactNode;
}): JSX.Element;

type CameraTypeMap = {
    orthographic: OrthographicCamera;
    perspective: PerspectiveCamera;
};
type CameraMode = keyof CameraTypeMap;
type ThreeEventMap<Mode extends CameraMode> = {
    beforeupdate: {
        time: number;
        scene: Scene;
        renderer: WebGLRenderer;
        camera: CameraTypeMap[Mode];
    };
    beforerender: {
        time: number;
        scene: Scene;
        renderer: WebGLRenderer;
        camera: CameraTypeMap[Mode];
    };
    afterrender: {
        time: number;
        scene: Scene;
        renderer: WebGLRenderer;
        camera: CameraTypeMap[Mode];
    };
    afterupdate: {
        time: number;
        scene: Scene;
        renderer: WebGLRenderer;
        camera: CameraTypeMap[Mode];
    };
};
type ThreeEffect<Mode extends CameraMode = CameraMode> = (params: {
    renderer: WebGLRenderer;
    scene: Scene;
    camera: CameraTypeMap[Mode];
}) => Destructor | NoReturnType;
type CreateObjectEffect<Mode extends CameraMode> = (params: {
    renderer: WebGLRenderer;
    scene: Scene;
    camera: CameraTypeMap[Mode];
}) => NoReturnType | Object3D | readonly [Object3D, Destructor];
type ThreeEventCallback<Mode extends CameraMode, EventName extends keyof ThreeEventMap<Mode>> = (params: ThreeEventMap<Mode>[EventName]) => void;

declare function useThreeEffect<Mode extends CameraMode = CameraMode>(effect: ThreeEffect<Mode>, deps?: DependencyList): void;

declare function useThreeEvent<Mode extends CameraMode>(name: "beforeupdate", callback: ThreeEventCallback<Mode, "beforeupdate">): void;
declare function useThreeEvent<Mode extends CameraMode>(name: "beforerender", callback: ThreeEventCallback<Mode, "beforerender">): void;
declare function useThreeEvent<Mode extends CameraMode>(name: "afterrender", callback: ThreeEventCallback<Mode, "afterrender">): void;
declare function useThreeEvent<Mode extends CameraMode>(name: "afterupdate", callback: ThreeEventCallback<Mode, "afterupdate">): void;

declare function useThreeForceUpdate(): () => void;

declare function useThreeObject<Mode extends CameraMode = CameraMode>(createObject: CreateObjectEffect<Mode>, deps?: DependencyList): void;

export { Three, ThreeView, useThreeEffect, useThreeEvent, useThreeForceUpdate, useThreeObject };
