import type { TimeMs } from '../models/types';
import type { PreviewPendingState, PreviewRuntimeState } from './previewBackend';
export interface TimelinePendingPreviewState {
    mode: 'seek' | 'scrub';
    targetTime: TimeMs;
    resumePlayOnReady: boolean;
    errorMessage: string | null;
    timeoutId: ReturnType<typeof setTimeout> | null;
    failedTimeoutId?: ReturnType<typeof setTimeout> | null;
    pendingFailedMessage?: string | null;
    awaitingSync: boolean;
    syncRequestId: number;
}
interface TimelinePreviewStateControllerCallbacks {
    applyPendingState: (state: PreviewPendingState | null) => void;
    emitBufferingStateChange: (isBuffering: boolean) => void;
    emitSourceLoadingStateChange: () => void;
    resumePlayback: () => void;
    requestPreviewSync: () => void;
}
interface TimelinePreviewStateControllerOptions {
    callbacks: TimelinePreviewStateControllerCallbacks;
    pendingTimeoutMs?: number;
    failedOverlayDelayMs?: number;
}
export declare class TimelinePreviewStateController {
    private readonly callbacks;
    private readonly pendingTimeoutMs;
    private readonly failedOverlayDelayMs;
    private _previewSourceLoadingCount;
    private _previewBuffering;
    private _previewAwaitingMedia;
    private _pendingPreviewState;
    private _nextPendingPreviewSyncRequestId;
    constructor(options: TimelinePreviewStateControllerOptions);
    get previewSourceLoadingCount(): number;
    set previewSourceLoadingCount(value: number);
    get previewBuffering(): boolean;
    set previewBuffering(value: boolean);
    get pendingPreviewState(): TimelinePendingPreviewState | null;
    set pendingPreviewState(value: TimelinePendingPreviewState | null);
    get nextPendingPreviewSyncRequestId(): number;
    set nextPendingPreviewSyncRequestId(value: number);
    handleBufferingStateChange(isBuffering: boolean): void;
    handleSourceLoadingChange(pending: number): void;
    handleRuntimeStateChange(state: PreviewRuntimeState): void;
    markSyncProcessed(syncRequestId?: number): void;
    beginPendingPreview(time: TimeMs, mode: 'seek' | 'scrub', resumePlayOnReady: boolean): void;
    buildPreviewPendingState(): PreviewPendingState | null;
    updatePendingPreviewState(): void;
    retryPendingPreview(): void;
    clearPendingPreviewState(): void;
    resetPreviewRuntimeState(): void;
    private ensurePendingPreviewTimeout;
    private clearPendingPreviewTimeout;
    private scheduleFailedOverlay;
    private clearFailedOverlayTimeout;
}
export {};
