@combeenation/3d-viewer 4.1.0 → 4.3.0-alpha1

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 (80) hide show
  1. package/README.md +2 -2
  2. package/dist/lib-cjs/api/classes/dottedPath.js +2 -5
  3. package/dist/lib-cjs/api/classes/dottedPath.js.map +1 -1
  4. package/dist/lib-cjs/api/classes/element.js +89 -66
  5. package/dist/lib-cjs/api/classes/element.js.map +1 -1
  6. package/dist/lib-cjs/api/classes/event.js.map +1 -1
  7. package/dist/lib-cjs/api/classes/eventBroadcaster.js.map +1 -1
  8. package/dist/lib-cjs/api/classes/parameter.js +3 -2
  9. package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
  10. package/dist/lib-cjs/api/classes/parameterObservable.js.map +1 -1
  11. package/dist/lib-cjs/api/classes/parameterizable.js.map +1 -1
  12. package/dist/lib-cjs/api/classes/placementAnimation.js +2 -2
  13. package/dist/lib-cjs/api/classes/placementAnimation.js.map +1 -1
  14. package/dist/lib-cjs/api/classes/variant.js +26 -19
  15. package/dist/lib-cjs/api/classes/variant.js.map +1 -1
  16. package/dist/lib-cjs/api/classes/variantInstance.js +19 -19
  17. package/dist/lib-cjs/api/classes/variantInstance.js.map +1 -1
  18. package/dist/lib-cjs/api/classes/variantParameterizable.js.map +1 -1
  19. package/dist/lib-cjs/api/classes/viewer.d.ts +13 -3
  20. package/dist/lib-cjs/api/classes/viewer.js +107 -51
  21. package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
  22. package/dist/lib-cjs/api/classes/viewerLight.js +24 -24
  23. package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -1
  24. package/dist/lib-cjs/api/internal/debugViewer.js +1 -2
  25. package/dist/lib-cjs/api/internal/debugViewer.js.map +1 -1
  26. package/dist/lib-cjs/api/internal/lensRendering.js.map +1 -1
  27. package/dist/lib-cjs/api/internal/sceneSetup.js +25 -22
  28. package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
  29. package/dist/lib-cjs/api/manager/animationManager.js +24 -15
  30. package/dist/lib-cjs/api/manager/animationManager.js.map +1 -1
  31. package/dist/lib-cjs/api/manager/sceneManager.js +3 -3
  32. package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
  33. package/dist/lib-cjs/api/manager/variantInstanceManager.js +10 -7
  34. package/dist/lib-cjs/api/manager/variantInstanceManager.js.map +1 -1
  35. package/dist/lib-cjs/api/store/specStorage.js.map +1 -1
  36. package/dist/lib-cjs/api/util/babylonHelper.d.ts +1 -1
  37. package/dist/lib-cjs/api/util/babylonHelper.js +12 -15
  38. package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
  39. package/dist/lib-cjs/api/util/globalTypes.d.ts +31 -24
  40. package/dist/lib-cjs/api/util/resourceHelper.js +3 -1
  41. package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
  42. package/dist/lib-cjs/api/util/stringHelper.d.ts +1 -1
  43. package/dist/lib-cjs/api/util/stringHelper.js +2 -2
  44. package/dist/lib-cjs/api/util/stringHelper.js.map +1 -1
  45. package/dist/lib-cjs/index.js.map +1 -1
  46. package/package.json +7 -3
  47. package/src/api/classes/animationInterface.ts +4 -6
  48. package/src/api/classes/dottedPath.ts +179 -187
  49. package/src/api/classes/element.ts +644 -621
  50. package/src/api/classes/event.ts +310 -313
  51. package/src/api/classes/eventBroadcaster.ts +47 -49
  52. package/src/api/classes/parameter.ts +394 -397
  53. package/src/api/classes/parameterObservable.ts +84 -83
  54. package/src/api/classes/parameterizable.ts +71 -73
  55. package/src/api/classes/placementAnimation.ts +130 -130
  56. package/src/api/classes/variant.ts +806 -778
  57. package/src/api/classes/variantInstance.ts +60 -52
  58. package/src/api/classes/variantParameterizable.ts +72 -67
  59. package/src/api/classes/viewer.ts +530 -451
  60. package/src/api/classes/viewerLight.ts +300 -300
  61. package/src/api/internal/debugViewer.ts +61 -53
  62. package/src/api/internal/lensRendering.ts +2 -3
  63. package/src/api/internal/sceneSetup.ts +144 -137
  64. package/src/api/manager/animationManager.ts +122 -97
  65. package/src/api/manager/sceneManager.ts +83 -86
  66. package/src/api/manager/variantInstanceManager.ts +234 -224
  67. package/src/api/store/specStorage.ts +48 -51
  68. package/src/api/util/babylonHelper.ts +329 -325
  69. package/src/api/util/globalTypes.ts +244 -239
  70. package/src/api/util/resourceHelper.ts +97 -109
  71. package/src/api/util/stringHelper.ts +13 -16
  72. package/src/buildinfo.json +2 -2
  73. package/src/commonjs.tsconfig.json +8 -11
  74. package/src/declaration.tsconfig.json +6 -8
  75. package/src/dev.ts +28 -28
  76. package/src/es6.tsconfig.json +8 -11
  77. package/src/index.ts +39 -39
  78. package/src/tsconfig.json +30 -41
  79. package/src/tsconfig.types.json +8 -9
  80. package/src/types.d.ts +0 -1
