import type { ActiveClipPlaybackInfo, ClipVisualTransform, PlayState, PreviewAspectRatio, PreviewSourceResolver, TextPreviewFontConfig, TimeMs, TrackType } from '../models/types';
import type { SourceMediaRegistry } from '../resources/sourceMediaRegistry';
import type { PreviewPendingState, PreviewRuntimeState } from './previewBackend';
interface TimelinePreviewSessionCallbacks {
    onBufferingStateChange?: (isBuffering: boolean) => void;
    onSourceLoadingChange?: (pending: number) => void;
    onSyncProcessed?: (syncRequestId?: number) => void;
    onRuntimeStateChange?: (state: PreviewRuntimeState) => void;
    onAspectRatioChange?: (aspectRatio: PreviewAspectRatio) => void;
    onVisualTransformCommit?: (clipId: string, visualTransform: ClipVisualTransform) => void;
    onPendingPreviewRetry?: () => void;
}
interface TimelinePreviewSessionDependencies {
    createMediaElement?: (kind: TrackType, role: 'current' | 'preload') => HTMLMediaElement;
    createAspectRatioProbe?: () => HTMLVideoElement;
    createAudioContext?: () => AudioContext | null;
    rootClassName?: string;
    frameClassName?: string;
    slotClassNamePrefix?: string;
    previewSourceResolver?: PreviewSourceResolver;
    textPreviewFont?: TextPreviewFontConfig | null;
    sourceMediaRegistry?: SourceMediaRegistry;
}
export interface TimelinePreviewSyncPayload {
    activeClips: ActiveClipPlaybackInfo[];
    nextClips: ActiveClipPlaybackInfo[];
    firstVideoClip: ActiveClipPlaybackInfo | null;
    autoAspectRatioClip: ActiveClipPlaybackInfo | null;
    currentTime: TimeMs;
    playState: PlayState;
    speed: number;
    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;
    constructor(callbacks?: TimelinePreviewSessionCallbacks, dependencies?: TimelinePreviewSessionDependencies);
    private logLoadTrace;
    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 destroySlot;
    private getTrackSlots;
    private swapTrackSlots;
    private applyTrackPlan;
    private applySlotTarget;
    private resolveDesiredSource;
    private decorateSlotSourceUrl;
    private slotNeedsRecovery;
    private recoverSlot;
    private finishSlotRecovery;
    private applyResolvedSlotState;
    private isCurrentRequest;
    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 {};
