import { TimelineStore } from '../stores/timelineStore';
import type { Clip, TimeMs, TrackInsertionPlacement, TrackType } from '../models/types';
export interface ValueChangeCommandResult<T> {
    previousValue: T;
    nextValue: T;
    changed: boolean;
}
export interface SelectionCommandResult {
    previousClipId: string | null;
    nextClipId: string | null;
    changed: boolean;
}
export interface TimelineTrackView {
    getId?(): string;
    id?: string;
    type?: TrackType;
    getClips(): Clip[];
    getTrackType?(): TrackType;
    addClip?(clip: Clip): void;
    removeClip?(clipId: string): void;
    splitSelectedClip?(time: TimeMs): void;
}
export interface TimelineTrackLayout {
    id: string;
    type: TrackType;
    role?: 'primary' | 'normal';
}
export interface ClipLookupResult {
    clip: Clip;
    track: TimelineTrackView;
    trackId: string | null;
}
export interface RemoveClipCommandResult {
    exists: boolean;
    clip: Clip | null;
    trackId: string | null;
    shouldClearSelection: boolean;
}
export type MoveClipToTrackCommandResult = {
    status: 'ready';
    clip: Clip;
    sourceTrack: TimelineTrackView;
    sourceTrackId: string;
    targetTrack: TimelineTrackView;
    targetTrackId: string;
} | {
    status: 'noop';
    clipId: string;
    sourceTrackId: string;
    targetTrackId: string;
} | {
    status: 'missing_source_track' | 'missing_target_track' | 'track_type_mismatch';
    clipId: string;
    targetTrackId: string;
    sourceTrackId?: string;
};
export type TrackPlacementCommandResult = {
    status: 'use_existing_track';
    trackId: string;
} | {
    status: 'create_track';
    trackType: TrackType;
    suggestedTrackName: string;
    insertionPlacement: TrackInsertionPlacement;
};
export type CrossTrackMoveCommandResult = {
    status: 'missing_target_track_by_position';
} | {
    status: 'same_track';
    targetTrackId: string;
} | {
    status: 'missing_target_track_view';
    targetTrackId: string;
} | {
    status: 'track_type_mismatch';
    targetTrackId: string;
    targetTrackType: TrackType | null;
} | {
    status: 'move_to_track';
    targetTrackId: string;
} | {
    status: 'create_track';
    trackType: TrackType;
    insertionPlacement: TrackInsertionPlacement;
    referenceTrackId?: string;
};
export type CrossTrackPreviewCommandResult = {
    status: 'existing_track_placeholder';
    targetTrackId: string;
} | {
    status: 'new_track_insertion';
    trackType: TrackType;
    insertionPlacement: TrackInsertionPlacement;
    referenceTrackId?: string;
} | {
    status: 'clear';
};
export declare class TimelineCommands {
    private readonly timelineStore;
    constructor(timelineStore: TimelineStore);
    selectClip(clipId: string): SelectionCommandResult;
    clearSelection(): SelectionCommandResult;
    findClipById(tracks: TimelineTrackView[], clipId: string): ClipLookupResult | null;
    findClipAtTime(tracks: TimelineTrackView[], time: TimeMs): ClipLookupResult | null;
    prepareRemoveClip(clipId: string, tracks: TimelineTrackView[]): RemoveClipCommandResult;
    prepareMoveClipToTrack(clipId: string, targetTrackId: string, tracks: TimelineTrackView[]): MoveClipToTrackCommandResult;
    planTrackPlacement(clip: Pick<Clip, 'type' | 'startTime' | 'duration'>, tracks: TimelineTrackView[]): TrackPlacementCommandResult;
    planCrossTrackMove(clip: Pick<Clip, 'id' | 'type' | 'startTime' | 'duration'>, targetTrackY: number, currentTrackId: string, timeScaleHeight: number, layoutTracks: TimelineTrackLayout[], tracks: TimelineTrackView[]): CrossTrackMoveCommandResult;
    planCrossTrackPreview(clip: Pick<Clip, 'id' | 'type' | 'startTime' | 'duration'>, targetTrackY: number, currentTrackId: string, timeScaleHeight: number, layoutTracks: TimelineTrackLayout[], tracks: TimelineTrackView[]): CrossTrackPreviewCommandResult;
    setCurrentTime(time: TimeMs): ValueChangeCommandResult<TimeMs>;
    setZoom(zoom: number): ValueChangeCommandResult<number>;
    setSpeed(speed: number): ValueChangeCommandResult<number>;
    private updateSelection;
    private updateCurrentTime;
    private updateZoom;
    private updateSpeed;
    private resolveTrackId;
    private resolveTrackType;
    private resolveTrackTargetByY;
    private resolvePreferredInsertionPlacement;
    private hasOverlapOnTrack;
}
