angular-three 2.0.0-beta.270 → 2.0.0-beta.271

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/lib/canvas.d.ts CHANGED
@@ -93,8 +93,8 @@ export declare class NgtCanvas {
93
93
  name?: string | undefined;
94
94
  readonly type?: string | undefined;
95
95
  attach: string | string[] | import("angular-three").NgtAttachFunction;
96
- addEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<Camera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<Camera, typeof Camera>, ev: import("./three-types").NgtNodeEventMap<Camera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtObject3DEventsMap[TEventKey]) => any) => void);
97
- removeEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<Camera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<Camera, typeof Camera>, ev: import("./three-types").NgtNodeEventMap<Camera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtObject3DEventsMap[TEventKey]) => any) => void);
96
+ addEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<Camera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<Camera, typeof Camera>, ev: import("./three-types").NgtNodeEventMap<Camera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtAllObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtAllObject3DEventsMap[TEventKey]) => any) => void);
97
+ removeEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<Camera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<Camera, typeof Camera>, ev: import("./three-types").NgtNodeEventMap<Camera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtAllObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtAllObject3DEventsMap[TEventKey]) => any) => void);
98
98
  __ngt_args__: [];
99
99
  readonly isCamera?: true | undefined;
100
100
  matrixWorldInverse?: import("three").Matrix4 | undefined;
@@ -191,8 +191,8 @@ export declare class NgtCanvas {
191
191
  name?: string | undefined;
192
192
  readonly type?: string | undefined;
193
193
  attach: string | string[] | import("angular-three").NgtAttachFunction;
194
- addEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<PerspectiveCamera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<PerspectiveCamera, typeof PerspectiveCamera>, ev: import("./three-types").NgtNodeEventMap<PerspectiveCamera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtObject3DEventsMap[TEventKey]) => any) => void);
195
- removeEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<PerspectiveCamera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<PerspectiveCamera, typeof PerspectiveCamera>, ev: import("./three-types").NgtNodeEventMap<PerspectiveCamera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtObject3DEventsMap[TEventKey]) => any) => void);
194
+ addEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<PerspectiveCamera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<PerspectiveCamera, typeof PerspectiveCamera>, ev: import("./three-types").NgtNodeEventMap<PerspectiveCamera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtAllObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtAllObject3DEventsMap[TEventKey]) => any) => void);
195
+ removeEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<PerspectiveCamera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<PerspectiveCamera, typeof PerspectiveCamera>, ev: import("./three-types").NgtNodeEventMap<PerspectiveCamera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtAllObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtAllObject3DEventsMap[TEventKey]) => any) => void);
196
196
  __ngt_args__: [fov?: number | undefined, aspect?: number | undefined, near?: number | undefined, far?: number | undefined];
197
197
  readonly isCamera?: true | undefined;
198
198
  matrixWorldInverse?: import("three").Matrix4 | undefined;
@@ -318,8 +318,8 @@ export declare class NgtCanvas {
318
318
  name?: string | undefined;
319
319
  readonly type?: string | undefined;
320
320
  attach: string | string[] | import("angular-three").NgtAttachFunction;
321
- addEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<OrthographicCamera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<OrthographicCamera, typeof OrthographicCamera>, ev: import("./three-types").NgtNodeEventMap<OrthographicCamera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtObject3DEventsMap[TEventKey]) => any) => void);
322
- removeEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<OrthographicCamera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<OrthographicCamera, typeof OrthographicCamera>, ev: import("./three-types").NgtNodeEventMap<OrthographicCamera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtObject3DEventsMap[TEventKey]) => any) => void);
321
+ addEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<OrthographicCamera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<OrthographicCamera, typeof OrthographicCamera>, ev: import("./three-types").NgtNodeEventMap<OrthographicCamera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtAllObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtAllObject3DEventsMap[TEventKey]) => any) => void);
322
+ removeEventListener: (<TEventKey extends keyof import("./three-types").NgtNodeEventMap<OrthographicCamera>>(type: TEventKey, listener: (this: import("./three-types").NgtNodeElement<OrthographicCamera, typeof OrthographicCamera>, ev: import("./three-types").NgtNodeEventMap<OrthographicCamera>[TEventKey]) => any) => void) & (<TEventKey extends keyof import("./three-types").NgtAllObject3DEventsMap>(type: TEventKey, listener: (this: any, ev: import("./three-types").NgtAllObject3DEventsMap[TEventKey]) => any) => void);
323
323
  __ngt_args__: [left?: number | undefined, right?: number | undefined, top?: number | undefined, bottom?: number | undefined, near?: number | undefined, far?: number | undefined];
324
324
  readonly isCamera?: true | undefined;
325
325
  matrixWorldInverse?: import("three").Matrix4 | undefined;
