# `Labs.fire`

> 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.

Method of [`Labs`](Labs.md) · labs · since 2.0.0 · called as `session.labs.fire`

```ts
fire(spec: FireSpec, placement: Placement & {
  owner: Collection;
}): Promise<Part<C>>;
```

Volumetric fire, owned by `owner`: an item of that collection, so it follows its [`parent`](Part.parent.md) and
goes with its owner. Resolves with its part. Rejects HoloAssetError when its assets fail, and
AbortError, starting nothing, when `owner` is disposed. An
asset load: not allowed inside [`beforeCommit`](Session.beforeCommit.md). A later `set()` on the owner removes it, as it
removes `load()` items its spec doesn't list, so give it a collection of its own. Its spec and
placement are fixed: for a new `size` or anchor, clear the owner (`set({ items: [] })`) and
call `fire()` again. A commit that fails inside the runtime after it resolved drops it, as
[`Collection.load`](Collection.load.md)'s does.

**Default:** placement.at the identity pose; placement.parent the owner's root

## Example

Imports: values (`has`, `validate`, the `Holo*Error` classes, the pure helpers) from `@holostep-configurators/runtime-client`, types from `@holostep-configurators/runtime-client/contract`, `/math` and `/testing` names from those entries; `boot` from the runtime module the root's `loadRuntimeAtFloor` resolves to. A type your page defines is your app's: declare it there, never import it from the package.

Compiled under the contract's strict settings (`examples/declaration/20-Labs.fire.ts`):

```ts
import type { Part, Session } from '@holostep-configurators/runtime-client/contract';
declare const session: Session;
declare const signal: AbortSignal;
declare const anchor: Part;                                // the firebox's anchor part
// the flame's own collection: a later set() on it removes the flame
const fx = session.collection('fire', { role: 'scenery', signal });
await session.labs.fire(
  { size: { x: 0.8, y: 0.35, z: 0.2 }, detail: { iterations: 33, octaves: 5 }, drawOrder: 1 },
  { owner: fx, parent: anchor, at: { position: { x: 0, y: 0.18, z: 0 } } },
);
// a new size is a new fire: clear the owner, then call fire() again
await fx.set({ items: [] });
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `fire` names no product |
| 2. A precedent | pass: [Unity ParticleSystem](https://docs.unity3d.com/ScriptReference/ParticleSystem.html) (row `E2`) |
| 3. Two apps, or labs | labs: it graduates when a second app uses it; apps today: app-0c773a4ee3, app-b362a81c85 |
| 4. The cheaper fix first | decided per need in Appendix B: rows `E2`, `K24` at tier labs (a member only where no rule, data, asset or app code serves the need) |
