@variantic/player 0.0.23 → 0.0.25
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 +35 -3
- package/assembly.d.ts +4762 -0
- package/index.d.ts +2198 -0
- package/package.json +17 -10
- package/libs/packages/player/src/index.d.ts +0 -8
- package/libs/schemas/engine/src/index.d.ts +0 -3
- package/libs/schemas/engine/src/lib/documentation.d.ts +0 -9
- package/libs/schemas/engine/src/lib/engine.d.ts +0 -206
- package/libs/schemas/engine/src/lib/publication.d.ts +0 -83
- package/libs/schemas/file-types/export-configuration/src/index.d.ts +0 -1
- package/libs/schemas/file-types/export-configuration/src/lib/export-configuration.d.ts +0 -10
- package/libs/schemas/file-types/vas/src/index.d.ts +0 -3
- package/libs/schemas/file-types/vas/src/lib/interaction.d.ts +0 -3
- package/libs/schemas/file-types/vas/src/lib/object-configuration.d.ts +0 -25
- package/libs/schemas/file-types/vas/src/lib/vas.d.ts +0 -526
- package/libs/schemas/library-api/src/index.d.ts +0 -1
- package/libs/schemas/library-api/src/lib/library-api.d.ts +0 -27
- package/libs/schemas/web-component/api/player/ar/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/ar/src/lib/ar.d.ts +0 -22
- package/libs/schemas/web-component/api/player/configuration/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/configuration/src/lib/configuration.d.ts +0 -27
- package/libs/schemas/web-component/api/player/documentation/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/documentation/src/lib/documentation.d.ts +0 -26
- package/libs/schemas/web-component/api/player/events/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/events/src/lib/events.d.ts +0 -19
- package/libs/schemas/web-component/api/player/integration-connector/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/integration-connector/src/lib/integration-connector.d.ts +0 -30
- package/libs/schemas/web-component/api/player/layout/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/layout/src/lib/layout.d.ts +0 -18
- package/libs/schemas/web-component/api/player/player/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/player/src/lib/player.d.ts +0 -46
- package/libs/schemas/web-component/api/player/snapshot/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/snapshot/src/lib/snapshot.d.ts +0 -29
- package/libs/schemas/web-component/api/player/viewer/src/index.d.ts +0 -1
- package/libs/schemas/web-component/api/player/viewer/src/lib/viewer.d.ts +0 -471
package/index.d.ts
ADDED
|
@@ -0,0 +1,2198 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
type EventName = PropertyKey;
|
|
4
|
+
type DatalessEventNames<EventData> = {
|
|
5
|
+
[Key in keyof EventData]: EventData[Key] extends undefined ? Key : never;
|
|
6
|
+
}[keyof EventData];
|
|
7
|
+
declare const listenerAdded: unique symbol;
|
|
8
|
+
declare const listenerRemoved: unique symbol;
|
|
9
|
+
type OmnipresentEventData = {
|
|
10
|
+
[listenerAdded]: ListenerChangedData;
|
|
11
|
+
[listenerRemoved]: ListenerChangedData;
|
|
12
|
+
};
|
|
13
|
+
type DebugLogger<EventData, Name extends keyof EventData> = (type: string, debugName: string, eventName?: Name, eventData?: EventData[Name]) => void;
|
|
14
|
+
type DebugOptions<EventData> = {
|
|
15
|
+
/**
|
|
16
|
+
Define a name for the instance of Emittery to use when outputting debug data.
|
|
17
|
+
|
|
18
|
+
@default undefined
|
|
19
|
+
|
|
20
|
+
@example
|
|
21
|
+
```
|
|
22
|
+
import Emittery from 'emittery';
|
|
23
|
+
|
|
24
|
+
Emittery.isDebugEnabled = true;
|
|
25
|
+
|
|
26
|
+
const emitter = new Emittery({debug: {name: 'myEmitter'}});
|
|
27
|
+
|
|
28
|
+
emitter.on('test', data => {
|
|
29
|
+
// …
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
emitter.emit('test');
|
|
33
|
+
//=> [16:43:20.417][emittery:subscribe][myEmitter] Event Name: test
|
|
34
|
+
// data: undefined
|
|
35
|
+
```
|
|
36
|
+
*/
|
|
37
|
+
readonly name: string;
|
|
38
|
+
/**
|
|
39
|
+
Toggle debug logging just for this instance.
|
|
40
|
+
|
|
41
|
+
@default false
|
|
42
|
+
|
|
43
|
+
@example
|
|
44
|
+
```
|
|
45
|
+
import Emittery from 'emittery';
|
|
46
|
+
|
|
47
|
+
const emitter1 = new Emittery({debug: {name: 'emitter1', enabled: true}});
|
|
48
|
+
const emitter2 = new Emittery({debug: {name: 'emitter2'}});
|
|
49
|
+
|
|
50
|
+
emitter1.on('test', data => {
|
|
51
|
+
// …
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
emitter2.on('test', data => {
|
|
55
|
+
// …
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
emitter1.emit('test');
|
|
59
|
+
//=> [16:43:20.417][emittery:subscribe][emitter1] Event Name: test
|
|
60
|
+
// data: undefined
|
|
61
|
+
|
|
62
|
+
emitter2.emit('test');
|
|
63
|
+
```
|
|
64
|
+
*/
|
|
65
|
+
readonly enabled?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
Function that handles debug data.
|
|
68
|
+
|
|
69
|
+
@default
|
|
70
|
+
```
|
|
71
|
+
(type, debugName, eventName, eventData) => {
|
|
72
|
+
eventData = JSON.stringify(eventData);
|
|
73
|
+
|
|
74
|
+
if (typeof eventName === 'symbol' || typeof eventName === 'number') {
|
|
75
|
+
eventName = eventName.toString();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const currentTime = new Date();
|
|
79
|
+
const logTime = `${currentTime.getHours()}:${currentTime.getMinutes()}:${currentTime.getSeconds()}.${currentTime.getMilliseconds()}`;
|
|
80
|
+
console.log(`[${logTime}][emittery:${type}][${debugName}] Event Name: ${eventName}\n\tdata: ${eventData}`);
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
@example
|
|
85
|
+
```
|
|
86
|
+
import Emittery from 'emittery';
|
|
87
|
+
|
|
88
|
+
const myLogger = (type, debugName, eventName, eventData) => {
|
|
89
|
+
console.log(`[${type}]: ${eventName}`);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const emitter = new Emittery({
|
|
93
|
+
debug: {
|
|
94
|
+
name: 'myEmitter',
|
|
95
|
+
enabled: true,
|
|
96
|
+
logger: myLogger
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
emitter.on('test', data => {
|
|
101
|
+
// …
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
emitter.emit('test');
|
|
105
|
+
//=> [subscribe]: test
|
|
106
|
+
```
|
|
107
|
+
*/
|
|
108
|
+
readonly logger?: DebugLogger<EventData, keyof EventData>;
|
|
109
|
+
};
|
|
110
|
+
type Options<EventData> = {
|
|
111
|
+
readonly debug?: DebugOptions<EventData>;
|
|
112
|
+
};
|
|
113
|
+
type EmitteryOncePromise<T> = {
|
|
114
|
+
off(): void;
|
|
115
|
+
} & Promise<T>;
|
|
116
|
+
type UnsubscribeFunction = () => void;
|
|
117
|
+
type ListenerChangedData = {
|
|
118
|
+
/**
|
|
119
|
+
The listener that was added or removed.
|
|
120
|
+
*/
|
|
121
|
+
listener: (eventData?: unknown) => (void | Promise<void>);
|
|
122
|
+
/**
|
|
123
|
+
The name of the event that was added or removed if `.on()` or `.off()` was used, or `undefined` if `.onAny()` or `.offAny()` was used.
|
|
124
|
+
*/
|
|
125
|
+
eventName?: EventName;
|
|
126
|
+
};
|
|
127
|
+
declare class Emittery<EventData = Record<EventName, any>, // TODO: Use `unknown` instead of `any`.
|
|
128
|
+
AllEventData = EventData & OmnipresentEventData, DatalessEvents = DatalessEventNames<EventData>> {
|
|
129
|
+
/**
|
|
130
|
+
Toggle debug mode for all instances.
|
|
131
|
+
|
|
132
|
+
Default: `true` if the `DEBUG` environment variable is set to `emittery` or `*`, otherwise `false`.
|
|
133
|
+
|
|
134
|
+
@example
|
|
135
|
+
```
|
|
136
|
+
import Emittery from 'emittery';
|
|
137
|
+
|
|
138
|
+
Emittery.isDebugEnabled = true;
|
|
139
|
+
|
|
140
|
+
const emitter1 = new Emittery({debug: {name: 'myEmitter1'}});
|
|
141
|
+
const emitter2 = new Emittery({debug: {name: 'myEmitter2'}});
|
|
142
|
+
|
|
143
|
+
emitter1.on('test', data => {
|
|
144
|
+
// …
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
emitter2.on('otherTest', data => {
|
|
148
|
+
// …
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
emitter1.emit('test');
|
|
152
|
+
//=> [16:43:20.417][emittery:subscribe][myEmitter1] Event Name: test
|
|
153
|
+
// data: undefined
|
|
154
|
+
|
|
155
|
+
emitter2.emit('otherTest');
|
|
156
|
+
//=> [16:43:20.417][emittery:subscribe][myEmitter2] Event Name: otherTest
|
|
157
|
+
// data: undefined
|
|
158
|
+
```
|
|
159
|
+
*/
|
|
160
|
+
static isDebugEnabled: boolean;
|
|
161
|
+
/**
|
|
162
|
+
Fires when an event listener was added.
|
|
163
|
+
|
|
164
|
+
An object with `listener` and `eventName` (if `on` or `off` was used) is provided as event data.
|
|
165
|
+
|
|
166
|
+
@example
|
|
167
|
+
```
|
|
168
|
+
import Emittery from 'emittery';
|
|
169
|
+
|
|
170
|
+
const emitter = new Emittery();
|
|
171
|
+
|
|
172
|
+
emitter.on(Emittery.listenerAdded, ({listener, eventName}) => {
|
|
173
|
+
console.log(listener);
|
|
174
|
+
//=> data => {}
|
|
175
|
+
|
|
176
|
+
console.log(eventName);
|
|
177
|
+
//=> '🦄'
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
emitter.on('🦄', data => {
|
|
181
|
+
// Handle data
|
|
182
|
+
});
|
|
183
|
+
```
|
|
184
|
+
*/
|
|
185
|
+
static readonly listenerAdded: typeof listenerAdded;
|
|
186
|
+
/**
|
|
187
|
+
Fires when an event listener was removed.
|
|
188
|
+
|
|
189
|
+
An object with `listener` and `eventName` (if `on` or `off` was used) is provided as event data.
|
|
190
|
+
|
|
191
|
+
@example
|
|
192
|
+
```
|
|
193
|
+
import Emittery from 'emittery';
|
|
194
|
+
|
|
195
|
+
const emitter = new Emittery();
|
|
196
|
+
|
|
197
|
+
const off = emitter.on('🦄', data => {
|
|
198
|
+
// Handle data
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
emitter.on(Emittery.listenerRemoved, ({listener, eventName}) => {
|
|
202
|
+
console.log(listener);
|
|
203
|
+
//=> data => {}
|
|
204
|
+
|
|
205
|
+
console.log(eventName);
|
|
206
|
+
//=> '🦄'
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
off();
|
|
210
|
+
```
|
|
211
|
+
*/
|
|
212
|
+
static readonly listenerRemoved: typeof listenerRemoved;
|
|
213
|
+
/**
|
|
214
|
+
In TypeScript, it returns a decorator which mixins `Emittery` as property `emitteryPropertyName` and `methodNames`, or all `Emittery` methods if `methodNames` is not defined, into the target class.
|
|
215
|
+
|
|
216
|
+
@example
|
|
217
|
+
```
|
|
218
|
+
import Emittery from 'emittery';
|
|
219
|
+
|
|
220
|
+
@Emittery.mixin('emittery')
|
|
221
|
+
class MyClass {}
|
|
222
|
+
|
|
223
|
+
const instance = new MyClass();
|
|
224
|
+
|
|
225
|
+
instance.emit('event');
|
|
226
|
+
```
|
|
227
|
+
*/
|
|
228
|
+
static mixin(emitteryPropertyName: string | symbol, methodNames?: readonly string[]): <T extends {
|
|
229
|
+
new (...arguments_: readonly any[]): any;
|
|
230
|
+
}>(klass: T) => T; // eslint-disable-line @typescript-eslint/prefer-function-type
|
|
231
|
+
/**
|
|
232
|
+
Debugging options for the current instance.
|
|
233
|
+
*/
|
|
234
|
+
debug: DebugOptions<EventData>;
|
|
235
|
+
/**
|
|
236
|
+
Create a new Emittery instance with the specified options.
|
|
237
|
+
|
|
238
|
+
@returns An instance of Emittery that you can use to listen for and emit events.
|
|
239
|
+
*/
|
|
240
|
+
constructor(options?: Options<EventData>);
|
|
241
|
+
/**
|
|
242
|
+
Subscribe to one or more events.
|
|
243
|
+
|
|
244
|
+
Using the same listener multiple times for the same event will result in only one method call per emitted event.
|
|
245
|
+
|
|
246
|
+
@returns An unsubscribe method.
|
|
247
|
+
|
|
248
|
+
@example
|
|
249
|
+
```
|
|
250
|
+
import Emittery from 'emittery';
|
|
251
|
+
|
|
252
|
+
const emitter = new Emittery();
|
|
253
|
+
|
|
254
|
+
emitter.on('🦄', data => {
|
|
255
|
+
console.log(data);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
emitter.on(['🦄', '🐶'], data => {
|
|
259
|
+
console.log(data);
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
emitter.emit('🦄', '🌈'); // log => '🌈' x2
|
|
263
|
+
emitter.emit('🐶', '🍖'); // log => '🍖'
|
|
264
|
+
```
|
|
265
|
+
*/
|
|
266
|
+
on<Name extends keyof AllEventData>(eventName: Name | readonly Name[], listener: (eventData: AllEventData[Name]) => void | Promise<void>, options?: {
|
|
267
|
+
signal?: AbortSignal;
|
|
268
|
+
}): UnsubscribeFunction;
|
|
269
|
+
/**
|
|
270
|
+
Get an async iterator which buffers data each time an event is emitted.
|
|
271
|
+
|
|
272
|
+
Call `return()` on the iterator to remove the subscription.
|
|
273
|
+
|
|
274
|
+
@example
|
|
275
|
+
```
|
|
276
|
+
import Emittery from 'emittery';
|
|
277
|
+
|
|
278
|
+
const emitter = new Emittery();
|
|
279
|
+
const iterator = emitter.events('🦄');
|
|
280
|
+
|
|
281
|
+
emitter.emit('🦄', '🌈1'); // Buffered
|
|
282
|
+
emitter.emit('🦄', '🌈2'); // Buffered
|
|
283
|
+
|
|
284
|
+
iterator
|
|
285
|
+
.next()
|
|
286
|
+
.then(({value, done}) => {
|
|
287
|
+
// done === false
|
|
288
|
+
// value === '🌈1'
|
|
289
|
+
return iterator.next();
|
|
290
|
+
})
|
|
291
|
+
.then(({value, done}) => {
|
|
292
|
+
// done === false
|
|
293
|
+
// value === '🌈2'
|
|
294
|
+
// Revoke subscription
|
|
295
|
+
return iterator.return();
|
|
296
|
+
})
|
|
297
|
+
.then(({done}) => {
|
|
298
|
+
// done === true
|
|
299
|
+
});
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
In practice you would usually consume the events using the [for await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) statement. In that case, to revoke the subscription simply break the loop.
|
|
303
|
+
|
|
304
|
+
@example
|
|
305
|
+
```
|
|
306
|
+
import Emittery from 'emittery';
|
|
307
|
+
|
|
308
|
+
const emitter = new Emittery();
|
|
309
|
+
const iterator = emitter.events('🦄');
|
|
310
|
+
|
|
311
|
+
emitter.emit('🦄', '🌈1'); // Buffered
|
|
312
|
+
emitter.emit('🦄', '🌈2'); // Buffered
|
|
313
|
+
|
|
314
|
+
// In an async context.
|
|
315
|
+
for await (const data of iterator) {
|
|
316
|
+
if (data === '🌈2') {
|
|
317
|
+
break; // Revoke the subscription when we see the value `🌈2`.
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
It accepts multiple event names.
|
|
323
|
+
|
|
324
|
+
@example
|
|
325
|
+
```
|
|
326
|
+
import Emittery from 'emittery';
|
|
327
|
+
|
|
328
|
+
const emitter = new Emittery();
|
|
329
|
+
const iterator = emitter.events(['🦄', '🦊']);
|
|
330
|
+
|
|
331
|
+
emitter.emit('🦄', '🌈1'); // Buffered
|
|
332
|
+
emitter.emit('🦊', '🌈2'); // Buffered
|
|
333
|
+
|
|
334
|
+
iterator
|
|
335
|
+
.next()
|
|
336
|
+
.then(({value, done}) => {
|
|
337
|
+
// done === false
|
|
338
|
+
// value === '🌈1'
|
|
339
|
+
return iterator.next();
|
|
340
|
+
})
|
|
341
|
+
.then(({value, done}) => {
|
|
342
|
+
// done === false
|
|
343
|
+
// value === '🌈2'
|
|
344
|
+
// Revoke subscription
|
|
345
|
+
return iterator.return();
|
|
346
|
+
})
|
|
347
|
+
.then(({done}) => {
|
|
348
|
+
// done === true
|
|
349
|
+
});
|
|
350
|
+
```
|
|
351
|
+
*/
|
|
352
|
+
events<Name extends keyof EventData>(eventName: Name | readonly Name[]): AsyncIterableIterator<EventData[Name]>;
|
|
353
|
+
/**
|
|
354
|
+
Remove one or more event subscriptions.
|
|
355
|
+
|
|
356
|
+
@example
|
|
357
|
+
```
|
|
358
|
+
import Emittery from 'emittery';
|
|
359
|
+
|
|
360
|
+
const emitter = new Emittery();
|
|
361
|
+
|
|
362
|
+
const listener = data => {
|
|
363
|
+
console.log(data);
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
emitter.on(['🦄', '🐶', '🦊'], listener);
|
|
367
|
+
await emitter.emit('🦄', 'a');
|
|
368
|
+
await emitter.emit('🐶', 'b');
|
|
369
|
+
await emitter.emit('🦊', 'c');
|
|
370
|
+
emitter.off('🦄', listener);
|
|
371
|
+
emitter.off(['🐶', '🦊'], listener);
|
|
372
|
+
await emitter.emit('🦄', 'a'); // nothing happens
|
|
373
|
+
await emitter.emit('🐶', 'b'); // nothing happens
|
|
374
|
+
await emitter.emit('🦊', 'c'); // nothing happens
|
|
375
|
+
```
|
|
376
|
+
*/
|
|
377
|
+
off<Name extends keyof AllEventData>(eventName: Name | readonly Name[], listener: (eventData: AllEventData[Name]) => void | Promise<void>): void;
|
|
378
|
+
/**
|
|
379
|
+
Subscribe to one or more events only once. It will be unsubscribed after the first event that matches the predicate (if provided).
|
|
380
|
+
|
|
381
|
+
@param eventName - The event name(s) to subscribe to.
|
|
382
|
+
@param predicate - Optional predicate function to filter event data. The event will only be emitted if the predicate returns true.
|
|
383
|
+
|
|
384
|
+
@returns The promise of event data when `eventName` is emitted and predicate matches (if provided). This promise is extended with an `off` method.
|
|
385
|
+
|
|
386
|
+
@example
|
|
387
|
+
```
|
|
388
|
+
import Emittery from 'emittery';
|
|
389
|
+
|
|
390
|
+
const emitter = new Emittery();
|
|
391
|
+
|
|
392
|
+
emitter.once('🦄').then(data => {
|
|
393
|
+
console.log(data);
|
|
394
|
+
//=> '🌈'
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
emitter.once(['🦄', '🐶']).then(data => {
|
|
398
|
+
console.log(data);
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
// With predicate
|
|
402
|
+
emitter.once('data', data => data.ok === true).then(data => {
|
|
403
|
+
console.log(data);
|
|
404
|
+
//=> {ok: true, value: 42}
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
emitter.emit('🦄', '🌈'); // Logs `🌈` twice
|
|
408
|
+
emitter.emit('🐶', '🍖'); // Nothing happens
|
|
409
|
+
emitter.emit('data', {ok: false}); // Nothing happens
|
|
410
|
+
emitter.emit('data', {ok: true, value: 42}); // Logs {ok: true, value: 42}
|
|
411
|
+
```
|
|
412
|
+
*/
|
|
413
|
+
once<Name extends keyof AllEventData>(eventName: Name | readonly Name[], predicate?: (eventData: AllEventData[Name]) => boolean): EmitteryOncePromise<AllEventData[Name]>;
|
|
414
|
+
/**
|
|
415
|
+
Trigger an event asynchronously, optionally with some data. Listeners are called in the order they were added, but executed concurrently.
|
|
416
|
+
|
|
417
|
+
@returns A promise that resolves when all the event listeners are done. *Done* meaning executed if synchronous or resolved when an async/promise-returning function. You usually wouldn't want to wait for this, but you could for example catch possible errors. If any of the listeners throw/reject, the returned promise will be rejected with the error, but the other listeners will not be affected.
|
|
418
|
+
*/
|
|
419
|
+
emit<Name extends DatalessEvents>(eventName: Name): Promise<void>;
|
|
420
|
+
emit<Name extends keyof EventData>(eventName: Name, eventData: EventData[Name]): Promise<void>;
|
|
421
|
+
/**
|
|
422
|
+
Same as `emit()`, but it waits for each listener to resolve before triggering the next one. This can be useful if your events depend on each other. Although ideally they should not. Prefer `emit()` whenever possible.
|
|
423
|
+
|
|
424
|
+
If any of the listeners throw/reject, the returned promise will be rejected with the error and the remaining listeners will *not* be called.
|
|
425
|
+
|
|
426
|
+
@returns A promise that resolves when all the event listeners are done.
|
|
427
|
+
*/
|
|
428
|
+
emitSerial<Name extends DatalessEvents>(eventName: Name): Promise<void>;
|
|
429
|
+
emitSerial<Name extends keyof EventData>(eventName: Name, eventData: EventData[Name]): Promise<void>;
|
|
430
|
+
/**
|
|
431
|
+
Subscribe to be notified about any event.
|
|
432
|
+
|
|
433
|
+
@returns A method to unsubscribe.
|
|
434
|
+
*/
|
|
435
|
+
onAny(listener: (eventName: keyof EventData, eventData: EventData[keyof EventData]) => void | Promise<void>, options?: {
|
|
436
|
+
signal?: AbortSignal;
|
|
437
|
+
}): UnsubscribeFunction;
|
|
438
|
+
/**
|
|
439
|
+
Get an async iterator which buffers a tuple of an event name and data each time an event is emitted.
|
|
440
|
+
|
|
441
|
+
Call `return()` on the iterator to remove the subscription.
|
|
442
|
+
|
|
443
|
+
In the same way as for `events`, you can subscribe by using the `for await` statement.
|
|
444
|
+
|
|
445
|
+
@example
|
|
446
|
+
```
|
|
447
|
+
import Emittery from 'emittery';
|
|
448
|
+
|
|
449
|
+
const emitter = new Emittery();
|
|
450
|
+
const iterator = emitter.anyEvent();
|
|
451
|
+
|
|
452
|
+
emitter.emit('🦄', '🌈1'); // Buffered
|
|
453
|
+
emitter.emit('🌟', '🌈2'); // Buffered
|
|
454
|
+
|
|
455
|
+
iterator.next()
|
|
456
|
+
.then(({value, done}) => {
|
|
457
|
+
// done is false
|
|
458
|
+
// value is ['🦄', '🌈1']
|
|
459
|
+
return iterator.next();
|
|
460
|
+
})
|
|
461
|
+
.then(({value, done}) => {
|
|
462
|
+
// done is false
|
|
463
|
+
// value is ['🌟', '🌈2']
|
|
464
|
+
// revoke subscription
|
|
465
|
+
return iterator.return();
|
|
466
|
+
})
|
|
467
|
+
.then(({done}) => {
|
|
468
|
+
// done is true
|
|
469
|
+
});
|
|
470
|
+
```
|
|
471
|
+
*/
|
|
472
|
+
anyEvent(): AsyncIterableIterator<[
|
|
473
|
+
keyof EventData,
|
|
474
|
+
EventData[keyof EventData]
|
|
475
|
+
]>;
|
|
476
|
+
/**
|
|
477
|
+
Remove an `onAny` subscription.
|
|
478
|
+
*/
|
|
479
|
+
offAny(listener: (eventName: keyof EventData, eventData: EventData[keyof EventData]) => void | Promise<void>): void;
|
|
480
|
+
/**
|
|
481
|
+
Clear all event listeners on the instance.
|
|
482
|
+
|
|
483
|
+
If `eventName` is given, only the listeners for that event are cleared.
|
|
484
|
+
*/
|
|
485
|
+
clearListeners<Name extends keyof EventData>(eventName?: Name | readonly Name[]): void;
|
|
486
|
+
/**
|
|
487
|
+
The number of listeners for the `eventName` or all events if not specified.
|
|
488
|
+
*/
|
|
489
|
+
listenerCount<Name extends keyof EventData>(eventName?: Name | readonly Name[]): number;
|
|
490
|
+
/**
|
|
491
|
+
Bind the given `methodNames`, or all `Emittery` methods if `methodNames` is not defined, into the `target` object.
|
|
492
|
+
|
|
493
|
+
@example
|
|
494
|
+
```
|
|
495
|
+
import Emittery from 'emittery';
|
|
496
|
+
|
|
497
|
+
const object = {};
|
|
498
|
+
|
|
499
|
+
new Emittery().bindMethods(object);
|
|
500
|
+
|
|
501
|
+
object.emit('event');
|
|
502
|
+
```
|
|
503
|
+
*/
|
|
504
|
+
bindMethods(target: Record<string, unknown>, methodNames?: readonly string[]): void;
|
|
505
|
+
}
|
|
506
|
+
declare const ReadonlyKind: unique symbol;
|
|
507
|
+
declare const OptionalKind: unique symbol;
|
|
508
|
+
declare const Hint: unique symbol;
|
|
509
|
+
declare const Kind: unique symbol;
|
|
510
|
+
interface TAny extends TSchema {
|
|
511
|
+
[Kind]: "Any";
|
|
512
|
+
static: any;
|
|
513
|
+
}
|
|
514
|
+
type TReadonly<T extends TSchema> = T & {
|
|
515
|
+
[ReadonlyKind]: "Readonly";
|
|
516
|
+
};
|
|
517
|
+
type TLiteralValue = boolean | number | string;
|
|
518
|
+
interface TLiteral<T extends TLiteralValue = TLiteralValue> extends TSchema {
|
|
519
|
+
[Kind]: "Literal";
|
|
520
|
+
static: T;
|
|
521
|
+
const: T;
|
|
522
|
+
}
|
|
523
|
+
type UnionStatic<T extends TSchema[], P extends unknown[]> = {
|
|
524
|
+
[K in keyof T]: T[K] extends TSchema ? Static<T[K], P> : never;
|
|
525
|
+
}[number];
|
|
526
|
+
interface TUnion<T extends TSchema[] = TSchema[]> extends TSchema {
|
|
527
|
+
[Kind]: "Union";
|
|
528
|
+
static: UnionStatic<T, this["params"]>;
|
|
529
|
+
anyOf: T;
|
|
530
|
+
}
|
|
531
|
+
type StringFormatOption = "date-time" | "time" | "date" | "email" | "idn-email" | "hostname" | "idn-hostname" | "ipv4" | "ipv6" | "uri" | "uri-reference" | "iri" | "uuid" | "iri-reference" | "uri-template" | "json-pointer" | "relative-json-pointer" | "regex" | ({} & string);
|
|
532
|
+
type StringContentEncodingOption = "7bit" | "8bit" | "binary" | "quoted-printable" | "base64" | ({} & string);
|
|
533
|
+
interface StringOptions extends SchemaOptions {
|
|
534
|
+
/** The maximum string length */
|
|
535
|
+
maxLength?: number;
|
|
536
|
+
/** The minimum string length */
|
|
537
|
+
minLength?: number;
|
|
538
|
+
/** A regular expression pattern this string should match */
|
|
539
|
+
pattern?: string;
|
|
540
|
+
/** A format this string should match */
|
|
541
|
+
format?: StringFormatOption;
|
|
542
|
+
/** The content encoding for this string */
|
|
543
|
+
contentEncoding?: StringContentEncodingOption;
|
|
544
|
+
/** The content media type for this string */
|
|
545
|
+
contentMediaType?: string;
|
|
546
|
+
}
|
|
547
|
+
interface TString extends TSchema, StringOptions {
|
|
548
|
+
[Kind]: "String";
|
|
549
|
+
static: string;
|
|
550
|
+
type: "string";
|
|
551
|
+
}
|
|
552
|
+
interface TBoolean extends TSchema {
|
|
553
|
+
[Kind]: "Boolean";
|
|
554
|
+
static: boolean;
|
|
555
|
+
type: "boolean";
|
|
556
|
+
}
|
|
557
|
+
interface NumberOptions extends SchemaOptions {
|
|
558
|
+
exclusiveMaximum?: number;
|
|
559
|
+
exclusiveMinimum?: number;
|
|
560
|
+
maximum?: number;
|
|
561
|
+
minimum?: number;
|
|
562
|
+
multipleOf?: number;
|
|
563
|
+
}
|
|
564
|
+
interface TNumber extends TSchema, NumberOptions {
|
|
565
|
+
[Kind]: "Number";
|
|
566
|
+
static: number;
|
|
567
|
+
type: "number";
|
|
568
|
+
}
|
|
569
|
+
interface IntegerOptions extends SchemaOptions {
|
|
570
|
+
exclusiveMaximum?: number;
|
|
571
|
+
exclusiveMinimum?: number;
|
|
572
|
+
maximum?: number;
|
|
573
|
+
minimum?: number;
|
|
574
|
+
multipleOf?: number;
|
|
575
|
+
}
|
|
576
|
+
interface TInteger extends TSchema, IntegerOptions {
|
|
577
|
+
[Kind]: "Integer";
|
|
578
|
+
static: number;
|
|
579
|
+
type: "integer";
|
|
580
|
+
}
|
|
581
|
+
type TOptional<T extends TSchema> = T & {
|
|
582
|
+
[OptionalKind]: "Optional";
|
|
583
|
+
};
|
|
584
|
+
interface TNull extends TSchema {
|
|
585
|
+
[Kind]: "Null";
|
|
586
|
+
static: null;
|
|
587
|
+
type: "null";
|
|
588
|
+
}
|
|
589
|
+
type RecordStatic<Key extends TSchema, Type extends TSchema, P extends unknown[]> = (Evaluate<{
|
|
590
|
+
[_ in Assert<Static<Key>, PropertyKey>]: Static<Type, P>;
|
|
591
|
+
}>);
|
|
592
|
+
interface TRecord<Key extends TSchema = TSchema, Type extends TSchema = TSchema> extends TSchema {
|
|
593
|
+
[Kind]: "Record";
|
|
594
|
+
static: RecordStatic<Key, Type, this["params"]>;
|
|
595
|
+
type: "object";
|
|
596
|
+
patternProperties: {
|
|
597
|
+
[pattern: string]: Type;
|
|
598
|
+
};
|
|
599
|
+
additionalProperties: TAdditionalProperties;
|
|
600
|
+
}
|
|
601
|
+
type Static<Type extends TSchema, Params extends unknown[] = [
|
|
602
|
+
], Result = (Type & {
|
|
603
|
+
params: Params;
|
|
604
|
+
})["static"]> = Result;
|
|
605
|
+
type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
|
|
606
|
+
[K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? K : never) : never;
|
|
607
|
+
}[keyof T];
|
|
608
|
+
type ReadonlyPropertyKeys<T extends TProperties> = {
|
|
609
|
+
[K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? never : K) : never;
|
|
610
|
+
}[keyof T];
|
|
611
|
+
type OptionalPropertyKeys<T extends TProperties> = {
|
|
612
|
+
[K in keyof T]: T[K] extends TOptional<TSchema> ? (T[K] extends TReadonly<T[K]> ? never : K) : never;
|
|
613
|
+
}[keyof T];
|
|
614
|
+
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
615
|
+
type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
|
|
616
|
+
type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, {
|
|
617
|
+
[K in keyof T]: Static<T[K], P>;
|
|
618
|
+
}>;
|
|
619
|
+
type TPropertyKey = string | number;
|
|
620
|
+
type TProperties = Record<TPropertyKey, TSchema>;
|
|
621
|
+
type TIsLiteralString<Type extends string> = ([
|
|
622
|
+
Type
|
|
623
|
+
] extends [
|
|
624
|
+
string
|
|
625
|
+
] ? [
|
|
626
|
+
string
|
|
627
|
+
] extends [
|
|
628
|
+
Type
|
|
629
|
+
] ? false : true : false);
|
|
630
|
+
type IsRequiredArrayLiteralConstant<RequiredTuple extends string[]> = (RequiredTuple extends [
|
|
631
|
+
infer Left extends string,
|
|
632
|
+
...infer _ extends string[]
|
|
633
|
+
] ? TIsLiteralString<Left> : false);
|
|
634
|
+
type TRequiredArray<Properties extends TProperties, RequiredProperties extends TProperties = {
|
|
635
|
+
[Key in keyof Properties as Properties[Key] extends TOptional<Properties[Key]> ? never : Key]: Properties[Key];
|
|
636
|
+
}, RequiredUnion extends string = Extract<keyof RequiredProperties, string>, RequiredTuple extends string[] = UnionToTuple<RequiredUnion>, Result extends string[] | undefined = (IsRequiredArrayLiteralConstant<RequiredTuple> extends true ? RequiredTuple : string[] | undefined)> = Result;
|
|
637
|
+
type TAdditionalProperties = undefined | TSchema | boolean;
|
|
638
|
+
interface ObjectOptions extends SchemaOptions {
|
|
639
|
+
/** Additional property constraints for this object */
|
|
640
|
+
additionalProperties?: TAdditionalProperties;
|
|
641
|
+
/** The minimum number of properties allowed on this object */
|
|
642
|
+
minProperties?: number;
|
|
643
|
+
/** The maximum number of properties allowed on this object */
|
|
644
|
+
maxProperties?: number;
|
|
645
|
+
}
|
|
646
|
+
interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
|
|
647
|
+
[Kind]: "Object";
|
|
648
|
+
static: ObjectStatic<T, this["params"]>;
|
|
649
|
+
additionalProperties?: TAdditionalProperties;
|
|
650
|
+
type: "object";
|
|
651
|
+
properties: T;
|
|
652
|
+
required: TRequiredArray<T>;
|
|
653
|
+
}
|
|
654
|
+
type UnionToIntersect<U> = (U extends unknown ? (arg: U) => 0 : never) extends (arg: infer I) => 0 ? I : never;
|
|
655
|
+
type UnionLast<U> = UnionToIntersect<U extends unknown ? (x: U) => 0 : never> extends (x: infer L) => 0 ? L : never;
|
|
656
|
+
type UnionToTuple<U, Acc extends unknown[] = [
|
|
657
|
+
], R = UnionLast<U>> = [
|
|
658
|
+
U
|
|
659
|
+
] extends [
|
|
660
|
+
never
|
|
661
|
+
] ? Acc : UnionToTuple<Exclude<U, R>, [
|
|
662
|
+
Extract<U, R>,
|
|
663
|
+
...Acc
|
|
664
|
+
]>;
|
|
665
|
+
type Assert<T, E> = T extends E ? T : never;
|
|
666
|
+
type Evaluate<T> = T extends infer O ? {
|
|
667
|
+
[K in keyof O]: O[K];
|
|
668
|
+
} : never;
|
|
669
|
+
type Ensure<T> = T extends infer U ? U : never;
|
|
670
|
+
interface ArrayOptions extends SchemaOptions {
|
|
671
|
+
/** The minimum number of items in this array */
|
|
672
|
+
minItems?: number;
|
|
673
|
+
/** The maximum number of items in this array */
|
|
674
|
+
maxItems?: number;
|
|
675
|
+
/** Should this schema contain unique items */
|
|
676
|
+
uniqueItems?: boolean;
|
|
677
|
+
/** A schema for which some elements should match */
|
|
678
|
+
contains?: TSchema;
|
|
679
|
+
/** A minimum number of contains schema matches */
|
|
680
|
+
minContains?: number;
|
|
681
|
+
/** A maximum number of contains schema matches */
|
|
682
|
+
maxContains?: number;
|
|
683
|
+
}
|
|
684
|
+
type ArrayStatic<T extends TSchema, P extends unknown[]> = Ensure<Static<T, P>[]>;
|
|
685
|
+
interface TArray<T extends TSchema = TSchema> extends TSchema, ArrayOptions {
|
|
686
|
+
[Kind]: "Array";
|
|
687
|
+
static: ArrayStatic<T, this["params"]>;
|
|
688
|
+
type: "array";
|
|
689
|
+
items: T;
|
|
690
|
+
}
|
|
691
|
+
interface SchemaOptions {
|
|
692
|
+
$schema?: string;
|
|
693
|
+
/** Id for this schema */
|
|
694
|
+
$id?: string;
|
|
695
|
+
/** Title of this schema */
|
|
696
|
+
title?: string;
|
|
697
|
+
/** Description of this schema */
|
|
698
|
+
description?: string;
|
|
699
|
+
/** Default value for this schema */
|
|
700
|
+
default?: any;
|
|
701
|
+
/** Example values matching this schema */
|
|
702
|
+
examples?: any;
|
|
703
|
+
/** Optional annotation for readOnly */
|
|
704
|
+
readOnly?: boolean;
|
|
705
|
+
/** Optional annotation for writeOnly */
|
|
706
|
+
writeOnly?: boolean;
|
|
707
|
+
[prop: string]: any;
|
|
708
|
+
}
|
|
709
|
+
interface TKind {
|
|
710
|
+
[Kind]: string;
|
|
711
|
+
}
|
|
712
|
+
interface TSchema extends TKind, SchemaOptions {
|
|
713
|
+
[ReadonlyKind]?: string;
|
|
714
|
+
[OptionalKind]?: string;
|
|
715
|
+
[Hint]?: string;
|
|
716
|
+
params: unknown[];
|
|
717
|
+
static: unknown;
|
|
718
|
+
}
|
|
719
|
+
declare const vasFileSchema: TObject<{
|
|
720
|
+
id: TString;
|
|
721
|
+
set: TObject<{
|
|
722
|
+
configuration: TObject<{
|
|
723
|
+
settings: TOptional<TObject<{
|
|
724
|
+
general: TOptional<TObject<{
|
|
725
|
+
assemblyMode: TOptional<TUnion<[
|
|
726
|
+
TLiteral<"multi-object">,
|
|
727
|
+
TLiteral<"single-object">
|
|
728
|
+
]>>;
|
|
729
|
+
editorMode: TOptional<TUnion<[
|
|
730
|
+
TLiteral<"default">,
|
|
731
|
+
TLiteral<"assembly">,
|
|
732
|
+
TNull
|
|
733
|
+
]>>;
|
|
734
|
+
}>>;
|
|
735
|
+
assetsPalette: TOptional<TObject<{
|
|
736
|
+
nodes: TOptional<TArray<TObject<{
|
|
737
|
+
id: TNumber;
|
|
738
|
+
name: TString;
|
|
739
|
+
tags: TArray<TNumber>;
|
|
740
|
+
icon: TOptional<TUnion<[
|
|
741
|
+
TString,
|
|
742
|
+
TNull
|
|
743
|
+
]>>;
|
|
744
|
+
}>>>;
|
|
745
|
+
roots: TOptional<TArray<TNumber>>;
|
|
746
|
+
tree: TOptional<TRecord<TNumber, TArray<TNumber>>>;
|
|
747
|
+
linkedProperties: TOptional<TObject<{
|
|
748
|
+
name: TOptional<TNumber>;
|
|
749
|
+
description: TOptional<TNumber>;
|
|
750
|
+
image: TOptional<TNumber>;
|
|
751
|
+
}>>;
|
|
752
|
+
styleSettings: TOptional<TObject<{
|
|
753
|
+
image: TOptional<TObject<{
|
|
754
|
+
size: TUnion<[
|
|
755
|
+
TLiteral<"sm">,
|
|
756
|
+
TLiteral<"md">,
|
|
757
|
+
TLiteral<"lg">
|
|
758
|
+
]>;
|
|
759
|
+
orientation: TUnion<[
|
|
760
|
+
TLiteral<"square">,
|
|
761
|
+
TLiteral<"portrait">,
|
|
762
|
+
TLiteral<"landscape">
|
|
763
|
+
]>;
|
|
764
|
+
}>>;
|
|
765
|
+
name: TOptional<TObject<{
|
|
766
|
+
visible: TOptional<TBoolean>;
|
|
767
|
+
}>>;
|
|
768
|
+
description: TOptional<TObject<{
|
|
769
|
+
visible: TOptional<TBoolean>;
|
|
770
|
+
}>>;
|
|
771
|
+
}>>;
|
|
772
|
+
defaultNodeId: TOptional<TNumber>;
|
|
773
|
+
patternType: TOptional<TUnion<[
|
|
774
|
+
TLiteral<"hierarchical">,
|
|
775
|
+
TLiteral<"breadcrumbs">
|
|
776
|
+
]>>;
|
|
777
|
+
addingAssetsMethod: TOptional<TUnion<[
|
|
778
|
+
TLiteral<"dragAndDrop">,
|
|
779
|
+
TLiteral<"clickToAdd">
|
|
780
|
+
]>>;
|
|
781
|
+
sortingSettings: TOptional<TObject<{
|
|
782
|
+
field: TUnion<[
|
|
783
|
+
TLiteral<"name">,
|
|
784
|
+
TLiteral<"property">
|
|
785
|
+
]>;
|
|
786
|
+
order: TUnion<[
|
|
787
|
+
TLiteral<"asc">,
|
|
788
|
+
TLiteral<"desc">
|
|
789
|
+
]>;
|
|
790
|
+
}>>;
|
|
791
|
+
}>>;
|
|
792
|
+
outline: TOptional<TObject<{
|
|
793
|
+
enabled: TOptional<TBoolean>;
|
|
794
|
+
selected: TOptional<TObject<{
|
|
795
|
+
enabled: TOptional<TBoolean>;
|
|
796
|
+
thicknessPx: TOptional<TNumber>;
|
|
797
|
+
visible: TOptional<TObject<{
|
|
798
|
+
color: TOptional<TNumber>;
|
|
799
|
+
alpha: TOptional<TNumber>;
|
|
800
|
+
}>>;
|
|
801
|
+
hidden: TOptional<TObject<{
|
|
802
|
+
color: TOptional<TNumber>;
|
|
803
|
+
alpha: TOptional<TNumber>;
|
|
804
|
+
}>>;
|
|
805
|
+
}>>;
|
|
806
|
+
hover: TOptional<TObject<{
|
|
807
|
+
enabled: TOptional<TBoolean>;
|
|
808
|
+
thicknessPx: TOptional<TNumber>;
|
|
809
|
+
visible: TOptional<TObject<{
|
|
810
|
+
color: TOptional<TNumber>;
|
|
811
|
+
alpha: TOptional<TNumber>;
|
|
812
|
+
fillAlpha: TOptional<TNumber>;
|
|
813
|
+
}>>;
|
|
814
|
+
hidden: TOptional<TObject<{
|
|
815
|
+
color: TOptional<TNumber>;
|
|
816
|
+
alpha: TOptional<TNumber>;
|
|
817
|
+
fillAlpha: TOptional<TNumber>;
|
|
818
|
+
}>>;
|
|
819
|
+
}>>;
|
|
820
|
+
edgeStrength: TOptional<TNumber>;
|
|
821
|
+
edgeGlow: TOptional<TNumber>;
|
|
822
|
+
edgeThickness: TOptional<TNumber>;
|
|
823
|
+
pulsePeriod: TOptional<TNumber>;
|
|
824
|
+
visibleEdgeColor: TOptional<TNumber>;
|
|
825
|
+
hiddenEdgeColor: TOptional<TNumber>;
|
|
826
|
+
}>>;
|
|
827
|
+
highlight: TOptional<TObject<{
|
|
828
|
+
enabled: TOptional<TBoolean>;
|
|
829
|
+
color: TOptional<TNumber>;
|
|
830
|
+
blinkDurationMs: TOptional<TNumber>;
|
|
831
|
+
pulseCount: TOptional<TNumber>;
|
|
832
|
+
lineOpacityStart: TOptional<TNumber>;
|
|
833
|
+
lineOpacityEnd: TOptional<TNumber>;
|
|
834
|
+
boxOpacityStart: TOptional<TNumber>;
|
|
835
|
+
boxOpacityEnd: TOptional<TNumber>;
|
|
836
|
+
}>>;
|
|
837
|
+
dimensions: TOptional<TObject<{
|
|
838
|
+
offsetX: TOptional<TNumber>;
|
|
839
|
+
offsetY: TOptional<TNumber>;
|
|
840
|
+
offsetZ: TOptional<TNumber>;
|
|
841
|
+
rangefinder: TOptional<TObject<{
|
|
842
|
+
lineColor: TOptional<TString>;
|
|
843
|
+
textColor: TOptional<TString>;
|
|
844
|
+
textBackgroundColor: TOptional<TString>;
|
|
845
|
+
}>>;
|
|
846
|
+
}>>;
|
|
847
|
+
autoSnap: TOptional<TObject<{
|
|
848
|
+
enabled: TOptional<TBoolean>;
|
|
849
|
+
requireConnection: TOptional<TBoolean>;
|
|
850
|
+
showSnapPoints: TOptional<TBoolean>;
|
|
851
|
+
delay: TOptional<TNumber>;
|
|
852
|
+
distance: TOptional<TNumber>;
|
|
853
|
+
distanceTolerance: TOptional<TNumber>;
|
|
854
|
+
lookupRadiusPx: TOptional<TNumber>;
|
|
855
|
+
rotationPreviewRadiusPx: TOptional<TNumber>;
|
|
856
|
+
previewStrategy: TOptional<TUnion<[
|
|
857
|
+
TLiteral<"replace-dragged">,
|
|
858
|
+
TLiteral<"highlight-preview">
|
|
859
|
+
]>>;
|
|
860
|
+
externalDragMovement: TOptional<TUnion<[
|
|
861
|
+
TLiteral<"camera-plane">,
|
|
862
|
+
TLiteral<"floor-slide">,
|
|
863
|
+
TLiteral<"keep-visible">
|
|
864
|
+
]>>;
|
|
865
|
+
}>>;
|
|
866
|
+
drag: TOptional<TObject<{
|
|
867
|
+
minimumDropDistance: TOptional<TNumber>;
|
|
868
|
+
showGridHelper: TOptional<TBoolean>;
|
|
869
|
+
interactionStrategy: TOptional<TUnion<[
|
|
870
|
+
TLiteral<"directDrag">,
|
|
871
|
+
TLiteral<"pressMoveThreshold">,
|
|
872
|
+
TLiteral<"holdToDrag">
|
|
873
|
+
]>>;
|
|
874
|
+
desktopHoldDelayMs: TOptional<TNumber>;
|
|
875
|
+
touchHoldDelayMs: TOptional<TNumber>;
|
|
876
|
+
dragStartThresholdPx: TOptional<TNumber>;
|
|
877
|
+
clickTolerancePx: TOptional<TNumber>;
|
|
878
|
+
selectDraggedObjectOnDrop: TOptional<TBoolean>;
|
|
879
|
+
}>>;
|
|
880
|
+
postprocessing: TOptional<TObject<{
|
|
881
|
+
gtao: TOptional<TObject<{
|
|
882
|
+
enabled: TOptional<TBoolean>;
|
|
883
|
+
blendIntensity: TOptional<TNumber>;
|
|
884
|
+
radius: TOptional<TNumber>;
|
|
885
|
+
samples: TOptional<TNumber>;
|
|
886
|
+
distanceFallOff: TOptional<TNumber>;
|
|
887
|
+
screenSpaceRadius: TOptional<TBoolean>;
|
|
888
|
+
denoiseRadius: TOptional<TNumber>;
|
|
889
|
+
denoiseSamples: TOptional<TNumber>;
|
|
890
|
+
}>>;
|
|
891
|
+
outlineEffect: TOptional<TObject<{
|
|
892
|
+
enabled: TOptional<TBoolean>;
|
|
893
|
+
thickness: TOptional<TNumber>;
|
|
894
|
+
color: TOptional<TNumber>;
|
|
895
|
+
alpha: TOptional<TNumber>;
|
|
896
|
+
}>>;
|
|
897
|
+
}>>;
|
|
898
|
+
materials: TOptional<TObject<{
|
|
899
|
+
linkedProperties: TOptional<TObject<{
|
|
900
|
+
name: TOptional<TNumber>;
|
|
901
|
+
thumbnail: TOptional<TNumber>;
|
|
902
|
+
}>>;
|
|
903
|
+
styleSettings: TOptional<TObject<{
|
|
904
|
+
image: TOptional<TObject<{
|
|
905
|
+
size: TUnion<[
|
|
906
|
+
TLiteral<"sm">,
|
|
907
|
+
TLiteral<"md">,
|
|
908
|
+
TLiteral<"lg">
|
|
909
|
+
]>;
|
|
910
|
+
orientation: TUnion<[
|
|
911
|
+
TLiteral<"square">,
|
|
912
|
+
TLiteral<"portrait">,
|
|
913
|
+
TLiteral<"landscape">
|
|
914
|
+
]>;
|
|
915
|
+
}>>;
|
|
916
|
+
name: TOptional<TObject<{
|
|
917
|
+
visible: TOptional<TBoolean>;
|
|
918
|
+
}>>;
|
|
919
|
+
description: TOptional<TObject<{
|
|
920
|
+
visible: TOptional<TBoolean>;
|
|
921
|
+
}>>;
|
|
922
|
+
}>>;
|
|
923
|
+
materialsSortingSettings: TOptional<TObject<{
|
|
924
|
+
field: TUnion<[
|
|
925
|
+
TLiteral<"name">,
|
|
926
|
+
TLiteral<"property">
|
|
927
|
+
]>;
|
|
928
|
+
order: TUnion<[
|
|
929
|
+
TLiteral<"asc">,
|
|
930
|
+
TLiteral<"desc">
|
|
931
|
+
]>;
|
|
932
|
+
}>>;
|
|
933
|
+
materialGroupsSortingSettings: TOptional<TObject<{
|
|
934
|
+
field: TUnion<[
|
|
935
|
+
TLiteral<"name">,
|
|
936
|
+
TLiteral<"property">
|
|
937
|
+
]>;
|
|
938
|
+
order: TUnion<[
|
|
939
|
+
TLiteral<"asc">,
|
|
940
|
+
TLiteral<"desc">
|
|
941
|
+
]>;
|
|
942
|
+
}>>;
|
|
943
|
+
behavior: TOptional<TObject<{
|
|
944
|
+
onInsert: TOptional<TUnion<[
|
|
945
|
+
TLiteral<"default">,
|
|
946
|
+
TLiteral<"last">
|
|
947
|
+
]>>;
|
|
948
|
+
applicationStrategy: TOptional<TUnion<[
|
|
949
|
+
TLiteral<"selected">,
|
|
950
|
+
TLiteral<"all">
|
|
951
|
+
]>>;
|
|
952
|
+
}>>;
|
|
953
|
+
}>>;
|
|
954
|
+
subcomponents: TOptional<TObject<{
|
|
955
|
+
linkedProperties: TOptional<TObject<{
|
|
956
|
+
name: TOptional<TNumber>;
|
|
957
|
+
thumbnail: TOptional<TNumber>;
|
|
958
|
+
}>>;
|
|
959
|
+
styleSettings: TOptional<TObject<{
|
|
960
|
+
image: TOptional<TObject<{
|
|
961
|
+
size: TUnion<[
|
|
962
|
+
TLiteral<"sm">,
|
|
963
|
+
TLiteral<"md">,
|
|
964
|
+
TLiteral<"lg">
|
|
965
|
+
]>;
|
|
966
|
+
orientation: TUnion<[
|
|
967
|
+
TLiteral<"square">,
|
|
968
|
+
TLiteral<"portrait">,
|
|
969
|
+
TLiteral<"landscape">
|
|
970
|
+
]>;
|
|
971
|
+
}>>;
|
|
972
|
+
name: TOptional<TObject<{
|
|
973
|
+
visible: TOptional<TBoolean>;
|
|
974
|
+
}>>;
|
|
975
|
+
description: TOptional<TObject<{
|
|
976
|
+
visible: TOptional<TBoolean>;
|
|
977
|
+
}>>;
|
|
978
|
+
}>>;
|
|
979
|
+
subcomponentsSortingSettings: TOptional<TObject<{
|
|
980
|
+
field: TUnion<[
|
|
981
|
+
TLiteral<"name">,
|
|
982
|
+
TLiteral<"property">
|
|
983
|
+
]>;
|
|
984
|
+
order: TUnion<[
|
|
985
|
+
TLiteral<"asc">,
|
|
986
|
+
TLiteral<"desc">
|
|
987
|
+
]>;
|
|
988
|
+
}>>;
|
|
989
|
+
subcomponentGroupsSortingSettings: TOptional<TObject<{
|
|
990
|
+
field: TUnion<[
|
|
991
|
+
TLiteral<"name">,
|
|
992
|
+
TLiteral<"property">
|
|
993
|
+
]>;
|
|
994
|
+
order: TUnion<[
|
|
995
|
+
TLiteral<"asc">,
|
|
996
|
+
TLiteral<"desc">
|
|
997
|
+
]>;
|
|
998
|
+
}>>;
|
|
999
|
+
behavior: TOptional<TObject<{
|
|
1000
|
+
onInsert: TOptional<TUnion<[
|
|
1001
|
+
TLiteral<"default">,
|
|
1002
|
+
TLiteral<"last">
|
|
1003
|
+
]>>;
|
|
1004
|
+
applicationStrategy: TOptional<TUnion<[
|
|
1005
|
+
TLiteral<"selected">,
|
|
1006
|
+
TLiteral<"all">
|
|
1007
|
+
]>>;
|
|
1008
|
+
}>>;
|
|
1009
|
+
}>>;
|
|
1010
|
+
}>>;
|
|
1011
|
+
sceneSettings: TOptional<TObject<{
|
|
1012
|
+
studioId: TOptional<TUnion<[
|
|
1013
|
+
TNumber,
|
|
1014
|
+
TNull
|
|
1015
|
+
]>>;
|
|
1016
|
+
studios: TOptional<TRecord<TString, TObject<{
|
|
1017
|
+
scene: TOptional<TObject<{
|
|
1018
|
+
backgroundColor: TOptional<TUnion<[
|
|
1019
|
+
TString,
|
|
1020
|
+
TNull
|
|
1021
|
+
]>>;
|
|
1022
|
+
envMap: TOptional<TUnion<[
|
|
1023
|
+
TString,
|
|
1024
|
+
TNull
|
|
1025
|
+
]>>;
|
|
1026
|
+
backgroundMode: TOptional<TUnion<[
|
|
1027
|
+
TLiteral<"color">,
|
|
1028
|
+
TLiteral<"environment">
|
|
1029
|
+
]>>;
|
|
1030
|
+
backgroundBlurriness: TOptional<TNumber>;
|
|
1031
|
+
backgroundIntensity: TOptional<TNumber>;
|
|
1032
|
+
environmentIntensity: TOptional<TNumber>;
|
|
1033
|
+
environmentRotationY: TOptional<TNumber>;
|
|
1034
|
+
shadowMap: TOptional<TObject<{
|
|
1035
|
+
type: TOptional<TUnion<[
|
|
1036
|
+
TLiteral<"Basic">,
|
|
1037
|
+
TLiteral<"PCF">,
|
|
1038
|
+
TLiteral<"VSM">
|
|
1039
|
+
]>>;
|
|
1040
|
+
vsmQuality: TOptional<TUnion<[
|
|
1041
|
+
TLiteral<"Performance">,
|
|
1042
|
+
TLiteral<"Balanced">,
|
|
1043
|
+
TLiteral<"Quality">
|
|
1044
|
+
]>>;
|
|
1045
|
+
}>>;
|
|
1046
|
+
toneMapping: TOptional<TObject<{
|
|
1047
|
+
mode: TOptional<TUnion<[
|
|
1048
|
+
TLiteral<"None">,
|
|
1049
|
+
TLiteral<"Linear">,
|
|
1050
|
+
TLiteral<"Reinhard">,
|
|
1051
|
+
TLiteral<"Cineon">,
|
|
1052
|
+
TLiteral<"ACESFilmic">,
|
|
1053
|
+
TLiteral<"AgX">,
|
|
1054
|
+
TLiteral<"Neutral">
|
|
1055
|
+
]>>;
|
|
1056
|
+
exposure: TOptional<TNumber>;
|
|
1057
|
+
}>>;
|
|
1058
|
+
}>>;
|
|
1059
|
+
lights: TOptional<TObject<{
|
|
1060
|
+
preset: TOptional<TUnion<[
|
|
1061
|
+
TLiteral<"directional">,
|
|
1062
|
+
TLiteral<"area">,
|
|
1063
|
+
TLiteral<"environment">
|
|
1064
|
+
]>>;
|
|
1065
|
+
}>>;
|
|
1066
|
+
floor: TOptional<TObject<{
|
|
1067
|
+
activeFloor: TOptional<TBoolean>;
|
|
1068
|
+
activeFloorShadow: TOptional<TBoolean>;
|
|
1069
|
+
useFloorInAR: TOptional<TBoolean>;
|
|
1070
|
+
reflection: TOptional<TObject<{
|
|
1071
|
+
enabled: TOptional<TBoolean>;
|
|
1072
|
+
opacity: TOptional<TNumber>;
|
|
1073
|
+
fadeDistance: TOptional<TNumber>;
|
|
1074
|
+
}>>;
|
|
1075
|
+
floorSize: TOptional<TObject<{
|
|
1076
|
+
x: TOptional<TNumber>;
|
|
1077
|
+
y: TOptional<TNumber>;
|
|
1078
|
+
}>>;
|
|
1079
|
+
floorSizeType: TOptional<TUnion<[
|
|
1080
|
+
TLiteral<"infinity">,
|
|
1081
|
+
TLiteral<"likeObject">,
|
|
1082
|
+
TLiteral<"custom">
|
|
1083
|
+
]>>;
|
|
1084
|
+
selectedMaterialGroup: TOptional<TUnion<[
|
|
1085
|
+
TNumber,
|
|
1086
|
+
TNull
|
|
1087
|
+
]>>;
|
|
1088
|
+
selectedDefaultMaterial: TOptional<TUnion<[
|
|
1089
|
+
TNumber,
|
|
1090
|
+
TNull
|
|
1091
|
+
]>>;
|
|
1092
|
+
}>>;
|
|
1093
|
+
}>>>;
|
|
1094
|
+
backgroundColor: TOptional<TUnion<[
|
|
1095
|
+
TString,
|
|
1096
|
+
TNull
|
|
1097
|
+
]>>;
|
|
1098
|
+
envMap: TOptional<TUnion<[
|
|
1099
|
+
TString,
|
|
1100
|
+
TNull
|
|
1101
|
+
]>>;
|
|
1102
|
+
backgroundMode: TOptional<TUnion<[
|
|
1103
|
+
TLiteral<"color">,
|
|
1104
|
+
TLiteral<"environment">
|
|
1105
|
+
]>>;
|
|
1106
|
+
backgroundBlurriness: TOptional<TNumber>;
|
|
1107
|
+
backgroundIntensity: TOptional<TNumber>;
|
|
1108
|
+
environmentIntensity: TOptional<TNumber>;
|
|
1109
|
+
environmentRotationY: TOptional<TNumber>;
|
|
1110
|
+
shadowMap: TOptional<TObject<{
|
|
1111
|
+
type: TOptional<TUnion<[
|
|
1112
|
+
TLiteral<"Basic">,
|
|
1113
|
+
TLiteral<"PCF">,
|
|
1114
|
+
TLiteral<"VSM">
|
|
1115
|
+
]>>;
|
|
1116
|
+
vsmQuality: TOptional<TUnion<[
|
|
1117
|
+
TLiteral<"Performance">,
|
|
1118
|
+
TLiteral<"Balanced">,
|
|
1119
|
+
TLiteral<"Quality">
|
|
1120
|
+
]>>;
|
|
1121
|
+
}>>;
|
|
1122
|
+
toneMapping: TOptional<TObject<{
|
|
1123
|
+
mode: TOptional<TUnion<[
|
|
1124
|
+
TLiteral<"None">,
|
|
1125
|
+
TLiteral<"Linear">,
|
|
1126
|
+
TLiteral<"Reinhard">,
|
|
1127
|
+
TLiteral<"Cineon">,
|
|
1128
|
+
TLiteral<"ACESFilmic">,
|
|
1129
|
+
TLiteral<"AgX">,
|
|
1130
|
+
TLiteral<"Neutral">
|
|
1131
|
+
]>>;
|
|
1132
|
+
exposure: TOptional<TNumber>;
|
|
1133
|
+
}>>;
|
|
1134
|
+
floor: TOptional<TObject<{
|
|
1135
|
+
activeFloor: TOptional<TBoolean>;
|
|
1136
|
+
activeFloorShadow: TOptional<TBoolean>;
|
|
1137
|
+
useFloorInAR: TOptional<TBoolean>;
|
|
1138
|
+
reflection: TOptional<TObject<{
|
|
1139
|
+
enabled: TOptional<TBoolean>;
|
|
1140
|
+
opacity: TOptional<TNumber>;
|
|
1141
|
+
fadeDistance: TOptional<TNumber>;
|
|
1142
|
+
}>>;
|
|
1143
|
+
floorSize: TOptional<TObject<{
|
|
1144
|
+
x: TNumber;
|
|
1145
|
+
y: TNumber;
|
|
1146
|
+
}>>;
|
|
1147
|
+
floorSizeType: TOptional<TUnion<[
|
|
1148
|
+
TLiteral<"infinity">,
|
|
1149
|
+
TLiteral<"likeObject">,
|
|
1150
|
+
TLiteral<"custom">
|
|
1151
|
+
]>>;
|
|
1152
|
+
selectedMaterialGroup: TOptional<TUnion<[
|
|
1153
|
+
TNumber,
|
|
1154
|
+
TNull
|
|
1155
|
+
]>>;
|
|
1156
|
+
selectedDefaultMaterial: TOptional<TUnion<[
|
|
1157
|
+
TNumber,
|
|
1158
|
+
TNull
|
|
1159
|
+
]>>;
|
|
1160
|
+
}>>;
|
|
1161
|
+
layout: TOptional<TObject<{
|
|
1162
|
+
colors: TOptional<TObject<{
|
|
1163
|
+
primaryColor: TString;
|
|
1164
|
+
secondaryColor: TString;
|
|
1165
|
+
}>>;
|
|
1166
|
+
defaultLayoutMode: TOptional<TUnion<[
|
|
1167
|
+
TLiteral<"configuration">,
|
|
1168
|
+
TLiteral<"materials">
|
|
1169
|
+
]>>;
|
|
1170
|
+
layersButtons: TOptional<TArray<TObject<{
|
|
1171
|
+
label: TString;
|
|
1172
|
+
layers: TArray<TInteger>;
|
|
1173
|
+
defaultState: TBoolean;
|
|
1174
|
+
}>>>;
|
|
1175
|
+
}>>;
|
|
1176
|
+
}>>;
|
|
1177
|
+
pricingSettings: TOptional<TObject<{
|
|
1178
|
+
enabled: TOptional<TBoolean>;
|
|
1179
|
+
configId: TOptional<TNumber>;
|
|
1180
|
+
}>>;
|
|
1181
|
+
customRulesSettings: TOptional<TObject<{
|
|
1182
|
+
configIds: TOptional<TArray<TNumber>>;
|
|
1183
|
+
}>>;
|
|
1184
|
+
layoutResult: TOptional<TUnion<[
|
|
1185
|
+
TObject<{
|
|
1186
|
+
type: TLiteral<"none">;
|
|
1187
|
+
}>,
|
|
1188
|
+
TObject<{
|
|
1189
|
+
type: TLiteral<"pricing">;
|
|
1190
|
+
}>,
|
|
1191
|
+
TObject<{
|
|
1192
|
+
type: TLiteral<"custom-rule">;
|
|
1193
|
+
configId: TNumber;
|
|
1194
|
+
}>
|
|
1195
|
+
]>>;
|
|
1196
|
+
unitsSettings: TOptional<TObject<{
|
|
1197
|
+
price: TOptional<TObject<{
|
|
1198
|
+
roundType: TOptional<TUnion<[
|
|
1199
|
+
TLiteral<"round">,
|
|
1200
|
+
TLiteral<"ceil">,
|
|
1201
|
+
TLiteral<"floor">
|
|
1202
|
+
]>>;
|
|
1203
|
+
precision: TOptional<TNumber>;
|
|
1204
|
+
step: TOptional<TNumber>;
|
|
1205
|
+
}>>;
|
|
1206
|
+
}>>;
|
|
1207
|
+
documentation: TOptional<TObject<{
|
|
1208
|
+
fileUuid: TOptional<TUnion<[
|
|
1209
|
+
TString,
|
|
1210
|
+
TNull
|
|
1211
|
+
]>>;
|
|
1212
|
+
parameters: TOptional<TArray<TObject<{
|
|
1213
|
+
name: TString;
|
|
1214
|
+
type: TUnion<[
|
|
1215
|
+
TLiteral<"TEXT">,
|
|
1216
|
+
TLiteral<"PROJECTION">,
|
|
1217
|
+
TLiteral<"BOOL">,
|
|
1218
|
+
TLiteral<"SOURCE_DATA">
|
|
1219
|
+
]>;
|
|
1220
|
+
uuid: TString;
|
|
1221
|
+
value: TString;
|
|
1222
|
+
}>>>;
|
|
1223
|
+
}>>;
|
|
1224
|
+
presetsSettings: TOptional<TObject<{
|
|
1225
|
+
presets: TOptional<TObject<{
|
|
1226
|
+
enabled: TOptional<TBoolean>;
|
|
1227
|
+
items: TOptional<TArray<TObject<{
|
|
1228
|
+
id: TString;
|
|
1229
|
+
name: TString;
|
|
1230
|
+
description: TOptional<TString>;
|
|
1231
|
+
configuration: TAny;
|
|
1232
|
+
ignore: TOptional<TArray<TString>>;
|
|
1233
|
+
icon: TOptional<TUnion<[
|
|
1234
|
+
TString,
|
|
1235
|
+
TNull
|
|
1236
|
+
]>>;
|
|
1237
|
+
visible: TOptional<TBoolean>;
|
|
1238
|
+
}>>>;
|
|
1239
|
+
selectedId: TOptional<TString>;
|
|
1240
|
+
styleSettings: TOptional<TObject<{
|
|
1241
|
+
image: TOptional<TObject<{
|
|
1242
|
+
size: TUnion<[
|
|
1243
|
+
TLiteral<"sm">,
|
|
1244
|
+
TLiteral<"md">,
|
|
1245
|
+
TLiteral<"lg">
|
|
1246
|
+
]>;
|
|
1247
|
+
orientation: TUnion<[
|
|
1248
|
+
TLiteral<"square">,
|
|
1249
|
+
TLiteral<"portrait">,
|
|
1250
|
+
TLiteral<"landscape">
|
|
1251
|
+
]>;
|
|
1252
|
+
}>>;
|
|
1253
|
+
name: TOptional<TObject<{
|
|
1254
|
+
visible: TOptional<TBoolean>;
|
|
1255
|
+
}>>;
|
|
1256
|
+
description: TOptional<TObject<{
|
|
1257
|
+
visible: TOptional<TBoolean>;
|
|
1258
|
+
}>>;
|
|
1259
|
+
}>>;
|
|
1260
|
+
}>>;
|
|
1261
|
+
assemblyPresets: TOptional<TObject<{
|
|
1262
|
+
enabled: TOptional<TBoolean>;
|
|
1263
|
+
items: TOptional<TArray<TObject<{
|
|
1264
|
+
id: TString;
|
|
1265
|
+
name: TString;
|
|
1266
|
+
description: TOptional<TString>;
|
|
1267
|
+
configuration: TUnion<[
|
|
1268
|
+
TNull,
|
|
1269
|
+
TObject<{
|
|
1270
|
+
roots: TArray<TObject<{
|
|
1271
|
+
id: TString;
|
|
1272
|
+
fileId: TString;
|
|
1273
|
+
name: TOptional<TString>;
|
|
1274
|
+
transform: TArray<TNumber>;
|
|
1275
|
+
interaction: TOptional<TUnion<[
|
|
1276
|
+
TLiteral<"none">,
|
|
1277
|
+
TLiteral<"select-only">,
|
|
1278
|
+
TLiteral<"select-and-drag">
|
|
1279
|
+
]>>;
|
|
1280
|
+
configuration: TOptional<TRecord<TString, TObject<{
|
|
1281
|
+
transform: TOptional<TArray<TNumber>>;
|
|
1282
|
+
publication: TOptional<TObject<{
|
|
1283
|
+
blocks: TRecord<TString, TAny>;
|
|
1284
|
+
}>>;
|
|
1285
|
+
materials: TOptional<TRecord<TString, TObject<{
|
|
1286
|
+
selected: TString;
|
|
1287
|
+
}>>>;
|
|
1288
|
+
subcomponent: TOptional<TRecord<TString, TObject<{
|
|
1289
|
+
selected: TString;
|
|
1290
|
+
}>>>;
|
|
1291
|
+
interaction: TOptional<TUnion<[
|
|
1292
|
+
TLiteral<"none">,
|
|
1293
|
+
TLiteral<"select-only">,
|
|
1294
|
+
TLiteral<"select-and-drag">
|
|
1295
|
+
]>>;
|
|
1296
|
+
draggable: TOptional<TBoolean>;
|
|
1297
|
+
movementPlane: TOptional<TArray<TNumber>>;
|
|
1298
|
+
gridPlane: TOptional<TObject<{
|
|
1299
|
+
snaps: TRecord<TString, TObject<{
|
|
1300
|
+
snappedObjects: TArray<TString>;
|
|
1301
|
+
}>>;
|
|
1302
|
+
}>>;
|
|
1303
|
+
keyPoint: TOptional<TObject<{
|
|
1304
|
+
snappedObject: TString;
|
|
1305
|
+
}>>;
|
|
1306
|
+
}>>>;
|
|
1307
|
+
structureConfiguration: TOptional<TObject<{
|
|
1308
|
+
cameraAutoFitOn: TOptional<TBoolean>;
|
|
1309
|
+
showInProductsList: TOptional<TBoolean>;
|
|
1310
|
+
interaction: TOptional<TUnion<[
|
|
1311
|
+
TLiteral<"none">,
|
|
1312
|
+
TLiteral<"select-only">,
|
|
1313
|
+
TLiteral<"select-and-drag">
|
|
1314
|
+
]>>;
|
|
1315
|
+
}>>;
|
|
1316
|
+
}>>;
|
|
1317
|
+
singleObjectRootId: TOptional<TString>;
|
|
1318
|
+
}>
|
|
1319
|
+
]>;
|
|
1320
|
+
ignore: TOptional<TArray<TString>>;
|
|
1321
|
+
icon: TOptional<TUnion<[
|
|
1322
|
+
TString,
|
|
1323
|
+
TNull
|
|
1324
|
+
]>>;
|
|
1325
|
+
visible: TOptional<TBoolean>;
|
|
1326
|
+
}>>>;
|
|
1327
|
+
selectedId: TOptional<TString>;
|
|
1328
|
+
styleSettings: TOptional<TObject<{
|
|
1329
|
+
image: TOptional<TObject<{
|
|
1330
|
+
size: TUnion<[
|
|
1331
|
+
TLiteral<"sm">,
|
|
1332
|
+
TLiteral<"md">,
|
|
1333
|
+
TLiteral<"lg">
|
|
1334
|
+
]>;
|
|
1335
|
+
orientation: TUnion<[
|
|
1336
|
+
TLiteral<"square">,
|
|
1337
|
+
TLiteral<"portrait">,
|
|
1338
|
+
TLiteral<"landscape">
|
|
1339
|
+
]>;
|
|
1340
|
+
}>>;
|
|
1341
|
+
name: TOptional<TObject<{
|
|
1342
|
+
visible: TOptional<TBoolean>;
|
|
1343
|
+
}>>;
|
|
1344
|
+
description: TOptional<TObject<{
|
|
1345
|
+
visible: TOptional<TBoolean>;
|
|
1346
|
+
}>>;
|
|
1347
|
+
}>>;
|
|
1348
|
+
}>>;
|
|
1349
|
+
}>>;
|
|
1350
|
+
cameraSettings: TOptional<TObject<{
|
|
1351
|
+
cameraType: TOptional<TUnion<[
|
|
1352
|
+
TLiteral<"perspective">,
|
|
1353
|
+
TLiteral<"orthographic">
|
|
1354
|
+
]>>;
|
|
1355
|
+
enabledLayers: TOptional<TArray<TInteger>>;
|
|
1356
|
+
enablePan: TOptional<TBoolean>;
|
|
1357
|
+
enableRotate: TOptional<TBoolean>;
|
|
1358
|
+
blockRotationAxes: TOptional<TObject<{
|
|
1359
|
+
x: TOptional<TBoolean>;
|
|
1360
|
+
y: TOptional<TBoolean>;
|
|
1361
|
+
z: TOptional<TBoolean>;
|
|
1362
|
+
}>>;
|
|
1363
|
+
infinityRotationAxes: TOptional<TObject<{
|
|
1364
|
+
x: TOptional<TBoolean>;
|
|
1365
|
+
y: TOptional<TBoolean>;
|
|
1366
|
+
}>>;
|
|
1367
|
+
blockMoveUnderFloor: TOptional<TBoolean>;
|
|
1368
|
+
zoomBoundaries: TOptional<TObject<{
|
|
1369
|
+
min: TOptional<TNumber>;
|
|
1370
|
+
max: TOptional<TNumber>;
|
|
1371
|
+
}>>;
|
|
1372
|
+
rotateBoundaries: TOptional<TObject<{
|
|
1373
|
+
x: TOptional<TObject<{
|
|
1374
|
+
min: TNumber;
|
|
1375
|
+
max: TNumber;
|
|
1376
|
+
}>>;
|
|
1377
|
+
y: TOptional<TObject<{
|
|
1378
|
+
min: TNumber;
|
|
1379
|
+
max: TNumber;
|
|
1380
|
+
}>>;
|
|
1381
|
+
}>>;
|
|
1382
|
+
enableAutoRotate: TOptional<TBoolean>;
|
|
1383
|
+
autoRotateActivationTime: TOptional<TNumber>;
|
|
1384
|
+
autoRotateSpeed: TOptional<TNumber>;
|
|
1385
|
+
cameraProperties: TOptional<TObject<{
|
|
1386
|
+
near: TOptional<TNumber>;
|
|
1387
|
+
far: TOptional<TNumber>;
|
|
1388
|
+
}>>;
|
|
1389
|
+
}>>;
|
|
1390
|
+
flowsSettings: TOptional<TObject<{
|
|
1391
|
+
selectedFlowIds: TOptional<TArray<TString>>;
|
|
1392
|
+
}>>;
|
|
1393
|
+
}>;
|
|
1394
|
+
structure: TArray<TObject<{
|
|
1395
|
+
type: TLiteral<"set-item">;
|
|
1396
|
+
uuid: TString;
|
|
1397
|
+
name: TString;
|
|
1398
|
+
model: TUnion<[
|
|
1399
|
+
TObject<{
|
|
1400
|
+
type: TLiteral<"cabinet">;
|
|
1401
|
+
fileId: TString;
|
|
1402
|
+
configuration: TObject<{
|
|
1403
|
+
cameraAutoFitOn: TOptional<TBoolean>;
|
|
1404
|
+
showInProductsList: TOptional<TBoolean>;
|
|
1405
|
+
draggable: TOptional<TBoolean>;
|
|
1406
|
+
interaction: TOptional<TUnion<[
|
|
1407
|
+
TLiteral<"none">,
|
|
1408
|
+
TLiteral<"select-only">,
|
|
1409
|
+
TLiteral<"select-and-drag">
|
|
1410
|
+
]>>;
|
|
1411
|
+
transform: TOptional<TArray<TNumber>>;
|
|
1412
|
+
}>;
|
|
1413
|
+
objectsConfiguration: TOptional<TRecord<TString, TObject<{
|
|
1414
|
+
transform: TOptional<TArray<TNumber>>;
|
|
1415
|
+
publication: TOptional<TObject<{
|
|
1416
|
+
blocks: TRecord<TString, TAny>;
|
|
1417
|
+
}>>;
|
|
1418
|
+
materials: TOptional<TRecord<TString, TObject<{
|
|
1419
|
+
selected: TString;
|
|
1420
|
+
}>>>;
|
|
1421
|
+
subcomponent: TOptional<TRecord<TString, TObject<{
|
|
1422
|
+
selected: TString;
|
|
1423
|
+
}>>>;
|
|
1424
|
+
interaction: TOptional<TUnion<[
|
|
1425
|
+
TLiteral<"none">,
|
|
1426
|
+
TLiteral<"select-only">,
|
|
1427
|
+
TLiteral<"select-and-drag">
|
|
1428
|
+
]>>;
|
|
1429
|
+
draggable: TOptional<TBoolean>;
|
|
1430
|
+
movementPlane: TOptional<TArray<TNumber>>;
|
|
1431
|
+
gridPlane: TOptional<TObject<{
|
|
1432
|
+
snaps: TRecord<TString, TObject<{
|
|
1433
|
+
snappedObjects: TArray<TString>;
|
|
1434
|
+
}>>;
|
|
1435
|
+
}>>;
|
|
1436
|
+
keyPoint: TOptional<TObject<{
|
|
1437
|
+
snappedObject: TString;
|
|
1438
|
+
}>>;
|
|
1439
|
+
}>>>;
|
|
1440
|
+
}>,
|
|
1441
|
+
TObject<{
|
|
1442
|
+
type: TLiteral<"scene">;
|
|
1443
|
+
fileId: TString;
|
|
1444
|
+
}>,
|
|
1445
|
+
TObject<{
|
|
1446
|
+
type: TLiteral<"space-root">;
|
|
1447
|
+
}>
|
|
1448
|
+
]>;
|
|
1449
|
+
}>>;
|
|
1450
|
+
}>;
|
|
1451
|
+
}>;
|
|
1452
|
+
type TVasFile = Static<typeof vasFileSchema>;
|
|
1453
|
+
type TStudioShadowMapType = "Basic" | "PCF" | "VSM";
|
|
1454
|
+
type TVsmShadowQuality = "Performance" | "Balanced" | "Quality";
|
|
1455
|
+
type TSettings = TVasFile["set"]["configuration"]["settings"] & {
|
|
1456
|
+
sceneSettings?: TVasFile["set"]["configuration"]["sceneSettings"] & {
|
|
1457
|
+
backgroundColor?: string | null;
|
|
1458
|
+
studioId?: number | null;
|
|
1459
|
+
envMap?: string | null;
|
|
1460
|
+
toneMapping?: {
|
|
1461
|
+
mode?: "None" | "Linear" | "Reinhard" | "Cineon" | "ACESFilmic" | "AgX" | "Neutral";
|
|
1462
|
+
exposure?: number;
|
|
1463
|
+
};
|
|
1464
|
+
shadowMap?: {
|
|
1465
|
+
type?: TStudioShadowMapType;
|
|
1466
|
+
vsmQuality?: TVsmShadowQuality;
|
|
1467
|
+
};
|
|
1468
|
+
};
|
|
1469
|
+
cameraSettings?: TVasFile["set"]["configuration"]["cameraSettings"];
|
|
1470
|
+
flowsSettings?: TVasFile["set"]["configuration"]["flowsSettings"];
|
|
1471
|
+
};
|
|
1472
|
+
type TCommonWebComponentEvents = {
|
|
1473
|
+
ready: TTimestampEventPayload;
|
|
1474
|
+
scriptsLoaded: TTimestampEventPayload;
|
|
1475
|
+
};
|
|
1476
|
+
type TWebComponentEvents<T extends Record<string, unknown> = TCommonWebComponentEvents> = TCommonWebComponentEvents & T;
|
|
1477
|
+
type TTimestampEventPayload = {
|
|
1478
|
+
timestamp: number;
|
|
1479
|
+
};
|
|
1480
|
+
type TMouseClickedPayload = {
|
|
1481
|
+
position: T2DPosition;
|
|
1482
|
+
mouseButton: number;
|
|
1483
|
+
};
|
|
1484
|
+
type TMouseMovedPayload = {
|
|
1485
|
+
position: T2DPosition;
|
|
1486
|
+
};
|
|
1487
|
+
type T2DPosition = {
|
|
1488
|
+
x: number;
|
|
1489
|
+
y: number;
|
|
1490
|
+
};
|
|
1491
|
+
/**
|
|
1492
|
+
* @category Addons API
|
|
1493
|
+
*/
|
|
1494
|
+
export type TViewerApi = {
|
|
1495
|
+
events: Emittery<TViewerApiEvents>;
|
|
1496
|
+
getPlayerInstance(): any;
|
|
1497
|
+
get isLoaded(): boolean;
|
|
1498
|
+
/**
|
|
1499
|
+
* Returns the current configuration formatted for rendering.
|
|
1500
|
+
*/
|
|
1501
|
+
getConfiguration(options?: TGetConfigurationParams): TConfiguration | null;
|
|
1502
|
+
/**
|
|
1503
|
+
* Returns the current price value.
|
|
1504
|
+
*/
|
|
1505
|
+
getPrice(): number;
|
|
1506
|
+
/**
|
|
1507
|
+
* Returns the current price formatted with set rounding settings.
|
|
1508
|
+
*/
|
|
1509
|
+
getRoundedPrice(): number;
|
|
1510
|
+
/**
|
|
1511
|
+
* Returns the current price formatted with the appropriate currency symbol.
|
|
1512
|
+
*/
|
|
1513
|
+
getPriceWithCurrency(): string | undefined;
|
|
1514
|
+
/**
|
|
1515
|
+
* Overrides the current price with the specified value.
|
|
1516
|
+
*
|
|
1517
|
+
* @param value value to replace price with
|
|
1518
|
+
*/
|
|
1519
|
+
setPrice(value: number | string): void;
|
|
1520
|
+
/**
|
|
1521
|
+
* If enabled, returns price components calculated based on the selected pricing rule. Otherwise, returns null.
|
|
1522
|
+
*/
|
|
1523
|
+
getPricing(): TPricingData | null;
|
|
1524
|
+
/** @ignore */
|
|
1525
|
+
getScene(): any;
|
|
1526
|
+
/** @ignore */
|
|
1527
|
+
getModel3D(): any;
|
|
1528
|
+
/** @ignore */
|
|
1529
|
+
getModelContainer3D(): any;
|
|
1530
|
+
/**
|
|
1531
|
+
* Returns the WebGL canvas element.
|
|
1532
|
+
*/
|
|
1533
|
+
getCanvas(): HTMLCanvasElement;
|
|
1534
|
+
/**
|
|
1535
|
+
* Returns all available material groups.
|
|
1536
|
+
*/
|
|
1537
|
+
getMaterialGroups(): Promise<TMaterialGroup[]>;
|
|
1538
|
+
/**
|
|
1539
|
+
* Returns a mapping of group IDs to their selected material IDs.
|
|
1540
|
+
*/
|
|
1541
|
+
getSelectedMaterialByGroup(): {
|
|
1542
|
+
[key: number]: number;
|
|
1543
|
+
};
|
|
1544
|
+
/**
|
|
1545
|
+
* Returns the material definition for the specified material ID.
|
|
1546
|
+
*/
|
|
1547
|
+
getMaterialDataById(materialId: number): TMaterial;
|
|
1548
|
+
/**
|
|
1549
|
+
* Returns a list of materials matching the given filter ID, optionally grouped by the specified query ID.
|
|
1550
|
+
*/
|
|
1551
|
+
getMaterialsList({ filterId, groupingQueryId, page, perPage, searchPhrase, searchProps, }: TGetMaterialsListParams): Promise<TMaterialsList>;
|
|
1552
|
+
getMaterialsList(filterId: number, groupingQueryId?: number, page?: number, perPage?: number): Promise<TMaterialsList>;
|
|
1553
|
+
/**
|
|
1554
|
+
* Returns the current layout settings configuration.
|
|
1555
|
+
*/
|
|
1556
|
+
getLayoutSettings(): TLayoutSettings;
|
|
1557
|
+
/**
|
|
1558
|
+
* Returns the preset picker configuration for the current set.
|
|
1559
|
+
*/
|
|
1560
|
+
getPresetsConfiguration(): TPresetsConfiguration;
|
|
1561
|
+
/**
|
|
1562
|
+
* Assigns the specified material ID to the given group ID.
|
|
1563
|
+
*/
|
|
1564
|
+
assignMaterial(groupId: number, materialId: number): Promise<void>;
|
|
1565
|
+
/**
|
|
1566
|
+
* Assigns the specified material ID to the given group ID.
|
|
1567
|
+
*/
|
|
1568
|
+
assignMaterials(materials: Record<string, number>): Promise<void>;
|
|
1569
|
+
/**
|
|
1570
|
+
* Changes the camera projection type to either orthographic or perspective.
|
|
1571
|
+
*/
|
|
1572
|
+
changeCameraType(type: "orthographic" | "perspective"): void;
|
|
1573
|
+
/**
|
|
1574
|
+
* Applies the specified camera settings.
|
|
1575
|
+
*/
|
|
1576
|
+
setCameraSettings(settings: TCameraSettings): void;
|
|
1577
|
+
/**
|
|
1578
|
+
* Applies a subset of viewer settings without reloading the whole player.
|
|
1579
|
+
*/
|
|
1580
|
+
applySettings(settings: Partial<TSettings>): Promise<void>;
|
|
1581
|
+
/**
|
|
1582
|
+
* Moves the camera based on the provided parameters.
|
|
1583
|
+
*/
|
|
1584
|
+
moveCamera(params: TMoveCameraParams): Promise<void>;
|
|
1585
|
+
/**
|
|
1586
|
+
* Adjusts the camera to fit the current object within view.
|
|
1587
|
+
*/
|
|
1588
|
+
autoFitCamera(): Promise<void>;
|
|
1589
|
+
/**
|
|
1590
|
+
* Generates a bill of materials for the specified template ID and filter ID.
|
|
1591
|
+
*/
|
|
1592
|
+
generateBom({ templateId, filterId, }: {
|
|
1593
|
+
templateId: number;
|
|
1594
|
+
filterId: number;
|
|
1595
|
+
}): Promise<TBom>;
|
|
1596
|
+
/**
|
|
1597
|
+
* Returns the current floor settings.
|
|
1598
|
+
*/
|
|
1599
|
+
getSetFloorSettings(): TFloorSettings;
|
|
1600
|
+
/**
|
|
1601
|
+
* Returns the target unit for value transformation.
|
|
1602
|
+
*/
|
|
1603
|
+
getTargetUnit(): string;
|
|
1604
|
+
/**
|
|
1605
|
+
* Returns the list of available units.
|
|
1606
|
+
*/
|
|
1607
|
+
getUnits(): TUnit[];
|
|
1608
|
+
/** @ignore */
|
|
1609
|
+
getDimensions(filter?: "default" | "defaultNotControlledByEvent"): any[];
|
|
1610
|
+
/**
|
|
1611
|
+
* Changes the current unit to the specified unit.
|
|
1612
|
+
*/
|
|
1613
|
+
changeUnit(unit: string): void;
|
|
1614
|
+
/**
|
|
1615
|
+
* Converts a value from millimeters to the current set target unit.
|
|
1616
|
+
*/
|
|
1617
|
+
convertFromMillimeters(value: number | string, baseUnit: string): number | string;
|
|
1618
|
+
/**
|
|
1619
|
+
* Converts a value from the current set target unit to millimeters.
|
|
1620
|
+
*/
|
|
1621
|
+
convertToMillimeters(value: number | string, baseUnit: string): number | string;
|
|
1622
|
+
/**
|
|
1623
|
+
* Returns the localized string for the given key
|
|
1624
|
+
*/
|
|
1625
|
+
translate(key: string): string;
|
|
1626
|
+
/**
|
|
1627
|
+
* Switches the interface view to either preview or edit mode.
|
|
1628
|
+
*/
|
|
1629
|
+
changeView(view: "preview" | "edit"): void;
|
|
1630
|
+
/**
|
|
1631
|
+
* Updates the parameter identified by the code with the specified value.
|
|
1632
|
+
*/
|
|
1633
|
+
changeParameter(code: string, value: string | number): Promise<void>;
|
|
1634
|
+
/**
|
|
1635
|
+
* Updates multiple parameters in a single call.
|
|
1636
|
+
*/
|
|
1637
|
+
changeParameters(parameters: Record<string, string | number>): Promise<void>;
|
|
1638
|
+
/**
|
|
1639
|
+
* Normalizes the given value for a parameter, returning the value and its corresponding label.
|
|
1640
|
+
*/
|
|
1641
|
+
normalizeParameterValue(parameter: TParameter, value: string | number): {
|
|
1642
|
+
value: string | number;
|
|
1643
|
+
label: string;
|
|
1644
|
+
};
|
|
1645
|
+
/**
|
|
1646
|
+
* Enables all layers in the current context.
|
|
1647
|
+
*/
|
|
1648
|
+
enableAllLayers(): void;
|
|
1649
|
+
/**
|
|
1650
|
+
* Disables all layers in the current context.
|
|
1651
|
+
*/
|
|
1652
|
+
disableAllLayers(): void;
|
|
1653
|
+
/**
|
|
1654
|
+
* Enables the layer with the specified ID.
|
|
1655
|
+
*/
|
|
1656
|
+
enableLayer(id: number): void;
|
|
1657
|
+
/**
|
|
1658
|
+
* Disables the layer with the specified ID.
|
|
1659
|
+
*/
|
|
1660
|
+
disableLayer(id: number): void;
|
|
1661
|
+
/**
|
|
1662
|
+
* Toggles dimension visibility based on the state and optional dimension IDs or presets.
|
|
1663
|
+
*/
|
|
1664
|
+
toggleDimensions(state: boolean, dimensions?: number[] | "default" | "defaultNotControlledByEvent"): void;
|
|
1665
|
+
/**
|
|
1666
|
+
* Loads preset with given ID and reloads the viewer
|
|
1667
|
+
*/
|
|
1668
|
+
loadPreset(id: string | TPreset): Promise<void>;
|
|
1669
|
+
};
|
|
1670
|
+
export type TViewerApiEvents = TWebComponentEvents<{
|
|
1671
|
+
loaded: TTimestampEventPayload;
|
|
1672
|
+
reloaded: TTimestampEventPayload;
|
|
1673
|
+
reloadedAfterLoad: TTimestampEventPayload;
|
|
1674
|
+
configurationUpdating: TTimestampEventPayload;
|
|
1675
|
+
sceneReloaded: TTimestampEventPayload;
|
|
1676
|
+
configurationUpdated: TConfiguration;
|
|
1677
|
+
presetLoaded: {
|
|
1678
|
+
id: string;
|
|
1679
|
+
};
|
|
1680
|
+
priceChanged: {
|
|
1681
|
+
price: number;
|
|
1682
|
+
priceWithCurrency: string;
|
|
1683
|
+
};
|
|
1684
|
+
bomGenerated: {
|
|
1685
|
+
templateId: number;
|
|
1686
|
+
filterId: number;
|
|
1687
|
+
bom: TBom;
|
|
1688
|
+
};
|
|
1689
|
+
materialAssigned: {
|
|
1690
|
+
groupId: number;
|
|
1691
|
+
materialId: number;
|
|
1692
|
+
};
|
|
1693
|
+
materialAssignedAfterLoad: {
|
|
1694
|
+
groupId: number;
|
|
1695
|
+
materialId: number;
|
|
1696
|
+
};
|
|
1697
|
+
mouseClicked: TMouseClickedPayload;
|
|
1698
|
+
mouseMoved: TMouseMovedPayload;
|
|
1699
|
+
dimensionToggled: {
|
|
1700
|
+
state: boolean;
|
|
1701
|
+
};
|
|
1702
|
+
}>;
|
|
1703
|
+
export type TGetMaterialsListParams = {
|
|
1704
|
+
filterId: number;
|
|
1705
|
+
groupingQueryId?: number;
|
|
1706
|
+
page?: number;
|
|
1707
|
+
perPage?: number;
|
|
1708
|
+
searchPhrase?: string;
|
|
1709
|
+
searchProps?: TMaterialSearchProp[];
|
|
1710
|
+
langCode?: string;
|
|
1711
|
+
};
|
|
1712
|
+
export type TMaterialSearchProp = "name" | "code";
|
|
1713
|
+
export type TGetConfigurationParams = {
|
|
1714
|
+
/**
|
|
1715
|
+
* Specifies whether to include hidden items
|
|
1716
|
+
* @defaultValue `true`
|
|
1717
|
+
*/
|
|
1718
|
+
includeHidden?: boolean;
|
|
1719
|
+
};
|
|
1720
|
+
export type TMoveCameraParams = {
|
|
1721
|
+
/**
|
|
1722
|
+
* Target camera angle
|
|
1723
|
+
* @defaultValue `default`
|
|
1724
|
+
*/
|
|
1725
|
+
angle?: TCameraAngle;
|
|
1726
|
+
/**
|
|
1727
|
+
* Whether to move with animation
|
|
1728
|
+
* @defaultValue `true`
|
|
1729
|
+
*/
|
|
1730
|
+
animation?: boolean;
|
|
1731
|
+
};
|
|
1732
|
+
export type TCameraAngle = "default" | "-x+z" | "+x+z" | "-x-z" | "+x-z" | "+z" | "-z" | "+y" | "-y" | "+x" | "-x";
|
|
1733
|
+
export type TMaterial = {
|
|
1734
|
+
id: number;
|
|
1735
|
+
name: string;
|
|
1736
|
+
code: string;
|
|
1737
|
+
price: number;
|
|
1738
|
+
group: string;
|
|
1739
|
+
type: string;
|
|
1740
|
+
mass: number;
|
|
1741
|
+
mass_unit: string;
|
|
1742
|
+
dim_x: number;
|
|
1743
|
+
dim_y: number;
|
|
1744
|
+
dim_z: number;
|
|
1745
|
+
dim_unit: string;
|
|
1746
|
+
data_1: string;
|
|
1747
|
+
data_2: string;
|
|
1748
|
+
data_3: string;
|
|
1749
|
+
data_4: string;
|
|
1750
|
+
url: string;
|
|
1751
|
+
photo: string;
|
|
1752
|
+
enabled: boolean;
|
|
1753
|
+
grain: boolean;
|
|
1754
|
+
};
|
|
1755
|
+
export type TMeta = {
|
|
1756
|
+
totalItems: number;
|
|
1757
|
+
itemCount: number;
|
|
1758
|
+
itemsPerPage: number;
|
|
1759
|
+
totalPages: number;
|
|
1760
|
+
currentPage: number;
|
|
1761
|
+
};
|
|
1762
|
+
export type TMaterialsList = {
|
|
1763
|
+
items: TMaterial[];
|
|
1764
|
+
meta: TMeta;
|
|
1765
|
+
};
|
|
1766
|
+
export type TLayoutSettings = {
|
|
1767
|
+
colors: {
|
|
1768
|
+
primaryColor: string;
|
|
1769
|
+
secondaryColor: string;
|
|
1770
|
+
};
|
|
1771
|
+
defaultConfigurationMode: "configuration" | "materials";
|
|
1772
|
+
presetsEnabled?: boolean;
|
|
1773
|
+
};
|
|
1774
|
+
export type TFilterGroupingQuery = {
|
|
1775
|
+
name: string;
|
|
1776
|
+
default: boolean;
|
|
1777
|
+
};
|
|
1778
|
+
export type TFilter = {
|
|
1779
|
+
name: string;
|
|
1780
|
+
id: number;
|
|
1781
|
+
groupingQueries: TFilterGroupingQuery[];
|
|
1782
|
+
};
|
|
1783
|
+
export type TMaterialGroup = {
|
|
1784
|
+
id: number;
|
|
1785
|
+
name: string;
|
|
1786
|
+
filterData: TFilter;
|
|
1787
|
+
filters: TFilter[];
|
|
1788
|
+
showType: string;
|
|
1789
|
+
};
|
|
1790
|
+
export type TBom = {
|
|
1791
|
+
name: string;
|
|
1792
|
+
head: string[];
|
|
1793
|
+
body: string[][];
|
|
1794
|
+
};
|
|
1795
|
+
export type TCameraSettings = {
|
|
1796
|
+
autoCameraFit?: boolean;
|
|
1797
|
+
fitAngle?: TCameraAngle;
|
|
1798
|
+
cameraFitToSelected?: boolean;
|
|
1799
|
+
cameraSnapToAngle?: boolean;
|
|
1800
|
+
cameraType?: "orthographic" | "perspective";
|
|
1801
|
+
enablePan?: boolean;
|
|
1802
|
+
enableRotate?: boolean;
|
|
1803
|
+
blockRotationAxes?: {
|
|
1804
|
+
x?: boolean;
|
|
1805
|
+
y?: boolean;
|
|
1806
|
+
z?: boolean;
|
|
1807
|
+
};
|
|
1808
|
+
blockMoveUnderFloor?: boolean;
|
|
1809
|
+
zoomBoundaries?: {
|
|
1810
|
+
max?: number;
|
|
1811
|
+
min?: number;
|
|
1812
|
+
};
|
|
1813
|
+
rotateBoundaries?: {
|
|
1814
|
+
x?: {
|
|
1815
|
+
min?: number;
|
|
1816
|
+
max?: number;
|
|
1817
|
+
};
|
|
1818
|
+
y?: {
|
|
1819
|
+
min?: number;
|
|
1820
|
+
max?: number;
|
|
1821
|
+
};
|
|
1822
|
+
};
|
|
1823
|
+
enableCameraOptimization?: boolean;
|
|
1824
|
+
enableAutoRotate?: boolean;
|
|
1825
|
+
autoRotateActivationTime?: number;
|
|
1826
|
+
autoRotateSpeed?: number;
|
|
1827
|
+
infinityRotationAxes?: {
|
|
1828
|
+
x?: boolean;
|
|
1829
|
+
y?: boolean;
|
|
1830
|
+
};
|
|
1831
|
+
isCameraSet?: boolean;
|
|
1832
|
+
defaultFar?: boolean;
|
|
1833
|
+
};
|
|
1834
|
+
export type TFloorSettings = {
|
|
1835
|
+
activeFloor: boolean;
|
|
1836
|
+
activeFloorShadow: boolean;
|
|
1837
|
+
useFloorInAR: boolean;
|
|
1838
|
+
floorSize: {
|
|
1839
|
+
x: number;
|
|
1840
|
+
y: number;
|
|
1841
|
+
};
|
|
1842
|
+
floorSizeType: "infinity" | "likeObject" | "custom";
|
|
1843
|
+
selectedMaterialGroup: number | null;
|
|
1844
|
+
selectedDefaultMaterial: number | null;
|
|
1845
|
+
};
|
|
1846
|
+
export type TUnit = {
|
|
1847
|
+
unit: string;
|
|
1848
|
+
label: string;
|
|
1849
|
+
};
|
|
1850
|
+
export type TParameterTypes = "number-range" | "number-predefined" | "number-constant" | "text-constant" | "text-input" | "boolean" | "list-options" | "list-buttons" | "list-image-options" | "list-image-buttons" | "list-images" | "button";
|
|
1851
|
+
export type TParameterEvents = {
|
|
1852
|
+
[K in keyof GlobalEventHandlersEventMap]?: (event: GlobalEventHandlersEventMap[K]) => void;
|
|
1853
|
+
};
|
|
1854
|
+
export type TParameterBase<TType extends TParameterTypes = TParameterTypes, TSettings = undefined> = {
|
|
1855
|
+
code: string;
|
|
1856
|
+
name: string;
|
|
1857
|
+
type: TType;
|
|
1858
|
+
unit: string;
|
|
1859
|
+
unitLabel: string;
|
|
1860
|
+
value: string;
|
|
1861
|
+
valueLabel: string;
|
|
1862
|
+
settings: TSettings;
|
|
1863
|
+
events?: TParameterEvents;
|
|
1864
|
+
isHidden?: boolean;
|
|
1865
|
+
};
|
|
1866
|
+
export type TParameterNumberRange = TParameterBase<"number-range", {
|
|
1867
|
+
min: number;
|
|
1868
|
+
minLabel: string;
|
|
1869
|
+
max: number;
|
|
1870
|
+
maxLabel: string;
|
|
1871
|
+
preferred?: number[];
|
|
1872
|
+
step: number;
|
|
1873
|
+
}>;
|
|
1874
|
+
type TNumberPredefinedStyleSettings = {
|
|
1875
|
+
align?: "content" | "responsive";
|
|
1876
|
+
};
|
|
1877
|
+
export type TParameterNumberPredefined = TParameterBase<"number-predefined", {
|
|
1878
|
+
options: string[];
|
|
1879
|
+
optionLabels: string[];
|
|
1880
|
+
styleSettings?: TNumberPredefinedStyleSettings;
|
|
1881
|
+
}>;
|
|
1882
|
+
export type TParameterNumberConstant = TParameterBase<"number-constant">;
|
|
1883
|
+
type TListStyleSettings = {
|
|
1884
|
+
size?: "sm" | "md" | "lg";
|
|
1885
|
+
shape?: "square" | "portrait" | "landscape";
|
|
1886
|
+
align?: "content" | "responsive";
|
|
1887
|
+
};
|
|
1888
|
+
export type TParameterListOptions = TParameterBase<"list-options", {
|
|
1889
|
+
defaultValue: string;
|
|
1890
|
+
options: Record<string, string>;
|
|
1891
|
+
optionsOrdered: {
|
|
1892
|
+
key: string;
|
|
1893
|
+
value: string;
|
|
1894
|
+
}[];
|
|
1895
|
+
styleSettings?: TListStyleSettings;
|
|
1896
|
+
}>;
|
|
1897
|
+
export type TParameterListButtons = TParameterBase<"list-buttons", {
|
|
1898
|
+
defaultValue: string;
|
|
1899
|
+
options: Record<string, string>;
|
|
1900
|
+
optionsOrdered: {
|
|
1901
|
+
key: string;
|
|
1902
|
+
value: string;
|
|
1903
|
+
}[];
|
|
1904
|
+
styleSettings?: TListStyleSettings;
|
|
1905
|
+
}>;
|
|
1906
|
+
export type TParameterListImageOptions = TParameterBase<"list-image-options", {
|
|
1907
|
+
defaultValue: string;
|
|
1908
|
+
options: Record<string, string>;
|
|
1909
|
+
optionsOrdered: {
|
|
1910
|
+
key: string;
|
|
1911
|
+
value: string;
|
|
1912
|
+
}[];
|
|
1913
|
+
optionsImages: Record<string, string>;
|
|
1914
|
+
styleSettings?: TListStyleSettings;
|
|
1915
|
+
}>;
|
|
1916
|
+
export type TParameterListImageButtons = TParameterBase<"list-image-buttons", {
|
|
1917
|
+
defaultValue: string;
|
|
1918
|
+
options: Record<string, string>;
|
|
1919
|
+
optionsOrdered: {
|
|
1920
|
+
key: string;
|
|
1921
|
+
value: string;
|
|
1922
|
+
}[];
|
|
1923
|
+
optionsImages: Record<string, string>;
|
|
1924
|
+
styleSettings?: TListStyleSettings;
|
|
1925
|
+
}>;
|
|
1926
|
+
export type TParameterListImages = TParameterBase<"list-images", {
|
|
1927
|
+
defaultValue: string | null;
|
|
1928
|
+
options: Record<string, {
|
|
1929
|
+
image: string | null;
|
|
1930
|
+
label: string;
|
|
1931
|
+
}>;
|
|
1932
|
+
}>;
|
|
1933
|
+
export type TParameterText = TParameterBase<"text-constant">;
|
|
1934
|
+
export type TParameterTextInput = TParameterBase<"text-input", {
|
|
1935
|
+
maxLength: number;
|
|
1936
|
+
placeholder: string;
|
|
1937
|
+
}>;
|
|
1938
|
+
export type TParameterBoolean = TParameterBase<"boolean">;
|
|
1939
|
+
export type TParameterButton = TParameterBase<"button">;
|
|
1940
|
+
export type TParameter = TParameterNumberRange | TParameterNumberPredefined | TParameterNumberConstant | TParameterListOptions | TParameterListButtons | TParameterListImageOptions | TParameterListImageButtons | TParameterListImages | TParameterText | TParameterTextInput | TParameterBoolean | TParameterButton;
|
|
1941
|
+
export type TCategory = {
|
|
1942
|
+
id: number;
|
|
1943
|
+
name: string;
|
|
1944
|
+
parameters: TParameter[];
|
|
1945
|
+
isHidden?: boolean;
|
|
1946
|
+
};
|
|
1947
|
+
export type TConfiguration = {
|
|
1948
|
+
categories: TCategory[];
|
|
1949
|
+
};
|
|
1950
|
+
export type TPricingSection = {
|
|
1951
|
+
name: string;
|
|
1952
|
+
table: string[][];
|
|
1953
|
+
price: number;
|
|
1954
|
+
priceColumnIndex: number;
|
|
1955
|
+
};
|
|
1956
|
+
export type TPricingData = {
|
|
1957
|
+
finalPrice: number;
|
|
1958
|
+
sections: TPricingSection[];
|
|
1959
|
+
};
|
|
1960
|
+
export type TPreset = {
|
|
1961
|
+
id: string;
|
|
1962
|
+
name: string;
|
|
1963
|
+
configuration: any;
|
|
1964
|
+
ignore?: string[];
|
|
1965
|
+
description?: string;
|
|
1966
|
+
icon?: string | null;
|
|
1967
|
+
visible?: boolean;
|
|
1968
|
+
};
|
|
1969
|
+
export type TPresetStyleSettings = {
|
|
1970
|
+
image?: {
|
|
1971
|
+
size: "sm" | "md" | "lg";
|
|
1972
|
+
orientation: "square" | "portrait" | "landscape";
|
|
1973
|
+
};
|
|
1974
|
+
name?: {
|
|
1975
|
+
visible?: boolean;
|
|
1976
|
+
};
|
|
1977
|
+
description?: {
|
|
1978
|
+
visible?: boolean;
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
export type TPresetsConfiguration = {
|
|
1982
|
+
enabled: boolean;
|
|
1983
|
+
selectedId?: string;
|
|
1984
|
+
styleSettings?: TPresetStyleSettings;
|
|
1985
|
+
items: TPreset[];
|
|
1986
|
+
};
|
|
1987
|
+
/**
|
|
1988
|
+
* @category Addons API
|
|
1989
|
+
*/
|
|
1990
|
+
export type TARApi = {
|
|
1991
|
+
events: Emittery<TARApiEvents>;
|
|
1992
|
+
/**
|
|
1993
|
+
* Generates and uploads the current project for AR viewing, returning a QR image and URL.
|
|
1994
|
+
*/
|
|
1995
|
+
generateAndUpload(): Promise<{
|
|
1996
|
+
qrImage: string;
|
|
1997
|
+
url: string;
|
|
1998
|
+
}>;
|
|
1999
|
+
/**
|
|
2000
|
+
* Generates and returns the project data as a Blob for AR viewing.
|
|
2001
|
+
*/
|
|
2002
|
+
generate(): Promise<Blob>;
|
|
2003
|
+
};
|
|
2004
|
+
export type TARApiEvents = TWebComponentEvents<{
|
|
2005
|
+
generated: Blob;
|
|
2006
|
+
}>;
|
|
2007
|
+
/**
|
|
2008
|
+
* @category Addons API
|
|
2009
|
+
*/
|
|
2010
|
+
export type TConfigurationApi = {
|
|
2011
|
+
events: Emittery<TConfigurationApiEvents>;
|
|
2012
|
+
/**
|
|
2013
|
+
* Generates and returns the current configuration content
|
|
2014
|
+
*/
|
|
2015
|
+
generate(): TConfigurationContent;
|
|
2016
|
+
/**
|
|
2017
|
+
* Generates and uploads the current configuration, returning a URL for later use.
|
|
2018
|
+
*/
|
|
2019
|
+
generateAndUpload(): Promise<TConfigurationUrl>;
|
|
2020
|
+
};
|
|
2021
|
+
export type TConfigurationApiEvents = TWebComponentEvents<{
|
|
2022
|
+
generated: TConfigurationContent;
|
|
2023
|
+
uploaded: TConfigurationUrl;
|
|
2024
|
+
}>;
|
|
2025
|
+
export type TConfigurationUrl = {
|
|
2026
|
+
id: string;
|
|
2027
|
+
url: string;
|
|
2028
|
+
dataUrl: string;
|
|
2029
|
+
configuration: TConfigurationContent;
|
|
2030
|
+
};
|
|
2031
|
+
export type TConfigurationContent = Record<string, unknown>;
|
|
2032
|
+
export type TPrimitive = bigint | boolean | null | number | string | symbol | undefined;
|
|
2033
|
+
/**
|
|
2034
|
+
* @category Addons API
|
|
2035
|
+
*/
|
|
2036
|
+
export type TDocumentationApi = {
|
|
2037
|
+
events: Emittery<TDocumentationApiEvents>;
|
|
2038
|
+
/**
|
|
2039
|
+
* Checks if documentation generation is available.
|
|
2040
|
+
*/
|
|
2041
|
+
getDocumentationAvailability(): boolean;
|
|
2042
|
+
/**
|
|
2043
|
+
* Generates the documentation PDF as a Blob using optional source data.
|
|
2044
|
+
*/
|
|
2045
|
+
generate(sourceData?: Record<string, TPrimitive>): Promise<Blob>;
|
|
2046
|
+
/**
|
|
2047
|
+
* Generates and triggers download of the documentation PDF using optional source data.
|
|
2048
|
+
*/
|
|
2049
|
+
generateAndDownload(sourceData?: Record<string, TPrimitive>): Promise<void>;
|
|
2050
|
+
};
|
|
2051
|
+
export type TDocumentationApiEvents = TWebComponentEvents<{
|
|
2052
|
+
availabilityChanged: boolean;
|
|
2053
|
+
generated: Blob;
|
|
2054
|
+
downloaded: Blob;
|
|
2055
|
+
}>;
|
|
2056
|
+
/**
|
|
2057
|
+
* @category Addons API
|
|
2058
|
+
*/
|
|
2059
|
+
export type TIntegrationConnectorApi = {
|
|
2060
|
+
events: Emittery<TIntegrationConnectorApiEvents>;
|
|
2061
|
+
/**
|
|
2062
|
+
* Executes a flow immediately with the given parameters and returns the response.
|
|
2063
|
+
*/
|
|
2064
|
+
execute: (params: TExecuteParams) => Promise<TExecutionResponse>;
|
|
2065
|
+
/**
|
|
2066
|
+
* Hooks specified flows by their IDs to the current project.
|
|
2067
|
+
*/
|
|
2068
|
+
hookFlowsByIds: (ids: string[]) => Promise<void>;
|
|
2069
|
+
};
|
|
2070
|
+
export type TIntegrationConnectorApiEvents = TWebComponentEvents<{
|
|
2071
|
+
executed: TExecutionResponse & {
|
|
2072
|
+
id: string;
|
|
2073
|
+
name: string;
|
|
2074
|
+
};
|
|
2075
|
+
}>;
|
|
2076
|
+
export type TExecuteParams = {
|
|
2077
|
+
id: string;
|
|
2078
|
+
inputData?: unknown;
|
|
2079
|
+
};
|
|
2080
|
+
export type TExecutionResponse = {
|
|
2081
|
+
isSuccess: boolean;
|
|
2082
|
+
data: unknown;
|
|
2083
|
+
};
|
|
2084
|
+
/**
|
|
2085
|
+
* @category Addons API
|
|
2086
|
+
*/
|
|
2087
|
+
export type TLayoutApi = {
|
|
2088
|
+
events: Emittery<TLayoutApiEvents>;
|
|
2089
|
+
/**
|
|
2090
|
+
* Enables or disables fullscreen mode based on the given state.
|
|
2091
|
+
*/
|
|
2092
|
+
toggleFullscreen: (state: boolean) => void;
|
|
2093
|
+
/**
|
|
2094
|
+
* Applies a subset of layout settings without remounting the addon.
|
|
2095
|
+
*/
|
|
2096
|
+
applyLayoutSettings: (settingsPatch: Partial<TLayoutSettings>) => void;
|
|
2097
|
+
};
|
|
2098
|
+
export type TLayoutApiEvents = TWebComponentEvents;
|
|
2099
|
+
/**
|
|
2100
|
+
* @category Addons API
|
|
2101
|
+
*/
|
|
2102
|
+
export type TSnapshotApi = {
|
|
2103
|
+
events: Emittery<TSnapshotApiEvents>;
|
|
2104
|
+
/**
|
|
2105
|
+
* Generates a snapshot of current view and returns it as a Blob.
|
|
2106
|
+
*/
|
|
2107
|
+
generate(): Promise<Blob>;
|
|
2108
|
+
/**
|
|
2109
|
+
* Generates and triggers download of a snapshot of current view.
|
|
2110
|
+
*/
|
|
2111
|
+
generateAndDownload(): Promise<void>;
|
|
2112
|
+
/**
|
|
2113
|
+
* Generates and uploads a snapshot of current view, returning its URL.
|
|
2114
|
+
*/
|
|
2115
|
+
generateAndUpload(): Promise<TSnapshotUrl>;
|
|
2116
|
+
};
|
|
2117
|
+
export type TSnapshotApiEvents = TWebComponentEvents<{
|
|
2118
|
+
generated: Blob;
|
|
2119
|
+
downloaded: Blob;
|
|
2120
|
+
uploaded: TSnapshotUrl;
|
|
2121
|
+
}>;
|
|
2122
|
+
export type TSnapshotUrl = {
|
|
2123
|
+
url: string;
|
|
2124
|
+
snapshotBlob: Blob;
|
|
2125
|
+
};
|
|
2126
|
+
declare const exportConfigurationSchema: TObject<{
|
|
2127
|
+
exports: TArray<TObject<{
|
|
2128
|
+
name: TString;
|
|
2129
|
+
bomTemplateId: TNumber;
|
|
2130
|
+
bomFilterId: TNumber;
|
|
2131
|
+
}>>;
|
|
2132
|
+
v: TLiteral<1>;
|
|
2133
|
+
}>;
|
|
2134
|
+
type TExportConfigurationFile = Static<typeof exportConfigurationSchema>;
|
|
2135
|
+
interface ILibraryApi {
|
|
2136
|
+
/**
|
|
2137
|
+
* Returns the URL for the asset with the given ID for current library version.
|
|
2138
|
+
*/
|
|
2139
|
+
getAssetUrl(id: string): string;
|
|
2140
|
+
/**
|
|
2141
|
+
* Returns the thumbnail URL for the asset with the given ID for current library version.
|
|
2142
|
+
*/
|
|
2143
|
+
getAssetThumbnailUrl(id: string): string;
|
|
2144
|
+
/**
|
|
2145
|
+
* Retrieves the asset content by ID for current library version, or null if not found.
|
|
2146
|
+
*/
|
|
2147
|
+
getAssetById(id: string): Promise<Response | null>;
|
|
2148
|
+
/**
|
|
2149
|
+
* Retrieves the assembly data for current library version.
|
|
2150
|
+
*/
|
|
2151
|
+
getAssemblyData(): Promise<unknown>;
|
|
2152
|
+
/**
|
|
2153
|
+
* Retrieves the configuration data for current library version.
|
|
2154
|
+
*/
|
|
2155
|
+
getConfigurationData(): Promise<unknown>;
|
|
2156
|
+
/**
|
|
2157
|
+
* Retrieves the export configuration data for current library version.
|
|
2158
|
+
*/
|
|
2159
|
+
getExportConfiguration(): Promise<TExportConfigurationFile>;
|
|
2160
|
+
}
|
|
2161
|
+
/**
|
|
2162
|
+
* @category Addons API
|
|
2163
|
+
*/
|
|
2164
|
+
export type TPlayerApi = {
|
|
2165
|
+
events: Emittery<TPlayerApiEvents>;
|
|
2166
|
+
viewer: TViewerApi;
|
|
2167
|
+
/**
|
|
2168
|
+
* Returns the current site identifier as a string.
|
|
2169
|
+
*/
|
|
2170
|
+
getSiteId: () => string;
|
|
2171
|
+
isDevelopmentMode: () => boolean;
|
|
2172
|
+
/**
|
|
2173
|
+
* Returns the current library version as a string.
|
|
2174
|
+
*/
|
|
2175
|
+
getLibraryVersion: () => string;
|
|
2176
|
+
/**
|
|
2177
|
+
* Returns the current configuration ID, or null if none is set.
|
|
2178
|
+
*/
|
|
2179
|
+
getCurrentConfigurationId: () => string | null;
|
|
2180
|
+
/**
|
|
2181
|
+
* Asynchronously loads a configuration by ID; returns success status and optional error code.
|
|
2182
|
+
*/
|
|
2183
|
+
loadConfiguration: (id: string | null) => Promise<{
|
|
2184
|
+
result: boolean;
|
|
2185
|
+
error?: "INVALID_CONFIGURATION_ID_OR_URL" | "INVALID_CONFIGURATION" | "COMPONENT_ID_MISMATCH" | "LIBRARY_VERSION_MISMATCH";
|
|
2186
|
+
}>;
|
|
2187
|
+
libraryApi: ILibraryApi;
|
|
2188
|
+
} & Partial<{
|
|
2189
|
+
ar: TARApi;
|
|
2190
|
+
configuration: TConfigurationApi;
|
|
2191
|
+
documentation: TDocumentationApi;
|
|
2192
|
+
ic: TIntegrationConnectorApi;
|
|
2193
|
+
layout: TLayoutApi;
|
|
2194
|
+
snapshot: TSnapshotApi;
|
|
2195
|
+
}>;
|
|
2196
|
+
export type TPlayerApiEvents = TWebComponentEvents;
|
|
2197
|
+
|
|
2198
|
+
export {};
|