@@ -1,4 +1,4 @@
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';
1
+ import { AmbientLight, ArrayCamera, ArrowHelper, Audio, AxesHelper, BatchedMesh, 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
2
  import { NgtEventHandlers } from './events';
3
3
  import { NgtAfterAttach, NgtAttachFunction, NgtInstanceNode } from './instance';
4
4
  import { NgtBeforeRenderEvent } from './store';
@@ -43,6 +43,7 @@ export type NgtNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = Ex
43
43
  export type NgtObject3DEventsMap = {
44
44
  [TEvent in keyof NgtEventHandlers]-?: Parameters<NonNullable<NgtEventHandlers[TEvent]>>[0];
45
45
  };
46
+ export type NgtAllObject3DEventsMap = NgtObject3DEventsMap & NgtNodeEventMap<NgtInstanceNode>;
46
47
  export type NgtObject3DNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOriginal>> = Expand<NgtOverwrite<NgtNode<TOriginal, TConstructor, TNoEvent>, {
47
48
  position: NgtVector3;
48
49
  up: NgtVector3;
@@ -52,8 +53,8 @@ export type NgtObject3DNode<TOriginal, TConstructor, TNoEvent = NoEvent<TOrigina
52
53
  quaternion: NgtQuaternion;
53
54
  layers: NgtLayers;
54
55
  dispose: (() => void) | null;
55
- addEventListener<TEventKey extends keyof NgtObject3DEventsMap>(type: TEventKey, listener: (this: NgtObject3DNode<TOriginal, TConstructor>, ev: NgtObject3DEventsMap[TEventKey]) => any): void;
56
- removeEventListener<TEventKey extends keyof NgtObject3DEventsMap>(type: TEventKey, listener: (this: NgtObject3DNode<TOriginal, TConstructor>, ev: NgtObject3DEventsMap[TEventKey]) => any): void;
56
+ addEventListener<TEventKey extends keyof NgtAllObject3DEventsMap>(type: TEventKey, listener: (this: NgtObject3DNode<TOriginal, TConstructor>, ev: NgtAllObject3DEventsMap[TEventKey]) => any): void;
57
+ removeEventListener<TEventKey extends keyof NgtAllObject3DEventsMap>(type: TEventKey, listener: (this: NgtObject3DNode<TOriginal, TConstructor>, ev: NgtAllObject3DEventsMap[TEventKey]) => any): void;
57
58
  }>>;
58
59
  export type NgtGeometry<TGeometry extends BufferGeometry, TConstructor> = NgtNode<TGeometry, TConstructor>;
59
60
  export type NgtMaterial<TMaterial extends Material, TConstructor> = NgtNode<TMaterial, TConstructor>;
@@ -64,6 +65,7 @@ export type NgtAudioListener = NgtObject3DNode<AudioListener, typeof AudioListen
64
65
  export type NgtPositionalAudio = NgtObject3DNode<PositionalAudio, typeof PositionalAudio>;
65
66
  export type NgtMesh = NgtObject3DNode<Mesh, typeof Mesh>;
66
67
  export type NgtInstancedMesh = NgtObject3DNode<InstancedMesh, typeof InstancedMesh>;
68
+ export type NgtBatchedMesh = NgtObject3DNode<BatchedMesh, typeof BatchedMesh>;
67
69
  export type NgtScene = NgtObject3DNode<Scene, typeof Scene>;
68
70
  export type NgtSprite = NgtObject3DNode<Sprite, typeof Sprite>;
69
71
  export type NgtLOD = NgtObject3DNode<LOD, typeof LOD>;
@@ -299,5 +301,7 @@ export interface ThreeElements {
299
301
  declare global {
300
302
  interface HTMLElementTagNameMap extends ThreeElements {
301
303
  }
304
+ interface HTMLElementEventMap extends NgtNodeEventMap<NgtInstanceNode> {
305
+ }
302
306
  }
303
307
  export {};
@@ -8,12 +8,8 @@ export declare function makeDpr(dpr: NgtDpr, window?: Window): number;
8
8
  export declare function makeRendererInstance<TCanvas extends NgtCanvasElement>(glOptions: NgtGLOptions, canvas: TCanvas): WebGLRenderer;
9
9
  export declare function makeCameraInstance(isOrthographic: boolean, size: NgtSize): OrthographicCamera | PerspectiveCamera;
10
10
  export type NgtObjectMap = {
11
- nodes: {
12
- [name: string]: Object3D;
13
- };
14
- materials: {
15
- [name: string]: Material;
16
- };
11
+ nodes: Record<string, Object3D<any>>;
12
+ materials: Record<string, Material>;
17
13
  [key: string]: any;
18
14
  };
19
15
  export declare function makeObjectGraph(object: Object3D): NgtObjectMap;