@playcanvas/web-components 0.15.0 → 0.16.0

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.
@@ -0,0 +1,127 @@
1
+ import { AsyncElement } from '../async-element.cjs';
2
+ import { AnimComponentElement } from './anim-component.cjs';
3
+ /**
4
+ * The AnimClipElement interface provides properties and methods for manipulating
5
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-anim-clip/ | `<pc-anim-clip>`}
6
+ * elements. The AnimClipElement interface also inherits the properties and methods of the
7
+ * {@link HTMLElement} interface.
8
+ *
9
+ * A clip declares one named animation on its parent `<pc-anim>`. `name` is both the clip's name
10
+ * and the track looked up in the clip's source: an explicit `asset` (a `container`, an
11
+ * `animation` `.glb`, or an `animclip` JSON), or, without one, the container of the `<pc-model>`
12
+ * enclosing the parent `<pc-anim>`. A source holding a single track supplies it whatever it is
13
+ * named; in a multi-track source the track named `name` is chosen, falling back to the first
14
+ * with a warning. The element becomes ready once its resolved track is assigned.
15
+ *
16
+ * @category Components
17
+ */
18
+ declare class AnimClipElement extends AsyncElement {
19
+ /**
20
+ * The `<pc-anim>` this clip was adopted by, captured when the parent adopts the clip and on
21
+ * connection.
22
+ *
23
+ * `disconnectedCallback` cannot rediscover it: by the time the element is disconnected its
24
+ * `parentElement` is already `null`, so a lookup would both fail to find the component and
25
+ * emit a misleading "must be a direct child" warning for what is an ordinary removal.
26
+ */
27
+ private _animElement;
28
+ private _asset;
29
+ /**
30
+ * Incremented on every connect and disconnect, and captured by connectedCallback on entry —
31
+ * a resume from an await abandons itself if the value has moved on, so a stale callback can
32
+ * neither act on a torn-down tree nor register its clip alongside a re-inserted element's
33
+ * own callback.
34
+ */
35
+ private _connectionGeneration;
36
+ private _errorHandle;
37
+ /**
38
+ * Incremented on every track resolution and on disconnect, and captured by a resolution when
39
+ * it starts. A resolution that resumes from an await or an asset callback abandons itself if
40
+ * the value has moved on, so a superseded resolution cannot hand a stale track to the parent.
41
+ */
42
+ private _loadGeneration;
43
+ /**
44
+ * The pending asset subscriptions of the current resolution, if it is waiting for its asset.
45
+ * Held so that whatever supersedes the resolution can detach the handlers from the asset,
46
+ * rather than leave them registered until the asset settles (or forever, if it never does).
47
+ */
48
+ private _loadHandle;
49
+ private _loop;
50
+ private _name;
51
+ private _speed;
52
+ /**
53
+ * The source complaint already made — the asset id it was made for, or `''` for the
54
+ * no-asset-no-model case — so re-resolutions (host cycles, model reloads) do not repeat it.
55
+ */
56
+ private _warnedSource;
57
+ /**
58
+ * Whether the owning `<pc-anim>` already rejected this clip's name — its sweeps re-run on
59
+ * host cycles and must not repeat the complaint.
60
+ */
61
+ private _warnedInvalid;
62
+ connectedCallback(): Promise<void>;
63
+ disconnectedCallback(): void;
64
+ protected get animElement(): AnimComponentElement | null;
65
+ private _detachLoadHandlers;
66
+ /**
67
+ * Complains about the clip's source, once per source value — resolutions re-run on host
68
+ * cycles and model reloads, and must not repeat the complaint.
69
+ */
70
+ private _warnSource;
71
+ /**
72
+ * Picks the clip's track out of a loaded source asset: the track named `name`, or a lone
73
+ * track whatever it is named, or the first of several with a warning.
74
+ *
75
+ * @param asset - The loaded source asset.
76
+ * @param source - How warnings name the source.
77
+ */
78
+ private _extractTrack;
79
+ /**
80
+ * Sets the id of the `pc-asset` supplying the clip's track: a `container`, an `animation`
81
+ * `.glb`, or an `animclip` JSON. When empty, the track comes from the container of the
82
+ * `<pc-model>` enclosing the parent `<pc-anim>`.
83
+ * @param value - The asset id.
84
+ */
85
+ set asset(value: string);
86
+ /**
87
+ * Gets the id of the `pc-asset` supplying the clip's track.
88
+ * @returns The asset id.
89
+ */
90
+ get asset(): string;
91
+ /**
92
+ * Sets whether the clip loops. A non-looping clip holds its last pose when it ends — the
93
+ * engine reports no completion. Defaults to `true`.
94
+ * @param value - Whether the clip loops.
95
+ */
96
+ set loop(value: boolean);
97
+ /**
98
+ * Gets whether the clip loops.
99
+ * @returns Whether the clip loops.
100
+ */
101
+ get loop(): boolean;
102
+ /**
103
+ * Sets the name of the clip: the name it is played by, and the track looked up in the
104
+ * clip's source. Names must be unique within a `<pc-anim>` and must not contain `.`.
105
+ * @param value - The clip name.
106
+ */
107
+ set name(value: string);
108
+ /**
109
+ * Gets the name of the clip.
110
+ * @returns The clip name.
111
+ */
112
+ get name(): string;
113
+ /**
114
+ * Sets the playback speed of the clip, where negative values play it backwards. Applies
115
+ * immediately, preserving the playhead. Defaults to 1.
116
+ * @param value - The playback speed.
117
+ */
118
+ set speed(value: number);
119
+ /**
120
+ * Gets the playback speed of the clip.
121
+ * @returns The playback speed.
122
+ */
123
+ get speed(): number;
124
+ static get observedAttributes(): string[];
125
+ attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
126
+ }
127
+ export { AnimClipElement };
@@ -0,0 +1,127 @@
1
+ import { AsyncElement } from '../async-element.js';
2
+ import { AnimComponentElement } from './anim-component.js';
3
+ /**
4
+ * The AnimClipElement interface provides properties and methods for manipulating
5
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-anim-clip/ | `<pc-anim-clip>`}
6
+ * elements. The AnimClipElement interface also inherits the properties and methods of the
7
+ * {@link HTMLElement} interface.
8
+ *
9
+ * A clip declares one named animation on its parent `<pc-anim>`. `name` is both the clip's name
10
+ * and the track looked up in the clip's source: an explicit `asset` (a `container`, an
11
+ * `animation` `.glb`, or an `animclip` JSON), or, without one, the container of the `<pc-model>`
12
+ * enclosing the parent `<pc-anim>`. A source holding a single track supplies it whatever it is
13
+ * named; in a multi-track source the track named `name` is chosen, falling back to the first
14
+ * with a warning. The element becomes ready once its resolved track is assigned.
15
+ *
16
+ * @category Components
17
+ */
18
+ declare class AnimClipElement extends AsyncElement {
19
+ /**
20
+ * The `<pc-anim>` this clip was adopted by, captured when the parent adopts the clip and on
21
+ * connection.
22
+ *
23
+ * `disconnectedCallback` cannot rediscover it: by the time the element is disconnected its
24
+ * `parentElement` is already `null`, so a lookup would both fail to find the component and
25
+ * emit a misleading "must be a direct child" warning for what is an ordinary removal.
26
+ */
27
+ private _animElement;
28
+ private _asset;
29
+ /**
30
+ * Incremented on every connect and disconnect, and captured by connectedCallback on entry —
31
+ * a resume from an await abandons itself if the value has moved on, so a stale callback can
32
+ * neither act on a torn-down tree nor register its clip alongside a re-inserted element's
33
+ * own callback.
34
+ */
35
+ private _connectionGeneration;
36
+ private _errorHandle;
37
+ /**
38
+ * Incremented on every track resolution and on disconnect, and captured by a resolution when
39
+ * it starts. A resolution that resumes from an await or an asset callback abandons itself if
40
+ * the value has moved on, so a superseded resolution cannot hand a stale track to the parent.
41
+ */
42
+ private _loadGeneration;
43
+ /**
44
+ * The pending asset subscriptions of the current resolution, if it is waiting for its asset.
45
+ * Held so that whatever supersedes the resolution can detach the handlers from the asset,
46
+ * rather than leave them registered until the asset settles (or forever, if it never does).
47
+ */
48
+ private _loadHandle;
49
+ private _loop;
50
+ private _name;
51
+ private _speed;
52
+ /**
53
+ * The source complaint already made — the asset id it was made for, or `''` for the
54
+ * no-asset-no-model case — so re-resolutions (host cycles, model reloads) do not repeat it.
55
+ */
56
+ private _warnedSource;
57
+ /**
58
+ * Whether the owning `<pc-anim>` already rejected this clip's name — its sweeps re-run on
59
+ * host cycles and must not repeat the complaint.
60
+ */
61
+ private _warnedInvalid;
62
+ connectedCallback(): Promise<void>;
63
+ disconnectedCallback(): void;
64
+ protected get animElement(): AnimComponentElement | null;
65
+ private _detachLoadHandlers;
66
+ /**
67
+ * Complains about the clip's source, once per source value — resolutions re-run on host
68
+ * cycles and model reloads, and must not repeat the complaint.
69
+ */
70
+ private _warnSource;
71
+ /**
72
+ * Picks the clip's track out of a loaded source asset: the track named `name`, or a lone
73
+ * track whatever it is named, or the first of several with a warning.
74
+ *
75
+ * @param asset - The loaded source asset.
76
+ * @param source - How warnings name the source.
77
+ */
78
+ private _extractTrack;
79
+ /**
80
+ * Sets the id of the `pc-asset` supplying the clip's track: a `container`, an `animation`
81
+ * `.glb`, or an `animclip` JSON. When empty, the track comes from the container of the
82
+ * `<pc-model>` enclosing the parent `<pc-anim>`.
83
+ * @param value - The asset id.
84
+ */
85
+ set asset(value: string);
86
+ /**
87
+ * Gets the id of the `pc-asset` supplying the clip's track.
88
+ * @returns The asset id.
89
+ */
90
+ get asset(): string;
91
+ /**
92
+ * Sets whether the clip loops. A non-looping clip holds its last pose when it ends — the
93
+ * engine reports no completion. Defaults to `true`.
94
+ * @param value - Whether the clip loops.
95
+ */
96
+ set loop(value: boolean);
97
+ /**
98
+ * Gets whether the clip loops.
99
+ * @returns Whether the clip loops.
100
+ */
101
+ get loop(): boolean;
102
+ /**
103
+ * Sets the name of the clip: the name it is played by, and the track looked up in the
104
+ * clip's source. Names must be unique within a `<pc-anim>` and must not contain `.`.
105
+ * @param value - The clip name.
106
+ */
107
+ set name(value: string);
108
+ /**
109
+ * Gets the name of the clip.
110
+ * @returns The clip name.
111
+ */
112
+ get name(): string;
113
+ /**
114
+ * Sets the playback speed of the clip, where negative values play it backwards. Applies
115
+ * immediately, preserving the playhead. Defaults to 1.
116
+ * @param value - The playback speed.
117
+ */
118
+ set speed(value: number);
119
+ /**
120
+ * Gets the playback speed of the clip.
121
+ * @returns The playback speed.
122
+ */
123
+ get speed(): number;
124
+ static get observedAttributes(): string[];
125
+ attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
126
+ }
127
+ export { AnimClipElement };
@@ -0,0 +1,207 @@
1
+ import type { AnimComponent, Asset, ContainerResource } from 'playcanvas';
2
+ import { ComponentElement } from './component.cjs';
3
+ /**
4
+ * A container resource with the `animations` sub-assets the engine documents but does not type:
5
+ * one `Asset` of type `animation` per glTF animation, each holding an `AnimTrack` resource.
6
+ */
7
+ type ContainerWithAnimations = ContainerResource & {
8
+ animations: Asset[];
9
+ };
10
+ /**
11
+ * The AnimComponentElement interface provides properties and methods for manipulating
12
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-anim/ | `<pc-anim>`} elements.
13
+ * The AnimComponentElement interface also inherits the properties and methods of the
14
+ * {@link HTMLElement} interface.
15
+ *
16
+ * The element drives animation clips over the host entity's hierarchy. Clips come from
17
+ * `<pc-anim-clip>` children — or, when the element is a direct child of a `<pc-model>` and
18
+ * declares no clips, every animation of that model's container asset is assigned, named by track
19
+ * name, in container order. The first clip plays automatically (opt out with `activate="false"`);
20
+ * switch clips declaratively through the `clip` attribute, or imperatively through {@link play}
21
+ * and {@link transition}. Tracks bind to scene nodes by name, so any hierarchy whose node names
22
+ * match a clip's curves can be animated — a model's skeleton is simply the common case.
23
+ *
24
+ * The engine reports no clip completion: a non-looping clip holds its last pose silently. Poll
25
+ * the underlying {@link AnimComponent} (via {@link component}) for playback state beyond what
26
+ * this element exposes.
27
+ *
28
+ * @category Components
29
+ */
30
+ declare class AnimComponentElement extends ComponentElement {
31
+ /**
32
+ * Whether playback starts automatically once a clip is assigned.
33
+ */
34
+ private _activate;
35
+ /**
36
+ * The clip elements whose states are currently assigned, by clip name. The single writer of
37
+ * a state: a later clip child re-using an adopted name is rejected as a duplicate.
38
+ */
39
+ private _assignedClips;
40
+ /**
41
+ * Whether the current clip set was auto-assigned from the enclosing model rather than
42
+ * declared by clip children.
43
+ */
44
+ private _autoAssigned;
45
+ /**
46
+ * The name of the active clip.
47
+ */
48
+ private _clip;
49
+ /**
50
+ * The element the model-readiness listener is attached to, held so disconnection can detach
51
+ * it after `closestEntity` no longer resolves.
52
+ */
53
+ private _modelListenerTarget;
54
+ /**
55
+ * Incremented whenever the clip source changes, and captured by an auto-assign pass on
56
+ * entry — a pass resuming from an await abandons itself if the value has moved on, so a
57
+ * superseded pass cannot assign clips alongside declared children or a newer pass.
58
+ */
59
+ private _sourceGeneration;
60
+ /**
61
+ * The playback speed multiplier applied across all clips.
62
+ */
63
+ private _speed;
64
+ /**
65
+ * The cross-fade duration of declarative clip switches, in seconds.
66
+ */
67
+ private _transitionTime;
68
+ /**
69
+ * The unknown clip name already warned about, so a repeated selection of the same missing
70
+ * name complains once.
71
+ */
72
+ private _warnedClip;
73
+ /**
74
+ * Rebinds when a model under the host announces readiness. The engine resolves each curve
75
+ * once, at the first tick after assignment, and never retries — and its mesh-instance
76
+ * broadcast fires before an instantiated hierarchy is parented, so a model that loads after
77
+ * the clips were assigned would otherwise stay silently unbound. A re-instantiation of the
78
+ * implicit clip source (the parent `<pc-model>`) means a new container, so the clip set
79
+ * refreshes instead — unless every clip declares its own asset, where a rebind suffices.
80
+ */
81
+ private _onModelReady;
82
+ /** @ignore */
83
+ constructor();
84
+ protected getInitialComponentData(): {
85
+ activate: boolean;
86
+ speed: number;
87
+ };
88
+ protected initComponent(): void;
89
+ disconnectedCallback(): void;
90
+ /**
91
+ * The clip children in DOM order. Read afresh each pass — the DOM is the single source of
92
+ * truth for the declared clip set.
93
+ */
94
+ private _clipElements;
95
+ /**
96
+ * Assigns a clip's state. Until the clip's real track resolves, the engine's own placeholder
97
+ * track stands in — it keeps the layer playable, so `activate` can start playback and the
98
+ * declared `clip` selection can apply before any asset has loaded.
99
+ */
100
+ private _assignClip;
101
+ /**
102
+ * Validates a clip child and, when valid, assigns its state and starts its track resolution.
103
+ *
104
+ * @param clip - The clip element.
105
+ * @returns Whether the clip was adopted.
106
+ */
107
+ private _adoptClip;
108
+ /**
109
+ * Assigns the current clip set: the declared clip children when there are any, otherwise the
110
+ * enclosing model's clips. Runs against a fresh component after a host cycle, so the
111
+ * adoption bookkeeping rebuilds from scratch.
112
+ */
113
+ private _applyClips;
114
+ /**
115
+ * Assigns every clip of the enclosing model's container, named by track name, in container
116
+ * order. Names the engine cannot host — dotted (reserved for blend tree paths) or already
117
+ * taken — are skipped with a warning naming each.
118
+ */
119
+ private _kickAutoAssign;
120
+ /**
121
+ * Applies the active-clip selection: the declared `clip` when it names an assigned state,
122
+ * else a captured pre-rebuild state when it survived, else the engine's default (the first
123
+ * assigned clip). A restore also reinstates the playhead and both playing flags exactly as
124
+ * captured — the reassignment that preceded it set both to the `activate` outcome, which is
125
+ * not necessarily the state the rebuild interrupted.
126
+ */
127
+ private _applySelection;
128
+ private _warnUnknownClip;
129
+ /**
130
+ * Resumes playback, optionally switching to a named clip first (a hard cut). A name that
131
+ * matches no clip leaves the selection unchanged.
132
+ *
133
+ * @param name - The name of the clip to play. Resumes the current clip when omitted.
134
+ */
135
+ play(name?: string): void;
136
+ /**
137
+ * Pauses playback, preserving the playhead — {@link play} resumes from where it stopped.
138
+ */
139
+ pause(): void;
140
+ /**
141
+ * Cross-fades to a named clip and ensures playback is running. A name that matches no clip
142
+ * leaves the selection unchanged.
143
+ *
144
+ * @param name - The name of the clip to fade to.
145
+ * @param time - The fade duration in seconds. Defaults to the `transition-time` attribute.
146
+ */
147
+ transition(name: string, time?: number): void;
148
+ /**
149
+ * Gets the underlying PlayCanvas anim component.
150
+ * @returns The anim component.
151
+ */
152
+ get component(): AnimComponent;
153
+ /**
154
+ * Gets the names of the assigned clips.
155
+ * @returns The clip names, in assignment order.
156
+ */
157
+ get clips(): string[];
158
+ /**
159
+ * Sets whether playback starts automatically once a clip is assigned. Defaults to `true`.
160
+ * Applies when clips are assigned — it does not stop a clip that is already playing.
161
+ * @param value - Whether playback starts automatically.
162
+ */
163
+ set activate(value: boolean);
164
+ /**
165
+ * Gets whether playback starts automatically once a clip is assigned.
166
+ * @returns Whether playback starts automatically.
167
+ */
168
+ get activate(): boolean;
169
+ /**
170
+ * Sets the name of the active clip. Changing it switches playback, cross-fading over
171
+ * `transition-time` seconds (a hard cut at 0). An empty value leaves the current clip
172
+ * playing; a name that matches no clip warns and leaves the selection unchanged.
173
+ * @param value - The name of the active clip.
174
+ */
175
+ set clip(value: string);
176
+ /**
177
+ * Gets the name of the active clip.
178
+ * @returns The name of the active clip.
179
+ */
180
+ get clip(): string;
181
+ /**
182
+ * Sets the playback speed multiplier applied across all clips, where 0 freezes playback.
183
+ * Defaults to 1.
184
+ * @param value - The playback speed multiplier.
185
+ */
186
+ set speed(value: number);
187
+ /**
188
+ * Gets the playback speed multiplier applied across all clips.
189
+ * @returns The playback speed multiplier.
190
+ */
191
+ get speed(): number;
192
+ /**
193
+ * Sets the cross-fade duration of clip switches made through the `clip` attribute, in
194
+ * seconds. Defaults to 0 (a hard cut).
195
+ * @param value - The cross-fade duration in seconds.
196
+ */
197
+ set transitionTime(value: number);
198
+ /**
199
+ * Gets the cross-fade duration of clip switches made through the `clip` attribute.
200
+ * @returns The cross-fade duration in seconds.
201
+ */
202
+ get transitionTime(): number;
203
+ static get observedAttributes(): string[];
204
+ attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
205
+ }
206
+ export { AnimComponentElement };
207
+ export type { ContainerWithAnimations };
@@ -0,0 +1,207 @@
1
+ import type { AnimComponent, Asset, ContainerResource } from 'playcanvas';
2
+ import { ComponentElement } from './component.js';
3
+ /**
4
+ * A container resource with the `animations` sub-assets the engine documents but does not type:
5
+ * one `Asset` of type `animation` per glTF animation, each holding an `AnimTrack` resource.
6
+ */
7
+ type ContainerWithAnimations = ContainerResource & {
8
+ animations: Asset[];
9
+ };
10
+ /**
11
+ * The AnimComponentElement interface provides properties and methods for manipulating
12
+ * {@link https://developer.playcanvas.com/user-manual/web-components/tags/pc-anim/ | `<pc-anim>`} elements.
13
+ * The AnimComponentElement interface also inherits the properties and methods of the
14
+ * {@link HTMLElement} interface.
15
+ *
16
+ * The element drives animation clips over the host entity's hierarchy. Clips come from
17
+ * `<pc-anim-clip>` children — or, when the element is a direct child of a `<pc-model>` and
18
+ * declares no clips, every animation of that model's container asset is assigned, named by track
19
+ * name, in container order. The first clip plays automatically (opt out with `activate="false"`);
20
+ * switch clips declaratively through the `clip` attribute, or imperatively through {@link play}
21
+ * and {@link transition}. Tracks bind to scene nodes by name, so any hierarchy whose node names
22
+ * match a clip's curves can be animated — a model's skeleton is simply the common case.
23
+ *
24
+ * The engine reports no clip completion: a non-looping clip holds its last pose silently. Poll
25
+ * the underlying {@link AnimComponent} (via {@link component}) for playback state beyond what
26
+ * this element exposes.
27
+ *
28
+ * @category Components
29
+ */
30
+ declare class AnimComponentElement extends ComponentElement {
31
+ /**
32
+ * Whether playback starts automatically once a clip is assigned.
33
+ */
34
+ private _activate;
35
+ /**
36
+ * The clip elements whose states are currently assigned, by clip name. The single writer of
37
+ * a state: a later clip child re-using an adopted name is rejected as a duplicate.
38
+ */
39
+ private _assignedClips;
40
+ /**
41
+ * Whether the current clip set was auto-assigned from the enclosing model rather than
42
+ * declared by clip children.
43
+ */
44
+ private _autoAssigned;
45
+ /**
46
+ * The name of the active clip.
47
+ */
48
+ private _clip;
49
+ /**
50
+ * The element the model-readiness listener is attached to, held so disconnection can detach
51
+ * it after `closestEntity` no longer resolves.
52
+ */
53
+ private _modelListenerTarget;
54
+ /**
55
+ * Incremented whenever the clip source changes, and captured by an auto-assign pass on
56
+ * entry — a pass resuming from an await abandons itself if the value has moved on, so a
57
+ * superseded pass cannot assign clips alongside declared children or a newer pass.
58
+ */
59
+ private _sourceGeneration;
60
+ /**
61
+ * The playback speed multiplier applied across all clips.
62
+ */
63
+ private _speed;
64
+ /**
65
+ * The cross-fade duration of declarative clip switches, in seconds.
66
+ */
67
+ private _transitionTime;
68
+ /**
69
+ * The unknown clip name already warned about, so a repeated selection of the same missing
70
+ * name complains once.
71
+ */
72
+ private _warnedClip;
73
+ /**
74
+ * Rebinds when a model under the host announces readiness. The engine resolves each curve
75
+ * once, at the first tick after assignment, and never retries — and its mesh-instance
76
+ * broadcast fires before an instantiated hierarchy is parented, so a model that loads after
77
+ * the clips were assigned would otherwise stay silently unbound. A re-instantiation of the
78
+ * implicit clip source (the parent `<pc-model>`) means a new container, so the clip set
79
+ * refreshes instead — unless every clip declares its own asset, where a rebind suffices.
80
+ */
81
+ private _onModelReady;
82
+ /** @ignore */
83
+ constructor();
84
+ protected getInitialComponentData(): {
85
+ activate: boolean;
86
+ speed: number;
87
+ };
88
+ protected initComponent(): void;
89
+ disconnectedCallback(): void;
90
+ /**
91
+ * The clip children in DOM order. Read afresh each pass — the DOM is the single source of
92
+ * truth for the declared clip set.
93
+ */
94
+ private _clipElements;
95
+ /**
96
+ * Assigns a clip's state. Until the clip's real track resolves, the engine's own placeholder
97
+ * track stands in — it keeps the layer playable, so `activate` can start playback and the
98
+ * declared `clip` selection can apply before any asset has loaded.
99
+ */
100
+ private _assignClip;
101
+ /**
102
+ * Validates a clip child and, when valid, assigns its state and starts its track resolution.
103
+ *
104
+ * @param clip - The clip element.
105
+ * @returns Whether the clip was adopted.
106
+ */
107
+ private _adoptClip;
108
+ /**
109
+ * Assigns the current clip set: the declared clip children when there are any, otherwise the
110
+ * enclosing model's clips. Runs against a fresh component after a host cycle, so the
111
+ * adoption bookkeeping rebuilds from scratch.
112
+ */
113
+ private _applyClips;
114
+ /**
115
+ * Assigns every clip of the enclosing model's container, named by track name, in container
116
+ * order. Names the engine cannot host — dotted (reserved for blend tree paths) or already
117
+ * taken — are skipped with a warning naming each.
118
+ */
119
+ private _kickAutoAssign;
120
+ /**
121
+ * Applies the active-clip selection: the declared `clip` when it names an assigned state,
122
+ * else a captured pre-rebuild state when it survived, else the engine's default (the first
123
+ * assigned clip). A restore also reinstates the playhead and both playing flags exactly as
124
+ * captured — the reassignment that preceded it set both to the `activate` outcome, which is
125
+ * not necessarily the state the rebuild interrupted.
126
+ */
127
+ private _applySelection;
128
+ private _warnUnknownClip;
129
+ /**
130
+ * Resumes playback, optionally switching to a named clip first (a hard cut). A name that
131
+ * matches no clip leaves the selection unchanged.
132
+ *
133
+ * @param name - The name of the clip to play. Resumes the current clip when omitted.
134
+ */
135
+ play(name?: string): void;
136
+ /**
137
+ * Pauses playback, preserving the playhead — {@link play} resumes from where it stopped.
138
+ */
139
+ pause(): void;
140
+ /**
141
+ * Cross-fades to a named clip and ensures playback is running. A name that matches no clip
142
+ * leaves the selection unchanged.
143
+ *
144
+ * @param name - The name of the clip to fade to.
145
+ * @param time - The fade duration in seconds. Defaults to the `transition-time` attribute.
146
+ */
147
+ transition(name: string, time?: number): void;
148
+ /**
149
+ * Gets the underlying PlayCanvas anim component.
150
+ * @returns The anim component.
151
+ */
152
+ get component(): AnimComponent;
153
+ /**
154
+ * Gets the names of the assigned clips.
155
+ * @returns The clip names, in assignment order.
156
+ */
157
+ get clips(): string[];
158
+ /**
159
+ * Sets whether playback starts automatically once a clip is assigned. Defaults to `true`.
160
+ * Applies when clips are assigned — it does not stop a clip that is already playing.
161
+ * @param value - Whether playback starts automatically.
162
+ */
163
+ set activate(value: boolean);
164
+ /**
165
+ * Gets whether playback starts automatically once a clip is assigned.
166
+ * @returns Whether playback starts automatically.
167
+ */
168
+ get activate(): boolean;
169
+ /**
170
+ * Sets the name of the active clip. Changing it switches playback, cross-fading over
171
+ * `transition-time` seconds (a hard cut at 0). An empty value leaves the current clip
172
+ * playing; a name that matches no clip warns and leaves the selection unchanged.
173
+ * @param value - The name of the active clip.
174
+ */
175
+ set clip(value: string);
176
+ /**
177
+ * Gets the name of the active clip.
178
+ * @returns The name of the active clip.
179
+ */
180
+ get clip(): string;
181
+ /**
182
+ * Sets the playback speed multiplier applied across all clips, where 0 freezes playback.
183
+ * Defaults to 1.
184
+ * @param value - The playback speed multiplier.
185
+ */
186
+ set speed(value: number);
187
+ /**
188
+ * Gets the playback speed multiplier applied across all clips.
189
+ * @returns The playback speed multiplier.
190
+ */
191
+ get speed(): number;
192
+ /**
193
+ * Sets the cross-fade duration of clip switches made through the `clip` attribute, in
194
+ * seconds. Defaults to 0 (a hard cut).
195
+ * @param value - The cross-fade duration in seconds.
196
+ */
197
+ set transitionTime(value: number);
198
+ /**
199
+ * Gets the cross-fade duration of clip switches made through the `clip` attribute.
200
+ * @returns The cross-fade duration in seconds.
201
+ */
202
+ get transitionTime(): number;
203
+ static get observedAttributes(): string[];
204
+ attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
205
+ }
206
+ export { AnimComponentElement };
207
+ export type { ContainerWithAnimations };