import type { CellBuffer } from "../buffer/cell-buffer.js"; import type { CapabilityProfile, KeyEvent } from "../types.js"; export interface SessionRenderContext { width: number; height: number; capabilities: CapabilityProfile; frame: number; now: number; } export interface SessionAnimationContext extends SessionRenderContext { stateChangedAt: number; } export interface SessionOptions { title?: string; alternateScreen?: boolean; mouse?: boolean; initialState: T; animationIntervalMs?: number; escapeTimeoutMs?: number; render: (state: T, ctx: SessionRenderContext) => CellBuffer; handle: (state: T, event: KeyEvent, controls: SessionControls) => void; shouldAnimate?: (state: T, ctx: SessionAnimationContext) => boolean; } export interface SessionControls { setState: (updater: (state: T) => T) => void; resolve: (value: unknown) => void; reject: (err: Error) => void; render: () => void; } export declare class TuiCancelled extends Error { constructor(message?: string); } export declare function getCapabilities(): CapabilityProfile; export declare function runSession(options: SessionOptions): Promise; export declare function onceFrame(): Promise; //# sourceMappingURL=session.d.ts.map