@react-three/fiber 8.0.0-beta-05 → 8.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @react-three/fiber
2
2
 
3
+ ## 8.0.0-beta.0
4
+
5
+ ### Patch Changes
6
+
7
+ - cf6316c: new beta for library testing
8
+
3
9
  ## 7.0.25
4
10
 
5
11
  ### Patch Changes
@@ -1,21 +1,20 @@
1
1
  import * as THREE from 'three';
2
- import type { UseStore } from 'zustand';
2
+ import type { UseBoundStore } from 'zustand';
3
3
  import type { RootState } from './store';
4
4
  export interface Intersection extends THREE.Intersection {
5
5
  eventObject: THREE.Object3D;
6
6
  }
7
7
  export interface IntersectionEvent<TSourceEvent> extends Intersection {
8
+ eventObject: THREE.Object3D;
8
9
  intersections: Intersection[];
9
- stopped: boolean;
10
10
  unprojectedPoint: THREE.Vector3;
11
+ pointer: THREE.Vector2;
12
+ delta: number;
11
13
  ray: THREE.Ray;
12
14
  camera: Camera;
13
15
  stopPropagation: () => void;
14
- sourceEvent: TSourceEvent;
15
16
  nativeEvent: TSourceEvent;
16
- delta: number;
17
- spaceX: number;
18
- spaceY: number;
17
+ stopped: boolean;
19
18
  }
20
19
  export declare type Camera = THREE.OrthographicCamera | THREE.PerspectiveCamera;
21
20
  export declare type ThreeEvent<TEvent> = IntersectionEvent<TEvent>;
@@ -47,8 +46,14 @@ export declare type EventHandlers = {
47
46
  onPointerCancel?: (event: ThreeEvent<PointerEvent>) => void;
48
47
  onWheel?: (event: ThreeEvent<WheelEvent>) => void;
49
48
  };
