Skip to content

CopyChoreographer

Defined in: state.ts:342

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 several copies of these rules.

new CopyChoreographer(options?): CopyChoreographer

Defined in: state.ts:382

ChoreographerOptions = {}

CopyChoreographer

backgroundReady(bgImage): void

Defined in: state.ts:816

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.

The patch waits for the browser to DECODE the image first, so a new background never paints before its pixels exist. On failure the patch still lands; outside a browser it is immediate.

string

void


checkDeadline(): void

Defined in: state.ts:581

Apply a hold expiry whose time has already passed but whose timer has not run: a background tab throttles timers, and a page restored from the back/forward cache resumes with them overdue. Copy events call this first, so text arriving after the deadline is never shown in place of the fallback. Renderers call it when the page is shown again. Idempotent.

void


copyChunk(field, text): void

Defined in: state.ts:706

A delta landed. While holding (and in view) the first text takes the canvas; on a live field it extends the text. Dropped for a final field.

CopyField

string

void


copyDone(field, text): void

Defined in: state.ts:733

A field closed. Its text completes what the field shows: it lands whole on a blank field and finishes a typed one. It never replaces different visible text — if it does not extend what was typed, the typed text stands (and development builds warn). For a final field this only marks it settled.

CopyField

string

void


copyStart(field, mode, source): void

Defined in: state.ts:686

A field opened: proof of life, and provenance. Restarts the hold budget once if it is running. Dropped for a final field.

CopyField

"generate" | "replay" | null

"generated" | "cached" | "static"

void


ctaReady(text, style, action?): void

Defined in: state.ts:850

string

unknown

string

void


ctaStyleReady(style): void

Defined in: state.ts:845

unknown

void


dispose(): void

Defined in: state.ts:961

Release timers. Safe to call twice.

void


done(meta): void

Defined in: state.ts:904

Terminal, success.

Record<string, unknown>

void


failed(message): void

Defined in: state.ts:951

Terminal, failure. No failure blanks the canvas: copy that closed stays, a blank field gets its fallback, and a field the stream was still writing goes through the UnfinishedCopyPolicy.

string

void


getState(): CreativeState

Defined in: state.ts:428

CreativeState


keepFallback(field): void

Defined in: state.ts:772

The renderer will not show this field’s copy: it does not fit the slot its fallback reserved. The fallback lands instead and is final for the view; later copy for the field is dropped. Call it before the copy is painted (a renderer measures before the browser paints), never for text the visitor has seen.

CopyField

void


layoutReady(layout, manifest?): void

Defined in: state.ts:800

string

unknown

void


sequenceReady(frames, heroIndex, fps): void

Defined in: state.ts:835

string[]

number

number

void


slotInView(): void

Defined in: state.ts:532

Call when the slot is in view (already in view at mount counts). Only meaningful with holdStartsInView; otherwise the slot is in view from the start and this is a no-op.

At that moment copy the stream already delivered takes the canvas — finished fields land whole, unfinished ones type from the buffer — and with nothing delivered the hold budget starts.

void


streamOpened(): void

Defined in: state.ts:486

Call when live copy is coming: when the stream request opens, or earlier when a renderer already knows it will (a stream waiting on a shared variant). Idempotent.

Arms the hold when there is fallback copy the visitor has not seen. Copy the visitor can already see (initialIsOnScreen) or finished creative (serverRendered) is final instead: nothing to hold, nothing to replace.

void


subscribe(listener): () => void

Defined in: state.ts:432

Listener

() => void


themeReady(colors, sources): void

Defined in: state.ts:795

Record<string, string>

Record<string, string>

void


videoReady(videoUrl): void

Defined in: state.ts:840

string

void