interface FesttideRuntime {
/** The runtime's version, e.g. "1.0.3". */
readonly version: string
/** Resolves after the first render decision, or after the 1.5 s give-up. Never rejects. */
readonly ready: Promise<void>
/** Listens to an event; returns a function that stops listening. */
on(event: RuntimeEventName, handler: (detail: RuntimeEventDetail) => void): () => void
/** Consent for counting (views, clicks). Rendering never needs consent. */
consent(granted: boolean): void
/** Campaign ids live on this page right now. */
active(): string[]
/** Removes everything the runtime added to the page, until the next page load. */
pause(): void
}
type RuntimeEventName =
| "ready"
| "campaign:start"
| "campaign:end"
| "banner:view"
| "banner:click"
| "banner:dismiss"
| "offer:copy"
| "error"
interface RuntimeEventDetail {
campaignId?: string
/** For "error": a short code. */
code?: string
}