49
+ export declare type FilterFunction = (items: THREE.Intersection[], state: RootState) => THREE.Intersection[];
50
+ export declare type ComputeFunction = (event: DomEvent, root: RootState, previous?: RootState) => void;
50
51
  export interface EventManager<TTarget> {
51
- connected: TTarget | boolean;
52
+ enabled: boolean;
53
+ priority: number;
54
+ compute?: ComputeFunction;
55
+ filter?: FilterFunction;
56
+ connected?: TTarget;
52
57
  handlers?: Events;
53
58
  connect?: (target: TTarget) => void;
54
59
  disconnect?: () => void;
@@ -58,7 +63,7 @@ export interface PointerCaptureTarget {
58
63
  target: Element;
59
64
  }
60
65
  export declare function getEventPriority(): any;
61
- export declare function removeInteractivity(store: UseStore<RootState>, object: THREE.Object3D): void;
62
- export declare function createEvents(store: UseStore<RootState>): {
66
+ export declare function removeInteractivity(store: UseBoundStore<RootState>, object: THREE.Object3D): void;
67
+ export declare function createEvents(store: UseBoundStore<RootState>): {
63
68
  handlePointer: (name: string) => (event: DomEvent) => void;
64
69
  };
@@ -10,12 +10,16 @@ export declare type Extensions = (loader: THREE.Loader) => void;
10
10
  export declare type LoaderResult<T> = T extends any[] ? Loader<T[number]> : Loader<T>;
11
11
  export declare type ConditionalType<Child, Parent, Truthy, Falsy> = Child extends Parent ? Truthy : Falsy;
12
12
  export declare type BranchingReturn<T, Parent, Coerced> = ConditionalType<T, Parent, Coerced, T>;
13
- export declare function useStore(): import("zustand").UseStore<RootState>;
13
+ declare type noop = (...args: any[]) => any;
14
+ declare type PickFunction<T extends noop> = (...args: Parameters<T>) => ReturnType<T>;
15
+ export declare function useStore(): import("zustand").UseBoundStore<RootState, import("zustand").StoreApi<RootState>>;
14
16
  export declare function useThree<T = RootState>(selector?: StateSelector<RootState, T>, equalityFn?: EqualityChecker<T>): T;
15
17
  export declare function useFrame(callback: RenderCallback, renderPriority?: number): null;
16
18
  export declare function useGraph(object: THREE.Object3D): ObjectMap;
19
+ export declare function useMemoizedFn<T extends noop>(fn?: T): PickFunction<T>;
17
20
  export declare function useLoader<T, U extends string | string[]>(Proto: new () => LoaderResult<T>, input: U, extensions?: Extensions, onProgress?: (event: ProgressEvent<EventTarget>) => void): U extends any[] ? BranchingReturn<T, GLTF, GLTF & ObjectMap>[] : BranchingReturn<T, GLTF, GLTF & ObjectMap>;
18
21
  export declare namespace useLoader {
19
22
  var preload: <T, U extends string | string[]>(Proto: new () => LoaderResult<T>, input: U, extensions?: Extensions | undefined) => undefined;
20
23
  var clear: <T, U extends string | string[]>(Proto: new () => LoaderResult<T>, input: U) => void;
21
24
  }
25
+ export {};
@@ -1,32 +1,42 @@
1
1
  /// <reference types="react-reconciler" />
2
2
  import * as THREE from 'three';
3
3
  import * as React from 'react';
4
- import { UseStore } from 'zustand';
5
- import { dispose } from '../core/utils';
6
- import { Renderer, StoreProps, context, RootState, Size } from '../core/store';
7
- import { extend, Root } from '../core/renderer';
8
- import { addEffect, addAfterEffect, addTail } from '../core/loop';
9
- import { EventManager } from './events';
4
+ import { UseBoundStore } from 'zustand';
5
+ import { Renderer, StoreProps, context, RootState, Size } from './store';
6
+ import { extend, Root } from './renderer';
7
+ import { addEffect, addAfterEffect, addTail } from './loop';
8
+ import { EventManager, ComputeFunction } from './events';
9
+ import { dispose, getRootState } from './utils';
10
10
  declare const roots: Map<Element, Root>;
11
11
  declare const invalidate: (state?: RootState | undefined) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined, frame?: THREE.XRFrame | undefined) => void;
12
- declare const reconciler: import("react-reconciler").Reconciler<unknown, unknown, unknown, unknown, unknown>, applyProps: typeof import("../core/utils").applyProps;
12
+ declare const reconciler: import("react-reconciler").Reconciler<unknown, unknown, unknown, unknown, unknown>, applyProps: typeof import("./utils").applyProps;
13
13
  declare type Properties<T> = Pick<T, {
14
14
  [K in keyof T]: T[K] extends (_: any) => any ? never : K;
15
15
  }[keyof T]>;
16
16
  declare type GLProps = Renderer | ((canvas: HTMLCanvasElement) => Renderer) | Partial<Properties<THREE.WebGLRenderer> | THREE.WebGLRendererParameters> | undefined;
17
17
  export declare type RenderProps<TCanvas extends Element> = Omit<StoreProps, 'gl' | 'events' | 'size'> & {
18
18
  gl?: GLProps;
19
- events?: (store: UseStore<RootState>) => EventManager<TCanvas>;
19
+ events?: (store: UseBoundStore<RootState>) => EventManager<TCanvas>;
20
20
  size?: Size;
21
21
  onCreated?: (state: RootState) => void;
22
22
  };
23
- declare function createRoot<TCanvas extends Element>(canvas: TCanvas, config?: RenderProps<TCanvas>): {
24
- render: (element: React.ReactNode) => UseStore<RootState>;
23
+ export declare type ReconcilerRoot<TCanvas extends Element> = {
24
+ configure: (config?: RenderProps<TCanvas>) => ReconcilerRoot<TCanvas>;
25
+ render: (element: React.ReactNode) => UseBoundStore<RootState>;
25
26
  unmount: () => void;
26
27
  };
27
- declare function render<TCanvas extends Element>(element: React.ReactNode, canvas: TCanvas, config?: RenderProps<TCanvas>): UseStore<RootState>;
28
+ declare function createRoot<TCanvas extends Element>(canvas: TCanvas): ReconcilerRoot<TCanvas>;
29
+ declare function render<TCanvas extends Element>(children: React.ReactNode, canvas: TCanvas, config: RenderProps<TCanvas>): UseBoundStore<RootState>;
28
30
  declare function unmountComponentAtNode<TElement extends Element>(canvas: TElement, callback?: (canvas: TElement) => void): void;
31
+ export declare type InjectState = Partial<Omit<RootState, 'set' | 'get' | 'setSize' | 'setFrameloop' | 'setDpr' | 'events' | 'invalidate' | 'advance' | 'performance' | 'internal'> & {
32
+ events: {
33
+ enabled?: boolean;
34
+ priority?: number;
35
+ compute?: ComputeFunction;
36
+ connected?: any;
37
+ };
38
+ }>;
39
+ declare function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): React.ReactNode;
29
40
  declare const act: any;
30
- declare function createPortal(children: React.ReactNode, container: THREE.Object3D): React.ReactNode;
31
41
  export * from './hooks';
32
- export { context, render, createRoot, unmountComponentAtNode, createPortal, reconciler, applyProps, dispose, invalidate, advance, extend, addEffect, addAfterEffect, addTail, act, roots as _roots, };
42
+ export { context, render, createRoot, unmountComponentAtNode, createPortal, reconciler, applyProps, dispose, invalidate, advance, extend, addEffect, addAfterEffect, addTail, getRootState, act, roots as _roots, };
@@ -6,7 +6,7 @@ export declare const addEffect: (callback: GlobalRenderCallback) => () => void;
6
6
  export declare const addAfterEffect: (callback: GlobalRenderCallback) => () => void;
7
7
  export declare const addTail: (callback: GlobalRenderCallback) => () => void;
8
8
  export declare function createLoop<TCanvas>(roots: Map<TCanvas, Root>): {
9
- loop: (timestamp: number) => number | undefined;
9
+ loop: (timestamp: number) => void;
10
10
  invalidate: (state?: RootState | undefined) => void;
11
11
  advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined, frame?: THREE.XRFrame | undefined) => void;
12
12
  };
