import type { KyogijoReplay } from "./mount.ts"; import { type Aim } from "./turn.dom.ts"; import type { ReplaySettings, ReplayTimeline } from "./replay.types.ts"; import type { TurnModel } from "./turn.model.ts"; import { type TurnReplayLook } from "./turn.replay.ts"; /** What a 3D view lends a replay: its elements, its model, a way to lay the replay on the model, and a way to paint the view again. */ export interface TurnInternals { doc: Document; /** The view's root (`.ky-turn`) and the element that turns (`.ky-turn-view`). */ root: HTMLElement; stage: HTMLElement; model(): TurnModel; /** Lay a replay on every model the view makes from now on (`undefined` takes it off), draw the world again with it, and call `after` once it is drawn, then and each time after. */ setDecorate(decorate: ((model: TurnModel) => TurnModel) | undefined, after?: () => void): void; /** Paint the view as it is now: the planes whose place changed are written, the others are not touched. */ repaint(): void; /** Look at a point of the floor with a zoom on top of the view's (a camera following the play), at once or in a glide; `undefined` gives the view back. Painted at the next `repaint`. */ aim(next: Aim | undefined, glide?: boolean): void; /** Be told when the reader turns, tips or zooms the view (`turn`) or presses a viewpoint or Reset (`preset`). */ onUser(listener: (kind: "preset" | "turn") => void): () => void; /** The view's own frame requests, which the auto-turn shares: one animation frame a frame, whatever runs. */ requestFrame(callback: FrameRequestCallback): number; cancelFrame(id: number): void; } /** Settings of a replay on a 3D view: the flat replay's, and `stand`. */ export type TurnReplaySettings = ReplaySettings & TurnReplayLook; /** Attach a replay to a 3D view. The controller it gives back has `destroy`, which takes the replay away and leaves the view as it was. */ export declare function attachTurnReplay(view: TurnInternals, timeline: ReplayTimeline, settings: TurnReplaySettings): KyogijoReplay;