# `Animations`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Interface · `import type { Animations } from '@holostep-configurators/runtime-client/contract';` · stable · since 2.0.0 · section 14. Animations

Clip writes are look-only and not in the write queue: outside a transaction each starts at once,
so plays called in the same task start in the same frame. Autocommit: [`play`](Animations.play.md) resolves when the clip
ends or holds its last frame; with `loop: true` it is open-ended and resolves once it has started
([`idle()`](Session.idle.md) and [`capture()`](Session.capture.md) ignore it). Through a `tx`: [`play`](Animations.play.md) and [`pause`](Animations.pause.md) resolve 'deferred' and
start when the commit is shown; [`stop`](Animations.stop.md) and [`reset`](Animations.reset.md) are staged, so `worldPose`, `bounds()` and
`connectors()` read frame 0 at once and the screen shows it at the commit.
`target` is a ModelNode `nodeId`, or the root [`Part`](Part.md) of a collection `model` item
([`collection(name).part(key)`](Collection.part.md), or the Part `load()` resolved with). The [`Part`](Part.md) target is
experimental: check [`supports('animations.items')`](Session.supports.md) (one app so far; spec 3.1).
Clips of one model (a ModelNode's GLB or a `model` item's) that animate a common node or joint
are exclusive: [`play`](Animations.play.md) first stops every other such clip of that model at frame 0 (its next
`toggle` plays forward; its pending play resolves) and fires 'animation:stopped' for one that
was playing or paused. Clips on disjoint nodes play together (1.x `animation.controller.ts:503-545`).
Each run of a clip fires one 'animation:started' and then one 'animation:stopped' or
'animation:finished' (see [`Events`](Events.md)).

## Members

| Member | Kind | Summary |
| --- | --- | --- |
| <a id="list"></a>[`list`](Animations.list.md) | method | Authored read: the clips of `target`, or of every loaded node and collection `model` item. |
| <a id="play"></a>[`play`](Animations.play.md) | method | Plays a clip (look-only; a newer play of the same clip on that part takes it over). |
| <a id="pause"></a>[`pause`](Animations.pause.md) | method | Pauses a playing clip where it is. |
| <a id="stop"></a>[`stop`](Animations.stop.md) | method | The clip back to its first frame, stopped; its next `toggle` plays forward. |
| <a id="reset"></a>[`reset`](Animations.reset.md) | method | Every clip of `target` (or of all nodes and items) back to its first frame, stopped; each one's next `toggle` plays forward. |

## Declaration

```ts
export interface Animations<C extends object = NoCommitOptions> {
  list(target?: string | Part): ClipInfo[];
  play(target: string | Part, clip: string, options?: C & PlayOptions): Promise<Report>;
  pause(target: string | Part, clip: string, options?: C & SignalOption): Promise<Report>;
  stop(target: string | Part, clip: string, options?: C & SignalOption): Promise<Report>;
  reset(target?: string | Part, options?: C & SignalOption): Promise<Report>;
}
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `Animations` names no product |
| 2. A precedent | not recorded: no ledger row (coverage.json) names this member or its owner |
| 3. Two apps, or labs | pass: 21 apps (fleet cross-check: app-04c2774145, app-0c773a4ee3, app-37356bf09f, app-4762caacdc, app-4fd23bc869, app-822bb9d6aa, app-8675b3225c, app-b362a81c85 and 13 more) |
| 4. The cheaper fix first | not recorded per member (Appendix B decides it per need) |