@@ -1,28 +1,29 @@
1
1
  import * as THREE from 'three';
2
- import { UseStore } from 'zustand';
2
+ import { UseBoundStore } from 'zustand';
3
3
  import Reconciler from 'react-reconciler';
4
4
  import { prepare, applyProps } from './utils';
5
5
  import { RootState } from './store';
6
6
  import { EventHandlers } from './events';
7
7
  export declare type Root = {
8
8
  fiber: Reconciler.FiberRoot;
9
- store: UseStore<RootState>;
9
+ store: UseBoundStore<RootState>;
10
10
  };
11
11
  export declare type LocalState = {
12
- root: UseStore<RootState>;
12
+ type: string;
13
+ root: UseBoundStore<RootState>;
13
14
  objects: Instance[];
14
15
  parent: Instance | null;
15
16
  primitive?: boolean;
16
17
  eventCount: number;
17
18
  handlers: Partial<EventHandlers>;
18
19
  attach?: AttachType;
19
- previousAttach?: any;
20
+ previousAttach: any;
20
21
  memoizedProps: {
21
22
  [key: string]: any;
22
23
  };
23
24
  };
24
- export declare type AttachFnType = (parent: Instance, self: Instance) => void;
25
- export declare type AttachType = string | [attach: string | AttachFnType, detach: string | AttachFnType];
25
+ export declare type AttachFnType = (parent: Instance, self: Instance) => () => void;
26
+ export declare type AttachType = string | AttachFnType;
26
27
  export declare type BaseInstance = Omit<THREE.Object3D, 'children' | 'attach' | 'add' | 'remove' | 'raycast'> & {
27
28
  __r3f: LocalState;
28
29
  children: Instance[];
@@ -1,8 +1,7 @@
1
1
  import * as THREE from 'three';
2
2
  import * as React from 'react';
3
3
  import * as ReactThreeFiber from '../three-types';
4
- import { GetState, SetState, UseStore } from 'zustand';
5
- import { Instance, InstanceProps } from './renderer';
4
+ import { GetState, SetState, StoreApi, UseBoundStore } from 'zustand';
6
5
  import { DomEvent, EventManager, PointerCaptureTarget, ThreeEvent } from './events';
7
6
  export interface Intersection extends THREE.Intersection {
8
7
  eventObject: THREE.Object3D;
@@ -24,11 +23,6 @@ export declare type Viewport = Size & {
24
23
  aspect: number;
25
24
  };
26
25
  export declare type Camera = THREE.OrthographicCamera | THREE.PerspectiveCamera;
27
- export declare type Raycaster = THREE.Raycaster & {
28
- enabled: boolean;
29
- filter?: FilterFunction;
30
- computeOffsets?: ComputeOffsetsFunction;
31
- };
32
26
  export declare type RenderCallback = (state: RootState, delta: number, frame?: THREE.XRFrame) => void;
33
27
  export declare type Performance = {
34
28
  current: number;
@@ -40,13 +34,12 @@ export declare type Performance = {
40
34
  export declare type Renderer = {
41
35
  render: (scene: THREE.Scene, camera: THREE.Camera) => any;
42
36
  };
43
- export declare const isRenderer: (def: Renderer) => boolean;
44
- export declare const isOrthographicCamera: (def: THREE.Camera) => def is THREE.OrthographicCamera;
37
+ export declare const isRenderer: (def: any) => boolean;
38
+ export declare const isOrthographicCamera: (def: any) => def is THREE.OrthographicCamera;
45
39
  export declare type InternalState = {
46
40
  active: boolean;
47
41
  priority: number;
48
42
  frames: number;
49
- lastProps: StoreProps;
50
43
  lastEvent: React.MutableRefObject<DomEvent | null>;
51
44
  interaction: THREE.Object3D[];
52
45
  hovered: Map<string, ThreeEvent<DomEvent>>;
@@ -54,48 +47,44 @@ export declare type InternalState = {
54
47
  capturedMap: Map<number, Map<THREE.Object3D, PointerCaptureTarget>>;
55
48
  initialClick: [x: number, y: number];
56
49
  initialHits: THREE.Object3D[];
57
- xr: {
58
- connect: () => void;
59
- disconnect: () => void;
60
- };
61
50
  subscribe: (callback: React.MutableRefObject<RenderCallback>, priority?: number) => () => void;
62
51
  };
63
52
  export declare type RootState = {
53
+ set: SetState<RootState>;
54
+ get: GetState<RootState>;
64
55
  gl: THREE.WebGLRenderer;
65
- scene: THREE.Scene;
66
56
  camera: Camera & {
67
57
  manual?: boolean;
68
58
  };
59
+ scene: THREE.Scene;
60
+ raycaster: THREE.Raycaster;
61
+ clock: THREE.Clock;
62
+ events: EventManager<any>;
63
+ xr: {
64
+ connect: () => void;
65
+ disconnect: () => void;
66
+ };
69
67
  controls: THREE.EventDispatcher | null;
70
- raycaster: Raycaster;
68
+ pointer: THREE.Vector2;
71
69
  mouse: THREE.Vector2;
72
- clock: THREE.Clock;
73
70
  linear: boolean;
74
71
  flat: boolean;
75
72
  frameloop: 'always' | 'demand' | 'never';
76
73
  performance: Performance;
77
74
  size: Size;
78
75
  viewport: Viewport & {
79
- getCurrentViewport: (camera?: Camera, target?: THREE.Vector3, size?: Size) => Omit<Viewport, 'dpr' | 'initialDpr'>;
76
+ getCurrentViewport: (camera?: Camera, target?: THREE.Vector3 | Parameters<THREE.Vector3['set']>, size?: Size) => Omit<Viewport, 'dpr' | 'initialDpr'>;
80
77
  };
81
- set: SetState<RootState>;
82
- get: GetState<RootState>;
83
78
  invalidate: () => void;
84
79
  advance: (timestamp: number, runGlobalEffects?: boolean) => void;
80
+ setEvents: (events: Partial<EventManager<any>>) => void;
85
81
  setSize: (width: number, height: number) => void;
86
82
  setDpr: (dpr: Dpr) => void;
87
83
  setFrameloop: (frameloop?: 'always' | 'demand' | 'never') => void;
88
84
  onPointerMissed?: (event: MouseEvent) => void;
89
- events: EventManager<any>;
85
+ previousRoot?: UseBoundStore<RootState, StoreApi<RootState>>;
90
86
  internal: InternalState;
91
87
  };
92
- export declare type FilterFunction = (items: THREE.Intersection[], state: RootState) => THREE.Intersection[];
93
- export declare type ComputeOffsetsFunction = (event: any, state: RootState) => {
94
- offsetX: number;
95
- offsetY: number;
96
- width?: number;
97
- height?: number;
98
- };
99
88
  export declare type StoreProps = {
100
89
  gl: THREE.WebGLRenderer;
101
90
  size: Size;
@@ -106,14 +95,12 @@ export declare type StoreProps = {
106
95
  frameloop?: 'always' | 'demand' | 'never';
107
96
  performance?: Partial<Omit<Performance, 'regress'>>;
108
97
  dpr?: Dpr;
109
- clock?: THREE.Clock;
110
- raycaster?: Partial<Raycaster>;
98
+ raycaster?: Partial<THREE.Raycaster>;
111
99
  camera?: (Camera | Partial<ReactThreeFiber.Object3DNode<THREE.Camera, typeof THREE.Camera> & ReactThreeFiber.Object3DNode<THREE.PerspectiveCamera, typeof THREE.PerspectiveCamera> & ReactThreeFiber.Object3DNode<THREE.OrthographicCamera, typeof THREE.OrthographicCamera>>) & {
112
100
  manual?: boolean;
113
101
  };
114
102
  onPointerMissed?: (event: MouseEvent) => void;
115
103
  };
116
- export declare type ApplyProps = (instance: Instance, newProps: InstanceProps) => void;
117
- declare const context: React.Context<UseStore<RootState>>;
118
- declare const createStore: (applyProps: ApplyProps, invalidate: (state?: RootState | undefined) => void, advance: (timestamp: number, runGlobalEffects?: boolean | undefined, state?: RootState | undefined, frame?: THREE.XRFrame | undefined) => void, props: StoreProps) => UseStore<RootState>;
104
+ declare const context: React.Context<UseBoundStore<RootState, StoreApi<RootState>>>;
105
+ declare const createStore: (invalidate: (state?: RootState | undefined) => void, advance: (timestamp: number, runGlobalEffects?: boolean | undefined, state?: RootState | undefined, frame?: THREE.XRFrame | undefined) => void) => UseBoundStore<RootState>;
119
106
  export { createStore, context };
@@ -1,6 +1,6 @@
1
1
  import * as THREE from 'three';
2
2
  import { AttachType, Instance, InstanceProps, LocalState } from './renderer';
3
- import { Dpr } from './store';
3
+ import { Dpr, RootState } from './store';
4
4
  export declare const DEFAULT = "__default";
5
5
  export declare type DiffSet = {
6
6
  memoized: {
@@ -21,19 +21,26 @@ export declare type ObjectMap = {
21
21
  };
22
22
  };
23
23
  export declare function calculateDpr(dpr: Dpr): number;
24
+ export declare const getRootState: (obj: THREE.Object3D) => RootState | undefined;
24
25
  export declare function filterKeys<TObj extends {
25
26
  [key: string]: any;
26
27
  }, TOmit extends boolean, TKey extends keyof TObj>(obj: TObj, omit: TOmit, ...keys: TKey[]): TOmit extends true ? Omit<TObj, TKey> : Pick<TObj, TKey>;
27
28
  export declare const pick: <TObj>(obj: Partial<TObj>, keys: (keyof TObj)[]) => Pick<Partial<TObj>, keyof TObj>;
28
29
  export declare const omit: <TObj>(obj: Partial<TObj>, keys: (keyof TObj)[]) => Omit<Partial<TObj>, keyof TObj>;
30
+ export declare type EquConfig = {
31
+ arrays?: 'reference' | 'shallow';
32
+ objects?: 'reference' | 'shallow';
33
+ strict?: boolean;
34
+ };
29
35
  export declare const is: {
30
36
  obj: (a: any) => boolean;
31
37
  fun: (a: any) => a is Function;
32
38
  str: (a: any) => a is string;
33
39
  num: (a: any) => a is number;
40
+ boo: (a: any) => a is boolean;
34
41
  und: (a: any) => boolean;
35
42
  arr: (a: any) => boolean;
36
- equ(a: any, b: any): boolean;
43
+ equ(a: any, b: any, { arrays, objects, strict }?: EquConfig): boolean;
37
44
  };
38
45
  export declare function buildGraph(object: THREE.Object3D): ObjectMap;
39
46
  export declare function dispose<TObj extends {
@@ -45,6 +52,6 @@ export declare function prepare<T = THREE.Object3D>(object: T, state?: Partial<L
45
52
  export declare function attach(parent: Instance, child: Instance, type: AttachType): void;
46
53
  export declare function detach(parent: Instance, child: Instance, type: AttachType): void;
47
54
  export declare function diffProps(instance: Instance, { children: cN, key: kN, ref: rN, ...props }: InstanceProps, { children: cP, key: kP, ref: rP, ...previous }?: InstanceProps, remove?: boolean): DiffSet;
48
- export declare function applyProps(instance: Instance, data: InstanceProps | DiffSet): void;
55
+ export declare function applyProps(instance: Instance, data: InstanceProps | DiffSet): Instance;
49
56
  export declare function invalidateInstance(instance: Instance): void;
50
57
  export declare function updateInstance(instance: Instance): void;
@@ -1,6 +1,7 @@
1
1
  export * from './three-types';
2
2
  import * as ReactThreeFiber from './three-types';
3
3
  export { ReactThreeFiber };
4
+ export type { BaseInstance, LocalState } from './core/renderer';
4
5
  export type { Intersection, Subscription, Dpr, Size, Viewport, Camera, RenderCallback, Performance, RootState, } from './core/store';
5
6
  export type { ThreeEvent, Events, EventManager } from './core/events';
6
7
  export type { ObjectMap } from './core/utils';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { View, ViewProps, ViewStyle } from 'react-native';
3
- import { UseStore } from 'zustand';
3
+ import { UseBoundStore } from 'zustand';
4
4
  import { RenderProps } from '../core';
5
5
  import { RootState } from '../core/store';
6
6
  import { EventManager } from '../core/events';
@@ -8,6 +8,6 @@ export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size' | 'ev
8
8
  children: React.ReactNode;
9
9
  fallback?: React.ReactNode;
10
10
  style?: ViewStyle;
11
- events?: (store: UseStore<RootState>) => EventManager<any>;
11
+ events?: (store: UseBoundStore<RootState>) => EventManager<any>;
12
12
  }
13
13
  export declare const Canvas: React.ForwardRefExoticComponent<Props & React.RefAttributes<View>>;
@@ -1,5 +1,5 @@
1
- import { UseStore } from 'zustand';
1
+ import { UseBoundStore } from 'zustand';
2
2
  import { RootState } from '../core/store';
3
3
  import { EventManager } from '../core/events';
4
4
  import { View } from 'react-native';
5
- export declare function createTouchEvents(store: UseStore<RootState>): EventManager<View>;
5
+ export declare function createTouchEvents(store: UseBoundStore<RootState>): EventManager<View>;
@@ -1,6 +1,7 @@
1
1
  export * from './three-types';
2
2
  import * as ReactThreeFiber from './three-types';
3
3
  export { ReactThreeFiber };
4
+ export type { BaseInstance, LocalState } from './core/renderer';
4
5
  export type { Intersection, Subscription, Dpr, Size, Viewport, Camera, RenderCallback, Performance, RootState, } from './core/store';
5
6
  export type { ThreeEvent, Events, EventManager } from './core/events';
6
7
  export type { ObjectMap } from './core/utils';
@@ -41,6 +41,7 @@ export declare type Object3DNode<T, P> = Overwrite<Node<T, P>, {
41
41
  export declare type BufferGeometryNode<T extends THREE.BufferGeometry, P> = Node<T, P>;
42
42
  export declare type MaterialNode<T extends THREE.Material, P> = Node<T, P>;
43
43
  export declare type LightNode<T extends THREE.Light, P> = Object3DNode<T, P>;
44
+ export declare type Object3DProps = Object3DNode<THREE.Object3D, typeof THREE.Object3D>;
44
45
  export declare type AudioListenerProps = Object3DNode<THREE.AudioListener, typeof THREE.AudioListener>;
45
46
  export declare type PositionalAudioProps = Object3DNode<THREE.PositionalAudio, typeof THREE.PositionalAudio>;
46
47
  export declare type MeshProps = Object3DNode<THREE.Mesh, typeof THREE.Mesh>;
@@ -166,7 +167,15 @@ export declare type Matrix3Props = Node<THREE.Matrix3, typeof THREE.Matrix3>;
166
167
  export declare type Matrix4Props = Node<THREE.Matrix4, typeof THREE.Matrix4>;
167
168
  export declare type QuaternionProps = Node<THREE.Quaternion, typeof THREE.Quaternion>;
168
169
  export declare type BufferAttributeProps = Node<THREE.BufferAttribute, typeof THREE.BufferAttribute>;
170
+ export declare type Float16BufferAttributeProps = Node<THREE.Float16BufferAttribute, typeof THREE.Float16BufferAttribute>;
169
171
  export declare type Float32BufferAttributeProps = Node<THREE.Float32BufferAttribute, typeof THREE.Float32BufferAttribute>;
172
+ export declare type Float64BufferAttributeProps = Node<THREE.Float64BufferAttribute, typeof THREE.Float64BufferAttribute>;
173
+ export declare type Int8BufferAttributeProps = Node<THREE.Int8BufferAttribute, typeof THREE.Int8BufferAttribute>;
174
+ export declare type Int16BufferAttributeProps = Node<THREE.Int16BufferAttribute, typeof THREE.Int16BufferAttribute>;
175
+ export declare type Int32BufferAttributeProps = Node<THREE.Int32BufferAttribute, typeof THREE.Int32BufferAttribute>;
176
+ export declare type Uint8BufferAttributeProps = Node<THREE.Uint8BufferAttribute, typeof THREE.Uint8BufferAttribute>;
177
+ export declare type Uint16BufferAttributeProps = Node<THREE.Uint16BufferAttribute, typeof THREE.Uint16BufferAttribute>;
178
+ export declare type Uint32BufferAttributeProps = Node<THREE.Uint32BufferAttribute, typeof THREE.Uint32BufferAttribute>;
170
179
  export declare type InstancedBufferAttributeProps = Node<THREE.InstancedBufferAttribute, typeof THREE.InstancedBufferAttribute>;
171
180
  export declare type ColorProps = Node<THREE.Color, ColorArray>;
172
181
  export declare type FogProps = Node<THREE.Fog, typeof THREE.Fog>;
@@ -175,6 +184,7 @@ export declare type ShapeProps = Node<THREE.Shape, typeof THREE.Shape>;
175
184
  declare global {
176
185
  namespace JSX {
177
186
  interface IntrinsicElements {
187
+ object3D: Object3DProps;
178
188
  audioListener: AudioListenerProps;
179
189
  positionalAudio: PositionalAudioProps;
180
190
  mesh: MeshProps;
@@ -296,7 +306,15 @@ declare global {
296
306
  matrix4: Matrix4Props;
297
307
  quaternion: QuaternionProps;
298
308
  bufferAttribute: BufferAttributeProps;
309
+ float16BufferAttribute: Float16BufferAttributeProps;
299
310
  float32BufferAttribute: Float32BufferAttributeProps;
311
+ float64BufferAttribute: Float64BufferAttributeProps;
312
+ int8BufferAttribute: Int8BufferAttributeProps;
313
+ int16BufferAttribute: Int16BufferAttributeProps;
314
+ int32BufferAttribute: Int32BufferAttributeProps;
315
+ uint8BufferAttribute: Uint8BufferAttributeProps;
316
+ uint16BufferAttribute: Uint16BufferAttributeProps;
317
+ uint32BufferAttribute: Uint32BufferAttributeProps;
300
318
  instancedBufferAttribute: InstancedBufferAttributeProps;
301
319
  color: ColorProps;
302
320
  fog: FogProps;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Options as ResizeOptions } from 'react-use-measure';
3
- import { UseStore } from 'zustand';
3
+ import { UseBoundStore } from 'zustand';
4
4
  import { RenderProps } from '../core';
5
5
  import { RootState } from '../core/store';
6
6
  import { EventManager } from '../core/events';
@@ -8,6 +8,6 @@ export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size' | 'ev
8
8
  children: React.ReactNode;
9
9
  fallback?: React.ReactNode;
10
10
  resize?: ResizeOptions;
11
- events?: (store: UseStore<RootState>) => EventManager<any>;
11
+ events?: (store: UseBoundStore<RootState>) => EventManager<any>;
12
12
  }
13
13
  export declare const Canvas: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLCanvasElement>>;
@@ -1,4 +1,4 @@
1
- import { UseStore } from 'zustand';
1
+ import { UseBoundStore } from 'zustand';
2
2
  import { RootState } from '../core/store';
3
3
  import { EventManager } from '../core/events';
4
- export declare function createPointerEvents(store: UseStore<RootState>): EventManager<HTMLElement>;
4
+ export declare function createPointerEvents(store: UseBoundStore<RootState>): EventManager<HTMLElement>;