import type { DurationMode, RenderControllerState, VideoRenderController as VideoRenderControllerSpec } from './nitro/VideoPipeline.nitro'; /** * Bindings the `Video.*` wrapper (T012) hands to the controller at the moment * it kicks off a native render. Wires the JS-side controller to the tokenised * `finishRender` / `cancelRender` pair exposed by the Nitro module. * * @internal */ export interface ControllerBindings { readonly finishRender: () => void; readonly cancelRender: () => void; /** * Duration mode of the render this controller is attached to. `finish()` is * a no-op on fixed-duration renders: truncating a fixed-duration render * would blur the abort/finish distinction, so early termination of a fixed * render uses `AbortSignal` instead. */ readonly durationMode: DurationMode; } /** * Handle for graceful end-of-stream on open-ended renders. * * Distinct from `AbortSignal`: * - `abort()` cancels and **discards** the output — the render promise * rejects with `Cancelled`. * - `finish()` stops after the current frame and **finalises** the output — * the render promise resolves normally. * * State transitions: * - `running → finishing → done` (graceful: `finish()` then native flush) * - `running → done` (fixed-duration natural end) * - `running → aborted` (hard cancel) * - `finishing → aborted` (abort wins over in-flight finish) * * Terminal states (`done`, `aborted`) absorb further calls: both `finish()` * and `abort()` are idempotent. * * A controller maps 1:1 to a render — pass a fresh instance per `Video.*` * call. Rebinding is a programmer error and throws. */ export declare class VideoRenderController implements VideoRenderControllerSpec { #private; get state(): RenderControllerState; finish(): void; abort(): void; /** * Attach native bindings. Called by the `Video.*` wrapper exactly once, * synchronously with the Nitro render invocation. Any state transitions * the caller already performed (`abort()` / `finish()` before the render * was started) are relayed to native here. * * @internal */ _bind(bindings: ControllerBindings): void; /** * Transition to the `done` terminal state. Called by the `Video.*` wrapper * when the native render promise resolves successfully. A prior `abort()` * wins — native may emit a final frame after we told it to cancel, and we * must not flip the terminal state back to `done`. * * @internal */ _markDone(): void; } //# sourceMappingURL=controller.d.ts.map