@@ -4,7 +4,6 @@ import { isString } from 'lodash-es';
4
4
  /** @internal **/
5
5
  export const emitter = new EventEmitter();
6
6
 
7
-
8
7
  /**
9
8
  * This `Event` class defines all events that can be consumed and fired by the {@link EventBroadcaster}. Use
10
9
  * {@link EventBroadcaster.addEventListener} or {@link EventBroadcaster.on} to register event handler on your objects.
@@ -35,336 +34,334 @@ export const emitter = new EventEmitter();
35
34
  * ```
36
35
  */
37
36
  export class Event {
37
+ /**
38
+ * Constructor.
39
+ */
40
+ private constructor() {}
38
41
 
39
- /**
40
- * Constructor.
41
- */
42
- private constructor() {}
43
-
44
- /**
45
- * Fired before bootstrapping of the {@link Viewer} starts.
46
- *
47
- * Scopes:
48
- * * Global
49
- * * {@link Viewer}
50
- *
51
- * Payload:
52
- * * viewer: {@link Viewer}
53
- */
54
- public static readonly BOOTSTRAP_START = 'bootstrapStart';
55
- /**
56
- * Fired after bootstrapping of the {@link Viewer} finished.
57
- *
58
- * Scopes:
59
- * * Global
60
- * * {@link Viewer}
61
- *
62
- * Payload:
63
- * * viewer: {@link Viewer}
64
- */
65
- public static readonly BOOTSTRAP_END = 'bootstrapEnd';
66
-
67
- /**
68
- * Fired before loading any type of JSON or resource.
69
- *
70
- * Scopes:
71
- * * Global
72
- *
73
- * Payload:
74
- * * path: string
75
- */
76
- public static readonly LOADING_START = 'loadingStart';
77
- /**
78
- * Fired after loading any type of JSON or resource finished.
79
- *
80
- * Scopes:
81
- * * Global
82
- *
83
- * Payload:
84
- * * path: string
85
- */
86
- public static readonly LOADING_END = 'loadingEnd';
42
+ /**
43
+ * Fired before bootstrapping of the {@link Viewer} starts.
44
+ *
45
+ * Scopes:
46
+ * * Global
47
+ * * {@link Viewer}
48
+ *
49
+ * Payload:
50
+ * * viewer: {@link Viewer}
51
+ */
52
+ public static readonly BOOTSTRAP_START = 'bootstrapStart';
53
+ /**
54
+ * Fired after bootstrapping of the {@link Viewer} finished.
55
+ *
56
+ * Scopes:
57
+ * * Global
58
+ * * {@link Viewer}
59
+ *
60
+ * Payload:
61
+ * * viewer: {@link Viewer}
62
+ */
63
+ public static readonly BOOTSTRAP_END = 'bootstrapEnd';
87
64
 
88
- /**
89
- * Fired before loading an asset (e.g. glTF) onto the scene.
90
- *
91
- * Scopes:
92
- * * Global
93
- * * {@link Variant}
94
- *
95
- * Payload:
96
- * * variant: {@link Variant}
97
- */
98
- public static readonly ASSET_LOADING_START = 'assetLoadingStart';
99
- /**
100
- * Fired after loading an asset (e.g. glTF) onto the scene finished.
101
- *
102
- * Scopes:
103
- * * Global
104
- * * {@link Variant}
105
- *
106
- * Payload:
107
- * * variant: {@link Variant}
108
- */
109
- public static readonly ASSET_LOADING_END = 'assetLoadingEnd';
65
+ /**
66
+ * Fired before loading any type of JSON or resource.
67
+ *
68
+ * Scopes:
69
+ * * Global
70
+ *
71
+ * Payload:
72
+ * * path: string
73
+ */
74
+ public static readonly LOADING_START = 'loadingStart';
75
+ /**
76
+ * Fired after loading any type of JSON or resource finished.
77
+ *
78
+ * Scopes:
79
+ * * Global
80
+ *
81
+ * Payload:
82
+ * * path: string
83
+ */
84
+ public static readonly LOADING_END = 'loadingEnd';
110
85
 
111
- /**
112
- * Fired before scene initialization starts when bootstrapping the {@link Viewer}.
113
- *
114
- * Scopes:
115
- * * Global
116
- * * {@link Viewer}
117
- *
118
- * Payload:
119
- * * sceneJson: {@link SceneJson}
120
- */
121
- public static readonly SCENE_PROCESSING_START = 'sceneProcessingStart';
122
- /**
123
- * Fired after scene initialization end when bootstrapping the {@link Viewer}.
124
- *
125
- * Scopes:
126
- * * Global
127
- * * {@link Viewer}
128
- *
129
- * Payload:
130
- * * scene: {@link Scene}
131
- */
132
- public static readonly SCENE_PROCESSING_END = 'sceneProcessingEnd';
86
+ /**
87
+ * Fired before loading an asset (e.g. glTF) onto the scene.
88
+ *
89
+ * Scopes:
90
+ * * Global
91
+ * * {@link Variant}
92
+ *
93
+ * Payload:
94
+ * * variant: {@link Variant}
95
+ */
96
+ public static readonly ASSET_LOADING_START = 'assetLoadingStart';
97
+ /**
98
+ * Fired after loading an asset (e.g. glTF) onto the scene finished.
99
+ *
100
+ * Scopes:
101
+ * * Global
102
+ * * {@link Variant}
103
+ *
104
+ * Payload:
105
+ * * variant: {@link Variant}
106
+ */
107
+ public static readonly ASSET_LOADING_END = 'assetLoadingEnd';
133
108
 
134
- /**
135
- * Fired after a {@link Variant} has been created.
136
- *
137
- * Scopes:
138
- * * Global
139
- * * {@link Variant}
140
- *
141
- * Payload:
142
- * * variant: {@link Variant}
143
- */
144
- public static readonly VARIANT_CREATED = 'variantCreated';
145
- /**
146
- * Fired after a {@link Variant} has been destroyed.
147
- *
148
- * Scopes:
149
- * * Global
150
- * * {@link Variant}
151
- *
152
- * Payload:
153
- * * variant: {@link Variant}
154
- */
155
- public static readonly VARIANT_DESTROYED = 'variantDestroyed';
109
+ /**
110
+ * Fired before scene initialization starts when bootstrapping the {@link Viewer}.
111
+ *
112
+ * Scopes:
113
+ * * Global
114
+ * * {@link Viewer}
115
+ *
116
+ * Payload:
117
+ * * sceneJson: {@link SceneJson}
118
+ */
119
+ public static readonly SCENE_PROCESSING_START = 'sceneProcessingStart';
120
+ /**
121
+ * Fired after scene initialization end when bootstrapping the {@link Viewer}.
122
+ *
123
+ * Scopes:
124
+ * * Global
125
+ * * {@link Viewer}
126
+ *
127
+ * Payload:
128
+ * * scene: {@link Scene}
129
+ */
130
+ public static readonly SCENE_PROCESSING_END = 'sceneProcessingEnd';
156
131
 
157
- /**
158
- * Fired after the {@link Variant} under the cursor has been picked/selected.
159
- *
160
- * Scopes:
161
- * * Global
162
- * * {@link Viewer}
163
- *
164
- * Payload:
165
- * * variant: {@link Variant}
166
- */
167
- public static readonly VARIANT_PICKED = 'variantPicked';
132
+ /**
133
+ * Fired after a {@link Variant} has been created.
134
+ *
135
+ * Scopes:
136
+ * * Global
137
+ * * {@link Variant}
138
+ *
139
+ * Payload:
140
+ * * variant: {@link Variant}
141
+ */
142
+ public static readonly VARIANT_CREATED = 'variantCreated';
143
+ /**
144
+ * Fired after a {@link Variant} has been destroyed.
145
+ *
146
+ * Scopes:
147
+ * * Global
148
+ * * {@link Variant}
149
+ *
150
+ * Payload:
151
+ * * variant: {@link Variant}
152
+ */
153
+ public static readonly VARIANT_DESTROYED = 'variantDestroyed';
168
154
 
169
- /**
170
- * Fired after the {@link Element} under the cursor has been picked/selected.
171
- *
172
- * Scopes:
173
- * * Global
174
- * * {@link Viewer}
175
- *
176
- * Payload:
177
- * * element: {@link Element}
178
- */
179
- public static readonly ELEMENT_PICKED = 'elementPicked';
155
+ /**
156
+ * Fired after the {@link Variant} under the cursor has been picked/selected.
157
+ *
158
+ * Scopes:
159
+ * * Global
160
+ * * {@link Viewer}
161
+ *
162
+ * Payload:
163
+ * * variant: {@link Variant}
164
+ */
165
+ public static readonly VARIANT_PICKED = 'variantPicked';
180
166
 
181
- /**
182
- * Fired after a parameter on a {@link Variant} has been committed.
183
- *
184
- * Scopes:
185
- * * Global
186
- * * {@link Variant}
187
- *
188
- * Payload:
189
- * * variant: {@link Variant}
190
- * * parameter: string
191
- * * oldValue: string
192
- * * newValue: string
193
- */
194
- public static readonly VARIANT_PARAMETER_COMMITTED = 'variantParameterCommitted';
167
+ /**
168
+ * Fired after the {@link Element} under the cursor has been picked/selected.
169
+ *
170
+ * Scopes:
171
+ * * Global
172
+ * * {@link Viewer}
173
+ *
174
+ * Payload:
175
+ * * element: {@link Element}
176
+ */
177
+ public static readonly ELEMENT_PICKED = 'elementPicked';
195
178
 
196
- /**
197
- * Fired after a {@link ParameterBag} has been committed.
198
- *
199
- * Scopes:
200
- * * Global
201
- * * {@link Variant}
202
- *
203
- * Payload:
204
- * * variant: {@link Variant}
205
- * * parameters: {@link ParameterBag}
206
- * * oldValues: string[]
207
- * * newValues: string[]
208
- */
209
- public static readonly VARIANT_PARAMETER_BAG_COMMITTED = 'variantParameterBagCommitted';
179
+ /**
180
+ * Fired after a parameter on a {@link Variant} has been committed.
181
+ *
182
+ * Scopes:
183
+ * * Global
184
+ * * {@link Variant}
185
+ *
186
+ * Payload:
187
+ * * variant: {@link Variant}
188
+ * * parameter: string
189
+ * * oldValue: string
190
+ * * newValue: string
191
+ */
192
+ public static readonly VARIANT_PARAMETER_COMMITTED = 'variantParameterCommitted';
210
193
 
211
- /**
212
- * Fired after a {@link VariantInstance} has been created.
213
- *
214
- * Scopes:
215
- * * Global
216
- * * {@link VariantInstanceManager}
217
- *
218
- * Payload:
219
- * * variantInstance: {@link VariantInstance}
220
- */
221
- public static readonly VARIANT_INSTANCE_CREATED = 'variantInstanceCreated';
222
- /**
223
- * Fired after a {@link VariantInstance} has been registered. This is the case when the {@link VariantInstance} is
224
- * considered "lazy".
225
- *
226
- * Scopes:
227
- * * Global
228
- * * {@link VariantInstanceManager}
229
- *
230
- * Payload:
231
- * * variantInstanceDefinition: {@link VariantInstanceDefinition}
232
- */
233
- public static readonly VARIANT_INSTANCE_REGISTERED = 'variantInstanceRegistered';
234
- /**
235
- * Fired after a {@link VariantInstance} has been cloned.
236
- *
237
- * Scopes:
238
- * * Global
239
- * * {@link VariantInstanceManager}
240
- *
241
- * Payload:
242
- * * variantInstanceClone: {@link VariantInstance}
243
- */
244
- public static readonly VARIANT_INSTANCE_CLONED = 'variantInstanceCloned';
245
- /**
246
- * Fired after a {@link VariantInstance} has been destroyed.
247
- *
248
- * Scopes:
249
- * * Global
250
- * * {@link VariantInstanceManager}
251
- *
252
- * Payload:
253
- * * variantInstance: {@link VariantInstance}
254
- */
255
- public static readonly VARIANT_INSTANCE_DESTROYED = 'variantInstanceDestroyed';
194
+ /**
195
+ * Fired after a {@link ParameterBag} has been committed.
196
+ *
197
+ * Scopes:
198
+ * * Global
199
+ * * {@link Variant}
200
+ *
201
+ * Payload:
202
+ * * variant: {@link Variant}
203
+ * * parameters: {@link ParameterBag}
204
+ * * oldValues: string[]
205
+ * * newValues: string[]
206
+ */
207
+ public static readonly VARIANT_PARAMETER_BAG_COMMITTED = 'variantParameterBagCommitted';
256
208
 
257
- /**
258
- * Fired after a parameter on an {@link Element} has been committed.
259
- *
260
- * Scopes:
261
- * * Global
262
- * * {@link Element}
263
- *
264
- * Payload:
265
- * * element: {@link Element}
266
- * * parameter: string
267
- * * oldValue: string
268
- * * newValue: string
269
- */
270
- public static readonly ELEMENT_PARAMETER_COMMITTED = 'elementParameterCommitted';
209
+ /**
210
+ * Fired after a {@link VariantInstance} has been created.
211
+ *
212
+ * Scopes:
213
+ * * Global
214
+ * * {@link VariantInstanceManager}
215
+ *
216
+ * Payload:
217
+ * * variantInstance: {@link VariantInstance}
218
+ */
219
+ public static readonly VARIANT_INSTANCE_CREATED = 'variantInstanceCreated';
220
+ /**
221
+ * Fired after a {@link VariantInstance} has been registered. This is the case when the {@link VariantInstance} is
222
+ * considered "lazy".
223
+ *
224
+ * Scopes:
225
+ * * Global
226
+ * * {@link VariantInstanceManager}
227
+ *
228
+ * Payload:
229
+ * * variantInstanceDefinition: {@link VariantInstanceDefinition}
230
+ */
231
+ public static readonly VARIANT_INSTANCE_REGISTERED = 'variantInstanceRegistered';
232
+ /**
233
+ * Fired after a {@link VariantInstance} has been cloned.
234
+ *
235
+ * Scopes:
236
+ * * Global
237
+ * * {@link VariantInstanceManager}
238
+ *
239
+ * Payload:
240
+ * * variantInstanceClone: {@link VariantInstance}
241
+ */
242
+ public static readonly VARIANT_INSTANCE_CLONED = 'variantInstanceCloned';
243
+ /**
244
+ * Fired after a {@link VariantInstance} has been destroyed.
245
+ *
246
+ * Scopes:
247
+ * * Global
248
+ * * {@link VariantInstanceManager}
249
+ *
250
+ * Payload:
251
+ * * variantInstance: {@link VariantInstance}
252
+ */
253
+ public static readonly VARIANT_INSTANCE_DESTROYED = 'variantInstanceDestroyed';
271
254
 
272
- /**
273
- * Fired after a parameter on an {@link ViewerLight} has been committed.
274
- *
275
- * Scopes:
276
- * * Global
277
- * * {@link ViewerLight}
278
- *
279
- * Payload:
280
- * * light: {@link ViewerLight}
281
- * * parameter: string
282
- * * oldValue: string
283
- * * newValue: string
284
- */
285
- public static readonly VIEWER_LIGHT_PARAMETER_COMMITTED = 'viewerLightParameterCommitted';
255
+ /**
256
+ * Fired after a parameter on an {@link Element} has been committed.
257
+ *
258
+ * Scopes:
259
+ * * Global
260
+ * * {@link Element}
261
+ *
262
+ * Payload:
263
+ * * element: {@link Element}
264
+ * * parameter: string
265
+ * * oldValue: string
266
+ * * newValue: string
267
+ */
268
+ public static readonly ELEMENT_PARAMETER_COMMITTED = 'elementParameterCommitted';
286
269
 
287
- /**
288
- * Fired after a parameter on an {@link SceneManager} has been committed.
289
- *
290
- * Scopes:
291
- * * Global
292
- * * {@link SceneManager}
293
- *
294
- * Payload:
295
- * * variant: {@link SceneManager}
296
- * * parameter: string
297
- * * oldValue: string
298
- * * newValue: string
299
- */
300
- public static readonly SCENE_PARAMETER_COMMITTED = 'sceneParameterCommitted';
270
+ /**
271
+ * Fired after a parameter on an {@link ViewerLight} has been committed.
272
+ *
273
+ * Scopes:
274
+ * * Global
275
+ * * {@link ViewerLight}
276
+ *
277
+ * Payload:
278
+ * * light: {@link ViewerLight}
279
+ * * parameter: string
280
+ * * oldValue: string
281
+ * * newValue: string
282
+ */
283
+ public static readonly VIEWER_LIGHT_PARAMETER_COMMITTED = 'viewerLightParameterCommitted';
301
284
 
302
- /**
303
- * Fired after the active camera on the scene has been switched.
304
- *
305
- * Scopes:
306
- * * Global
307
- * * {@link Viewer}
308
- *
309
- * Payload:
310
- * * camera: Camera
311
- */
312
- public static readonly CAMERA_SWITCHED = 'cameraSwitched';
285
+ /**
286
+ * Fired after a parameter on an {@link SceneManager} has been committed.
287
+ *
288
+ * Scopes:
289
+ * * Global
290
+ * * {@link SceneManager}
291
+ *
292
+ * Payload:
293
+ * * variant: {@link SceneManager}
294
+ * * parameter: string
295
+ * * oldValue: string
296
+ * * newValue: string
297
+ */
298
+ public static readonly SCENE_PARAMETER_COMMITTED = 'sceneParameterCommitted';
313
299
 
314
- /**
315
- * Fired after the {@link Mesh} under the cursor has been picked/selected.
316
- *
317
- * Scopes:
318
- * * Global
319
- * * {@link Viewer}
320
- *
321
- * Payload:
322
- * * mesh: {@link Mesh}
323
- * * element: {@link Element}
324
- * * variant: {@link Variant}
325
- */
326
- public static readonly MESH_PICKED = 'meshPicked';
300
+ /**
301
+ * Fired after the active camera on the scene has been switched.
302
+ *
303
+ * Scopes:
304
+ * * Global
305
+ * * {@link Viewer}
306
+ *
307
+ * Payload:
308
+ * * camera: Camera
309
+ */
310
+ public static readonly CAMERA_SWITCHED = 'cameraSwitched';
327
311
 
328
- /**
329
- * All events defined in this class.
330
- */
331
- public static get all() {
332
- const all: string[] = [];
333
- for( const event in Event ) {
334
- const property = Object.getOwnPropertyDescriptor(Event, event);
335
- if( event.toUpperCase() === event && property && isString( property.value ) ) {
336
- all.push( property.value );
337
- }
338
- }
339
- return all;
340
- }
312
+ /**
313
+ * Fired after the {@link Mesh} under the cursor has been picked/selected.
314
+ *
315
+ * Scopes:
316
+ * * Global
317
+ * * {@link Viewer}
318
+ *
319
+ * Payload:
320
+ * * mesh: {@link Mesh}
321
+ * * element: {@link Element}
322
+ * * variant: {@link Variant}
323
+ */
324
+ public static readonly MESH_PICKED = 'meshPicked';
341
325
 
342
- /**
343
- * All events starting with 'variant'.
344
- */
345
- public static get variant() {
346
- return Event.all.filter( event => event.startsWith( 'variant' ) );
347
- }
326
+ /**
327
+ * All events defined in this class.
328
+ */
329
+ public static get all() {
330
+ const all: string[] = [];
331
+ for (const event in Event) {
332
+ const property = Object.getOwnPropertyDescriptor(Event, event);
333
+ if (event.toUpperCase() === event && property && isString(property.value)) {
334
+ all.push(property.value);
335
+ }
336
+ }
337
+ return all;
338
+ }
348
339
 
349
- /**
350
- * All events starting with 'element'.
351
- */
352
- public static get element() {
353
- return Event.all.filter( event => event.startsWith( 'element' ) );
354
- }
340
+ /**
341
+ * All events starting with 'variant'.
342
+ */
343
+ public static get variant() {
344
+ return Event.all.filter(event => event.startsWith('variant'));
345
+ }
355
346
 
356
- /**
357
- * All events starting with 'scene'.
358
- */
359
- public static get scene() {
360
- return Event.all.filter( event => event.startsWith( 'scene' ) );
361
- }
347
+ /**
348
+ * All events starting with 'element'.
349
+ */
350
+ public static get element() {
351
+ return Event.all.filter(event => event.startsWith('element'));
352
+ }
362
353
 
363
- /**
364
- * All events starting with 'camera'.
365
- */
366
- public static get camera() {
367
- return Event.all.filter( event => event.startsWith( 'camera' ) );
368
- }
354
+ /**
355
+ * All events starting with 'scene'.
356
+ */
357
+ public static get scene() {
358
+ return Event.all.filter(event => event.startsWith('scene'));
359
+ }
369
360
 
361
+ /**
362
+ * All events starting with 'camera'.
363
+ */
364
+ public static get camera() {
365
+ return Event.all.filter(event => event.startsWith('camera'));
366
+ }
370
367
  }