Skip to content

CopyChoreographer

Defined in: state.ts:181

Owns one island’s copy for one page view. Fed wire events; emits states.

Pure with respect to the DOM: it decides WHAT should be on screen and when, and never touches how. That is what lets the same choreography drive React, the iframe shell, and anything else without three copies of these rules.

new CopyChoreographer(options?): CopyChoreographer

Defined in: state.ts:243

ChoreographerOptions = {}

CopyChoreographer

backgroundReady(bgImage): void

Defined in: state.ts:626

Absence of this event means KEEP THE BAKED THEME WASH. It does not mean clear the art layer — the server omits it when there is no creative image, and a client that cleared on absence would blank the hero on exactly the campaigns that never had a picture.

The patch waits for the browser to DECODE the image first: consumers render this state directly, and a backgroundImage that lands before pixels exist paints the already-flipped theme against the old (or blank) art — the contrast tear. On failure the patch still lands (the consumer’s own loading treatment owns that case); outside a browser it is immediate.

string

void


copyChunk(field, text): void

Defined in: state.ts:553

A delta landed. Text on the wire is text we can show: the first chunk takes the canvas away from the pending fallback, whatever the start called itself. While the field shows restored fallback copy a reader can see, deltas still buffer off-canvas — that text changes ONCE, composed, at *-done, never delta by delta.

CopyField

string

void


copyDone(field, text): void

Defined in: state.ts:578

A field closed. text is authoritative — a client that missed chunks can paint this alone, which is what makes chunk loss a cosmetic problem instead of a correctness one.

CopyField

string

void


copyStart(field, mode, source): void

Defined in: state.ts:527

A field opened. Proof of life, and provenance — nothing more.

The canvas changes hands on the first CHUNK, not here: the delivery mode is recorded on the field but no longer consulted for hold release. All a start does while holding is RESTART the fallback budget, because the stream has just proven it is alive and the old budget was measuring a connection that had not connected yet.

CopyField

"generate" | "replay" | null

"generated" | "cached" | "static"

void


ctaReady(text, style, action?): void

Defined in: state.ts:663

string

unknown

string

void


ctaStyleReady(style): void

Defined in: state.ts:658

unknown

void


dispose(): void

Defined in: state.ts:826

Release timers. Safe to call twice.

void


done(meta): void

Defined in: state.ts:677

Terminal. Anything still held paints now, once, composed — the last chance for the stream’s copy to land as a single deliberate change rather than being dropped because the budget happened to outlive the stream.

Record<string, unknown>

void


failed(message): void

Defined in: state.ts:767

The stream failed.

No failure blanks the canvas. A field that closed keeps its delivered copy; a field the stream opened but never finished is repainted with its WHOLE fallback and demoted to static; a still-blank field gets its fallback back. The worst honest outcome is that the creative simply stopped adapting, which looks like a normal page.

string

void


getState(): CreativeState

Defined in: state.ts:275

CreativeState


layoutReady(layout, manifest?): void

Defined in: state.ts:606

string

unknown

void


sequenceReady(frames, heroIndex, fps): void

Defined in: state.ts:648

string[]

number

number

void


streamOpened(): void

Defined in: state.ts:322

Call when the stream request has been opened.

Arms the hold if — and only if — there is fallback copy on the canvas that has NOT already been read. Copy that has been on screen since first paint stays put: it is not a placeholder, and hiding it would be the mid-read wipe this whole machine exists to prevent.

void


subscribe(listener): () => void

Defined in: state.ts:279

Listener

() => void


themeReady(colors, sources): void

Defined in: state.ts:601

Record<string, string>

Record<string, string>

void


videoReady(videoUrl): void

Defined in: state.ts:653

string

void