import type { ActiveClipPlaybackInfo, ClipVisualTransform, PlayState, PreviewAspectRatio, PreviewSourceResolver, TextPreviewFontConfig, TimeMs, TrackType } from '../models/types';
import type { SourceMediaRegistry } from '../resources/sourceMediaRegistry';
import type { ResourceCacheManager } from '../resources/resourceCache';
import type { PreviewPendingState, PreviewRuntimeState } from './previewBackend';
import { type DiagnosticEmitInput, type DiagnosticsCenter } from '../../utils/diagnostics';
interface TimelinePreviewSessionCallbacks {
    onBufferingStateChange?: (isBuffering: boolean) => void;
    onSourceLoadingChange?: (pending: number) => void;
    onSyncProcessed?: (syncRequestId?: number) => void;
    onRuntimeStateChange?: (state: PreviewRuntimeState) => void;
    onAspectRatioChange?: (aspectRatio: PreviewAspectRatio) => void;
    onPreviewClipSelect?: (clipId: string) => void;
    onVisualTransformCommit?: (clipId: string, visualTransform: ClipVisualTransform) => void;
    onPendingPreviewRetry?: () => void;
}
interface TimelinePreviewSessionDependencies {
    createMediaElement?: (kind: TrackType, role: 'current' | 'preload') => HTMLMediaElement;
    createAspectRatioProbe?: () => HTMLVideoElement;
    createAudioContext?: () => AudioContext | null;
    diagnostics?: DiagnosticsCenter;
    getDiagnosticsContext?: () => Partial<DiagnosticEmitInput>;
    rootClassName?: string;
    frameClassName?: string;
    slotClassNamePrefix?: string;
    previewSourceResolver?: PreviewSourceResolver;
    textPreviewFont?: TextPreviewFontConfig | null;
    sourceMediaRegistry?: SourceMediaRegistry;
    resourceCacheManager?: ResourceCacheManager | null;
}
export interface TimelinePreviewSyncPayload {
    activeClips: ActiveClipPlaybackInfo[];
    nextClips: ActiveClipPlaybackInfo[];
    firstVideoClip: ActiveClipPlaybackInfo | null;
    autoAspectRatioClip: ActiveClipPlaybackInfo | null;
    currentTime: TimeMs;
    playState: PlayState;
    speed: number;
    interactionMode?: 'steady' | 'seek' | 'scrub';
    primarySelectedClipId?: string | null;
    syncRequestId?: number;
}
export declare class TimelinePreviewSession {
    private container;
    private rootElement;
    private frameElement;
    private textOverlayRoot;
    private pendingOverlayElement;
    private readonly pendingOverlayRenderer;
    private resizeObserver;
    private readonly trackSlots;
    private readonly textPreviewEntries;
    private audioContext;
    private masterGainNode;
    private loadingCount;
    private isBuffering;
    private bufferingVisibleTimeoutId;
    private lastRuntimeSignature;
    private lastRuntimeState;
    private lastSettledSyncRequestId;
    private primarySelectedClipId;
    private transientVisualTransform;
    private textPreviewDragState;
    private textPreviewFontStyleElement;
    private textPreviewFontSignature;
    private textPreviewFontLoadState;
    private textPreviewFontLoadToken;
    private readonly callbacks;
    private readonly dependencies;
    private readonly transformOverlay;
    private readonly boundTextPreviewPointerMove;
    private readonly boundTextPreviewPointerUp;
    private readonly boundTextPreviewVisibilityChange;
    private readonly boundTextPreviewWindowBlur;
    private requestedAspectRatio;
    private resolvedAutoAspectRatio;
    private aspectRatioProbe;
    private aspectRatioProbeSrc;
    private aspectRatioProbeResolveToken;
    private isAspectRatioProbeLoading;
    private pendingState;
    private activeSyncRequestId;
    private isSyncProjecting;
    private readonly deferredPreloadSlotKeys;
    private deferredPreloadFlushScheduled;
    constructor(callbacks?: TimelinePreviewSessionCallbacks, dependencies?: TimelinePreviewSessionDependencies);
    private emitDiagnostic;
    private buildSlotTraceData;
    hasPreview(): boolean;
    attach(container: HTMLElement): void;
    detach(): void;
    setPendingState(state: PreviewPendingState | null): void;
    sync(payload: TimelinePreviewSyncPayload): void;
    applyAspectRatio(aspectRatio: PreviewAspectRatio): void;
    getAspectRatio(): PreviewAspectRatio;
    private createMediaElement;
    private createSlot;
    private resetSlotRecoveryTracking;
    private destroySlot;
    private releaseSlotObjectUrl;
    private clearPendingRuntimeSource;
    private rememberSlotObjectUrl;
    private revokeResolvedObjectUrl;
    private getTrackSlots;
    private swapTrackSlots;
    private applyTrackPlan;
    private applySlotTarget;
    private settleResolvedSourceWithoutRecovery;
    private resolveDesiredSource;
    private decorateSlotSourceUrl;
    private resolvePlayableSlotSource;
    private emitRuntimeSourceDiagnostic;
    private getReusableResolvedSlotSource;
    private slotNeedsRecovery;
    private recoverSlot;
    private finishSlotRecovery;
    private getSlotKey;
    private isActiveCurrentSlot;
    private hasBlockingActiveCurrentSlot;
    private shouldDeferPreloadTarget;
    private shouldDeferPreloadRecovery;
    private buildDeferredPreloadTarget;
    private deferPreloadTarget;
    private deferPreloadRecovery;
    private scheduleDeferredPreloadFlush;
    private flushDeferredPreloads;
    private applyResolvedSlotState;
    private buildCurrentTargetForSlot;
    private isCurrentRequest;
    private isCurrentSourceTarget;
    private shouldIgnoreExpectedEmptied;
    private shouldIgnoreExpectedAbort;
    private shouldIgnoreClearedSlotRecoverableEvent;
    private shouldSkipImmediatePreloadRecovery;
    private isBackgroundPreloadSlot;
    private parkPreloadSlot;
    private failSlot;
    private configureAudioRouting;
    private syncCurrentSlot;
    private preparePreloadSlot;
    private setSlotVisible;
    private getAudioContext;
    private getMasterGainNode;
    private resumeAudioContext;
    private updateFrameLayout;
    private maybeResolveAutoAspectRatio;
    private resolveAspectRatioProbeSource;
    private buildPreviewSourceCacheKey;
    private getAspectRatioProbe;
    private tryResolveAutoAspectRatioFromSlot;
    private handleResolvedAutoAspectRatio;
    private refreshRuntimeState;
    private syncVisibleBufferingState;
    private clearBufferingVisibleTimeout;
    private refreshPendingOverlay;
    private handlePreviewTransformChange;
    private refreshVisualLayout;
    private syncTextPreviewEntries;
    private clearTextPreviewEntries;
    private removeTextPreviewEntry;
    private applyTextPreviewEntry;
    private refreshTextPreviewLayout;
    private refreshTextPreviewEntries;
    private createTextPreviewPointerDownHandler;
    private bindTextPreviewDocumentListeners;
    private unbindTextPreviewDocumentListeners;
    private handleTextPreviewPointerMove;
    private finishTextPreviewDrag;
    private refreshTextPreviewInteractionState;
    private getTextPreviewFontConfig;
    private getTextPreviewFontFamily;
    private ensureTextPreviewFontReady;
    private resetTextPreviewFontState;
    private refreshSlotVisualLayout;
    private buildSelectedOverlayState;
    private getFrameSize;
    private getDocument;
    private toFrameLocalPoint;
    private getTextPreviewBaselineMetrics;
    private getMediaSize;
    private getEffectiveVisualTransform;
}
export {};
