@react-three/fiber 8.0.0-alpha-08 → 8.0.0-alpha-09
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/dist/declarations/src/core/events.d.ts +2 -2
- package/dist/declarations/src/core/hooks.d.ts +1 -1
- package/dist/declarations/src/core/renderer.d.ts +4 -15
- package/dist/declarations/src/core/utils.d.ts +27 -0
- package/dist/declarations/src/web/Canvas.d.ts +1 -1
- package/dist/declarations/src/web/events.d.ts +2 -1
- package/dist/declarations/src/web/index.d.ts +1 -1
- package/dist/react-three-fiber.cjs.dev.js +265 -268
- package/dist/react-three-fiber.cjs.prod.js +265 -268
- package/dist/react-three-fiber.esm.js +266 -269
- package/package.json +1 -1
- package/dist/declarations/src/core/is.d.ts +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { UseStore } from 'zustand';
|
|
3
|
+
import { RootState } from './store';
|
|
4
4
|
export interface Intersection extends THREE.Intersection {
|
|
5
5
|
eventObject: THREE.Object3D;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { StateSelector, EqualityChecker } from 'zustand';
|
|
3
|
-
import
|
|
3
|
+
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
|
|
4
4
|
import { RootState, RenderCallback } from './store';
|
|
5
5
|
export interface Loader<T> extends THREE.Loader {
|
|
6
6
|
load(url: string, onLoad?: (result: T) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): unknown;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import Reconciler from 'react-reconciler';
|
|
3
2
|
import { UseStore } from 'zustand';
|
|
3
|
+
import Reconciler from 'react-reconciler';
|
|
4
|
+
import { prepare, applyProps } from './utils';
|
|
4
5
|
import { RootState } from './store';
|
|
5
6
|
import { EventHandlers } from './events';
|
|
6
7
|
export declare type Root = {
|
|
@@ -18,9 +19,6 @@ export declare type LocalState = {
|
|
|
18
19
|
[key: string]: any;
|
|
19
20
|
};
|
|
20
21
|
};
|
|
21
|
-
export declare type ClassConstructor = {
|
|
22
|
-
new (): void;
|
|
23
|
-
};
|
|
24
22
|
export declare type AttachFnType = (self: Instance, parent: Instance) => void;
|
|
25
23
|
export declare type AttachFnsType = [attach: string | AttachFnType, detach: string | AttachFnType];
|
|
26
24
|
export declare type BaseInstance = Omit<THREE.Object3D, 'parent' | 'children' | 'attach' | 'add' | 'remove' | 'raycast'> & {
|
|
@@ -45,18 +43,9 @@ export declare type InstanceProps = {
|
|
|
45
43
|
dispose?: null;
|
|
46
44
|
attach?: string;
|
|
47
45
|
};
|
|
48
|
-
export declare type DiffSet = {
|
|
49
|
-
accumulative: boolean;
|
|
50
|
-
memoized: {
|
|
51
|
-
[key: string]: any;
|
|
52
|
-
};
|
|
53
|
-
changes: [key: string, value: unknown, isEvent: boolean, instance: Instance, prop: any][];
|
|
54
|
-
};
|
|
55
|
-
export declare const isDiffSet: (def: any) => def is DiffSet;
|
|
56
46
|
declare let extend: (objects: object) => void;
|
|
57
|
-
declare function
|
|
58
|
-
declare function createRenderer<TCanvas>(roots: Map<TCanvas, Root>): {
|
|
47
|
+
declare function createRenderer<TCanvas>(roots: Map<TCanvas, Root>, getEventPriority?: () => any): {
|
|
59
48
|
reconciler: Reconciler.Reconciler<unknown, unknown, unknown, unknown, unknown>;
|
|
60
|
-
applyProps:
|
|
49
|
+
applyProps: typeof applyProps;
|
|
61
50
|
};
|
|
62
51
|
export { prepare, createRenderer, extend };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { Instance, InstanceProps, LocalState } from './renderer';
|
|
3
|
+
export declare const DEFAULT = "__default";
|
|
4
|
+
export declare type DiffSet = {
|
|
5
|
+
memoized: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
changes: [key: string, value: unknown, isEvent: boolean, instance: Instance, prop: any][];
|
|
9
|
+
};
|
|
10
|
+
export declare const isDiffSet: (def: any) => def is DiffSet;
|
|
11
|
+
export declare type ClassConstructor = {
|
|
12
|
+
new (): void;
|
|
13
|
+
};
|
|
14
|
+
export declare const is: {
|
|
15
|
+
obj: (a: any) => boolean;
|
|
16
|
+
fun: (a: any) => a is Function;
|
|
17
|
+
str: (a: any) => a is string;
|
|
18
|
+
num: (a: any) => a is number;
|
|
19
|
+
und: (a: any) => boolean;
|
|
20
|
+
arr: (a: any) => boolean;
|
|
21
|
+
equ(a: any, b: any): boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function prepare<T = THREE.Object3D>(object: T, state?: Partial<LocalState>): T;
|
|
24
|
+
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;
|
|
25
|
+
export declare function applyProps(instance: Instance, data: InstanceProps | DiffSet): void;
|
|
26
|
+
export declare function invalidateInstance(instance: Instance): void;
|
|
27
|
+
export declare function updateInstance(instance: Instance): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Options as ResizeOptions } from 'react-use-measure';
|
|
3
|
-
import { RenderProps } from './index';
|
|
4
3
|
import { UseStore } from 'zustand';
|
|
4
|
+
import { RenderProps } from './index';
|
|
5
5
|
import { RootState } from '../core/store';
|
|
6
6
|
import { EventManager } from '../core/events';
|
|
7
7
|
export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size' | 'events'>, React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UseStore } from 'zustand';
|
|
2
2
|
import { RootState } from '../core/store';
|
|
3
|
-
import
|
|
3
|
+
import { EventManager } from '../core/events';
|
|
4
|
+
export declare function getEventPriority(): any;
|
|
4
5
|
export declare function createPointerEvents(store: UseStore<RootState>): EventManager<HTMLElement>;
|
|
@@ -10,7 +10,7 @@ import { Canvas } from './Canvas';
|
|
|
10
10
|
import { EventManager } from '../core/events';
|
|
11
11
|
declare const roots: Map<Element, Root>;
|
|
12
12
|
declare const invalidate: (state?: RootState | undefined) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined) => void;
|
|
13
|
-
declare const reconciler: import("react-reconciler").Reconciler<unknown, unknown, unknown, unknown, unknown>, applyProps:
|
|
13
|
+
declare const reconciler: import("react-reconciler").Reconciler<unknown, unknown, unknown, unknown, unknown>, applyProps: typeof import("../core/utils").applyProps;
|
|
14
14
|
export declare type RenderProps<TCanvas extends Element> = Omit<StoreProps, 'gl' | 'events' | 'size'> & {
|
|
15
15
|
gl?: THREE.WebGLRenderer | Partial<THREE.WebGLRendererParameters>;
|
|
16
16
|
events?: (store: UseStore<RootState>) => EventManager<TCanvas>;
|