angular-three 0.0.0-replace

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.
Files changed (89) hide show
  1. package/README.md +7 -0
  2. package/esm2022/angular-three.mjs +5 -0
  3. package/esm2022/index.mjs +20 -0
  4. package/esm2022/lib/canvas.mjs +187 -0
  5. package/esm2022/lib/directives/args.mjs +35 -0
  6. package/esm2022/lib/directives/common.mjs +42 -0
  7. package/esm2022/lib/directives/parent.mjs +35 -0
  8. package/esm2022/lib/dom/events.mjs +73 -0
  9. package/esm2022/lib/events.mjs +362 -0
  10. package/esm2022/lib/instance.mjs +70 -0
  11. package/esm2022/lib/loader.mjs +64 -0
  12. package/esm2022/lib/loop.mjs +153 -0
  13. package/esm2022/lib/portal.mjs +208 -0
  14. package/esm2022/lib/ref.mjs +46 -0
  15. package/esm2022/lib/renderer/catalogue.mjs +7 -0
  16. package/esm2022/lib/renderer/constants.mjs +21 -0
  17. package/esm2022/lib/renderer/index.mjs +432 -0
  18. package/esm2022/lib/renderer/store.mjs +423 -0
  19. package/esm2022/lib/renderer/utils.mjs +201 -0
  20. package/esm2022/lib/roots.mjs +261 -0
  21. package/esm2022/lib/routed-scene.mjs +33 -0
  22. package/esm2022/lib/store.mjs +181 -0
  23. package/esm2022/lib/three-types.mjs +2 -0
  24. package/esm2022/lib/types.mjs +2 -0
  25. package/esm2022/lib/utils/apply-props.mjs +123 -0
  26. package/esm2022/lib/utils/attach.mjs +32 -0
  27. package/esm2022/lib/utils/before-render.mjs +12 -0
  28. package/esm2022/lib/utils/create-api-token.mjs +13 -0
  29. package/esm2022/lib/utils/inputs.mjs +18 -0
  30. package/esm2022/lib/utils/is.mjs +52 -0
  31. package/esm2022/lib/utils/make.mjs +53 -0
  32. package/esm2022/lib/utils/signal-store.mjs +101 -0
  33. package/esm2022/lib/utils/update.mjs +34 -0
  34. package/fesm2022/angular-three.mjs +3167 -0
  35. package/fesm2022/angular-three.mjs.map +1 -0
  36. package/index.d.ts +22 -0
  37. package/lib/canvas.d.ts +1170 -0
  38. package/lib/directives/args.d.ts +11 -0
  39. package/lib/directives/common.d.ts +26 -0
  40. package/lib/directives/parent.d.ts +13 -0
  41. package/lib/dom/events.d.ts +5 -0
  42. package/lib/events.d.ts +83 -0
  43. package/lib/instance.d.ts +46 -0
  44. package/lib/loader.d.ts +32 -0
  45. package/lib/loop.d.ts +68 -0
  46. package/lib/portal.d.ts +58 -0
  47. package/lib/ref.d.ts +7 -0
  48. package/lib/renderer/catalogue.d.ts +13 -0
  49. package/lib/renderer/constants.d.ts +20 -0
  50. package/lib/renderer/index.d.ts +56 -0
  51. package/lib/renderer/store.d.ts +64 -0
  52. package/lib/renderer/utils.d.ts +31 -0
  53. package/lib/roots.d.ts +12 -0
  54. package/lib/routed-scene.d.ts +10 -0
  55. package/lib/store.d.ts +141 -0
  56. package/lib/three-types.d.ts +302 -0
  57. package/lib/types.d.ts +12 -0
  58. package/lib/utils/apply-props.d.ts +3 -0
  59. package/lib/utils/attach.d.ts +11 -0
  60. package/lib/utils/before-render.d.ts +6 -0
  61. package/lib/utils/create-api-token.d.ts +23 -0
  62. package/lib/utils/inputs.d.ts +5 -0
  63. package/lib/utils/is.d.ts +23 -0
  64. package/lib/utils/make.d.ts +19 -0
  65. package/lib/utils/signal-store.d.ts +30 -0
  66. package/lib/utils/update.d.ts +4 -0
  67. package/metadata.json +1 -0
  68. package/package.json +73 -0
  69. package/plugin/README.md +11 -0
  70. package/plugin/generators.json +17 -0
  71. package/plugin/src/generators/init/compat.d.ts +2 -0
  72. package/plugin/src/generators/init/compat.js +6 -0
  73. package/plugin/src/generators/init/compat.js.map +1 -0
  74. package/plugin/src/generators/init/files/experience/experience.component.html__tmpl__ +4 -0
  75. package/plugin/src/generators/init/files/experience/experience.component.ts__tmpl__ +18 -0
  76. package/plugin/src/generators/init/generator.d.ts +3 -0
  77. package/plugin/src/generators/init/generator.js +143 -0
  78. package/plugin/src/generators/init/generator.js.map +1 -0
  79. package/plugin/src/generators/init/schema.json +6 -0
  80. package/plugin/src/generators/utils.d.ts +2 -0
  81. package/plugin/src/generators/utils.js +34 -0
  82. package/plugin/src/generators/utils.js.map +1 -0
  83. package/plugin/src/generators/version.d.ts +14 -0
  84. package/plugin/src/generators/version.js +18 -0
  85. package/plugin/src/generators/version.js.map +1 -0
  86. package/plugin/src/index.d.ts +0 -0
  87. package/plugin/src/index.js +1 -0
  88. package/plugin/src/index.js.map +1 -0
  89. package/web-types.json +1 -0
