import * as THREE from 'three';
import type * as React from 'react';
import { Instance } from "./reconciler.js";
import type { Dpr, RootStore, Size } from "./store.js";
export type { Act, Bridge, SetBlock, UnblockProps } from "./utils/react.js";
export { act, useIsomorphicLayoutEffect, useMutableCallback, useGate, useBridge, Block, ErrorBoundary, } from "./utils/react.js";
export type NonFunctionKeys
= {
[K in keyof P]-?: P[K] extends Function ? never : K;
}[keyof P];
export type Overwrite
= Omit
> & O;
export type Properties = Pick>;
export type Mutable = {
[K in keyof P]: P[K] | Readonly
;
};
export type IsOptional = undefined extends T ? true : false;
export type IsAllOptional = T extends [infer First, ...infer Rest] ? IsOptional extends true ? IsAllOptional : false : true;
/**
* Returns the instance's initial (outmost) root.
*/
export declare function findInitialRoot(instance: Instance): RootStore;
export type Camera = (THREE.OrthographicCamera | THREE.PerspectiveCamera) & {
manual?: boolean;
};
export declare const isOrthographicCamera: (def: Camera) => def is THREE.OrthographicCamera;
export declare const isRef: (obj: any) => obj is React.RefObject;
export declare const isColorRepresentation: (value: unknown) => value is THREE.ColorRepresentation;
export declare const noop: () => void;
export interface ObjectMap {
nodes: {
[name: string]: THREE.Object3D;
};
materials: {
[name: string]: THREE.Material;
};
meshes: {
[name: string]: THREE.Mesh;
};
}
export declare function calculateDpr(dpr: Dpr): number;
/**
* Calls `onChange` whenever window.devicePixelRatio changes: moving to another display or zooming.
* Neither resizes the canvas, so resize observers won't see it. A resolution query only matches the
* current ratio, so it is re-created after every change. Returns the unsubscribe function.
*/
export declare function watchDpr(onChange: () => void): () => void;
/**
* Returns instance root state
*/
export declare function getRootState(obj: T): import("./store.js").RootState | undefined;
export interface EquConfig {
/** Compare arrays by reference equality a === b (default), or by shallow equality */
arrays?: 'reference' | 'shallow';
/** Compare objects by reference equality a === b (default), or by shallow equality */
objects?: 'reference' | 'shallow';
/** If true the keys in both a and b must match 1:1 (default), if false a's keys must intersect b's */
strict?: boolean;
}
export declare const is: {
obj: (a: any) => boolean;
fun: (a: any) => a is Function;
str: (a: any) => a is string;
num: (a: any) => a is number;
boo: (a: any) => a is boolean;
und: (a: any) => boolean;
nul: (a: any) => boolean;
arr: (a: any) => boolean;
equ(a: any, b: any, { arrays, objects, strict }?: EquConfig): boolean;
};
export declare function buildGraph(object: THREE.Object3D): ObjectMap;
export interface Disposable {
type?: string;
dispose?: () => void;
}
export declare function dispose(obj: T): void;
export declare const REACT_INTERNAL_PROPS: string[];
export declare function getInstanceProps(pendingProps: Record): Instance['props'];
export declare function prepare(target: T, root: RootStore, type: string, props: Instance['props']): Instance;
export declare function resolve(root: any, key: string): {
root: any;
key: string;
target: any;
};
export declare function attach(parent: Instance, child: Instance): void;
export declare function detach(parent: Instance, child: Instance): void;
export declare const RESERVED_PROPS: string[];
export declare function diffProps(instance: Instance, newProps: Instance['props']): Instance['props'];
export declare function applyProps(object: Instance['object'], props: Instance['props']): Instance['object'];
export declare function invalidateInstance(instance: Instance): void;
export declare function updateCamera(camera: Camera, size: Size): void;
export declare const isObject3D: (object: any) => object is THREE.Object3D;