@zcomponent/core 1.14.3 → 1.16.0-beta
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 +0 -6
- package/lib/actionbehavior.d.ts +12 -3
- package/lib/actionbehavior.js +12 -3
- package/lib/animation/animation.d.ts +96 -4
- package/lib/animation/animation.js +93 -0
- package/lib/animation/animationstate.d.ts +52 -2
- package/lib/animation/bezier.d.ts +12 -1
- package/lib/animation/bezier.js +15 -12
- package/lib/animation/clips/clip.d.ts +71 -0
- package/lib/animation/clips/clip.js +68 -0
- package/lib/animation/interpolate.d.ts +17 -0
- package/lib/animation/interpolate.js +71 -0
- package/lib/animation/keyframe.d.ts +24 -1
- package/lib/animation/layer.d.ts +73 -1
- package/lib/animation/layer.js +69 -0
- package/lib/animation/layerclip.d.ts +75 -0
- package/lib/animation/layerclip.js +69 -0
- package/lib/animation/stream.d.ts +49 -7
- package/lib/animation/stream.js +3 -0
- package/lib/animation/tracks/cliptrack.d.ts +64 -0
- package/lib/animation/tracks/cliptrack.js +65 -1
- package/lib/animation/tracks/functiontrack.d.ts +60 -0
- package/lib/animation/tracks/functiontrack.js +62 -3
- package/lib/animation/tracks/propertytrack.d.ts +84 -0
- package/lib/animation/tracks/propertytrack.js +75 -0
- package/lib/animation/tracks/streamtrack.d.ts +51 -0
- package/lib/animation/tracks/streamtrack.js +54 -3
- package/lib/animation/tracks/track.d.ts +56 -0
- package/lib/animation/tracks/track.js +40 -0
- package/lib/behavior.d.ts +37 -0
- package/lib/behavior.js +21 -0
- package/lib/behaviors/ActivateState.d.ts +10 -3
- package/lib/behaviors/ActivateState.js +8 -4
- package/lib/behaviors/CallFunction.d.ts +1 -1
- package/lib/behaviors/CallFunction.js +2 -2
- package/lib/behaviors/ConsoleLog.d.ts +1 -1
- package/lib/behaviors/ConsoleLog.js +2 -2
- package/lib/behaviors/DownloadSnapshot.d.ts +5 -2
- package/lib/behaviors/DownloadSnapshot.js +5 -2
- package/lib/behaviors/LaunchURL.d.ts +1 -1
- package/lib/behaviors/LaunchURL.js +1 -1
- package/lib/behaviors/LogAnalyticsEvent.d.ts +1 -1
- package/lib/behaviors/LogAnalyticsEvent.js +2 -2
- package/lib/behaviors/PauseLayerClip.d.ts +5 -3
- package/lib/behaviors/PauseLayerClip.js +3 -2
- package/lib/behaviors/PlayLayerClip.d.ts +10 -4
- package/lib/behaviors/PlayLayerClip.js +7 -5
- package/lib/behaviors/PlaySound.d.ts +4 -4
- package/lib/behaviors/PlaySound.js +4 -4
- package/lib/behaviors/SetLayerOff.d.ts +4 -3
- package/lib/behaviors/SetLayerOff.js +3 -2
- package/lib/behaviors/ShowTextAlert.d.ts +2 -2
- package/lib/behaviors/ShowTextAlert.js +5 -5
- package/lib/behaviors/ToggleLayerClips.d.ts +4 -3
- package/lib/behaviors/ToggleLayerClips.js +5 -4
- package/lib/behaviors/stream/PauseStream.d.ts +15 -3
- package/lib/behaviors/stream/PauseStream.js +13 -2
- package/lib/behaviors/stream/PlayStream.d.ts +14 -4
- package/lib/behaviors/stream/PlayStream.js +10 -3
- package/lib/behaviors/stream/SeekStream.d.ts +12 -3
- package/lib/behaviors/stream/SeekStream.js +10 -2
- package/lib/behaviors/stream/StopStream.d.ts +11 -3
- package/lib/behaviors/stream/StopStream.js +9 -2
- package/lib/component.d.ts +85 -5
- package/lib/component.js +49 -1
- package/lib/components/Audio.d.ts +14 -5
- package/lib/components/Audio.js +19 -10
- package/lib/components/AudioLayerSettings.d.ts +9 -3
- package/lib/components/AudioLayerSettings.js +9 -3
- package/lib/components/Children.d.ts +7 -2
- package/lib/components/Children.js +6 -1
- package/lib/components/DefaultCookieConsent.d.ts +13 -3
- package/lib/components/DefaultCookieConsent.js +62 -38
- package/lib/components/DefaultLoader.d.ts +14 -9
- package/lib/components/DefaultLoader.js +25 -20
- package/lib/components/Gamepad.d.ts +12 -4
- package/lib/components/Gamepad.js +16 -8
- package/lib/components/LongLoad.d.ts +7 -1
- package/lib/components/LongLoad.js +7 -1
- package/lib/components/SnapshotUI.d.ts +10 -0
- package/lib/components/SnapshotUI.js +24 -0
- package/lib/context.d.ts +117 -0
- package/lib/context.js +50 -71
- package/lib/contexts/analyticscontext.d.ts +6 -0
- package/lib/contexts/analyticscontext.js +6 -0
- package/lib/contexts/audiocontextcontext.d.ts +26 -1
- package/lib/contexts/audiocontextcontext.js +26 -1
- package/lib/contexts/canvascontext.d.ts +59 -1
- package/lib/contexts/canvascontext.js +54 -1
- package/lib/contexts/cookieconsentcontext.d.ts +84 -10
- package/lib/contexts/cookieconsentcontext.js +71 -0
- package/lib/contexts/environmentcontext.d.ts +40 -5
- package/lib/contexts/environmentcontext.js +40 -5
- package/lib/contexts/gamepadcontext.d.ts +38 -0
- package/lib/contexts/gamepadcontext.js +38 -0
- package/lib/contexts/gesturecontext.d.ts +31 -4
- package/lib/contexts/gesturecontext.js +28 -4
- package/lib/contexts/globaltagcontext.d.ts +14 -2
- package/lib/contexts/globaltagcontext.js +13 -1
- package/lib/contexts/loadcontext.d.ts +92 -5
- package/lib/contexts/loadcontext.js +98 -11
- package/lib/contexts/orientationcontext.d.ts +58 -1
- package/lib/contexts/orientationcontext.js +51 -1
- package/lib/contexts/snapshotContext.d.ts +97 -4
- package/lib/contexts/snapshotContext.js +115 -4
- package/lib/contexts/tagcontext.d.ts +56 -2
- package/lib/contexts/tagcontext.js +77 -7
- package/lib/contexts/textalertcontext.d.ts +35 -2
- package/lib/contexts/textalertcontext.js +20 -2
- package/lib/contexts/usereventcontext.d.ts +29 -0
- package/lib/contexts/usereventcontext.js +30 -1
- package/lib/data/animation.d.ts +163 -0
- package/lib/data/animation.js +9 -0
- package/lib/data/change.d.ts +199 -0
- package/lib/data/change.js +190 -0
- package/lib/emitter.d.ts +8 -1
- package/lib/emitter.js +7 -0
- package/lib/entity.d.ts +30 -5
- package/lib/entity.js +23 -7
- package/lib/event.d.ts +19 -2
- package/lib/event.js +19 -2
- package/lib/fractionalindexing.js +38 -42
- package/lib/inflate.d.ts +68 -0
- package/lib/inflate.js +76 -0
- package/lib/observable.d.ts +3 -3
- package/lib/observable.js +4 -4
- package/lib/profile.d.ts +27 -0
- package/lib/profile.js +26 -0
- package/lib/selectors.d.ts +114 -0
- package/lib/selectors.js +159 -7
- package/lib/types.d.ts +215 -0
- package/lib/types.js +110 -1
- package/lib/validators.d.ts +27 -0
- package/lib/validators.js +27 -0
- package/lib/values/values.d.ts +5 -0
- package/lib/values/values.js +5 -0
- package/lib/zcomponent.d.ts +72 -0
- package/lib/zcomponent.js +81 -0
- package/lib/zcomponentconstruction.d.ts +11 -1
- package/lib/zcomponentconstruction.js +10 -0
- package/package.json +7 -2
package/lib/data/animation.d.ts
CHANGED
|
@@ -1,23 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type for mapping IDs to objects.
|
|
3
|
+
*/
|
|
1
4
|
export type ByID<T> = {
|
|
2
5
|
[id: string]: T | undefined;
|
|
3
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Type for mapping node properties.
|
|
9
|
+
*/
|
|
4
10
|
export type ByNodeProperty<T> = {
|
|
5
11
|
[id: string]: {
|
|
6
12
|
[id: string]: T | undefined;
|
|
7
13
|
} | undefined;
|
|
8
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Interface defining the structure of an Animation.
|
|
17
|
+
*/
|
|
9
18
|
export interface Animation {
|
|
10
19
|
clips: ByID<Clip>;
|
|
11
20
|
layers: ByID<Layer>;
|
|
12
21
|
curves: ByID<Curve>;
|
|
13
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Type for defining blend methods.
|
|
25
|
+
*/
|
|
14
26
|
export type BlendType = 'overlay' | 'add';
|
|
27
|
+
/**
|
|
28
|
+
* Interface for fade parameters.
|
|
29
|
+
*/
|
|
15
30
|
export interface FadeParameters {
|
|
16
31
|
time: number;
|
|
17
32
|
pin?: number;
|
|
18
33
|
easing?: Easing;
|
|
19
34
|
reverse?: boolean;
|
|
20
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Interface defining a Layer within an animation.
|
|
38
|
+
*/
|
|
21
39
|
export interface Layer {
|
|
22
40
|
order: string;
|
|
23
41
|
name: string;
|
|
@@ -28,6 +46,9 @@ export interface Layer {
|
|
|
28
46
|
defaultClip?: string | null;
|
|
29
47
|
enabled: boolean;
|
|
30
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Interface defining a LayerClip, a clip within a Layer.
|
|
51
|
+
*/
|
|
31
52
|
export interface LayerClip {
|
|
32
53
|
order: string;
|
|
33
54
|
id: string;
|
|
@@ -38,12 +59,24 @@ export interface LayerClip {
|
|
|
38
59
|
scriptName?: string;
|
|
39
60
|
playAtStart?: boolean;
|
|
40
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Type for mapping active layer clips.
|
|
64
|
+
*/
|
|
41
65
|
export type ActiveLayerClips = ByID<string | undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* Enum for different types of Clips.
|
|
68
|
+
*/
|
|
42
69
|
export declare enum ClipType {
|
|
43
70
|
Timeline = "timeline",
|
|
44
71
|
State = "state"
|
|
45
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Type for defining clip length types.
|
|
75
|
+
*/
|
|
46
76
|
export type ClipLengthType = 'auto' | 'expand' | 'manual';
|
|
77
|
+
/**
|
|
78
|
+
* Interface defining a Clip.
|
|
79
|
+
*/
|
|
47
80
|
export interface Clip {
|
|
48
81
|
order: string;
|
|
49
82
|
type: ClipType;
|
|
@@ -56,6 +89,9 @@ export interface Clip {
|
|
|
56
89
|
timeSourceTrack?: string;
|
|
57
90
|
scriptName?: string;
|
|
58
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Interface for a keyframe in an animation.
|
|
94
|
+
*/
|
|
59
95
|
export interface Keyframe {
|
|
60
96
|
id: string;
|
|
61
97
|
v: any;
|
|
@@ -63,18 +99,39 @@ export interface Keyframe {
|
|
|
63
99
|
label?: string;
|
|
64
100
|
easing?: Easing;
|
|
65
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Predefined curves for easing
|
|
104
|
+
*/
|
|
66
105
|
export declare const predefinedCurve: {
|
|
67
106
|
[id: string]: Bezier[];
|
|
68
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* Type for easing, which can be a predefined curve name or a custom bezier curve.
|
|
110
|
+
*/
|
|
69
111
|
export type Easing = null | keyof typeof predefinedCurve | string;
|
|
112
|
+
/**
|
|
113
|
+
* Type representing a point in a Bezier curve.
|
|
114
|
+
*/
|
|
70
115
|
export type Point = [number, number];
|
|
116
|
+
/**
|
|
117
|
+
* Type representing a Bezier curve.
|
|
118
|
+
*
|
|
119
|
+
* @note
|
|
120
|
+
* Bezier represents the four control points between this keyframe and the next
|
|
121
|
+
*/
|
|
71
122
|
export type Bezier = [Point, Point, Point, Point];
|
|
123
|
+
/**
|
|
124
|
+
* Type representing a curve, which is a collection of Bezier segments.
|
|
125
|
+
*/
|
|
72
126
|
export type Curve = {
|
|
73
127
|
id: string;
|
|
74
128
|
order?: string;
|
|
75
129
|
name: string;
|
|
76
130
|
curve: Bezier[];
|
|
77
131
|
};
|
|
132
|
+
/**
|
|
133
|
+
* Enum for different types of Tracks in an animation.
|
|
134
|
+
*/
|
|
78
135
|
export declare enum TrackType {
|
|
79
136
|
Property = "property",
|
|
80
137
|
Clip = "clip",
|
|
@@ -86,6 +143,9 @@ export declare enum TrackType {
|
|
|
86
143
|
Fade = "fade"
|
|
87
144
|
}
|
|
88
145
|
export type Track = PropertyTrack | ClipTrack | StreamTrack | FunctionTrack | LabelTrack;
|
|
146
|
+
/**
|
|
147
|
+
* Base interface for a track in an animation.
|
|
148
|
+
*/
|
|
89
149
|
export interface BaseTrack {
|
|
90
150
|
order: string;
|
|
91
151
|
id: string;
|
|
@@ -117,47 +177,150 @@ export interface ClipTrackEntity {
|
|
|
117
177
|
s0: number;
|
|
118
178
|
rate: number;
|
|
119
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Represents a stream track, extending the base track with specific properties for streaming.
|
|
182
|
+
*/
|
|
120
183
|
export interface StreamTrack extends BaseTrack {
|
|
184
|
+
/**
|
|
185
|
+
* The type of track, defined as 'Stream'.
|
|
186
|
+
*/
|
|
121
187
|
type: TrackType.Stream;
|
|
188
|
+
/**
|
|
189
|
+
* The name of the stream track.
|
|
190
|
+
*/
|
|
122
191
|
name: string;
|
|
192
|
+
/**
|
|
193
|
+
* The data associated with the stream track, mapped by ID.
|
|
194
|
+
*/
|
|
123
195
|
data: ByID<StreamTrackEntity>;
|
|
196
|
+
/**
|
|
197
|
+
* The weight of each stream track entity, mapped by ID.
|
|
198
|
+
*/
|
|
124
199
|
weight: ByID<Keyframe>;
|
|
200
|
+
/**
|
|
201
|
+
* An array representing the properties of the stream track.
|
|
202
|
+
*/
|
|
125
203
|
property: (string | number)[];
|
|
126
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Describes the structure of a stream track entity.
|
|
207
|
+
*/
|
|
127
208
|
export interface StreamTrackEntity {
|
|
209
|
+
/**
|
|
210
|
+
* Unique identifier for the stream track entity.
|
|
211
|
+
*/
|
|
128
212
|
id: string;
|
|
213
|
+
/**
|
|
214
|
+
* Start point on track.
|
|
215
|
+
*/
|
|
129
216
|
t0: number;
|
|
217
|
+
/**
|
|
218
|
+
* End point on track.
|
|
219
|
+
*/
|
|
130
220
|
t1?: number;
|
|
221
|
+
/**
|
|
222
|
+
* Start point in stream.
|
|
223
|
+
*/
|
|
131
224
|
s0: number;
|
|
225
|
+
/**
|
|
226
|
+
* Playback rate of the stream.
|
|
227
|
+
*/
|
|
132
228
|
rate: number;
|
|
133
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Describes the structure of a function track which is an extension of a base track,
|
|
232
|
+
*/
|
|
134
233
|
export interface FunctionTrack extends BaseTrack {
|
|
234
|
+
/**
|
|
235
|
+
* Type of track.
|
|
236
|
+
*/
|
|
135
237
|
type: TrackType.Function;
|
|
238
|
+
/**
|
|
239
|
+
* The data for the function track.
|
|
240
|
+
*/
|
|
136
241
|
data: ByID<FunctionTrackEntity>;
|
|
137
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Defines a type that represents entities within a function track.
|
|
245
|
+
*/
|
|
138
246
|
export type FunctionTrackEntity = EntityFunctionTrackEntity | ImportFunctionTrackEntity;
|
|
247
|
+
/**
|
|
248
|
+
* Serves as a base interface for entities within a function track.
|
|
249
|
+
* Providing common properties independent of the specific function track entity type.
|
|
250
|
+
*/
|
|
139
251
|
export interface BaseFunctionTrackEntity {
|
|
252
|
+
/**
|
|
253
|
+
* Unique identifier for the function track entity.
|
|
254
|
+
*/
|
|
140
255
|
id: string;
|
|
256
|
+
/**
|
|
257
|
+
* Start point on track.
|
|
258
|
+
*/
|
|
141
259
|
t0: number;
|
|
260
|
+
/**
|
|
261
|
+
* The type of function track entity.
|
|
262
|
+
*/
|
|
142
263
|
type: 'entity' | 'import';
|
|
143
264
|
args: ByID<any>;
|
|
144
265
|
runAtDesignTime?: boolean;
|
|
145
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Represents an entity function track entity, extending the base function track entity.
|
|
269
|
+
*/
|
|
146
270
|
export interface EntityFunctionTrackEntity extends BaseFunctionTrackEntity {
|
|
271
|
+
/**
|
|
272
|
+
* The type of function track entity, defined as 'entity'.
|
|
273
|
+
*/
|
|
147
274
|
type: 'entity';
|
|
275
|
+
/**
|
|
276
|
+
* The ID of the entity associated with the function track.
|
|
277
|
+
*/
|
|
148
278
|
entityID: string;
|
|
279
|
+
/**
|
|
280
|
+
* The name of the function to be executed.
|
|
281
|
+
*/
|
|
149
282
|
functionName: string;
|
|
150
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Represents an import function track entity, extending the base function track entity.
|
|
286
|
+
*/
|
|
151
287
|
export interface ImportFunctionTrackEntity extends BaseFunctionTrackEntity {
|
|
288
|
+
/**
|
|
289
|
+
* The type of function track entity, defined as 'import'.
|
|
290
|
+
*/
|
|
152
291
|
type: 'import';
|
|
292
|
+
/**
|
|
293
|
+
* The import path or identifier.
|
|
294
|
+
*/
|
|
153
295
|
import: string;
|
|
154
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Represents a label track, extending the base track with specific data for labels.
|
|
299
|
+
*/
|
|
155
300
|
export interface LabelTrack extends BaseTrack {
|
|
301
|
+
/**
|
|
302
|
+
* The type of track, defined as 'Label'.
|
|
303
|
+
*/
|
|
156
304
|
type: TrackType.Label;
|
|
305
|
+
/**
|
|
306
|
+
* The data for the label track, mapped by ID.
|
|
307
|
+
*/
|
|
157
308
|
data: ByID<LabelTrackEntity>;
|
|
158
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Describes the structure of a label track entity.
|
|
312
|
+
*/
|
|
159
313
|
export interface LabelTrackEntity {
|
|
314
|
+
/**
|
|
315
|
+
* The order of the label in the track.
|
|
316
|
+
*/
|
|
160
317
|
order: string;
|
|
318
|
+
/**
|
|
319
|
+
* The time point of the label on the track.
|
|
320
|
+
*/
|
|
161
321
|
t: number;
|
|
322
|
+
/**
|
|
323
|
+
* The text label.
|
|
324
|
+
*/
|
|
162
325
|
label: string;
|
|
163
326
|
}
|
package/lib/data/animation.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
// CLIP
|
|
2
|
+
/**
|
|
3
|
+
* Enum for different types of Clips.
|
|
4
|
+
*/
|
|
2
5
|
export var ClipType;
|
|
3
6
|
(function (ClipType) {
|
|
4
7
|
ClipType["Timeline"] = "timeline";
|
|
5
8
|
ClipType["State"] = "state";
|
|
6
9
|
})(ClipType || (ClipType = {}));
|
|
7
10
|
// TODO: it's a temporary placement for this object
|
|
11
|
+
/**
|
|
12
|
+
* Predefined curves for easing
|
|
13
|
+
*/
|
|
8
14
|
export const predefinedCurve = {
|
|
9
15
|
linear: [
|
|
10
16
|
[
|
|
@@ -127,6 +133,9 @@ export const predefinedCurve = {
|
|
|
127
133
|
// }
|
|
128
134
|
// ];
|
|
129
135
|
////// TRACKS
|
|
136
|
+
/**
|
|
137
|
+
* Enum for different types of Tracks in an animation.
|
|
138
|
+
*/
|
|
130
139
|
export var TrackType;
|
|
131
140
|
(function (TrackType) {
|
|
132
141
|
TrackType["Property"] = "property";
|
package/lib/data/change.d.ts
CHANGED
|
@@ -1,44 +1,243 @@
|
|
|
1
1
|
import { BehaviorByID, BehaviorData, ComputedHierarchy, EntityPropOverride, NodeByID, NodeData, ZComponentData } from './core';
|
|
2
2
|
import { Prop } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Computes and memoizes the hierarchy of nodes.
|
|
5
|
+
*
|
|
6
|
+
* @param nodes - A map of node IDs to node data.
|
|
7
|
+
* @returns The computed hierarchy of nodes.
|
|
8
|
+
*/
|
|
3
9
|
export declare function computeNodeHierarchy(nodes: NodeByID): ComputedHierarchy;
|
|
10
|
+
/**
|
|
11
|
+
* Computes and memoizes the hierarchy of behaviors.
|
|
12
|
+
*
|
|
13
|
+
* @param behaviors - A map of behavior IDs to behavior data.
|
|
14
|
+
* @returns The computed hierarchy of behaviors.
|
|
15
|
+
*/
|
|
4
16
|
export declare function computeBehaviorHierarchy(behaviors: BehaviorByID): ComputedHierarchy;
|
|
17
|
+
/**
|
|
18
|
+
* Adds a new node to the specified ZComponentData.
|
|
19
|
+
*
|
|
20
|
+
* @param zcomp - The ZComponentData to which the node is added.
|
|
21
|
+
* @param info - The combined data of the node to be added.
|
|
22
|
+
*/
|
|
5
23
|
export declare function addNode(zcomp: ZComponentData, info: NodeDataCombined): void;
|
|
24
|
+
/**
|
|
25
|
+
* Adds a new behavior to the specified ZComponentData.
|
|
26
|
+
*
|
|
27
|
+
* @param zcomp - The ZComponentData to which the behavior is added.
|
|
28
|
+
* @param info - The combined data of the behavior to be added.
|
|
29
|
+
*/
|
|
6
30
|
export declare function addBehavior(zcomp: ZComponentData, info: BehaviorDataCombined): void;
|
|
31
|
+
/**
|
|
32
|
+
* Updates a component property in the ZComponentData.
|
|
33
|
+
*
|
|
34
|
+
* @param zcomp - The ZComponentData to update.
|
|
35
|
+
* @param prop - The property name to update.
|
|
36
|
+
* @param isConstructorProp - Indicates if the property is a constructor property.
|
|
37
|
+
* @param newValue - The new value for the property.
|
|
38
|
+
* @param newIsConstructorProp - Indicates if the new value is a constructor property.
|
|
39
|
+
*/
|
|
7
40
|
export declare function updateComponentProp(zcomp: ZComponentData, prop: string, isConstructorProp: boolean, newValue: Prop | undefined, newIsConstructorProp: boolean): void;
|
|
8
41
|
export declare function addEntityPropOverride(zcomp: ZComponentData, o: EntityPropOverride): void;
|
|
42
|
+
/**
|
|
43
|
+
* Deletes an entity property override from the specified ZComponentData.
|
|
44
|
+
*
|
|
45
|
+
* @param zcomp - The ZComponentData to update.
|
|
46
|
+
* @param id - The ID of the EntityPropOverride to delete.
|
|
47
|
+
*/
|
|
9
48
|
export declare function deleteEntityPropOverride(zcomp: ZComponentData, id: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Deep clones the given object.
|
|
51
|
+
*
|
|
52
|
+
* @typeParam T - The type of the object to clone.
|
|
53
|
+
* @param obj - The object to clone.
|
|
54
|
+
* @returns A deep clone of the object.
|
|
55
|
+
*/
|
|
10
56
|
export declare function clone<T>(obj: T): T;
|
|
57
|
+
/**
|
|
58
|
+
* Checks if two objects are equal by comparing their JSON string representations.
|
|
59
|
+
*
|
|
60
|
+
* @typeParam T - The type of the objects to compare.
|
|
61
|
+
* @param obj1 - The first object to compare.
|
|
62
|
+
* @param obj2 - The second object to compare.
|
|
63
|
+
* @returns True if the objects are equal, otherwise false.
|
|
64
|
+
*/
|
|
11
65
|
export declare function isEqual<T>(obj1: T, obj2: T): boolean;
|
|
12
66
|
export declare function addEntity(zcomp: ZComponentData, id: string, info: EntityDataCombined): void;
|
|
67
|
+
/**
|
|
68
|
+
* Moves nodes to a new parent within the ZComponentData hierarchy.
|
|
69
|
+
*
|
|
70
|
+
* @param zcomp - The ZComponentData containing the nodes.
|
|
71
|
+
* @param nodeIDs - Array of node IDs to be moved.
|
|
72
|
+
* @param newParentID - The ID of the new parent node.
|
|
73
|
+
* @param indx - The index at which to insert the nodes in the new parent's child array.
|
|
74
|
+
*/
|
|
13
75
|
export declare function moveNodes(zcomp: ZComponentData, nodeIDs: string[], newParentID: string, indx: number): void;
|
|
76
|
+
/**
|
|
77
|
+
* Deletes a node and its child nodes and associated behaviors from ZComponentData.
|
|
78
|
+
*
|
|
79
|
+
* @param zcomp - The ZComponentData from which the node will be deleted.
|
|
80
|
+
* @param id - The ID of the node to delete.
|
|
81
|
+
*/
|
|
14
82
|
export declare function deleteNode(zcomp: ZComponentData, id: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Deletes a behavior from ZComponentData.
|
|
85
|
+
*
|
|
86
|
+
* @param zcomp - The ZComponentData from which the behavior will be deleted.
|
|
87
|
+
* @param id - The ID of the behavior to delete.
|
|
88
|
+
*/
|
|
15
89
|
export declare function deleteBehavior(zcomp: ZComponentData, id: string): void;
|
|
90
|
+
/**
|
|
91
|
+
* Retrieves combined data for a specific node in ZComponentData.
|
|
92
|
+
*
|
|
93
|
+
* @param zcomp - The ZComponentData containing the node.
|
|
94
|
+
* @param id - The ID of the node.
|
|
95
|
+
* @returns Combined node data or undefined if the node doesn't exist.
|
|
96
|
+
*/
|
|
16
97
|
export declare function getNodeDataCombined(zcomp: ZComponentData, id: string): NodeDataCombined | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves combined data for a specific behavior in ZComponentData.
|
|
100
|
+
*
|
|
101
|
+
* @param zcomp - The ZComponentData containing the behavior.
|
|
102
|
+
* @param id - The ID of the behavior.
|
|
103
|
+
* @returns Combined behavior data or undefined if the behavior doesn't exist.
|
|
104
|
+
*/
|
|
17
105
|
export declare function getBehaviorDataCombined(zcomp: ZComponentData, id: string): BehaviorDataCombined | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Fixes any duplicate index issues in the node hierarchy.
|
|
108
|
+
*
|
|
109
|
+
* @param zcomp - The ZComponentData containing the nodes.
|
|
110
|
+
* @param hierarchy - The computed hierarchy of nodes.
|
|
111
|
+
* @param nodeID - The ID of the parent node.
|
|
112
|
+
* @param indx - The index to start checking for duplicates.
|
|
113
|
+
*/
|
|
18
114
|
export declare function fixAnyDuplicateIndex(zcomp: ZComponentData, hierarchy: ComputedHierarchy, nodeID: string, indx: number): void;
|
|
115
|
+
/**
|
|
116
|
+
* Fixes any duplicate index issues in the behavior hierarchy.
|
|
117
|
+
*
|
|
118
|
+
* @param zcomp - The ZComponentData containing the behaviors.
|
|
119
|
+
* @param behaviors - The computed hierarchy of behaviors.
|
|
120
|
+
* @param nodeID - The ID of the parent node.
|
|
121
|
+
* @param indx - The index to start checking for duplicates.
|
|
122
|
+
*/
|
|
19
123
|
export declare function fixAnyDuplicateBehaviorsIndex(zcomp: ZComponentData, behaviors: ComputedHierarchy, nodeID: string, indx: number): void;
|
|
124
|
+
/**
|
|
125
|
+
* Calculates the order for a node to be placed at a specific index under a parent.
|
|
126
|
+
*
|
|
127
|
+
* @param zcomp - The ZComponentData containing the nodes.
|
|
128
|
+
* @param parentID - The ID of the parent node.
|
|
129
|
+
* @param indx - The index at which the node is to be placed.
|
|
130
|
+
* @returns The order string for the node.
|
|
131
|
+
*/
|
|
20
132
|
export declare function nodeOrderForParentIndex(zcomp: ZComponentData, parentID: string, indx?: number): string;
|
|
133
|
+
/**
|
|
134
|
+
* Calculates the order for a behavior to be placed at a specific index under a parent.
|
|
135
|
+
*
|
|
136
|
+
* @param zcomp - The ZComponentData containing the behaviors.
|
|
137
|
+
* @param parentID - The ID of the parent node.
|
|
138
|
+
* @param indx - The index at which the behavior is to be placed.
|
|
139
|
+
* @returns The order string for the behavior.
|
|
140
|
+
*/
|
|
21
141
|
export declare function behaviorOrderForParentIndex(zcomp: ZComponentData, parentID: string, indx?: number): string;
|
|
142
|
+
/**
|
|
143
|
+
* Adds a node's label to the ZComponentData's label register.
|
|
144
|
+
*
|
|
145
|
+
* @param zcomp - The ZComponentData to update.
|
|
146
|
+
* @param id - The ID of the node whose label is to be added.
|
|
147
|
+
*/
|
|
22
148
|
export declare function addNodeLabelToRegister(zcomp: ZComponentData, id: string): void;
|
|
149
|
+
/**
|
|
150
|
+
* Removes a node's label from the ZComponentData's label register.
|
|
151
|
+
*
|
|
152
|
+
* @param zcomp - The ZComponentData to update.
|
|
153
|
+
* @param id - The ID of the node whose label is to be removed.
|
|
154
|
+
*/
|
|
23
155
|
export declare function removeNodeLabelFromRegister(zcomp: ZComponentData, id: string): void;
|
|
156
|
+
/**
|
|
157
|
+
* Adds a node's script name to the ZComponentData's script name register.
|
|
158
|
+
*
|
|
159
|
+
* @param zcomp - The ZComponentData to update.
|
|
160
|
+
* @param id - The ID of the node whose script name is to be added.
|
|
161
|
+
*/
|
|
24
162
|
export declare function addNodeScriptNameToRegister(zcomp: ZComponentData, id: string): void;
|
|
163
|
+
/**
|
|
164
|
+
* Removes a node's script name from the ZComponentData's script name register.
|
|
165
|
+
*
|
|
166
|
+
* @param zcomp - The ZComponentData to update.
|
|
167
|
+
* @param id - The ID of the node whose script name is to be removed.
|
|
168
|
+
*/
|
|
25
169
|
export declare function removeNodeScriptNameFromRegister(zcomp: ZComponentData, id: string): void;
|
|
170
|
+
/**
|
|
171
|
+
* Changes the label of a node in the ZComponentData.
|
|
172
|
+
*
|
|
173
|
+
* @param zcomp - The ZComponentData to update.
|
|
174
|
+
* @param id - The ID of the node whose label is to be changed.
|
|
175
|
+
* @param newLabel - The new label for the node.
|
|
176
|
+
*/
|
|
26
177
|
export declare function changeNodeLabel(zcomp: ZComponentData, id: string, newLabel: string | undefined): void;
|
|
178
|
+
/**
|
|
179
|
+
* Changes the script name of a node in the ZComponentData.
|
|
180
|
+
*
|
|
181
|
+
* @param zcomp - The ZComponentData to update.
|
|
182
|
+
* @param id - The ID of the node whose script name is to be changed.
|
|
183
|
+
* @param newScriptName - The new script name for the node.
|
|
184
|
+
*/
|
|
27
185
|
export declare function changeNodeScriptName(zcomp: ZComponentData, id: string, newScriptName: string | undefined): void;
|
|
186
|
+
/**
|
|
187
|
+
* Deletes an entity and its associated data from ZComponentData.
|
|
188
|
+
*
|
|
189
|
+
* @param zcomp - The ZComponentData to update.
|
|
190
|
+
* @param id - The ID of the entity to delete.
|
|
191
|
+
*/
|
|
28
192
|
export declare function deleteEntity(zcomp: ZComponentData, id: string): void;
|
|
193
|
+
/**
|
|
194
|
+
* Iterates over each ancestor of a node and executes a function.
|
|
195
|
+
*
|
|
196
|
+
* @param zcomp - The ZComponentData containing the node.
|
|
197
|
+
* @param id - The ID of the node.
|
|
198
|
+
* @param fn - The function to execute for each ancestor.
|
|
199
|
+
*/
|
|
29
200
|
export declare function forEachNodeAncestor(zcomp: ZComponentData, id: string, fn: (ancestorID: string) => void): void;
|
|
201
|
+
/**
|
|
202
|
+
* Represents combined entity data, including properties and constructor properties.
|
|
203
|
+
*/
|
|
30
204
|
export interface EntityDataCombined {
|
|
205
|
+
/**
|
|
206
|
+
* A map of property identifiers to their values.
|
|
207
|
+
*/
|
|
31
208
|
props: {
|
|
32
209
|
[id: string]: any;
|
|
33
210
|
};
|
|
211
|
+
/**
|
|
212
|
+
* A map of constructor property identifiers to their values.
|
|
213
|
+
*/
|
|
34
214
|
constructorProps: {
|
|
35
215
|
[id: string]: any;
|
|
36
216
|
};
|
|
37
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Represents combined node data, including the node data itself, properties, and constructor properties.
|
|
220
|
+
*/
|
|
38
221
|
export interface NodeDataCombined extends EntityDataCombined {
|
|
222
|
+
/**
|
|
223
|
+
* The data of the node.
|
|
224
|
+
*/
|
|
39
225
|
data: NodeData;
|
|
40
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Represents combined behavior data, including the behavior data itself, properties, and constructor properties.
|
|
229
|
+
*/
|
|
41
230
|
export interface BehaviorDataCombined extends EntityDataCombined {
|
|
231
|
+
/**
|
|
232
|
+
* The data of the behavior.
|
|
233
|
+
*/
|
|
42
234
|
data: BehaviorData;
|
|
43
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Generates a unique label for a node in ZComponentData.
|
|
238
|
+
*
|
|
239
|
+
* @param zcomp - The ZComponentData to check for existing labels.
|
|
240
|
+
* @param label - The base label to make unique.
|
|
241
|
+
* @returns A unique label for the node.
|
|
242
|
+
*/
|
|
44
243
|
export declare function getUniqueLabel(zcomp: ZComponentData, label: string): string;
|