package/lib/store.d.ts ADDED
@@ -0,0 +1,141 @@
1
+ /// <reference types="webxr" />
2
+ import { ElementRef, InjectionToken } from '@angular/core';
3
+ import { type Observable } from 'rxjs';
4
+ import * as THREE from 'three';
5
+ import type { NgtCamera, NgtDomEvent, NgtEventManager, NgtPointerCaptureTarget, NgtThreeEvent } from './events';
6
+ import type { NgtInstanceNode } from './instance';
7
+ import { type NgtSignalStore } from './utils/signal-store';
8
+ export type NgtRendererLike = {
9
+ render: (scene: THREE.Scene, camera: THREE.Camera) => any;
10
+ };
11
+ export type NgtCameraManual = NgtCamera & {
12
+ manual?: boolean;
13
+ };
14
+ export type NgtDpr = number | [min: number, max: number];
15
+ export type NgtSize = {
16
+ width: number;
17
+ height: number;
18
+ top: number;
19
+ left: number;
20
+ };
21
+ export type NgtViewport = NgtSize & {
22
+ /** The initial pixel ratio */
23
+ initialDpr: number;
24
+ /** Current pixel ratio */
25
+ dpr: number;
26
+ /** size.width / viewport.width */
27
+ factor: number;
28
+ /** Camera distance */
29
+ distance: number;
30
+ /** Camera aspect ratio: width / height */
31
+ aspect: number;
32
+ };
33
+ export type NgtPerformance = {
34
+ /** Current performance normal, between min and max */
35
+ current: number;
36
+ /** How low the performance can go, between 0 and max */
37
+ min: number;
38
+ /** How high the performance can go, between min and max */
39
+ max: number;
40
+ /** Time until current returns to max in ms */
41
+ debounce: number;
42
+ /** Sets current to min, puts the system in regression */
43
+ regress: () => void;
44
+ };
45
+ export type NgtRenderState = NgtState & {
46
+ delta: number;
47
+ frame?: XRFrame;
48
+ };
49
+ export type NgtBeforeRenderEvent<TObject extends NgtInstanceNode = NgtInstanceNode> = {
50
+ state: NgtRenderState;
51
+ object: TObject;
52
+ };
53
+ export type NgtBeforeRenderRecord = {
54
+ callback: (state: NgtRenderState) => void;
55
+ store: NgtSignalStore<NgtState>;
56
+ priority?: number;
57
+ };
58
+ export type NgtInternalState = {
59
+ active: boolean;
60
+ priority: number;
61
+ frames: number;
62
+ lastEvent: ElementRef<NgtDomEvent | null>;
63
+ interaction: THREE.Object3D[];
64
+ hovered: Map<string, NgtThreeEvent<NgtDomEvent>>;
65
+ capturedMap: Map<number, Map<THREE.Object3D, NgtPointerCaptureTarget>>;
66
+ initialClick: [x: number, y: number];
67
+ initialHits: THREE.Object3D[];
68
+ subscribers: NgtBeforeRenderRecord[];
69
+ subscribe: (callback: NgtBeforeRenderRecord['callback'], priority?: number, store?: NgtSignalStore<NgtState>) => () => void;
70
+ };
71
+ export type NgtState = {
72
+ /** The instance of the renderer */
73
+ gl: THREE.WebGLRenderer;
74
+ /** Default camera */
75
+ camera: NgtCameraManual;
76
+ /** Default scene */
77
+ scene: THREE.Scene;
78
+ /** Default raycaster */
79
+ raycaster: THREE.Raycaster;
80
+ /** Default clock */
81
+ clock: THREE.Clock;
82
+ /** Event layer interface, contains the event handler and the node they're connected to */
83
+ events: NgtEventManager<any>;
84
+ /** XR interface */
85
+ xr: {
86
+ connect: () => void;
87
+ disconnect: () => void;
88
+ };
89
+ /** Currently used controls */
90
+ controls: THREE.EventDispatcher | null;
91
+ /** Normalized event coordinates */
92
+ pointer: THREE.Vector2;
93
+ legacy: boolean;
94
+ /** Shortcut to gl.outputColorSpace = THREE.LinearSRGBColorSpace */
95
+ linear: boolean;
96
+ /** Shortcut to gl.toneMapping = NoTonemapping */
97
+ flat: boolean;
98
+ /** Render loop flags */
99
+ frameloop: 'always' | 'demand' | 'never';
100
+ /** Adaptive performance interface */
101
+ performance: NgtPerformance;
102
+ /** Reactive pixel-size of the canvas */
103
+ size: NgtSize;
104
+ /** Reactive size of the viewport in threejs units */
105
+ viewport: NgtViewport & {
106
+ getCurrentViewport: (camera?: NgtCamera, target?: THREE.Vector3 | Parameters<THREE.Vector3['set']>, size?: NgtSize) => Omit<NgtViewport, 'dpr' | 'initialDpr'>;
107
+ };
108
+ /** Flags the canvas for render, but doesn't render in itself */
109
+ invalidate: (frames?: number) => void;
110
+ /** Advance (render) one step */
111
+ advance: (timestamp: number, runGlobalEffects?: boolean) => void;
112
+ /** Shortcut to setting the event layer */
113
+ setEvents: (events: Partial<NgtEventManager<any>>) => void;
114
+ /**
115
+ * Shortcut to manual sizing
116
+ */
117
+ setSize: (width: number, height: number, top?: number, left?: number) => void;
118
+ /** Shortcut to manual setting the pixel ratio */
119
+ setDpr: (dpr: NgtDpr) => void;
120
+ /** Shortcut to frameloop flags */
121
+ setFrameloop: (frameloop?: 'always' | 'demand' | 'never') => void;
122
+ /** When the canvas was clicked but nothing was hit */
123
+ /** PointerMissed Observable */
124
+ pointerMissed$: Observable<MouseEvent>;
125
+ /** If this state model is layered (via createPortal) then this contains the previous layer */
126
+ previousRoot: NgtSignalStore<NgtState> | null;
127
+ /** Internals */
128
+ internal: NgtInternalState;
129
+ };
130
+ export declare const NGT_STORE: InjectionToken<NgtSignalStore<NgtState>>;
131
+ export declare const injectNgtStore: {
132
+ (): NgtSignalStore<NgtState>;
133
+ (injectOptions: import("@angular/core").InjectOptions & {
134
+ optional?: false | undefined;
135
+ } & {
136
+ injector?: import("@angular/core").Injector | undefined; /** Current performance normal, between min and max */
137
+ }): NgtSignalStore<NgtState>;
138
+ (injectOptions: import("@angular/core").InjectOptions & {
139
+ injector?: import("@angular/core").Injector | undefined;
140
+ }): NgtSignalStore<NgtState> | null;
141
+ }, provideNgtStore: (() => import("@angular/core").Provider) & ((value: NgtSignalStore<NgtState> | (() => NgtSignalStore<NgtState>)) => import("@angular/core").Provider);
@@ -0,0 +1,302 @@
1
+ import type * as THREE from 'three';
2
+ import type { NgtEventHandlers } from './events';
3
+ import type { NgtAfterAttach, NgtAttachFunction, NgtInstanceNode } from './instance';
4
+ import type { NgtBeforeRenderEvent } from './store';
5
+ type NoEvent<T> = Omit<T, 'addEventListener' | 'removeEventListener'>;
6
+ export type NgtNonFunctionKeys<T> = {
7
+ [K in keyof T]-?: T[K] extends Function ? never : K;
8
+ }[keyof T];
9
+ export type NgtOverwrite<T, O> = Omit<T, NgtNonFunctionKeys<O>> & O;
10
+ export type NgtExtendedColors<T> = {
11
+ [K in keyof T]: T[K] extends THREE.Color | undefined ? THREE.ColorRepresentation : T[K];
12
+ };
13
+ /**
14
+ * If **T** contains a constructor, @see ConstructorParameters must be used, otherwise **T**.
15
+ */
16
+ type NgtArguments<T> = T extends new (...args: any) => any ? ConstructorParameters<T> : T;
17
+ export type NgtEuler = THREE.Euler | Parameters<THREE.Euler['set']>;
18
+ export type NgtMatrix4 = THREE.Matrix4 | Parameters<THREE.Matrix4['set']> | Readonly<THREE.Matrix4['set']>;
19
+ /**
20
+ * Turn an implementation of THREE.Vector in to the type that an r3f component would accept as a prop.
21
+ */
22
+ type NgtVectorLike<VectorClass extends THREE.Vector2 | THREE.Vector3 | THREE.Vector4> = VectorClass | Parameters<VectorClass['set']> | Readonly<Parameters<VectorClass['set']>> | Parameters<VectorClass['setScalar']>[0];
23
+ export type NgtVector2 = NgtVectorLike<THREE.Vector2>;
24
+ export type NgtVector3 = NgtVectorLike<THREE.Vector3>;
25
+ export type NgtVector4 = NgtVectorLike<THREE.Vector4>;
26
+ export type NgtLayers = THREE.Layers | Parameters<THREE.Layers['set']>[0];
27
+ export type NgtQuaternion = THREE.Quaternion | Parameters<THREE.Quaternion['set']>;
28
+ export interface NgtNodeEventMap<TOriginal> {
29
+ afterAttach: NgtAfterAttach<NgtInstanceNode, TOriginal>;
30
+ afterUpdate: TOriginal;
31
+ beforeRender: NgtBeforeRenderEvent<TOriginal>;
32
+ }
33
+ export type NgtNodeElement<TOriginal, TConstructor> = {
34
+ attach: string | string[] | NgtAttachFunction;
35
+ addEventListener<TEventKey extends keyof NgtNodeEventMap<TOriginal>>(type: TEventKey, listener: (this: NgtNodeElement<TOriginal, TConstructor>, ev: NgtNodeEventMap<TOriginal>[TEventKey]) => any): void;
36
+ removeEventListener<TEventKey extends keyof NgtNodeEventMap<TOriginal>>(type: TEventKey, listener: (this: NgtNodeElement<TOriginal, TConstructor>, ev: NgtNodeEventMap<TOriginal>[TEventKey]) => any): void;
37
+ __ngt_args__: NgtArguments<TConstructor>;
38
+ };
39
+ export type NgtNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = NgtExtendedColors<NgtOverwrite<Partial<TNoEvent>, NgtNodeElement<TOriginal, TConstructor>>>;
40
+ export type NgtObject3DEventsMap = {
41
+ [TEvent in keyof NgtEventHandlers]-?: Parameters<NonNullable<NgtEventHandlers[TEvent]>>[0];
42
+ };
43
+ export type NgtObject3DNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = NgtOverwrite<NgtNode<TOriginal, TConstructor, TNoEvent>, {
44
+ position: NgtVector3;
45
+ up: NgtVector3;
46
+ scale: NgtVector3;
47
+ rotation: NgtEuler;
48
+ matrix: NgtMatrix4;
49
+ quaternion: NgtQuaternion;
50
+ layers: NgtLayers;
51
+ dispose: (() => void) | null;
52
+ addEventListener<TEventKey extends keyof NgtObject3DEventsMap>(type: TEventKey, listener: (this: NgtObject3DNode<TOriginal, TConstructor>, ev: NgtObject3DEventsMap[TEventKey]) => any): void;
53
+ removeEventListener<TEventKey extends keyof NgtObject3DEventsMap>(type: TEventKey, listener: (this: NgtObject3DNode<TOriginal, TConstructor>, ev: NgtObject3DEventsMap[TEventKey]) => any): void;
54
+ }>;
55
+ export type NgtGeometry<TGeometry extends THREE.BufferGeometry, TConstructor> = NgtNode<TGeometry, TConstructor>;
56
+ export type NgtMaterial<TMaterial extends THREE.Material, TConstructor> = NgtNode<TMaterial, TConstructor>;
57
+ export type NgtLight<T extends THREE.Light, P> = NgtObject3DNode<T, P>;
58
+ export type NgtObject3D = NgtObject3DNode<THREE.Object3D, typeof THREE.Object3D>;
59
+ export type NgtAudio = NgtObject3DNode<THREE.Audio, typeof THREE.Audio>;
60
+ export type NgtAudioListener = NgtObject3DNode<THREE.AudioListener, typeof THREE.AudioListener>;
61
+ export type NgtPositionalAudio = NgtObject3DNode<THREE.PositionalAudio, typeof THREE.PositionalAudio>;
62
+ export type NgtMesh = NgtObject3DNode<THREE.Mesh, typeof THREE.Mesh>;
63
+ export type NgtInstancedMesh = NgtObject3DNode<THREE.InstancedMesh, typeof THREE.InstancedMesh>;
64
+ export type NgtScene = NgtObject3DNode<THREE.Scene, typeof THREE.Scene>;
65
+ export type NgtSprite = NgtObject3DNode<THREE.Sprite, typeof THREE.Sprite>;
66
+ export type NgtLOD = NgtObject3DNode<THREE.LOD, typeof THREE.LOD>;
67
+ export type NgtSkinnedMesh = NgtObject3DNode<THREE.SkinnedMesh, typeof THREE.SkinnedMesh>;
68
+ export type NgtSkeleton = NgtObject3DNode<THREE.Skeleton, typeof THREE.Skeleton>;
69
+ export type NgtBone = NgtObject3DNode<THREE.Bone, typeof THREE.Bone>;
70
+ export type NgtLine = NgtObject3DNode<THREE.Line, typeof THREE.Line>;
71
+ export type NgtLineSegments = NgtObject3DNode<THREE.LineSegments, typeof THREE.LineSegments>;
72
+ export type NgtLineLoop = NgtObject3DNode<THREE.LineLoop, typeof THREE.LineLoop>;
73
+ export type NgtPoints = NgtObject3DNode<THREE.Points, typeof THREE.Points>;
74
+ export type NgtGroup = NgtObject3DNode<THREE.Group, typeof THREE.Group>;
75
+ export type NgtCameraNode = NgtObject3DNode<THREE.Camera, typeof THREE.Camera>;
76
+ export type NgtPerspectiveCamera = NgtObject3DNode<THREE.PerspectiveCamera, typeof THREE.PerspectiveCamera>;
77
+ export type NgtOrthographicCamera = NgtObject3DNode<THREE.OrthographicCamera, typeof THREE.OrthographicCamera>;
78
+ export type NgtCubeCamera = NgtObject3DNode<THREE.CubeCamera, typeof THREE.CubeCamera>;
79
+ export type NgtArrayCamera = NgtObject3DNode<THREE.ArrayCamera, typeof THREE.ArrayCamera>;
80
+ export type NgtInstancedBufferGeometry = NgtGeometry<THREE.InstancedBufferGeometry, typeof THREE.InstancedBufferGeometry>;
81
+ export type NgtBufferGeometry = NgtGeometry<THREE.BufferGeometry, typeof THREE.BufferGeometry>;
82
+ export type NgtWireframeGeometry = NgtGeometry<THREE.WireframeGeometry, typeof THREE.WireframeGeometry>;
83
+ export type NgtTetrahedronGeometry = NgtGeometry<THREE.TetrahedronGeometry, typeof THREE.TetrahedronGeometry>;
84
+ export type NgtOctahedronGeometry = NgtGeometry<THREE.OctahedronGeometry, typeof THREE.OctahedronGeometry>;
85
+ export type NgtIcosahedronGeometry = NgtGeometry<THREE.IcosahedronGeometry, typeof THREE.IcosahedronGeometry>;
86
+ export type NgtDodecahedronGeometry = NgtGeometry<THREE.DodecahedronGeometry, typeof THREE.DodecahedronGeometry>;
87
+ export type NgtPolyhedronGeometry = NgtGeometry<THREE.PolyhedronGeometry, typeof THREE.PolyhedronGeometry>;
88
+ export type NgtTubeGeometry = NgtGeometry<THREE.TubeGeometry, typeof THREE.TubeGeometry>;
89
+ export type NgtTorusKnotGeometry = NgtGeometry<THREE.TorusKnotGeometry, typeof THREE.TorusKnotGeometry>;
90
+ export type NgtTorusGeometry = NgtGeometry<THREE.TorusGeometry, typeof THREE.TorusGeometry>;
91
+ export type NgtSphereGeometry = NgtGeometry<THREE.SphereGeometry, typeof THREE.SphereGeometry>;
92
+ export type NgtRingGeometry = NgtGeometry<THREE.RingGeometry, typeof THREE.RingGeometry>;
93
+ export type NgtPlaneGeometry = NgtGeometry<THREE.PlaneGeometry, typeof THREE.PlaneGeometry>;
94
+ export type NgtLatheGeometry = NgtGeometry<THREE.LatheGeometry, typeof THREE.LatheGeometry>;
95
+ export type NgtShapeGeometry = NgtGeometry<THREE.ShapeGeometry, typeof THREE.ShapeGeometry>;
96
+ export type NgtExtrudeGeometry = NgtGeometry<THREE.ExtrudeGeometry, typeof THREE.ExtrudeGeometry>;
97
+ export type NgtEdgesGeometry = NgtGeometry<THREE.EdgesGeometry, typeof THREE.EdgesGeometry>;
98
+ export type NgtConeGeometry = NgtGeometry<THREE.ConeGeometry, typeof THREE.ConeGeometry>;
99
+ export type NgtCylinderGeometry = NgtGeometry<THREE.CylinderGeometry, typeof THREE.CylinderGeometry>;
100
+ export type NgtCircleGeometry = NgtGeometry<THREE.CircleGeometry, typeof THREE.CircleGeometry>;
101
+ export type NgtBoxGeometry = NgtGeometry<THREE.BoxGeometry, typeof THREE.BoxGeometry>;
102
+ export type NgtCapsuleGeometry = NgtGeometry<THREE.CapsuleGeometry, typeof THREE.CapsuleGeometry>;
103
+ export type NgtShadowMaterial = NgtMaterial<THREE.ShadowMaterial, [THREE.ShaderMaterialParameters]>;
104
+ export type NgtSpriteMaterial = NgtMaterial<THREE.SpriteMaterial, [THREE.SpriteMaterialParameters]>;
105
+ export type NgtRawShaderMaterial = NgtMaterial<THREE.RawShaderMaterial, [THREE.ShaderMaterialParameters]>;
106
+ export type NgtShaderMaterial = NgtMaterial<THREE.ShaderMaterial, [THREE.ShaderMaterialParameters]>;
107
+ export type NgtPointsMaterial = NgtMaterial<THREE.PointsMaterial, [THREE.PointsMaterialParameters]>;
108
+ export type NgtMeshPhysicalMaterial = NgtMaterial<THREE.MeshPhysicalMaterial, [THREE.MeshPhysicalMaterialParameters]>;
109
+ export type NgtMeshStandardMaterial = NgtMaterial<THREE.MeshStandardMaterial, [THREE.MeshStandardMaterialParameters]>;
110
+ export type NgtMeshPhongMaterial = NgtMaterial<THREE.MeshPhongMaterial, [THREE.MeshPhongMaterialParameters]>;
111
+ export type NgtMeshToonMaterial = NgtMaterial<THREE.MeshToonMaterial, [THREE.MeshToonMaterialParameters]>;
112
+ export type NgtMeshNormalMaterial = NgtMaterial<THREE.MeshNormalMaterial, [THREE.MeshNormalMaterialParameters]>;
113
+ export type NgtMeshLambertMaterial = NgtMaterial<THREE.MeshLambertMaterial, [THREE.MeshLambertMaterialParameters]>;
114
+ export type NgtMeshDepthMaterial = NgtMaterial<THREE.MeshDepthMaterial, [THREE.MeshDepthMaterialParameters]>;
115
+ export type NgtMeshDistanceMaterial = NgtMaterial<THREE.MeshDistanceMaterial, [THREE.MeshDistanceMaterialParameters]>;
116
+ export type NgtMeshBasicMaterial = NgtMaterial<THREE.MeshBasicMaterial, [THREE.MeshBasicMaterialParameters]>;
117
+ export type NgtMeshMatcapMaterial = NgtMaterial<THREE.MeshMatcapMaterial, [THREE.MeshMatcapMaterialParameters]>;
118
+ export type NgtLineDashedMaterial = NgtMaterial<THREE.LineDashedMaterial, [THREE.LineDashedMaterialParameters]>;
119
+ export type NgtLineBasicMaterial = NgtMaterial<THREE.LineBasicMaterial, [THREE.LineBasicMaterialParameters]>;
120
+ export type NgtPrimitive = NgtNodeElement<any, any>;
121
+ export type NgtValue = NgtNode<{
122
+ rawValue: any;
123
+ }, {}>;
124
+ export type NgtLightShadow = NgtNode<THREE.LightShadow, typeof THREE.LightShadow>;
125
+ export type NgtSpotLightShadow = NgtNode<THREE.SpotLightShadow, typeof THREE.SpotLightShadow>;
126
+ export type NgtDirectionalLightShadow = NgtNode<THREE.DirectionalLightShadow, typeof THREE.DirectionalLightShadow>;
127
+ export type NgtSpotLight = NgtLight<THREE.SpotLight, typeof THREE.SpotLight>;
128
+ export type NgtPointLight = NgtLight<THREE.PointLight, typeof THREE.PointLight>;
129
+ export type NgtRectAreaLight = NgtLight<THREE.RectAreaLight, typeof THREE.RectAreaLight>;
130
+ export type NgtHemisphereLight = NgtLight<THREE.HemisphereLight, typeof THREE.HemisphereLight>;
131
+ export type NgtDirectionalLight = NgtLight<THREE.DirectionalLight, typeof THREE.DirectionalLight>;
132
+ export type NgtAmbientLight = NgtLight<THREE.AmbientLight, typeof THREE.AmbientLight>;
133
+ export type NgtLightProbe = NgtLight<THREE.LightProbe, typeof THREE.LightProbe>;
134
+ export type NgtSpotLightHelper = NgtObject3DNode<THREE.SpotLightHelper, typeof THREE.SpotLightHelper>;
135
+ export type NgtSkeletonHelper = NgtObject3DNode<THREE.SkeletonHelper, typeof THREE.SkeletonHelper>;
136
+ export type NgtPointLightHelper = NgtObject3DNode<THREE.PointLightHelper, typeof THREE.PointLightHelper>;
137
+ export type NgtHemisphereLightHelper = NgtObject3DNode<THREE.HemisphereLightHelper, typeof THREE.HemisphereLightHelper>;
138
+ export type NgtGridHelper = NgtObject3DNode<THREE.GridHelper, typeof THREE.GridHelper>;
139
+ export type NgtPolarGridHelper = NgtObject3DNode<THREE.PolarGridHelper, typeof THREE.PolarGridHelper>;
140
+ export type NgtDirectionalLightHelper = NgtObject3DNode<THREE.DirectionalLightHelper, typeof THREE.DirectionalLightHelper>;
141
+ export type NgtCameraHelper = NgtObject3DNode<THREE.CameraHelper, typeof THREE.CameraHelper>;
142
+ export type NgtBoxHelper = NgtObject3DNode<THREE.BoxHelper, typeof THREE.BoxHelper>;
143
+ export type NgtBox3Helper = NgtObject3DNode<THREE.Box3Helper, typeof THREE.Box3Helper>;
144
+ export type NgtPlaneHelper = NgtObject3DNode<THREE.PlaneHelper, typeof THREE.PlaneHelper>;
145
+ export type NgtArrowHelper = NgtObject3DNode<THREE.ArrowHelper, typeof THREE.ArrowHelper>;
146
+ export type NgtAxesHelper = NgtObject3DNode<THREE.AxesHelper, typeof THREE.AxesHelper>;
147
+ export type NgtTexture = NgtNode<THREE.Texture, typeof THREE.Texture>;
148
+ export type NgtVideoTexture = NgtNode<THREE.VideoTexture, typeof THREE.VideoTexture>;
149
+ export type NgtDataTexture = NgtNode<THREE.DataTexture, typeof THREE.DataTexture>;
150
+ export type NgtData3DTexture = NgtNode<THREE.Data3DTexture, typeof THREE.Data3DTexture>;
151
+ export type NgtCompressedTexture = NgtNode<THREE.CompressedTexture, typeof THREE.CompressedTexture>;
152
+ export type NgtCubeTexture = NgtNode<THREE.CubeTexture, typeof THREE.CubeTexture>;
153
+ export type NgtCanvasTexture = NgtNode<THREE.CanvasTexture, typeof THREE.CanvasTexture>;
154
+ export type NgtDepthTexture = NgtNode<THREE.DepthTexture, typeof THREE.DepthTexture>;
155
+ export type NgtRaycaster = NgtNode<THREE.Raycaster, typeof THREE.Raycaster>;
156
+ export type NgtVector2Node = NgtNode<THREE.Vector2, typeof THREE.Vector2>;
157
+ export type NgtVector3Node = NgtNode<THREE.Vector3, typeof THREE.Vector3>;
158
+ export type NgtVector4Node = NgtNode<THREE.Vector4, typeof THREE.Vector4>;
159
+ export type NgtEulerNode = NgtNode<THREE.Euler, typeof THREE.Euler>;
160
+ export type NgtMatrix3Node = NgtNode<THREE.Matrix3, typeof THREE.Matrix3>;
161
+ export type NgtMatrix4Node = NgtNode<THREE.Matrix4, typeof THREE.Matrix4>;
162
+ export type NgtQuaternionNode = NgtNode<THREE.Quaternion, typeof THREE.Quaternion>;
163
+ export type NgtBufferAttribute = NgtNode<THREE.BufferAttribute, typeof THREE.BufferAttribute>;
164
+ export type NgtFloat16BufferAttribute = NgtNode<THREE.Float16BufferAttribute, typeof THREE.Float16BufferAttribute>;
165
+ export type NgtFloat32BufferAttribute = NgtNode<THREE.Float32BufferAttribute, typeof THREE.Float32BufferAttribute>;
166
+ export type NgtFloat64BufferAttribute = NgtNode<THREE.Float64BufferAttribute, typeof THREE.Float64BufferAttribute>;
167
+ export type NgtInt8BufferAttribute = NgtNode<THREE.Int8BufferAttribute, typeof THREE.Int8BufferAttribute>;
168
+ export type NgtInt16BufferAttribute = NgtNode<THREE.Int16BufferAttribute, typeof THREE.Int16BufferAttribute>;
169
+ export type NgtInt32BufferAttribute = NgtNode<THREE.Int32BufferAttribute, typeof THREE.Int32BufferAttribute>;
170
+ export type NgtUint8BufferAttribute = NgtNode<THREE.Uint8BufferAttribute, typeof THREE.Uint8BufferAttribute>;
171
+ export type NgtUint16BufferAttribute = NgtNode<THREE.Uint16BufferAttribute, typeof THREE.Uint16BufferAttribute>;
172
+ export type NgtUint32BufferAttribute = NgtNode<THREE.Uint32BufferAttribute, typeof THREE.Uint32BufferAttribute>;
173
+ export type NgtInstancedBufferAttribute = NgtNode<THREE.InstancedBufferAttribute, typeof THREE.InstancedBufferAttribute>;
174
+ export type NgtColor = NgtNode<THREE.Color, THREE.ColorRepresentation>;
175
+ export type NgtFog = NgtNode<THREE.Fog, typeof THREE.Fog>;
176
+ export type NgtFogExp2 = NgtNode<THREE.FogExp2, typeof THREE.FogExp2>;
177
+ export type NgtShape = NgtNode<THREE.Shape, typeof THREE.Shape>;
178
+ export interface ThreeElements {
179
+ 'ngt-object3D': NgtObject3D;
180
+ 'ngt-audio': NgtAudio;
181
+ 'ngt-audio-listener': NgtAudioListener;
182
+ 'ngt-positional-audio': NgtPositionalAudio;
183
+ 'ngt-mesh': NgtMesh;
184
+ 'ngt-instanced-mesh': NgtInstancedMesh;
185
+ 'ngt-scene': NgtScene;
186
+ 'ngt-sprite': NgtSprite;
187
+ 'ngt-lOD': NgtLOD;
188
+ 'ngt-skinned-mesh': NgtSkinnedMesh;
189
+ 'ngt-skeleton': NgtSkeleton;
190
+ 'ngt-bone': NgtBone;
191
+ 'ngt-line': NgtLine;
192
+ 'ngt-line-segments': NgtLineSegments;
193
+ 'ngt-line-loop': NgtLineLoop;
194
+ 'ngt-points': NgtPoints;
195
+ 'ngt-group': NgtGroup;
196
+ 'ngt-camera': NgtCameraNode;
197
+ 'ngt-perspective-camera': NgtPerspectiveCamera;
198
+ 'ngt-orthographic-camera': NgtOrthographicCamera;
199
+ 'ngt-cube-camera': NgtCubeCamera;
200
+ 'ngt-array-camera': NgtArrayCamera;
201
+ 'ngt-instanced-buffer-geometry': NgtInstancedBufferGeometry;
202
+ 'ngt-buffer-geometry': NgtBufferGeometry;
203
+ 'ngt-wireframe-geometry': NgtWireframeGeometry;
204
+ 'ngt-tetrahedron-geometry': NgtTetrahedronGeometry;
205
+ 'ngt-octahedron-geometry': NgtOctahedronGeometry;
206
+ 'ngt-icosahedron-geometry': NgtIcosahedronGeometry;
207
+ 'ngt-polyhedron-geometry': NgtPolyhedronGeometry;
208
+ 'ngt-dodecahedron-geometry': NgtDodecahedronGeometry;
209
+ 'ngt-tube-geometry': NgtTubeGeometry;
210
+ 'ngt-torus-knot-geometry': NgtTorusKnotGeometry;
211
+ 'ngt-torus-geometry': NgtTorusGeometry;
212
+ 'ngt-sphere-geometry': NgtSphereGeometry;
213
+ 'ngt-ring-geometry': NgtRingGeometry;
214
+ 'ngt-plane-geometry': NgtPlaneGeometry;
215
+ 'ngt-lathe-geometry': NgtLatheGeometry;
216
+ 'ngt-shape-geometry': NgtShapeGeometry;
217
+ 'ngt-extrude-geometry': NgtExtrudeGeometry;
218
+ 'ngt-edges-geometry': NgtEdgesGeometry;
219
+ 'ngt-cone-geometry': NgtConeGeometry;
220
+ 'ngt-cylinder-geometry': NgtCylinderGeometry;
221
+ 'ngt-circle-geometry': NgtCircleGeometry;
222
+ 'ngt-box-geometry': NgtBoxGeometry;
223
+ 'ngt-capsule-geometry': NgtCapsuleGeometry;
224
+ 'ngt-shadow-material': NgtShadowMaterial;
225
+ 'ngt-sprite-material': NgtSpriteMaterial;
226
+ 'ngt-raw-shader-material': NgtRawShaderMaterial;
227
+ 'ngt-shader-material': NgtShaderMaterial;
228
+ 'ngt-points-material': NgtPointsMaterial;
229
+ 'ngt-mesh-physical-material': NgtMeshPhysicalMaterial;
230
+ 'ngt-mesh-standard-material': NgtMeshStandardMaterial;
231
+ 'ngt-mesh-phong-material': NgtMeshPhongMaterial;
232
+ 'ngt-mesh-toon-material': NgtMeshToonMaterial;
233
+ 'ngt-mesh-normal-material': NgtMeshNormalMaterial;
234
+ 'ngt-mesh-lambert-material': NgtMeshLambertMaterial;
235
+ 'ngt-mesh-depth-material': NgtMeshDepthMaterial;
236
+ 'ngt-mesh-distance-material': NgtMeshDistanceMaterial;
237
+ 'ngt-mesh-basic-material': NgtMeshBasicMaterial;
238
+ 'ngt-mesh-matcap-material': NgtMeshMatcapMaterial;
239
+ 'ngt-line-dashed-material': NgtLineDashedMaterial;
240
+ 'ngt-line-basic-material': NgtLineBasicMaterial;
241
+ 'ngt-primitive': NgtPrimitive;
242
+ 'ngt-value': NgtValue;
243
+ 'ngt-spot-light-shadow': NgtSpotLightShadow;
244
+ 'ngt-spot-light': NgtSpotLight;
245
+ 'ngt-point-light': NgtPointLight;
246
+ 'ngt-rect-area-light': NgtRectAreaLight;
247
+ 'ngt-hemisphere-light': NgtHemisphereLight;
248
+ 'ngt-directional-light-shadow': NgtDirectionalLightShadow;
249
+ 'ngt-directional-light': NgtDirectionalLight;
250
+ 'ngt-ambient-light': NgtAmbientLight;
251
+ 'ngt-light-shadow': NgtLightShadow;
252
+ 'ngt-light-probe': NgtLightProbe;
253
+ 'ngt-spot-light-helper': NgtSpotLightHelper;
254
+ 'ngt-skeleton-helper': NgtSkeletonHelper;
255
+ 'ngt-point-light-helper': NgtPointLightHelper;
256
+ 'ngt-hemisphere-light-helper': NgtHemisphereLightHelper;
257
+ 'ngt-grid-helper': NgtGridHelper;
258
+ 'ngt-polar-grid-helper': NgtPolarGridHelper;
259
+ 'ngt-directional-light-helper': NgtDirectionalLightHelper;
260
+ 'ngt-camera-helper': NgtCameraHelper;
261
+ 'ngt-box-helper': NgtBoxHelper;
262
+ 'ngt-box3-helper': NgtBox3Helper;
263
+ 'ngt-plane-helper': NgtPlaneHelper;
264
+ 'ngt-arrow-helper': NgtArrowHelper;
265
+ 'ngt-axes-helper': NgtAxesHelper;
266
+ 'ngt-texture': NgtTexture;
267
+ 'ngt-video-texture': NgtVideoTexture;
268
+ 'ngt-data-texture': NgtDataTexture;
269
+ 'ngt-data3D-texture': NgtData3DTexture;
270
+ 'ngt-compressed-texture': NgtCompressedTexture;
271
+ 'ngt-cube-texture': NgtCubeTexture;
272
+ 'ngt-canvas-texture': NgtCanvasTexture;
273
+ 'ngt-depth-texture': NgtDepthTexture;
274
+ 'ngt-raycaster': NgtRaycaster;
275
+ 'ngt-vector2': NgtVector2Node;
276
+ 'ngt-vector3': NgtVector3Node;
277
+ 'ngt-vector4': NgtVector4Node;
278
+ 'ngt-euler': NgtEulerNode;
279
+ 'ngt-matrix3': NgtMatrix3Node;
280
+ 'ngt-matrix4': NgtMatrix4Node;
281
+ 'ngt-quaternion': NgtQuaternionNode;
282
+ 'ngt-buffer-attribute': NgtBufferAttribute;
283
+ 'ngt-float16-buffer-attribute': NgtFloat16BufferAttribute;
284
+ 'ngt-float32-buffer-attribute': NgtFloat32BufferAttribute;
285
+ 'ngt-float64-buffer-attribute': NgtFloat64BufferAttribute;
286
+ 'ngt-int8-buffer-attribute': NgtInt8BufferAttribute;
287
+ 'ngt-int16-buffer-attribute': NgtInt16BufferAttribute;
288
+ 'ngt-int32-buffer-attribute': NgtInt32BufferAttribute;
289
+ 'ngt-unit8-buffer-attribute': NgtUint8BufferAttribute;
290
+ 'ngt-unit16-buffer-attribute': NgtUint16BufferAttribute;
291
+ 'ngt-unit32-buffer-attribute': NgtUint32BufferAttribute;
292
+ 'ngt-instanced-buffer-attribute': NgtInstancedBufferAttribute;
293
+ 'ngt-color': NgtColor;
294
+ 'ngt-fog': NgtFog;
295
+ 'ngt-fog-exp2': NgtFogExp2;
296
+ 'ngt-shape': NgtShape;
297
+ }
298
+ declare global {
299
+ interface HTMLElementTagNameMap extends ThreeElements {
300
+ }
301
+ }
302
+ export {};
package/lib/types.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export type NgtProperties<T> = Pick<T, {
2
+ [K in keyof T]: T[K] extends (_: any) => any ? never : K;
3
+ }[keyof T]>;
4
+ export type NgtAnyRecord = Record<string, any>;
5
+ export type NgtEquConfig = {
6
+ /** Compare arrays by reference equality a === b (default), or by shallow equality */
7
+ arrays?: 'reference' | 'shallow';
8
+ /** Compare objects by reference equality a === b (default), or by shallow equality */
9
+ objects?: 'reference' | 'shallow';
10
+ /** If true the keys in both a and b must match 1:1 (default), if false a's keys must intersect b's */
11
+ strict?: boolean;
12
+ };
@@ -0,0 +1,3 @@
1
+ import { type NgtInstanceNode } from '../instance';
2
+ import type { NgtAnyRecord } from '../types';
3
+ export declare function applyProps(instance: NgtInstanceNode, props: NgtAnyRecord): any;
@@ -0,0 +1,11 @@
1
+ import { type NgtAttachFunction } from '../instance';
2
+ import type { NgtState } from '../store';
3
+ import type { NgtAnyRecord } from '../types';
4
+ import type { NgtSignalStore } from './signal-store';
5
+ export declare function attach(object: NgtAnyRecord, value: unknown, paths?: string[]): void;
6
+ export declare function detach(parent: NgtAnyRecord, child: NgtAnyRecord, attachProp: string[] | NgtAttachFunction): void;
7
+ export declare function createAttachFunction<TChild = any, TParent = any>(cb: (params: {
8
+ parent: TParent;
9
+ child: TChild;
10
+ store: NgtSignalStore<NgtState>;
11
+ }) => (() => void) | void): NgtAttachFunction<TChild, TParent>;
@@ -0,0 +1,6 @@
1
+ import { Injector } from '@angular/core';
2
+ import { type NgtBeforeRenderRecord } from '../store';
3
+ export declare function injectBeforeRender(cb: NgtBeforeRenderRecord['callback'], { priority, injector }?: {
4
+ priority?: number;
5
+ injector?: Injector;
6
+ }): () => void;
@@ -0,0 +1,23 @@
1
+ import { type Type } from '@angular/core';
2
+ import { type CreateInjectionTokenOptions } from 'ngxtension/create-injection-token';
3
+ declare function apiFactory<TObject extends {
4
+ api: any;
5
+ }, TApi = TObject extends {
6
+ api: infer Api;
7
+ } ? Api : never>(obj: TObject): TApi;
8
+ export declare function createApiToken<TObject extends {
9
+ api: any;
10
+ }, TApi = TObject extends {
11
+ api: infer Api;
12
+ } ? Api : never>(forwardedObject: () => Type<TObject>): readonly [{
13
+ (): CreateInjectionTokenOptions<typeof apiFactory, [TObject]>["multi"] extends true ? TApi[] : TApi;
14
+ (injectOptions: import("@angular/core").InjectOptions & {
15
+ optional?: false | undefined;
16
+ } & {
17
+ injector?: import("@angular/core").Injector | undefined;
18
+ }): CreateInjectionTokenOptions<typeof apiFactory, [TObject]>["multi"] extends true ? TApi[] : TApi;
19
+ (injectOptions: import("@angular/core").InjectOptions & {
20
+ injector?: import("@angular/core").Injector | undefined;
21
+ }): (CreateInjectionTokenOptions<typeof apiFactory, [TObject]>["multi"] extends true ? TApi[] : TApi) | null;
22
+ }, () => import("@angular/core").Provider];
23
+ export {};
@@ -0,0 +1,5 @@
1
+ import { type InputSignal, type Signal, type Type } from '@angular/core';
2
+ export type Inputs<T> = {
3
+ [P in keyof T]: T[P] extends InputSignal<infer U> ? U : never;
4
+ };
5
+ export declare function injectInputs<TDirective extends Type<any>>(dir: InstanceType<TDirective>, dirType: TDirective): Signal<Inputs<InstanceType<TDirective>>>;
@@ -0,0 +1,23 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import type * as THREE from 'three';
3
+ import type { NgtRendererLike } from '../store';
4
+ import type { NgtEquConfig } from '../types';
5
+ export declare const is: {
6
+ obj: (a: unknown) => a is object;
7
+ material: (a: unknown) => a is THREE.Material;
8
+ geometry: (a: unknown) => a is THREE.BufferGeometry<THREE.NormalBufferAttributes>;
9
+ orthographicCamera: (a: unknown) => a is THREE.OrthographicCamera;
10
+ perspectiveCamera: (a: unknown) => a is THREE.PerspectiveCamera;
11
+ camera: (a: unknown) => a is THREE.Camera;
12
+ renderer: (a: unknown) => boolean;
13
+ scene: (a: unknown) => a is THREE.Scene;
14
+ ref: (a: unknown) => a is ElementRef<any>;
15
+ instance: (a: unknown) => a is any;
16
+ object3D: (a: unknown) => a is THREE.Object3D<THREE.Object3DEventMap>;
17
+ colorSpaceExist: <T extends object | NgtRendererLike | THREE.Texture, P = T extends NgtRendererLike ? {
18
+ outputColorSpace: string;
19
+ } : {
20
+ colorSpace: string;
21
+ }>(object: T) => object is T & P;
22
+ equ(a: any, b: any, { arrays, objects, strict }?: NgtEquConfig): boolean;
23
+ };
@@ -0,0 +1,19 @@
1
+ import * as THREE from 'three';
2
+ import type { NgtGLOptions } from '../canvas';
3
+ import type { NgtIntersection } from '../events';
4
+ import type { NgtCanvasElement } from '../roots';
5
+ import type { NgtDpr, NgtSize } from '../store';
6
+ export declare function makeId(event?: NgtIntersection): string;
7
+ export declare function makeDpr(dpr: NgtDpr, window?: Window): number;
8
+ export declare function makeRendererInstance<TCanvas extends NgtCanvasElement>(glOptions: NgtGLOptions, canvas: TCanvas): THREE.WebGLRenderer;
9
+ export declare function makeCameraInstance(isOrthographic: boolean, size: NgtSize): THREE.OrthographicCamera | THREE.PerspectiveCamera;
10
+ export type NgtObjectMap = {
11
+ nodes: {
12
+ [name: string]: THREE.Object3D;
13
+ };
14
+ materials: {
15
+ [name: string]: THREE.Material;
16
+ };
17
+ [key: string]: any;
18
+ };
19
+ export declare function makeObjectGraph(object: THREE.Object3D): NgtObjectMap;
@@ -0,0 +1,30 @@
1
+ import { type CreateComputedOptions, type CreateSignalOptions, type Signal } from '@angular/core';
2
+ export type NgtSignalStore<State extends object> = {
3
+ select<Key1 extends keyof State, Key2 extends keyof State[Key1], Key3 extends keyof State[Key1][Key2], Key4 extends keyof State[Key1][Key2][Key3]>(key1: Key1, key2: Key2, key3: Key3, key4: Key4, options?: CreateComputedOptions<State[Key1][Key2][Key3][Key4]>): Signal<State[Key1][Key2][Key3][Key4]>;
4
+ select<Key1 extends keyof State, Key2 extends keyof State[Key1], Key3 extends keyof State[Key1][Key2]>(key1: Key1, key2: Key2, key3: Key3, options?: CreateComputedOptions<State[Key1][Key2][Key3]>): Signal<State[Key1][Key2][Key3]>;
5
+ select<Key1 extends keyof State, Key2 extends keyof State[Key1]>(key1: Key1, key2: Key2, options?: CreateComputedOptions<State[Key1][Key2]>): Signal<State[Key1][Key2]>;
6
+ select<Key extends keyof State>(key: Key, options?: CreateComputedOptions<State[Key]>): Signal<State[Key]>;
7
+ select(options?: CreateComputedOptions<State>): Signal<State>;
8
+ get<Key1 extends keyof State, Key2 extends keyof State[Key1], Key3 extends keyof State[Key1][Key2], Key4 extends keyof State[Key1][Key2][Key3]>(key1: Key1, key2: Key2, key3: Key3, key4: Key4): State[Key1][Key2][Key3][Key4];
9
+ get<Key1 extends keyof State, Key2 extends keyof State[Key1], Key3 extends keyof State[Key1][Key2]>(key1: Key1, key2: Key2, key3: Key3): State[Key1][Key2][Key3];
10
+ get<Key1 extends keyof State, Key2 extends keyof State[Key1]>(key1: Key1, key2: Key2): State[Key1][Key2];
11
+ get<Key extends keyof State>(key: Key): State[Key];
12
+ get(): State;
13
+ /**
14
+ * New state takes precedence
15
+ */
16
+ update(state: Partial<State> | ((previous: State) => Partial<State>)): void;
17
+ /**
18
+ * Non-undefined old state takes precedence
19
+ */
20
+ patch(state: Partial<State> | ((previous: State) => Partial<State>)): void;
21
+ /**
22
+ * Equivalence to select()
23
+ */
24
+ state: Signal<State>;
25
+ /**
26
+ * Equivalence to get()
27
+ */
28
+ get snapshot(): State;
29
+ };
30
+ export declare function signalStore<State extends object>(initialState?: Partial<State> | ((storeApi: Pick<NgtSignalStore<State>, 'get' | 'update' | 'patch' | 'select'>) => Partial<State>), options?: CreateSignalOptions<State>): NgtSignalStore<State>;
@@ -0,0 +1,4 @@
1
+ import type { NgtCameraManual, NgtSize } from '../store';
2
+ export declare function checkNeedsUpdate(value: unknown): void;
3
+ export declare function checkUpdate(value: unknown): void;
4
+ export declare function updateCamera(camera: NgtCameraManual, size: NgtSize): void;