@react-three/test-renderer 8.1.0 → 8.1.2

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,17 @@
1
1
  # @react-three/test-renderer
2
2
 
3
+ ## 8.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - d9e6316d: fix: transpile class properties
8
+
9
+ ## 8.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 9a776b71: fix(RTTR): backport traverse, update fixes
14
+
3
15
  ## 8.1.0
4
16
 
5
17
  ### Minor Changes
@@ -1,2 +1,2 @@
1
- import type { CreateCanvasParameters } from './types/internal';
2
- export declare const createCanvas: ({ beforeReturn, width, height }?: CreateCanvasParameters) => HTMLCanvasElement;
1
+ import type { CreateCanvasParameters } from './types/internal';
2
+ export declare const createCanvas: ({ beforeReturn, width, height }?: CreateCanvasParameters) => HTMLCanvasElement;
@@ -1,20 +1,20 @@
1
- import { Object3D } from 'three';
2
- import type { MockInstance, MockScene, Obj } from './types/internal';
3
- export declare class ReactThreeTestInstance<TInstance extends Object3D = Object3D> {
4
- _fiber: MockInstance;
5
- constructor(fiber: MockInstance | MockScene);
6
- get instance(): Object3D;
7
- get type(): string;
8
- get props(): Obj;
9
- get parent(): ReactThreeTestInstance | null;
10
- get children(): ReactThreeTestInstance[];
11
- get allChildren(): ReactThreeTestInstance[];
12
- private getChildren;
13
- find: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance;
14
- findAll: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance[];
15
- findByType: (type: string) => ReactThreeTestInstance;
16
- findAllByType: (type: string) => ReactThreeTestInstance[];
17
- findByProps: (props: Obj) => ReactThreeTestInstance;
18
- findAllByProps: (props: Obj) => ReactThreeTestInstance[];
19
- }
20
- export declare const wrapFiber: (fiber: MockInstance | MockScene) => ReactThreeTestInstance;
1
+ import { Object3D } from 'three';
2
+ import type { MockInstance, MockScene, Obj } from './types/internal';
3
+ export declare class ReactThreeTestInstance<TInstance extends Object3D = Object3D> {
4
+ _fiber: MockInstance;
5
+ constructor(fiber: MockInstance | MockScene);
6
+ get instance(): Object3D;
7
+ get type(): string;
8
+ get props(): Obj;
9
+ get parent(): ReactThreeTestInstance | null;
10
+ get children(): ReactThreeTestInstance[];
11
+ get allChildren(): ReactThreeTestInstance[];
12
+ private getChildren;
13
+ find: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance;
14
+ findAll: (decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance[];
15
+ findByType: (type: string) => ReactThreeTestInstance;
16
+ findAllByType: (type: string) => ReactThreeTestInstance[];
17
+ findByProps: (props: Obj) => ReactThreeTestInstance;
18
+ findAllByProps: (props: Obj) => ReactThreeTestInstance[];
19
+ }
20
+ export declare const wrapFiber: (fiber: MockInstance | MockScene) => ReactThreeTestInstance;
@@ -1 +1 @@
1
- export declare const createWebGLContext: (canvas: HTMLCanvasElement) => RenderingContext;
1
+ export declare const createWebGLContext: (canvas: HTMLCanvasElement) => RenderingContext;
@@ -1,4 +1,4 @@
1
- import ReactReconciler from 'react-reconciler';
2
- import { ReactThreeTestInstance } from './createTestInstance';
3
- import type { MockUseStoreState, MockEventData } from './types/internal';
4
- export declare const createEventFirer: (act: ReactReconciler.Reconciler<unknown, unknown, unknown, unknown, unknown>['act'], store: MockUseStoreState) => (element: ReactThreeTestInstance, eventName: string, data?: MockEventData) => Promise<any>;
1
+ import ReactReconciler from 'react-reconciler';
2
+ import { ReactThreeTestInstance } from './createTestInstance';
3
+ import type { MockUseStoreState, MockEventData } from './types/internal';
4
+ export declare const createEventFirer: (act: ReactReconciler.Reconciler<unknown, unknown, unknown, unknown, unknown>['act'], store: MockUseStoreState) => (element: ReactThreeTestInstance, eventName: string, data?: MockEventData) => Promise<any>;
@@ -1,3 +1,3 @@
1
- import type { MockScene, MockSceneChild } from '../types/internal';
2
- import type { SceneGraphItem } from '../types/public';
3
- export declare const toGraph: (object: MockScene | MockSceneChild) => SceneGraphItem[];
1
+ import type { MockScene, MockSceneChild } from '../types/internal';
2
+ import type { SceneGraphItem } from '../types/public';
3
+ export declare const toGraph: (object: MockScene | MockSceneChild) => SceneGraphItem[];
@@ -1,9 +1,9 @@
1
- export declare const is: {
2
- obj: (a: any) => boolean;
3
- fun: (a: any) => boolean;
4
- str: (a: any) => boolean;
5
- num: (a: any) => boolean;
6
- und: (a: any) => boolean;
7
- arr: (a: any) => boolean;
8
- equ(a: any, b: any): boolean;
9
- };
1
+ export declare const is: {
2
+ obj: (a: any) => boolean;
3
+ fun: (a: any) => boolean;
4
+ str: (a: any) => boolean;
5
+ num: (a: any) => boolean;
6
+ und: (a: any) => boolean;
7
+ arr: (a: any) => boolean;
8
+ equ(a: any, b: any): boolean;
9
+ };
@@ -1,2 +1,2 @@
1
- export declare const lowerCaseFirstLetter: (str: string) => string;
2
- export declare const toEventHandlerName: (eventName: string) => string;
1
+ export declare const lowerCaseFirstLetter: (str: string) => string;
2
+ export declare const toEventHandlerName: (eventName: string) => string;
@@ -1,5 +1,5 @@
1
- import { ReactThreeTestInstance } from '../createTestInstance';
2
- import type { Obj } from '../types/internal';
3
- export declare const expectOne: <TItem>(items: TItem[], msg: string) => TItem;
4
- export declare const matchProps: (props: Obj, filter: Obj) => boolean;
5
- export declare const findAll: (root: ReactThreeTestInstance, decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance<import("three").Object3D<import("three").Event>>[];
1
+ import { ReactThreeTestInstance } from '../createTestInstance';
2
+ import type { Obj } from '../types/internal';
3
+ export declare const expectOne: <TItem>(items: TItem[], msg: string) => TItem;
4
+ export declare const matchProps: (props: Obj, filter: Obj) => boolean;
5
+ export declare const findAll: (root: ReactThreeTestInstance, decider: (node: ReactThreeTestInstance) => boolean) => ReactThreeTestInstance<import("three").Object3D<import("three").Event>>[];
@@ -1,3 +1,3 @@
1
- import type { Tree } from '../types/public';
2
- import type { MockScene } from '../types/internal';
3
- export declare const toTree: (root: MockScene) => Tree;
1
+ import type { Tree } from '../types/public';
2
+ import type { MockScene } from '../types/internal';
3
+ export declare const toTree: (root: MockScene) => Tree;
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
2
- import type { CreateOptions, Renderer, Act } from './types/public';
3
- export * as ReactThreeTest from './types';
4
- declare const _default: {
5
- create: (element: React.ReactNode, options?: Partial<CreateOptions> | undefined) => Promise<Renderer>;
6
- act: Act;
7
- };
8
- export default _default;
1
+ import * as React from 'react';
2
+ import type { CreateOptions, Renderer, Act } from './types/public';
3
+ export * as ReactThreeTest from './types';
4
+ declare const _default: {
5
+ create: (element: React.ReactNode, options?: Partial<CreateOptions> | undefined) => Promise<Renderer>;
6
+ act: Act;
7
+ };
8
+ export default _default;
@@ -1 +1 @@
1
- export * from './public';
1
+ export * from './public';
@@ -1,31 +1,31 @@
1
- import * as THREE from 'three';
2
- import { UseBoundStore } from 'zustand';
3
- import type { BaseInstance, LocalState, RootState } from '@react-three/fiber';
4
- export declare type MockUseStoreState = UseBoundStore<RootState>;
5
- export interface MockInstance extends Omit<BaseInstance, '__r3f'> {
6
- __r3f: Omit<LocalState, 'root' | 'objects' | 'parent'> & {
7
- root: MockUseStoreState;
8
- objects: MockSceneChild[];
9
- parent: MockInstance;
10
- };
11
- }
12
- export interface MockSceneChild extends Omit<MockInstance, 'children'> {
13
- children: MockSceneChild[];
14
- }
15
- export interface MockScene extends Omit<THREE.Scene, 'children'>, Pick<MockInstance, '__r3f'> {
16
- children: MockSceneChild[];
17
- }
18
- export declare type CreateCanvasParameters = {
19
- beforeReturn?: (canvas: HTMLCanvasElement) => void;
20
- width?: number;
21
- height?: number;
22
- };
23
- export interface Obj {
24
- [key: string]: any;
25
- }
26
- export declare type MockEventData = {
27
- [key: string]: any;
28
- };
29
- export interface TestInstanceChildOpts {
30
- exhaustive: boolean;
31
- }
1
+ import * as THREE from 'three';
2
+ import { UseBoundStore } from 'zustand';
3
+ import type { BaseInstance, LocalState, RootState } from '@react-three/fiber';
4
+ export declare type MockUseStoreState = UseBoundStore<RootState>;
5
+ export interface MockInstance extends Omit<BaseInstance, '__r3f'> {
6
+ __r3f: Omit<LocalState, 'root' | 'objects' | 'parent'> & {
7
+ root: MockUseStoreState;
8
+ objects: MockSceneChild[];
9
+ parent: MockInstance;
10
+ };
11
+ }
12
+ export interface MockSceneChild extends Omit<MockInstance, 'children'> {
13
+ children: MockSceneChild[];
14
+ }
15
+ export interface MockScene extends Omit<THREE.Scene, 'children'>, Pick<MockInstance, '__r3f'> {
16
+ children: MockSceneChild[];
17
+ }
18
+ export declare type CreateCanvasParameters = {
19
+ beforeReturn?: (canvas: HTMLCanvasElement) => void;
20
+ width?: number;
21
+ height?: number;
22
+ };
23
+ export interface Obj {
24
+ [key: string]: any;
25
+ }
26
+ export declare type MockEventData = {
27
+ [key: string]: any;
28
+ };
29
+ export interface TestInstanceChildOpts {
30
+ exhaustive: boolean;
31
+ }
@@ -1,39 +1,39 @@
1
- /// <reference types="react" />
2
- import type { Camera, RenderProps } from '@react-three/fiber';
3
- import { ReactThreeTestInstance } from '../createTestInstance';
4
- import type { MockEventData, CreateCanvasParameters } from './internal';
5
- export { ReactThreeTestInstance };
6
- export declare type MockSyntheticEvent = {
7
- camera: Camera;
8
- stopPropagation: () => void;
9
- target: ReactThreeTestInstance;
10
- currentTarget: ReactThreeTestInstance;
11
- sourceEvent: MockEventData;
12
- [key: string]: any;
13
- };
14
- export declare type CreateOptions = CreateCanvasParameters & RenderProps<HTMLCanvasElement>;
15
- export declare type Act = (cb: () => Promise<any>) => Promise<any>;
16
- export declare type Renderer = {
17
- scene: ReactThreeTestInstance;
18
- unmount: () => Promise<void>;
19
- getInstance: () => null | unknown;
20
- update: (el: React.ReactNode) => Promise<void>;
21
- toTree: () => Tree | undefined;
22
- toGraph: () => SceneGraph | undefined;
23
- fireEvent: (element: ReactThreeTestInstance, handler: string, data?: MockEventData) => Promise<any>;
24
- advanceFrames: (frames: number, delta: number | number[]) => Promise<void>;
25
- };
26
- export interface SceneGraphItem {
27
- type: string;
28
- name: string;
29
- children: SceneGraphItem[] | null;
30
- }
31
- export declare type SceneGraph = SceneGraphItem[];
32
- export interface TreeNode {
33
- type: string;
34
- props: {
35
- [key: string]: any;
36
- };
37
- children: TreeNode[];
38
- }
39
- export declare type Tree = TreeNode[];
1
+ /// <reference types="react" />
2
+ import type { Camera, RenderProps } from '@react-three/fiber';
3
+ import { ReactThreeTestInstance } from '../createTestInstance';
4
+ import type { MockEventData, CreateCanvasParameters } from './internal';
5
+ export { ReactThreeTestInstance };
6
+ export declare type MockSyntheticEvent = {
7
+ camera: Camera;
8
+ stopPropagation: () => void;
9
+ target: ReactThreeTestInstance;
10
+ currentTarget: ReactThreeTestInstance;
11
+ sourceEvent: MockEventData;
12
+ [key: string]: any;
13
+ };
14
+ export declare type CreateOptions = CreateCanvasParameters & RenderProps<HTMLCanvasElement>;
15
+ export declare type Act = (cb: () => Promise<any>) => Promise<any>;
16
+ export declare type Renderer = {
17
+ scene: ReactThreeTestInstance;
18
+ unmount: () => Promise<void>;
19
+ getInstance: () => null | unknown;
20
+ update: (el: React.ReactNode) => Promise<void>;
21
+ toTree: () => Tree | undefined;
22
+ toGraph: () => SceneGraph | undefined;
23
+ fireEvent: (element: ReactThreeTestInstance, handler: string, data?: MockEventData) => Promise<any>;
24
+ advanceFrames: (frames: number, delta: number | number[]) => Promise<void>;
25
+ };
26
+ export interface SceneGraphItem {
27
+ type: string;
28
+ name: string;
29
+ children: SceneGraphItem[] | null;
30
+ }
31
+ export declare type SceneGraph = SceneGraphItem[];
32
+ export interface TreeNode {
33
+ type: string;
34
+ props: {
35
+ [key: string]: any;
36
+ };
37
+ children: TreeNode[];
38
+ }
39
+ export declare type Tree = TreeNode[];