angular-three 2.0.0-beta.26 → 2.0.0-beta.261
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 +221 -4
- package/esm2022/index.mjs +4 -12
- package/esm2022/lib/canvas.mjs +124 -196
- package/esm2022/lib/directives/args.mjs +46 -20
- package/esm2022/lib/dom/events.mjs +2 -2
- package/esm2022/lib/events.mjs +33 -31
- package/esm2022/lib/instance.mjs +43 -36
- package/esm2022/lib/loader.mjs +50 -32
- package/esm2022/lib/loop.mjs +28 -25
- package/esm2022/lib/portal.mjs +173 -193
- package/esm2022/lib/renderer/catalogue.mjs +3 -3
- package/esm2022/lib/renderer/constants.mjs +5 -6
- package/esm2022/lib/renderer/index.mjs +347 -231
- package/esm2022/lib/renderer/state.mjs +49 -0
- package/esm2022/lib/renderer/utils.mjs +94 -87
- package/esm2022/lib/roots.mjs +87 -76
- package/esm2022/lib/routed-scene.mjs +6 -7
- package/esm2022/lib/store.mjs +170 -194
- package/esm2022/lib/three-types.mjs +2 -2
- package/esm2022/lib/utils/apply-props.mjs +24 -28
- package/esm2022/lib/utils/attach.mjs +6 -6
- package/esm2022/lib/utils/before-render.mjs +23 -0
- package/esm2022/lib/utils/is.mjs +6 -5
- package/esm2022/lib/utils/make.mjs +19 -17
- package/esm2022/lib/utils/parameters.mjs +61 -0
- package/esm2022/lib/utils/resolve-ref.mjs +8 -0
- package/esm2022/lib/utils/signal-store.mjs +59 -60
- package/esm2022/lib/utils/update.mjs +6 -2
- package/fesm2022/angular-three.mjs +2012 -2432
- package/fesm2022/angular-three.mjs.map +1 -1
- package/index.d.ts +6 -11
- package/lib/canvas.d.ts +398 -53
- package/lib/directives/args.d.ts +14 -7
- package/lib/dom/events.d.ts +3 -3
- package/lib/events.d.ts +15 -15
- package/lib/instance.d.ts +25 -20
- package/lib/loader.d.ts +17 -7
- package/lib/loop.d.ts +10 -58
- package/lib/portal.d.ts +55 -48
- package/lib/renderer/catalogue.d.ts +7 -3
- package/lib/renderer/constants.d.ts +4 -5
- package/lib/renderer/index.d.ts +65 -4
- package/lib/renderer/state.d.ts +23 -0
- package/lib/renderer/utils.d.ts +8 -26
- package/lib/roots.d.ts +12 -6
- package/lib/store.d.ts +30 -33
- package/lib/three-types.d.ts +142 -145
- package/lib/utils/apply-props.d.ts +2 -3
- package/lib/utils/attach.d.ts +4 -4
- package/lib/utils/before-render.d.ts +10 -0
- package/lib/utils/is.d.ts +15 -14
- package/lib/utils/make.d.ts +10 -9
- package/lib/utils/parameters.d.ts +15 -0
- package/lib/utils/resolve-ref.d.ts +2 -0
- package/lib/utils/signal-store.d.ts +13 -4
- package/lib/utils/update.d.ts +1 -1
- package/metadata.json +1 -1
- package/package.json +30 -11
- package/web-types.json +1 -1
- package/esm2022/lib/before-render.mjs +0 -13
- package/esm2022/lib/directives/common.mjs +0 -41
- package/esm2022/lib/directives/key.mjs +0 -29
- package/esm2022/lib/directives/parent.mjs +0 -35
- package/esm2022/lib/directives/repeat.mjs +0 -17
- package/esm2022/lib/ref.mjs +0 -48
- package/esm2022/lib/renderer/store.mjs +0 -408
- package/esm2022/lib/utils/assert-injection-context.mjs +0 -14
- package/esm2022/lib/utils/create-injection-token.mjs +0 -47
- package/esm2022/lib/utils/safe-detect-changes.mjs +0 -17
- package/lib/before-render.d.ts +0 -6
- package/lib/directives/common.d.ts +0 -15
- package/lib/directives/key.d.ts +0 -10
- package/lib/directives/parent.d.ts +0 -11
- package/lib/directives/repeat.d.ts +0 -7
- package/lib/ref.d.ts +0 -8
- package/lib/renderer/store.d.ts +0 -67
- package/lib/utils/assert-injection-context.d.ts +0 -2
- package/lib/utils/create-injection-token.d.ts +0 -27
- package/lib/utils/safe-detect-changes.d.ts +0 -2
- package/plugin/README.md +0 -11
- package/plugin/generators.json +0 -49
- package/plugin/package.json +0 -6
- package/plugin/src/generators/init/compat.d.ts +0 -4
- package/plugin/src/generators/init/compat.js +0 -6
- package/plugin/src/generators/init/compat.js.map +0 -1
- package/plugin/src/generators/init/files/experience/experience.component.html__tmpl__ +0 -4
- package/plugin/src/generators/init/files/experience/experience.component.ts__tmpl__ +0 -18
- package/plugin/src/generators/init/generator.d.ts +0 -6
- package/plugin/src/generators/init/generator.js +0 -160
- package/plugin/src/generators/init/generator.js.map +0 -1
- package/plugin/src/generators/init/schema.json +0 -17
- package/plugin/src/generators/init-cannon/compat.d.ts +0 -2
- package/plugin/src/generators/init-cannon/compat.js +0 -6
- package/plugin/src/generators/init-cannon/compat.js.map +0 -1
- package/plugin/src/generators/init-cannon/generator.d.ts +0 -2
- package/plugin/src/generators/init-cannon/generator.js +0 -22
- package/plugin/src/generators/init-cannon/generator.js.map +0 -1
- package/plugin/src/generators/init-cannon/schema.json +0 -6
- package/plugin/src/generators/init-postprocessing/compat.d.ts +0 -2
- package/plugin/src/generators/init-postprocessing/compat.js +0 -6
- package/plugin/src/generators/init-postprocessing/compat.js.map +0 -1
- package/plugin/src/generators/init-postprocessing/generator.d.ts +0 -2
- package/plugin/src/generators/init-postprocessing/generator.js +0 -20
- package/plugin/src/generators/init-postprocessing/generator.js.map +0 -1
- package/plugin/src/generators/init-postprocessing/schema.json +0 -6
- package/plugin/src/generators/init-soba/compat.d.ts +0 -2
- package/plugin/src/generators/init-soba/compat.js +0 -6
- package/plugin/src/generators/init-soba/compat.js.map +0 -1
- package/plugin/src/generators/init-soba/generator.d.ts +0 -2
- package/plugin/src/generators/init-soba/generator.js +0 -26
- package/plugin/src/generators/init-soba/generator.js.map +0 -1
- package/plugin/src/generators/init-soba/schema.json +0 -6
- package/plugin/src/generators/utils.d.ts +0 -2
- package/plugin/src/generators/utils.js +0 -34
- package/plugin/src/generators/utils.js.map +0 -1
- package/plugin/src/generators/versions.d.ts +0 -12
- package/plugin/src/generators/versions.js +0 -16
- package/plugin/src/generators/versions.js.map +0 -1
- package/plugin/src/index.d.ts +0 -3
- package/plugin/src/index.js +0 -10
- package/plugin/src/index.js.map +0 -1
package/lib/store.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export type NgtRenderer = {
|
|
10
|
-
render: (scene: THREE.Scene, camera: THREE.Camera) => any;
|
|
1
|
+
import { ElementRef, InjectOptions, InjectionToken } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { Camera, Clock, EventDispatcher, Object3D, Raycaster, Scene, Vector2, Vector3, WebGLRenderer } from 'three';
|
|
4
|
+
import { NgtCamera, NgtDomEvent, NgtEventManager, NgtPointerCaptureTarget, NgtThreeEvent } from './events';
|
|
5
|
+
import { NgtInstanceNode } from './instance';
|
|
6
|
+
import { NgtSignalStore } from './utils/signal-store';
|
|
7
|
+
export type NgtRendererLike = {
|
|
8
|
+
render: (scene: Scene, camera: Camera) => any;
|
|
11
9
|
};
|
|
12
10
|
export type NgtCameraManual = NgtCamera & {
|
|
13
11
|
manual?: boolean;
|
|
@@ -61,27 +59,25 @@ export type NgtInternalState = {
|
|
|
61
59
|
priority: number;
|
|
62
60
|
frames: number;
|
|
63
61
|
lastEvent: ElementRef<NgtDomEvent | null>;
|
|
64
|
-
interaction:
|
|
62
|
+
interaction: Object3D[];
|
|
65
63
|
hovered: Map<string, NgtThreeEvent<NgtDomEvent>>;
|
|
66
|
-
capturedMap: Map<number, Map<
|
|
64
|
+
capturedMap: Map<number, Map<Object3D, NgtPointerCaptureTarget>>;
|
|
67
65
|
initialClick: [x: number, y: number];
|
|
68
|
-
initialHits:
|
|
66
|
+
initialHits: Object3D[];
|
|
69
67
|
subscribers: NgtBeforeRenderRecord[];
|
|
70
68
|
subscribe: (callback: NgtBeforeRenderRecord['callback'], priority?: number, store?: NgtSignalStore<NgtState>) => () => void;
|
|
71
69
|
};
|
|
72
70
|
export type NgtState = {
|
|
73
|
-
/** when all building blocks are initialized */
|
|
74
|
-
ready: boolean;
|
|
75
71
|
/** The instance of the renderer */
|
|
76
|
-
gl:
|
|
72
|
+
gl: WebGLRenderer;
|
|
77
73
|
/** Default camera */
|
|
78
74
|
camera: NgtCameraManual;
|
|
79
75
|
/** Default scene */
|
|
80
|
-
scene:
|
|
76
|
+
scene: Scene;
|
|
81
77
|
/** Default raycaster */
|
|
82
|
-
raycaster:
|
|
78
|
+
raycaster: Raycaster;
|
|
83
79
|
/** Default clock */
|
|
84
|
-
clock:
|
|
80
|
+
clock: Clock;
|
|
85
81
|
/** Event layer interface, contains the event handler and the node they're connected to */
|
|
86
82
|
events: NgtEventManager<any>;
|
|
87
83
|
/** XR interface */
|
|
@@ -90,11 +86,11 @@ export type NgtState = {
|
|
|
90
86
|
disconnect: () => void;
|
|
91
87
|
};
|
|
92
88
|
/** Currently used controls */
|
|
93
|
-
controls:
|
|
89
|
+
controls: EventDispatcher | null;
|
|
94
90
|
/** Normalized event coordinates */
|
|
95
|
-
pointer:
|
|
91
|
+
pointer: Vector2;
|
|
96
92
|
legacy: boolean;
|
|
97
|
-
/** Shortcut to gl.outputColorSpace =
|
|
93
|
+
/** Shortcut to gl.outputColorSpace = LinearSRGBColorSpace */
|
|
98
94
|
linear: boolean;
|
|
99
95
|
/** Shortcut to gl.toneMapping = NoTonemapping */
|
|
100
96
|
flat: boolean;
|
|
@@ -106,7 +102,7 @@ export type NgtState = {
|
|
|
106
102
|
size: NgtSize;
|
|
107
103
|
/** Reactive size of the viewport in threejs units */
|
|
108
104
|
viewport: NgtViewport & {
|
|
109
|
-
getCurrentViewport: (camera?: NgtCamera, target?:
|
|
105
|
+
getCurrentViewport: (camera?: NgtCamera, target?: Vector3 | Parameters<Vector3['set']>, size?: NgtSize) => Omit<NgtViewport, 'dpr' | 'initialDpr'>;
|
|
110
106
|
};
|
|
111
107
|
/** Flags the canvas for render, but doesn't render in itself */
|
|
112
108
|
invalidate: (frames?: number) => void;
|
|
@@ -125,19 +121,20 @@ export type NgtState = {
|
|
|
125
121
|
/** When the canvas was clicked but nothing was hit */
|
|
126
122
|
/** PointerMissed Observable */
|
|
127
123
|
pointerMissed$: Observable<MouseEvent>;
|
|
128
|
-
/** If this state model is
|
|
124
|
+
/** If this state model is layered (via createPortal) then this contains the previous layer */
|
|
129
125
|
previousRoot: NgtSignalStore<NgtState> | null;
|
|
130
126
|
/** Internals */
|
|
131
127
|
internal: NgtInternalState;
|
|
132
128
|
};
|
|
133
|
-
declare function storeFactory(
|
|
134
|
-
export type NgtStore = ReturnType<typeof storeFactory>;
|
|
129
|
+
declare function storeFactory(previousStore: NgtSignalStore<NgtState> | null): NgtSignalStore<NgtState>;
|
|
135
130
|
export declare const NGT_STORE: InjectionToken<NgtSignalStore<NgtState>>;
|
|
136
|
-
export declare
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
131
|
+
export declare function provideStore(store?: () => NgtSignalStore<NgtState>): {
|
|
132
|
+
provide: InjectionToken<NgtSignalStore<NgtState>>;
|
|
133
|
+
useFactory: typeof storeFactory;
|
|
134
|
+
};
|
|
135
|
+
export declare function injectStore(options: InjectOptions & {
|
|
136
|
+
optional?: false;
|
|
137
|
+
}): NgtSignalStore<NgtState>;
|
|
138
|
+
export declare function injectStore(options: InjectOptions): NgtSignalStore<NgtState> | null;
|
|
139
|
+
export declare function injectStore(): NgtSignalStore<NgtState>;
|
|
143
140
|
export {};
|
package/lib/three-types.d.ts
CHANGED
|
@@ -1,46 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { AmbientLight, ArrayCamera, ArrowHelper, Audio, AxesHelper, Bone, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CircleGeometry, Color, ColorRepresentation, CompressedTexture, ConeGeometry, CubeCamera, CubeTexture, CylinderGeometry, Data3DTexture, DataTexture, DepthTexture, DirectionalLight, DirectionalLightHelper, DirectionalLightShadow, DodecahedronGeometry, EdgesGeometry, Euler, ExtrudeGeometry, Float16BufferAttribute, Float32BufferAttribute, Fog, FogExp2, GridHelper, Group, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, InstancedBufferAttribute, InstancedBufferGeometry, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, LOD, LatheGeometry, Layers, Light, LightProbe, LightShadow, Line, LineBasicMaterial, LineBasicMaterialParameters, LineDashedMaterial, LineDashedMaterialParameters, LineLoop, LineSegments, Material, Matrix3, Matrix4, Mesh, MeshBasicMaterial, MeshBasicMaterialParameters, MeshDepthMaterial, MeshDepthMaterialParameters, MeshDistanceMaterial, MeshDistanceMaterialParameters, MeshLambertMaterial, MeshLambertMaterialParameters, MeshMatcapMaterial, MeshMatcapMaterialParameters, MeshNormalMaterial, MeshNormalMaterialParameters, MeshPhongMaterial, MeshPhongMaterialParameters, MeshPhysicalMaterial, MeshPhysicalMaterialParameters, MeshStandardMaterial, MeshStandardMaterialParameters, MeshToonMaterial, MeshToonMaterialParameters, Object3D, OctahedronGeometry, OrthographicCamera, PerspectiveCamera, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PointsMaterialParameters, PolarGridHelper, PolyhedronGeometry, PositionalAudio, Quaternion, RawShaderMaterial, Raycaster, RectAreaLight, RingGeometry, Scene, ShaderMaterial, ShaderMaterialParameters, ShadowMaterial, Shape, ShapeGeometry, Skeleton, SkeletonHelper, SkinnedMesh, SphereGeometry, SpotLight, SpotLightHelper, SpotLightShadow, Sprite, SpriteMaterial, SpriteMaterialParameters, TetrahedronGeometry, Texture, TorusGeometry, TorusKnotGeometry, TubeGeometry, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Vector2, Vector3, Vector4, VideoTexture, WireframeGeometry } from 'three';
|
|
2
|
+
import { NgtEventHandlers } from './events';
|
|
3
|
+
import { NgtAfterAttach, NgtAttachFunction, NgtInstanceNode } from './instance';
|
|
4
|
+
import { NgtBeforeRenderEvent } from './store';
|
|
5
|
+
type Expand<T> = T extends infer O ? {
|
|
6
|
+
[K in keyof O]: O[K];
|
|
7
|
+
} : never;
|
|
5
8
|
type NoEvent<T> = Omit<T, 'addEventListener' | 'removeEventListener'>;
|
|
6
9
|
export type NgtNonFunctionKeys<T> = {
|
|
7
10
|
[K in keyof T]-?: T[K] extends Function ? never : K;
|
|
8
11
|
}[keyof T];
|
|
9
12
|
export type NgtOverwrite<T, O> = Omit<T, NgtNonFunctionKeys<O>> & O;
|
|
10
13
|
export type NgtExtendedColors<T> = {
|
|
11
|
-
[K in keyof T]: T[K] extends
|
|
14
|
+
[K in keyof T]: T[K] extends Color | undefined ? ColorRepresentation : T[K];
|
|
12
15
|
};
|
|
13
16
|
/**
|
|
14
17
|
* If **T** contains a constructor, @see ConstructorParameters must be used, otherwise **T**.
|
|
15
18
|
*/
|
|
16
|
-
type
|
|
17
|
-
export type NgtEuler =
|
|
18
|
-
export type NgtMatrix4 =
|
|
19
|
+
type NgtArguments<T> = T extends new (...args: any) => any ? ConstructorParameters<T> : T;
|
|
20
|
+
export type NgtEuler = Euler | Parameters<Euler['set']>;
|
|
21
|
+
export type NgtMatrix4 = Matrix4 | Parameters<Matrix4['set']> | Readonly<Matrix4['set']>;
|
|
19
22
|
/**
|
|
20
|
-
* Turn an implementation of
|
|
23
|
+
* Turn an implementation of Vector in to the type that an r3f component would accept as a prop.
|
|
21
24
|
*/
|
|
22
|
-
type NgtVectorLike<VectorClass extends
|
|
23
|
-
export type NgtVector2 = NgtVectorLike<
|
|
24
|
-
export type NgtVector3 = NgtVectorLike<
|
|
25
|
-
export type NgtVector4 = NgtVectorLike<
|
|
26
|
-
export type NgtLayers =
|
|
27
|
-
export type NgtQuaternion =
|
|
25
|
+
type NgtVectorLike<VectorClass extends Vector2 | Vector3 | Vector4> = VectorClass | Parameters<VectorClass['set']> | Readonly<Parameters<VectorClass['set']>> | Parameters<VectorClass['setScalar']>[0];
|
|
26
|
+
export type NgtVector2 = NgtVectorLike<Vector2>;
|
|
27
|
+
export type NgtVector3 = NgtVectorLike<Vector3>;
|
|
28
|
+
export type NgtVector4 = NgtVectorLike<Vector4>;
|
|
29
|
+
export type NgtLayers = Layers | Parameters<Layers['set']>[0];
|
|
30
|
+
export type NgtQuaternion = Quaternion | Parameters<Quaternion['set']>;
|
|
28
31
|
export interface NgtNodeEventMap<TOriginal> {
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
attached: NgtAfterAttach<NgtInstanceNode, TOriginal>;
|
|
33
|
+
updated: TOriginal;
|
|
31
34
|
beforeRender: NgtBeforeRenderEvent<TOriginal>;
|
|
32
35
|
}
|
|
33
36
|
export type NgtNodeElement<TOriginal, TConstructor> = {
|
|
34
37
|
attach: string | string[] | NgtAttachFunction;
|
|
35
38
|
addEventListener<TEventKey extends keyof NgtNodeEventMap<TOriginal>>(type: TEventKey, listener: (this: NgtNodeElement<TOriginal, TConstructor>, ev: NgtNodeEventMap<TOriginal>[TEventKey]) => any): void;
|
|
36
39
|
removeEventListener<TEventKey extends keyof NgtNodeEventMap<TOriginal>>(type: TEventKey, listener: (this: NgtNodeElement<TOriginal, TConstructor>, ev: NgtNodeEventMap<TOriginal>[TEventKey]) => any): void;
|
|
37
|
-
__ngt_args__:
|
|
40
|
+
__ngt_args__: NgtArguments<TConstructor>;
|
|
38
41
|
};
|
|
39
|
-
export type NgtNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = NgtExtendedColors<NgtOverwrite<Partial<TNoEvent>, NgtNodeElement<TOriginal, TConstructor
|
|
42
|
+
export type NgtNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = Expand<NgtExtendedColors<NgtOverwrite<Partial<TNoEvent>, NgtNodeElement<TOriginal, TConstructor>>>>;
|
|
40
43
|
export type NgtObject3DEventsMap = {
|
|
41
44
|
[TEvent in keyof NgtEventHandlers]-?: Parameters<NonNullable<NgtEventHandlers[TEvent]>>[0];
|
|
42
45
|
};
|
|
43
|
-
export type NgtObject3DNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = NgtOverwrite<NgtNode<TOriginal, TConstructor, TNoEvent>, {
|
|
46
|
+
export type NgtObject3DNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = Expand<NgtOverwrite<NgtNode<TOriginal, TConstructor, TNoEvent>, {
|
|
44
47
|
position: NgtVector3;
|
|
45
48
|
up: NgtVector3;
|
|
46
49
|
scale: NgtVector3;
|
|
@@ -51,132 +54,129 @@ export type NgtObject3DNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOrigina
|
|
|
51
54
|
dispose: (() => void) | null;
|
|
52
55
|
addEventListener<TEventKey extends keyof NgtObject3DEventsMap>(type: TEventKey, listener: (this: NgtObject3DNode<TOriginal, TConstructor>, ev: NgtObject3DEventsMap[TEventKey]) => any): void;
|
|
53
56
|
removeEventListener<TEventKey extends keyof NgtObject3DEventsMap>(type: TEventKey, listener: (this: NgtObject3DNode<TOriginal, TConstructor>, ev: NgtObject3DEventsMap[TEventKey]) => any): void;
|
|
54
|
-
}
|
|
55
|
-
export type NgtGeometry<TGeometry extends
|
|
56
|
-
export type NgtMaterial<TMaterial extends
|
|
57
|
-
export type NgtLight<T extends
|
|
58
|
-
export type NgtObject3D = NgtObject3DNode<
|
|
59
|
-
export type NgtAudio = NgtObject3DNode<
|
|
60
|
-
export type NgtAudioListener = NgtObject3DNode<
|
|
61
|
-
export type NgtPositionalAudio = NgtObject3DNode<
|
|
62
|
-
export type NgtMesh = NgtObject3DNode<
|
|
63
|
-
export type NgtInstancedMesh = NgtObject3DNode<
|
|
64
|
-
export type NgtScene = NgtObject3DNode<
|
|
65
|
-
export type NgtSprite = NgtObject3DNode<
|
|
66
|
-
export type NgtLOD = NgtObject3DNode<
|
|
67
|
-
export type NgtSkinnedMesh = NgtObject3DNode<
|
|
68
|
-
export type NgtSkeleton = NgtObject3DNode<
|
|
69
|
-
export type NgtBone = NgtObject3DNode<
|
|
70
|
-
export type NgtLine = NgtObject3DNode<
|
|
71
|
-
export type NgtLineSegments = NgtObject3DNode<
|
|
72
|
-
export type NgtLineLoop = NgtObject3DNode<
|
|
73
|
-
export type NgtPoints = NgtObject3DNode<
|
|
74
|
-
export type NgtGroup = NgtObject3DNode<
|
|
75
|
-
export type NgtCameraNode = NgtObject3DNode<
|
|
76
|
-
export type NgtPerspectiveCamera = NgtObject3DNode<
|
|
77
|
-
export type NgtOrthographicCamera = NgtObject3DNode<
|
|
78
|
-
export type NgtCubeCamera = NgtObject3DNode<
|
|
79
|
-
export type NgtArrayCamera = NgtObject3DNode<
|
|
80
|
-
export type NgtInstancedBufferGeometry = NgtGeometry<
|
|
81
|
-
export type NgtBufferGeometry = NgtGeometry<
|
|
82
|
-
export type NgtWireframeGeometry = NgtGeometry<
|
|
83
|
-
export type NgtTetrahedronGeometry = NgtGeometry<
|
|
84
|
-
export type NgtOctahedronGeometry = NgtGeometry<
|
|
85
|
-
export type NgtIcosahedronGeometry = NgtGeometry<
|
|
86
|
-
export type NgtDodecahedronGeometry = NgtGeometry<
|
|
87
|
-
export type NgtPolyhedronGeometry = NgtGeometry<
|
|
88
|
-
export type NgtTubeGeometry = NgtGeometry<
|
|
89
|
-
export type NgtTorusKnotGeometry = NgtGeometry<
|
|
90
|
-
export type NgtTorusGeometry = NgtGeometry<
|
|
91
|
-
export type NgtSphereGeometry = NgtGeometry<
|
|
92
|
-
export type NgtRingGeometry = NgtGeometry<
|
|
93
|
-
export type NgtPlaneGeometry = NgtGeometry<
|
|
94
|
-
export type NgtLatheGeometry = NgtGeometry<
|
|
95
|
-
export type NgtShapeGeometry = NgtGeometry<
|
|
96
|
-
export type NgtExtrudeGeometry = NgtGeometry<
|
|
97
|
-
export type NgtEdgesGeometry = NgtGeometry<
|
|
98
|
-
export type NgtConeGeometry = NgtGeometry<
|
|
99
|
-
export type NgtCylinderGeometry = NgtGeometry<
|
|
100
|
-
export type NgtCircleGeometry = NgtGeometry<
|
|
101
|
-
export type NgtBoxGeometry = NgtGeometry<
|
|
102
|
-
export type NgtCapsuleGeometry = NgtGeometry<
|
|
103
|
-
export type NgtShadowMaterial = NgtMaterial<
|
|
104
|
-
export type NgtSpriteMaterial = NgtMaterial<
|
|
105
|
-
export type NgtRawShaderMaterial = NgtMaterial<
|
|
106
|
-
export type NgtShaderMaterial = NgtMaterial<
|
|
107
|
-
export type NgtPointsMaterial = NgtMaterial<
|
|
108
|
-
export type NgtMeshPhysicalMaterial = NgtMaterial<
|
|
109
|
-
export type NgtMeshStandardMaterial = NgtMaterial<
|
|
110
|
-
export type NgtMeshPhongMaterial = NgtMaterial<
|
|
111
|
-
export type NgtMeshToonMaterial = NgtMaterial<
|
|
112
|
-
export type NgtMeshNormalMaterial = NgtMaterial<
|
|
113
|
-
export type NgtMeshLambertMaterial = NgtMaterial<
|
|
114
|
-
export type NgtMeshDepthMaterial = NgtMaterial<
|
|
115
|
-
export type NgtMeshDistanceMaterial = NgtMaterial<
|
|
116
|
-
export type NgtMeshBasicMaterial = NgtMaterial<
|
|
117
|
-
export type NgtMeshMatcapMaterial = NgtMaterial<
|
|
118
|
-
export type NgtLineDashedMaterial = NgtMaterial<
|
|
119
|
-
export type NgtLineBasicMaterial = NgtMaterial<
|
|
57
|
+
}>>;
|
|
58
|
+
export type NgtGeometry<TGeometry extends BufferGeometry, TConstructor> = NgtNode<TGeometry, TConstructor>;
|
|
59
|
+
export type NgtMaterial<TMaterial extends Material, TConstructor> = NgtNode<TMaterial, TConstructor>;
|
|
60
|
+
export type NgtLight<T extends Light, P> = NgtObject3DNode<T, P>;
|
|
61
|
+
export type NgtObject3D = NgtObject3DNode<Object3D, typeof Object3D>;
|
|
62
|
+
export type NgtAudio = NgtObject3DNode<Audio, typeof Audio>;
|
|
63
|
+
export type NgtAudioListener = NgtObject3DNode<AudioListener, typeof AudioListener>;
|
|
64
|
+
export type NgtPositionalAudio = NgtObject3DNode<PositionalAudio, typeof PositionalAudio>;
|
|
65
|
+
export type NgtMesh = NgtObject3DNode<Mesh, typeof Mesh>;
|
|
66
|
+
export type NgtInstancedMesh = NgtObject3DNode<InstancedMesh, typeof InstancedMesh>;
|
|
67
|
+
export type NgtScene = NgtObject3DNode<Scene, typeof Scene>;
|
|
68
|
+
export type NgtSprite = NgtObject3DNode<Sprite, typeof Sprite>;
|
|
69
|
+
export type NgtLOD = NgtObject3DNode<LOD, typeof LOD>;
|
|
70
|
+
export type NgtSkinnedMesh = NgtObject3DNode<SkinnedMesh, typeof SkinnedMesh>;
|
|
71
|
+
export type NgtSkeleton = NgtObject3DNode<Skeleton, typeof Skeleton>;
|
|
72
|
+
export type NgtBone = NgtObject3DNode<Bone, typeof Bone>;
|
|
73
|
+
export type NgtLine = NgtObject3DNode<Line, typeof Line>;
|
|
74
|
+
export type NgtLineSegments = NgtObject3DNode<LineSegments, typeof LineSegments>;
|
|
75
|
+
export type NgtLineLoop = NgtObject3DNode<LineLoop, typeof LineLoop>;
|
|
76
|
+
export type NgtPoints = NgtObject3DNode<Points, typeof Points>;
|
|
77
|
+
export type NgtGroup = NgtObject3DNode<Group, typeof Group>;
|
|
78
|
+
export type NgtCameraNode = NgtObject3DNode<Camera, typeof Camera>;
|
|
79
|
+
export type NgtPerspectiveCamera = NgtObject3DNode<PerspectiveCamera, typeof PerspectiveCamera>;
|
|
80
|
+
export type NgtOrthographicCamera = NgtObject3DNode<OrthographicCamera, typeof OrthographicCamera>;
|
|
81
|
+
export type NgtCubeCamera = NgtObject3DNode<CubeCamera, typeof CubeCamera>;
|
|
82
|
+
export type NgtArrayCamera = NgtObject3DNode<ArrayCamera, typeof ArrayCamera>;
|
|
83
|
+
export type NgtInstancedBufferGeometry = NgtGeometry<InstancedBufferGeometry, typeof InstancedBufferGeometry>;
|
|
84
|
+
export type NgtBufferGeometry = NgtGeometry<BufferGeometry, typeof BufferGeometry>;
|
|
85
|
+
export type NgtWireframeGeometry = NgtGeometry<WireframeGeometry, typeof WireframeGeometry>;
|
|
86
|
+
export type NgtTetrahedronGeometry = NgtGeometry<TetrahedronGeometry, typeof TetrahedronGeometry>;
|
|
87
|
+
export type NgtOctahedronGeometry = NgtGeometry<OctahedronGeometry, typeof OctahedronGeometry>;
|
|
88
|
+
export type NgtIcosahedronGeometry = NgtGeometry<IcosahedronGeometry, typeof IcosahedronGeometry>;
|
|
89
|
+
export type NgtDodecahedronGeometry = NgtGeometry<DodecahedronGeometry, typeof DodecahedronGeometry>;
|
|
90
|
+
export type NgtPolyhedronGeometry = NgtGeometry<PolyhedronGeometry, typeof PolyhedronGeometry>;
|
|
91
|
+
export type NgtTubeGeometry = NgtGeometry<TubeGeometry, typeof TubeGeometry>;
|
|
92
|
+
export type NgtTorusKnotGeometry = NgtGeometry<TorusKnotGeometry, typeof TorusKnotGeometry>;
|
|
93
|
+
export type NgtTorusGeometry = NgtGeometry<TorusGeometry, typeof TorusGeometry>;
|
|
94
|
+
export type NgtSphereGeometry = NgtGeometry<SphereGeometry, typeof SphereGeometry>;
|
|
95
|
+
export type NgtRingGeometry = NgtGeometry<RingGeometry, typeof RingGeometry>;
|
|
96
|
+
export type NgtPlaneGeometry = NgtGeometry<PlaneGeometry, typeof PlaneGeometry>;
|
|
97
|
+
export type NgtLatheGeometry = NgtGeometry<LatheGeometry, typeof LatheGeometry>;
|
|
98
|
+
export type NgtShapeGeometry = NgtGeometry<ShapeGeometry, typeof ShapeGeometry>;
|
|
99
|
+
export type NgtExtrudeGeometry = NgtGeometry<ExtrudeGeometry, typeof ExtrudeGeometry>;
|
|
100
|
+
export type NgtEdgesGeometry = NgtGeometry<EdgesGeometry, typeof EdgesGeometry>;
|
|
101
|
+
export type NgtConeGeometry = NgtGeometry<ConeGeometry, typeof ConeGeometry>;
|
|
102
|
+
export type NgtCylinderGeometry = NgtGeometry<CylinderGeometry, typeof CylinderGeometry>;
|
|
103
|
+
export type NgtCircleGeometry = NgtGeometry<CircleGeometry, typeof CircleGeometry>;
|
|
104
|
+
export type NgtBoxGeometry = NgtGeometry<BoxGeometry, typeof BoxGeometry>;
|
|
105
|
+
export type NgtCapsuleGeometry = NgtGeometry<CapsuleGeometry, typeof CapsuleGeometry>;
|
|
106
|
+
export type NgtShadowMaterial = NgtMaterial<ShadowMaterial, [ShaderMaterialParameters]>;
|
|
107
|
+
export type NgtSpriteMaterial = NgtMaterial<SpriteMaterial, [SpriteMaterialParameters]>;
|
|
108
|
+
export type NgtRawShaderMaterial = NgtMaterial<RawShaderMaterial, [ShaderMaterialParameters]>;
|
|
109
|
+
export type NgtShaderMaterial = NgtMaterial<ShaderMaterial, [ShaderMaterialParameters]>;
|
|
110
|
+
export type NgtPointsMaterial = NgtMaterial<PointsMaterial, [PointsMaterialParameters]>;
|
|
111
|
+
export type NgtMeshPhysicalMaterial = NgtMaterial<MeshPhysicalMaterial, [MeshPhysicalMaterialParameters]>;
|
|
112
|
+
export type NgtMeshStandardMaterial = NgtMaterial<MeshStandardMaterial, [MeshStandardMaterialParameters]>;
|
|
113
|
+
export type NgtMeshPhongMaterial = NgtMaterial<MeshPhongMaterial, [MeshPhongMaterialParameters]>;
|
|
114
|
+
export type NgtMeshToonMaterial = NgtMaterial<MeshToonMaterial, [MeshToonMaterialParameters]>;
|
|
115
|
+
export type NgtMeshNormalMaterial = NgtMaterial<MeshNormalMaterial, [MeshNormalMaterialParameters]>;
|
|
116
|
+
export type NgtMeshLambertMaterial = NgtMaterial<MeshLambertMaterial, [MeshLambertMaterialParameters]>;
|
|
117
|
+
export type NgtMeshDepthMaterial = NgtMaterial<MeshDepthMaterial, [MeshDepthMaterialParameters]>;
|
|
118
|
+
export type NgtMeshDistanceMaterial = NgtMaterial<MeshDistanceMaterial, [MeshDistanceMaterialParameters]>;
|
|
119
|
+
export type NgtMeshBasicMaterial = NgtMaterial<MeshBasicMaterial, [MeshBasicMaterialParameters]>;
|
|
120
|
+
export type NgtMeshMatcapMaterial = NgtMaterial<MeshMatcapMaterial, [MeshMatcapMaterialParameters]>;
|
|
121
|
+
export type NgtLineDashedMaterial = NgtMaterial<LineDashedMaterial, [LineDashedMaterialParameters]>;
|
|
122
|
+
export type NgtLineBasicMaterial = NgtMaterial<LineBasicMaterial, [LineBasicMaterialParameters]>;
|
|
120
123
|
export type NgtPrimitive = NgtNodeElement<any, any>;
|
|
121
124
|
export type NgtValue = NgtNode<{
|
|
122
125
|
rawValue: any;
|
|
123
126
|
}, {}>;
|
|
124
|
-
export type NgtLightShadow = NgtNode<
|
|
125
|
-
export type NgtSpotLightShadow = NgtNode<
|
|
126
|
-
export type NgtDirectionalLightShadow = NgtNode<
|
|
127
|
-
export type NgtSpotLight = NgtLight<
|
|
128
|
-
export type NgtPointLight = NgtLight<
|
|
129
|
-
export type NgtRectAreaLight = NgtLight<
|
|
130
|
-
export type NgtHemisphereLight = NgtLight<
|
|
131
|
-
export type NgtDirectionalLight = NgtLight<
|
|
132
|
-
export type NgtAmbientLight = NgtLight<
|
|
133
|
-
export type
|
|
134
|
-
export type
|
|
135
|
-
export type
|
|
136
|
-
export type
|
|
137
|
-
export type
|
|
138
|
-
export type
|
|
139
|
-
export type
|
|
140
|
-
export type
|
|
141
|
-
export type
|
|
142
|
-
export type
|
|
143
|
-
export type
|
|
144
|
-
export type
|
|
145
|
-
export type
|
|
146
|
-
export type
|
|
147
|
-
export type
|
|
148
|
-
export type
|
|
149
|
-
export type
|
|
150
|
-
export type
|
|
151
|
-
export type
|
|
152
|
-
export type
|
|
153
|
-
export type
|
|
154
|
-
export type
|
|
155
|
-
export type
|
|
156
|
-
export type
|
|
157
|
-
export type
|
|
158
|
-
export type
|
|
159
|
-
export type
|
|
160
|
-
export type
|
|
161
|
-
export type
|
|
162
|
-
export type
|
|
163
|
-
export type
|
|
164
|
-
export type
|
|
165
|
-
export type
|
|
166
|
-
export type
|
|
167
|
-
export type
|
|
168
|
-
export type
|
|
169
|
-
export type
|
|
170
|
-
export type
|
|
171
|
-
export type
|
|
172
|
-
export type
|
|
173
|
-
export type
|
|
174
|
-
export type
|
|
175
|
-
export type
|
|
176
|
-
export type
|
|
177
|
-
export type NgtFog = NgtNode<THREE.Fog, typeof THREE.Fog>;
|
|
178
|
-
export type NgtFogExp2 = NgtNode<THREE.FogExp2, typeof THREE.FogExp2>;
|
|
179
|
-
export type NgtShape = NgtNode<THREE.Shape, typeof THREE.Shape>;
|
|
127
|
+
export type NgtLightShadow = NgtNode<LightShadow, typeof LightShadow>;
|
|
128
|
+
export type NgtSpotLightShadow = NgtNode<SpotLightShadow, typeof SpotLightShadow>;
|
|
129
|
+
export type NgtDirectionalLightShadow = NgtNode<DirectionalLightShadow, typeof DirectionalLightShadow>;
|
|
130
|
+
export type NgtSpotLight = NgtLight<SpotLight, typeof SpotLight>;
|
|
131
|
+
export type NgtPointLight = NgtLight<PointLight, typeof PointLight>;
|
|
132
|
+
export type NgtRectAreaLight = NgtLight<RectAreaLight, typeof RectAreaLight>;
|
|
133
|
+
export type NgtHemisphereLight = NgtLight<HemisphereLight, typeof HemisphereLight>;
|
|
134
|
+
export type NgtDirectionalLight = NgtLight<DirectionalLight, typeof DirectionalLight>;
|
|
135
|
+
export type NgtAmbientLight = NgtLight<AmbientLight, typeof AmbientLight>;
|
|
136
|
+
export type NgtLightProbe = NgtLight<LightProbe, typeof LightProbe>;
|
|
137
|
+
export type NgtSpotLightHelper = NgtObject3DNode<SpotLightHelper, typeof SpotLightHelper>;
|
|
138
|
+
export type NgtSkeletonHelper = NgtObject3DNode<SkeletonHelper, typeof SkeletonHelper>;
|
|
139
|
+
export type NgtPointLightHelper = NgtObject3DNode<PointLightHelper, typeof PointLightHelper>;
|
|
140
|
+
export type NgtHemisphereLightHelper = NgtObject3DNode<HemisphereLightHelper, typeof HemisphereLightHelper>;
|
|
141
|
+
export type NgtGridHelper = NgtObject3DNode<GridHelper, typeof GridHelper>;
|
|
142
|
+
export type NgtPolarGridHelper = NgtObject3DNode<PolarGridHelper, typeof PolarGridHelper>;
|
|
143
|
+
export type NgtDirectionalLightHelper = NgtObject3DNode<DirectionalLightHelper, typeof DirectionalLightHelper>;
|
|
144
|
+
export type NgtCameraHelper = NgtObject3DNode<CameraHelper, typeof CameraHelper>;
|
|
145
|
+
export type NgtBoxHelper = NgtObject3DNode<BoxHelper, typeof BoxHelper>;
|
|
146
|
+
export type NgtBox3Helper = NgtObject3DNode<Box3Helper, typeof Box3Helper>;
|
|
147
|
+
export type NgtPlaneHelper = NgtObject3DNode<PlaneHelper, typeof PlaneHelper>;
|
|
148
|
+
export type NgtArrowHelper = NgtObject3DNode<ArrowHelper, typeof ArrowHelper>;
|
|
149
|
+
export type NgtAxesHelper = NgtObject3DNode<AxesHelper, typeof AxesHelper>;
|
|
150
|
+
export type NgtTexture = NgtNode<Texture, typeof Texture>;
|
|
151
|
+
export type NgtVideoTexture = NgtNode<VideoTexture, typeof VideoTexture>;
|
|
152
|
+
export type NgtDataTexture = NgtNode<DataTexture, typeof DataTexture>;
|
|
153
|
+
export type NgtData3DTexture = NgtNode<Data3DTexture, typeof Data3DTexture>;
|
|
154
|
+
export type NgtCompressedTexture = NgtNode<CompressedTexture, typeof CompressedTexture>;
|
|
155
|
+
export type NgtCubeTexture = NgtNode<CubeTexture, typeof CubeTexture>;
|
|
156
|
+
export type NgtCanvasTexture = NgtNode<CanvasTexture, typeof CanvasTexture>;
|
|
157
|
+
export type NgtDepthTexture = NgtNode<DepthTexture, typeof DepthTexture>;
|
|
158
|
+
export type NgtRaycaster = NgtNode<Raycaster, typeof Raycaster>;
|
|
159
|
+
export type NgtVector2Node = NgtNode<Vector2, typeof Vector2>;
|
|
160
|
+
export type NgtVector3Node = NgtNode<Vector3, typeof Vector3>;
|
|
161
|
+
export type NgtVector4Node = NgtNode<Vector4, typeof Vector4>;
|
|
162
|
+
export type NgtEulerNode = NgtNode<Euler, typeof Euler>;
|
|
163
|
+
export type NgtMatrix3Node = NgtNode<Matrix3, typeof Matrix3>;
|
|
164
|
+
export type NgtMatrix4Node = NgtNode<Matrix4, typeof Matrix4>;
|
|
165
|
+
export type NgtQuaternionNode = NgtNode<Quaternion, typeof Quaternion>;
|
|
166
|
+
export type NgtBufferAttribute = NgtNode<BufferAttribute, typeof BufferAttribute>;
|
|
167
|
+
export type NgtFloat16BufferAttribute = NgtNode<Float16BufferAttribute, typeof Float16BufferAttribute>;
|
|
168
|
+
export type NgtFloat32BufferAttribute = NgtNode<Float32BufferAttribute, typeof Float32BufferAttribute>;
|
|
169
|
+
export type NgtInt8BufferAttribute = NgtNode<Int8BufferAttribute, typeof Int8BufferAttribute>;
|
|
170
|
+
export type NgtInt16BufferAttribute = NgtNode<Int16BufferAttribute, typeof Int16BufferAttribute>;
|
|
171
|
+
export type NgtInt32BufferAttribute = NgtNode<Int32BufferAttribute, typeof Int32BufferAttribute>;
|
|
172
|
+
export type NgtUint8BufferAttribute = NgtNode<Uint8BufferAttribute, typeof Uint8BufferAttribute>;
|
|
173
|
+
export type NgtUint16BufferAttribute = NgtNode<Uint16BufferAttribute, typeof Uint16BufferAttribute>;
|
|
174
|
+
export type NgtUint32BufferAttribute = NgtNode<Uint32BufferAttribute, typeof Uint32BufferAttribute>;
|
|
175
|
+
export type NgtInstancedBufferAttribute = NgtNode<InstancedBufferAttribute, typeof InstancedBufferAttribute>;
|
|
176
|
+
export type NgtColor = NgtNode<Color, ColorRepresentation>;
|
|
177
|
+
export type NgtFog = NgtNode<Fog, typeof Fog>;
|
|
178
|
+
export type NgtFogExp2 = NgtNode<FogExp2, typeof FogExp2>;
|
|
179
|
+
export type NgtShape = NgtNode<Shape, typeof Shape>;
|
|
180
180
|
export interface ThreeElements {
|
|
181
181
|
'ngt-object3D': NgtObject3D;
|
|
182
182
|
'ngt-audio': NgtAudio;
|
|
@@ -251,8 +251,6 @@ export interface ThreeElements {
|
|
|
251
251
|
'ngt-directional-light': NgtDirectionalLight;
|
|
252
252
|
'ngt-ambient-light': NgtAmbientLight;
|
|
253
253
|
'ngt-light-shadow': NgtLightShadow;
|
|
254
|
-
'ngt-ambient-light-probe': NgtAmbientLightProbe;
|
|
255
|
-
'ngt-hemisphere-light-probe': NgtHemisphereLightProbe;
|
|
256
254
|
'ngt-light-probe': NgtLightProbe;
|
|
257
255
|
'ngt-spot-light-helper': NgtSpotLightHelper;
|
|
258
256
|
'ngt-skeleton-helper': NgtSkeletonHelper;
|
|
@@ -286,7 +284,6 @@ export interface ThreeElements {
|
|
|
286
284
|
'ngt-buffer-attribute': NgtBufferAttribute;
|
|
287
285
|
'ngt-float16-buffer-attribute': NgtFloat16BufferAttribute;
|
|
288
286
|
'ngt-float32-buffer-attribute': NgtFloat32BufferAttribute;
|
|
289
|
-
'ngt-float64-buffer-attribute': NgtFloat64BufferAttribute;
|
|
290
287
|
'ngt-int8-buffer-attribute': NgtInt8BufferAttribute;
|
|
291
288
|
'ngt-int16-buffer-attribute': NgtInt16BufferAttribute;
|
|
292
289
|
'ngt-int32-buffer-attribute': NgtInt32BufferAttribute;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export declare function diffProps(instance: NgtAnyRecord, props: NgtAnyRecord): [key: string, value: unknown][];
|
|
1
|
+
import { NgtInstanceNode } from '../instance';
|
|
2
|
+
import { NgtAnyRecord } from '../types';
|
|
4
3
|
export declare function applyProps(instance: NgtInstanceNode, props: NgtAnyRecord): any;
|
package/lib/utils/attach.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { NgtAttachFunction } from '../instance';
|
|
2
|
+
import { NgtState } from '../store';
|
|
3
|
+
import { NgtAnyRecord } from '../types';
|
|
4
|
+
import { NgtSignalStore } from './signal-store';
|
|
5
5
|
export declare function attach(object: NgtAnyRecord, value: unknown, paths?: string[]): void;
|
|
6
6
|
export declare function detach(parent: NgtAnyRecord, child: NgtAnyRecord, attachProp: string[] | NgtAttachFunction): void;
|
|
7
7
|
export declare function createAttachFunction<TChild = any, TParent = any>(cb: (params: {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import { NgtBeforeRenderRecord } from '../store';
|
|
3
|
+
export declare function injectBeforeRender(cb: NgtBeforeRenderRecord['callback'], { priority, injector }?: {
|
|
4
|
+
priority?: number;
|
|
5
|
+
injector?: Injector;
|
|
6
|
+
}): () => void;
|
|
7
|
+
export declare function injectNextBeforeRender(cb: NgtBeforeRenderRecord['callback'], { priority, injector }?: {
|
|
8
|
+
priority?: number;
|
|
9
|
+
injector?: Injector;
|
|
10
|
+
}): import("@angular/core").Signal<(() => void) | null>;
|
package/lib/utils/is.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { BufferGeometry, Camera, Material, Object3D, OrthographicCamera, PerspectiveCamera, Scene, Texture } from 'three';
|
|
3
|
+
import { NgtInstanceNode } from '../instance';
|
|
4
|
+
import { NgtRendererLike } from '../store';
|
|
5
|
+
import { NgtEquConfig } from '../types';
|
|
5
6
|
export declare const is: {
|
|
6
7
|
obj: (a: unknown) => a is object;
|
|
7
|
-
material: (a: unknown) => a is
|
|
8
|
-
geometry: (a: unknown) => a is
|
|
9
|
-
orthographicCamera: (a: unknown) => a is
|
|
10
|
-
perspectiveCamera: (a: unknown) => a is
|
|
11
|
-
camera: (a: unknown) => a is
|
|
12
|
-
renderer: (a: unknown) =>
|
|
13
|
-
scene: (a: unknown) => a is
|
|
14
|
-
|
|
15
|
-
instance: (a: unknown) => a is
|
|
16
|
-
|
|
17
|
-
colorSpaceExist: <T extends
|
|
8
|
+
material: (a: unknown) => a is Material;
|
|
9
|
+
geometry: (a: unknown) => a is BufferGeometry;
|
|
10
|
+
orthographicCamera: (a: unknown) => a is OrthographicCamera;
|
|
11
|
+
perspectiveCamera: (a: unknown) => a is PerspectiveCamera;
|
|
12
|
+
camera: (a: unknown) => a is Camera;
|
|
13
|
+
renderer: (a: unknown) => boolean;
|
|
14
|
+
scene: (a: unknown) => a is Scene;
|
|
15
|
+
ref: (a: unknown) => a is ElementRef;
|
|
16
|
+
instance: (a: unknown) => a is NgtInstanceNode;
|
|
17
|
+
object3D: (a: unknown) => a is Object3D;
|
|
18
|
+
colorSpaceExist: <T extends NgtRendererLike | Texture | object, P = T extends NgtRendererLike ? {
|
|
18
19
|
outputColorSpace: string;
|
|
19
20
|
} : {
|
|
20
21
|
colorSpace: string;
|
package/lib/utils/make.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { Material, Object3D, OrthographicCamera, PerspectiveCamera, WebGLRenderer } from 'three';
|
|
2
|
+
import { NgtGLOptions } from '../canvas';
|
|
3
|
+
import { NgtIntersection } from '../events';
|
|
4
|
+
import { NgtCanvasElement } from '../roots';
|
|
5
|
+
import { NgtDpr, NgtSize } from '../store';
|
|
5
6
|
export declare function makeId(event?: NgtIntersection): string;
|
|
6
7
|
export declare function makeDpr(dpr: NgtDpr, window?: Window): number;
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function makeRendererInstance<TCanvas extends NgtCanvasElement>(glOptions: NgtGLOptions, canvas: TCanvas): WebGLRenderer;
|
|
9
|
+
export declare function makeCameraInstance(isOrthographic: boolean, size: NgtSize): OrthographicCamera | PerspectiveCamera;
|
|
9
10
|
export type NgtObjectMap = {
|
|
10
11
|
nodes: {
|
|
11
|
-
[name: string]:
|
|
12
|
+
[name: string]: Object3D;
|
|
12
13
|
};
|
|
13
14
|
materials: {
|
|
14
|
-
[name: string]:
|
|
15
|
+
[name: string]: Material;
|
|
15
16
|
};
|
|
16
17
|
[key: string]: any;
|
|
17
18
|
};
|
|
18
|
-
export declare function makeObjectGraph(object:
|
|
19
|
+
export declare function makeObjectGraph(object: Object3D): NgtObjectMap;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { Vector2, Vector3 } from 'three';
|
|
3
|
+
import { NgtVector2, NgtVector3 } from '../three-types';
|
|
4
|
+
type KeysOfType<TObject extends object, TType> = Exclude<{
|
|
5
|
+
[K in keyof TObject]: TObject[K] extends TType | undefined | null ? K : never;
|
|
6
|
+
}[keyof TObject], undefined>;
|
|
7
|
+
export declare function omit<TObject extends object, TKeys extends (keyof TObject)[]>(objFn: () => TObject, keysToOmit: TKeys): Signal<Omit<TObject, TKeys[number]>>;
|
|
8
|
+
export declare function pick<TObject extends object, TKey extends keyof TObject>(objFn: () => TObject, key: TKey): Signal<TObject[TKey]>;
|
|
9
|
+
export declare function pick<TObject extends object, TKeys extends (keyof TObject)[]>(objFn: () => TObject, keys: TKeys): Signal<Pick<TObject, TKeys[number]>>;
|
|
10
|
+
export declare function merge<TObject extends object>(objFn: () => TObject, toMerge: Partial<TObject>, mode?: 'override' | 'backfill'): Signal<TObject & Partial<TObject>>;
|
|
11
|
+
export declare function vector2<TObject extends object>(options: Signal<TObject>, key: KeysOfType<TObject, NgtVector2>): Signal<Vector2>;
|
|
12
|
+
export declare function vector2<TObject extends object>(options: Signal<TObject>, key: KeysOfType<TObject, NgtVector2>, keepUndefined: true): Signal<Vector2 | undefined>;
|
|
13
|
+
export declare function vector3<TObject extends object>(options: Signal<TObject>, key: KeysOfType<TObject, NgtVector3>): Signal<Vector3>;
|
|
14
|
+
export declare function vector3<TObject extends object>(options: Signal<TObject>, key: KeysOfType<TObject, NgtVector3>, keepUndefined: true): Signal<Vector3 | undefined>;
|
|
15
|
+
export {};
|