@react-three/test-renderer 10.0.0-canary.f50076a → 10.0.0-canary.f744c1e
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/README.md +19 -27
- package/dist/index.cjs +412 -66
- package/dist/index.d.cts +11 -1
- package/dist/index.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.mjs +411 -67
- package/dist/legacy.cjs +6 -0
- package/dist/legacy.mjs +6 -0
- package/package.json +3 -8
- package/dist/webgpu/index.cjs +0 -1575
- package/dist/webgpu/index.d.cts +0 -128
- package/dist/webgpu/index.d.mts +0 -126
- package/dist/webgpu/index.d.ts +0 -128
- package/dist/webgpu/index.mjs +0 -1566
package/dist/webgpu/index.d.cts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { act } from 'react';
|
|
2
|
-
export { act } from 'react';
|
|
3
|
-
import { Instance, RenderProps, Camera, Act } from '@react-three/fiber';
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
export { TextureEntry, TextureNode, UseTexturesReturn, useTextures } from '@react-three/fiber/webgpu';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Renderer mode for test canvas
|
|
9
|
-
* - 'webgl': WebGL/WebGL2 context (default, legacy)
|
|
10
|
-
* - 'webgpu': WebGPU context
|
|
11
|
-
*/
|
|
12
|
-
type RendererMode = 'webgl' | 'webgpu';
|
|
13
|
-
type CreateCanvasParameters = {
|
|
14
|
-
beforeReturn?: (canvas: HTMLCanvasElement) => void;
|
|
15
|
-
width?: number;
|
|
16
|
-
height?: number;
|
|
17
|
-
/** Renderer mode - 'webgl' (default) or 'webgpu' */
|
|
18
|
-
mode?: RendererMode;
|
|
19
|
-
};
|
|
20
|
-
interface Obj {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* this is an empty object of any,
|
|
25
|
-
* the data is passed to a new event
|
|
26
|
-
* and subsequently passed to the
|
|
27
|
-
* event handler you're calling
|
|
28
|
-
*/
|
|
29
|
-
type MockEventData = {
|
|
30
|
-
[key: string]: any;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
declare class ReactThreeTestInstance<TObject extends THREE.Object3D = THREE.Object3D> {
|
|
34
|
-
_fiber: Instance<TObject>;
|
|
35
|
-
constructor(fiber: Instance<TObject>);
|
|
36
|
-
get fiber(): Instance<TObject>;
|
|
37
|
-
get instance(): TObject;
|
|
38
|
-
get type(): string;
|
|
39
|
-
get props(): Obj;
|
|
40
|
-
get parent(): ReactThreeTestInstance | null;
|
|
41
|
-
get children(): ReactThreeTestInstance[];
|
|
42
|
-
get allChildren(): ReactThreeTestInstance[];
|
|
43
|
-
private getChildren;
|
|
44
|
-
findAll: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance[];
|
|
45
|
-
find: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance;
|
|
46
|
-
findByType: (type: string) => ReactThreeTestInstance;
|
|
47
|
-
findAllByType: (type: string) => ReactThreeTestInstance[];
|
|
48
|
-
findByProps: (props: Obj) => ReactThreeTestInstance;
|
|
49
|
-
findAllByProps: (props: Obj) => ReactThreeTestInstance[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
type MockSyntheticEvent = {
|
|
53
|
-
camera: Camera;
|
|
54
|
-
stopPropagation: () => void;
|
|
55
|
-
target: ReactThreeTestInstance;
|
|
56
|
-
currentTarget: ReactThreeTestInstance;
|
|
57
|
-
sourceEvent: MockEventData;
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
};
|
|
60
|
-
type CreateOptions = CreateCanvasParameters & RenderProps<HTMLCanvasElement>;
|
|
61
|
-
type Renderer = {
|
|
62
|
-
scene: ReactThreeTestInstance;
|
|
63
|
-
unmount: () => Promise<void>;
|
|
64
|
-
getInstance: () => null | unknown;
|
|
65
|
-
update: (el: React.ReactNode) => Promise<void>;
|
|
66
|
-
toTree: () => Tree | undefined;
|
|
67
|
-
toGraph: () => SceneGraph | undefined;
|
|
68
|
-
fireEvent: (element: ReactThreeTestInstance, handler: string, data?: MockEventData) => Promise<any>;
|
|
69
|
-
advanceFrames: (frames: number, delta: number | number[]) => Promise<void>;
|
|
70
|
-
};
|
|
71
|
-
interface SceneGraphItem {
|
|
72
|
-
type: string;
|
|
73
|
-
name: string;
|
|
74
|
-
children: SceneGraphItem[] | null;
|
|
75
|
-
}
|
|
76
|
-
type SceneGraph = SceneGraphItem[];
|
|
77
|
-
interface TreeNode {
|
|
78
|
-
type: string;
|
|
79
|
-
props: {
|
|
80
|
-
[key: string]: any;
|
|
81
|
-
};
|
|
82
|
-
children: TreeNode[];
|
|
83
|
-
}
|
|
84
|
-
type Tree = TreeNode[];
|
|
85
|
-
|
|
86
|
-
interface WaitOptions {
|
|
87
|
-
interval?: number;
|
|
88
|
-
timeout?: number;
|
|
89
|
-
}
|
|
90
|
-
declare function waitFor(callback: () => boolean | void, { interval, timeout }?: WaitOptions): Promise<void>;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Installs WebGPU mocks into the global scope
|
|
94
|
-
* Call this before running tests that use WebGPU
|
|
95
|
-
*/
|
|
96
|
-
declare function mockWebGPU(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Removes WebGPU mocks from the global scope
|
|
99
|
-
*/
|
|
100
|
-
declare function unmockWebGPU(): void;
|
|
101
|
-
|
|
102
|
-
declare const index_Act: typeof Act;
|
|
103
|
-
type index_CreateOptions = CreateOptions;
|
|
104
|
-
type index_MockSyntheticEvent = MockSyntheticEvent;
|
|
105
|
-
type index_ReactThreeTestInstance<TObject extends THREE.Object3D = THREE.Object3D> = ReactThreeTestInstance<TObject>;
|
|
106
|
-
declare const index_ReactThreeTestInstance: typeof ReactThreeTestInstance;
|
|
107
|
-
type index_Renderer = Renderer;
|
|
108
|
-
type index_SceneGraph = SceneGraph;
|
|
109
|
-
type index_SceneGraphItem = SceneGraphItem;
|
|
110
|
-
type index_Tree = Tree;
|
|
111
|
-
type index_TreeNode = TreeNode;
|
|
112
|
-
declare namespace index {
|
|
113
|
-
export { index_Act as Act, index_ReactThreeTestInstance as ReactThreeTestInstance };
|
|
114
|
-
export type { index_CreateOptions as CreateOptions, index_MockSyntheticEvent as MockSyntheticEvent, index_Renderer as Renderer, index_SceneGraph as SceneGraph, index_SceneGraphItem as SceneGraphItem, index_Tree as Tree, index_TreeNode as TreeNode };
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
declare const create: (element: React.ReactNode, options?: Partial<CreateOptions>) => Promise<Renderer>;
|
|
118
|
-
|
|
119
|
-
declare const _default: {
|
|
120
|
-
create: (element: React.ReactNode, options?: Partial<CreateOptions>) => Promise<Renderer>;
|
|
121
|
-
act: typeof act;
|
|
122
|
-
waitFor: typeof waitFor;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
// @ts-ignore
|
|
126
|
-
export = _default;
|
|
127
|
-
export { index as ReactThreeTest, create, mockWebGPU, unmockWebGPU, waitFor };
|
|
128
|
-
export type { WaitOptions };
|
package/dist/webgpu/index.d.mts
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { act } from 'react';
|
|
2
|
-
export { act } from 'react';
|
|
3
|
-
import { Instance, RenderProps, Camera, Act } from '@react-three/fiber';
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
export { TextureEntry, TextureNode, UseTexturesReturn, useTextures } from '@react-three/fiber/webgpu';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Renderer mode for test canvas
|
|
9
|
-
* - 'webgl': WebGL/WebGL2 context (default, legacy)
|
|
10
|
-
* - 'webgpu': WebGPU context
|
|
11
|
-
*/
|
|
12
|
-
type RendererMode = 'webgl' | 'webgpu';
|
|
13
|
-
type CreateCanvasParameters = {
|
|
14
|
-
beforeReturn?: (canvas: HTMLCanvasElement) => void;
|
|
15
|
-
width?: number;
|
|
16
|
-
height?: number;
|
|
17
|
-
/** Renderer mode - 'webgl' (default) or 'webgpu' */
|
|
18
|
-
mode?: RendererMode;
|
|
19
|
-
};
|
|
20
|
-
interface Obj {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* this is an empty object of any,
|
|
25
|
-
* the data is passed to a new event
|
|
26
|
-
* and subsequently passed to the
|
|
27
|
-
* event handler you're calling
|
|
28
|
-
*/
|
|
29
|
-
type MockEventData = {
|
|
30
|
-
[key: string]: any;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
declare class ReactThreeTestInstance<TObject extends THREE.Object3D = THREE.Object3D> {
|
|
34
|
-
_fiber: Instance<TObject>;
|
|
35
|
-
constructor(fiber: Instance<TObject>);
|
|
36
|
-
get fiber(): Instance<TObject>;
|
|
37
|
-
get instance(): TObject;
|
|
38
|
-
get type(): string;
|
|
39
|
-
get props(): Obj;
|
|
40
|
-
get parent(): ReactThreeTestInstance | null;
|
|
41
|
-
get children(): ReactThreeTestInstance[];
|
|
42
|
-
get allChildren(): ReactThreeTestInstance[];
|
|
43
|
-
private getChildren;
|
|
44
|
-
findAll: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance[];
|
|
45
|
-
find: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance;
|
|
46
|
-
findByType: (type: string) => ReactThreeTestInstance;
|
|
47
|
-
findAllByType: (type: string) => ReactThreeTestInstance[];
|
|
48
|
-
findByProps: (props: Obj) => ReactThreeTestInstance;
|
|
49
|
-
findAllByProps: (props: Obj) => ReactThreeTestInstance[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
type MockSyntheticEvent = {
|
|
53
|
-
camera: Camera;
|
|
54
|
-
stopPropagation: () => void;
|
|
55
|
-
target: ReactThreeTestInstance;
|
|
56
|
-
currentTarget: ReactThreeTestInstance;
|
|
57
|
-
sourceEvent: MockEventData;
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
};
|
|
60
|
-
type CreateOptions = CreateCanvasParameters & RenderProps<HTMLCanvasElement>;
|
|
61
|
-
type Renderer = {
|
|
62
|
-
scene: ReactThreeTestInstance;
|
|
63
|
-
unmount: () => Promise<void>;
|
|
64
|
-
getInstance: () => null | unknown;
|
|
65
|
-
update: (el: React.ReactNode) => Promise<void>;
|
|
66
|
-
toTree: () => Tree | undefined;
|
|
67
|
-
toGraph: () => SceneGraph | undefined;
|
|
68
|
-
fireEvent: (element: ReactThreeTestInstance, handler: string, data?: MockEventData) => Promise<any>;
|
|
69
|
-
advanceFrames: (frames: number, delta: number | number[]) => Promise<void>;
|
|
70
|
-
};
|
|
71
|
-
interface SceneGraphItem {
|
|
72
|
-
type: string;
|
|
73
|
-
name: string;
|
|
74
|
-
children: SceneGraphItem[] | null;
|
|
75
|
-
}
|
|
76
|
-
type SceneGraph = SceneGraphItem[];
|
|
77
|
-
interface TreeNode {
|
|
78
|
-
type: string;
|
|
79
|
-
props: {
|
|
80
|
-
[key: string]: any;
|
|
81
|
-
};
|
|
82
|
-
children: TreeNode[];
|
|
83
|
-
}
|
|
84
|
-
type Tree = TreeNode[];
|
|
85
|
-
|
|
86
|
-
interface WaitOptions {
|
|
87
|
-
interval?: number;
|
|
88
|
-
timeout?: number;
|
|
89
|
-
}
|
|
90
|
-
declare function waitFor(callback: () => boolean | void, { interval, timeout }?: WaitOptions): Promise<void>;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Installs WebGPU mocks into the global scope
|
|
94
|
-
* Call this before running tests that use WebGPU
|
|
95
|
-
*/
|
|
96
|
-
declare function mockWebGPU(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Removes WebGPU mocks from the global scope
|
|
99
|
-
*/
|
|
100
|
-
declare function unmockWebGPU(): void;
|
|
101
|
-
|
|
102
|
-
declare const index_Act: typeof Act;
|
|
103
|
-
type index_CreateOptions = CreateOptions;
|
|
104
|
-
type index_MockSyntheticEvent = MockSyntheticEvent;
|
|
105
|
-
type index_ReactThreeTestInstance<TObject extends THREE.Object3D = THREE.Object3D> = ReactThreeTestInstance<TObject>;
|
|
106
|
-
declare const index_ReactThreeTestInstance: typeof ReactThreeTestInstance;
|
|
107
|
-
type index_Renderer = Renderer;
|
|
108
|
-
type index_SceneGraph = SceneGraph;
|
|
109
|
-
type index_SceneGraphItem = SceneGraphItem;
|
|
110
|
-
type index_Tree = Tree;
|
|
111
|
-
type index_TreeNode = TreeNode;
|
|
112
|
-
declare namespace index {
|
|
113
|
-
export { index_Act as Act, index_ReactThreeTestInstance as ReactThreeTestInstance };
|
|
114
|
-
export type { index_CreateOptions as CreateOptions, index_MockSyntheticEvent as MockSyntheticEvent, index_Renderer as Renderer, index_SceneGraph as SceneGraph, index_SceneGraphItem as SceneGraphItem, index_Tree as Tree, index_TreeNode as TreeNode };
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
declare const create: (element: React.ReactNode, options?: Partial<CreateOptions>) => Promise<Renderer>;
|
|
118
|
-
|
|
119
|
-
declare const _default: {
|
|
120
|
-
create: (element: React.ReactNode, options?: Partial<CreateOptions>) => Promise<Renderer>;
|
|
121
|
-
act: typeof act;
|
|
122
|
-
waitFor: typeof waitFor;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export { index as ReactThreeTest, create, _default as default, mockWebGPU, unmockWebGPU, waitFor };
|
|
126
|
-
export type { WaitOptions };
|
package/dist/webgpu/index.d.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { act } from 'react';
|
|
2
|
-
export { act } from 'react';
|
|
3
|
-
import { Instance, RenderProps, Camera, Act } from '@react-three/fiber';
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
export { TextureEntry, TextureNode, UseTexturesReturn, useTextures } from '@react-three/fiber/webgpu';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Renderer mode for test canvas
|
|
9
|
-
* - 'webgl': WebGL/WebGL2 context (default, legacy)
|
|
10
|
-
* - 'webgpu': WebGPU context
|
|
11
|
-
*/
|
|
12
|
-
type RendererMode = 'webgl' | 'webgpu';
|
|
13
|
-
type CreateCanvasParameters = {
|
|
14
|
-
beforeReturn?: (canvas: HTMLCanvasElement) => void;
|
|
15
|
-
width?: number;
|
|
16
|
-
height?: number;
|
|
17
|
-
/** Renderer mode - 'webgl' (default) or 'webgpu' */
|
|
18
|
-
mode?: RendererMode;
|
|
19
|
-
};
|
|
20
|
-
interface Obj {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* this is an empty object of any,
|
|
25
|
-
* the data is passed to a new event
|
|
26
|
-
* and subsequently passed to the
|
|
27
|
-
* event handler you're calling
|
|
28
|
-
*/
|
|
29
|
-
type MockEventData = {
|
|
30
|
-
[key: string]: any;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
declare class ReactThreeTestInstance<TObject extends THREE.Object3D = THREE.Object3D> {
|
|
34
|
-
_fiber: Instance<TObject>;
|
|
35
|
-
constructor(fiber: Instance<TObject>);
|
|
36
|
-
get fiber(): Instance<TObject>;
|
|
37
|
-
get instance(): TObject;
|
|
38
|
-
get type(): string;
|
|
39
|
-
get props(): Obj;
|
|
40
|
-
get parent(): ReactThreeTestInstance | null;
|
|
41
|
-
get children(): ReactThreeTestInstance[];
|
|
42
|
-
get allChildren(): ReactThreeTestInstance[];
|
|
43
|
-
private getChildren;
|
|
44
|
-
findAll: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance[];
|
|
45
|
-
find: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance;
|
|
46
|
-
findByType: (type: string) => ReactThreeTestInstance;
|
|
47
|
-
findAllByType: (type: string) => ReactThreeTestInstance[];
|
|
48
|
-
findByProps: (props: Obj) => ReactThreeTestInstance;
|
|
49
|
-
findAllByProps: (props: Obj) => ReactThreeTestInstance[];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
type MockSyntheticEvent = {
|
|
53
|
-
camera: Camera;
|
|
54
|
-
stopPropagation: () => void;
|
|
55
|
-
target: ReactThreeTestInstance;
|
|
56
|
-
currentTarget: ReactThreeTestInstance;
|
|
57
|
-
sourceEvent: MockEventData;
|
|
58
|
-
[key: string]: any;
|
|
59
|
-
};
|
|
60
|
-
type CreateOptions = CreateCanvasParameters & RenderProps<HTMLCanvasElement>;
|
|
61
|
-
type Renderer = {
|
|
62
|
-
scene: ReactThreeTestInstance;
|
|
63
|
-
unmount: () => Promise<void>;
|
|
64
|
-
getInstance: () => null | unknown;
|
|
65
|
-
update: (el: React.ReactNode) => Promise<void>;
|
|
66
|
-
toTree: () => Tree | undefined;
|
|
67
|
-
toGraph: () => SceneGraph | undefined;
|
|
68
|
-
fireEvent: (element: ReactThreeTestInstance, handler: string, data?: MockEventData) => Promise<any>;
|
|
69
|
-
advanceFrames: (frames: number, delta: number | number[]) => Promise<void>;
|
|
70
|
-
};
|
|
71
|
-
interface SceneGraphItem {
|
|
72
|
-
type: string;
|
|
73
|
-
name: string;
|
|
74
|
-
children: SceneGraphItem[] | null;
|
|
75
|
-
}
|
|
76
|
-
type SceneGraph = SceneGraphItem[];
|
|
77
|
-
interface TreeNode {
|
|
78
|
-
type: string;
|
|
79
|
-
props: {
|
|
80
|
-
[key: string]: any;
|
|
81
|
-
};
|
|
82
|
-
children: TreeNode[];
|
|
83
|
-
}
|
|
84
|
-
type Tree = TreeNode[];
|
|
85
|
-
|
|
86
|
-
interface WaitOptions {
|
|
87
|
-
interval?: number;
|
|
88
|
-
timeout?: number;
|
|
89
|
-
}
|
|
90
|
-
declare function waitFor(callback: () => boolean | void, { interval, timeout }?: WaitOptions): Promise<void>;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Installs WebGPU mocks into the global scope
|
|
94
|
-
* Call this before running tests that use WebGPU
|
|
95
|
-
*/
|
|
96
|
-
declare function mockWebGPU(): void;
|
|
97
|
-
/**
|
|
98
|
-
* Removes WebGPU mocks from the global scope
|
|
99
|
-
*/
|
|
100
|
-
declare function unmockWebGPU(): void;
|
|
101
|
-
|
|
102
|
-
declare const index_Act: typeof Act;
|
|
103
|
-
type index_CreateOptions = CreateOptions;
|
|
104
|
-
type index_MockSyntheticEvent = MockSyntheticEvent;
|
|
105
|
-
type index_ReactThreeTestInstance<TObject extends THREE.Object3D = THREE.Object3D> = ReactThreeTestInstance<TObject>;
|
|
106
|
-
declare const index_ReactThreeTestInstance: typeof ReactThreeTestInstance;
|
|
107
|
-
type index_Renderer = Renderer;
|
|
108
|
-
type index_SceneGraph = SceneGraph;
|
|
109
|
-
type index_SceneGraphItem = SceneGraphItem;
|
|
110
|
-
type index_Tree = Tree;
|
|
111
|
-
type index_TreeNode = TreeNode;
|
|
112
|
-
declare namespace index {
|
|
113
|
-
export { index_Act as Act, index_ReactThreeTestInstance as ReactThreeTestInstance };
|
|
114
|
-
export type { index_CreateOptions as CreateOptions, index_MockSyntheticEvent as MockSyntheticEvent, index_Renderer as Renderer, index_SceneGraph as SceneGraph, index_SceneGraphItem as SceneGraphItem, index_Tree as Tree, index_TreeNode as TreeNode };
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
declare const create: (element: React.ReactNode, options?: Partial<CreateOptions>) => Promise<Renderer>;
|
|
118
|
-
|
|
119
|
-
declare const _default: {
|
|
120
|
-
create: (element: React.ReactNode, options?: Partial<CreateOptions>) => Promise<Renderer>;
|
|
121
|
-
act: typeof act;
|
|
122
|
-
waitFor: typeof waitFor;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
// @ts-ignore
|
|
126
|
-
export = _default;
|
|
127
|
-
export { index as ReactThreeTest, create, mockWebGPU, unmockWebGPU, waitFor };
|
|
128
|
-
export type { WaitOptions };
|