import { Studio, StudioTrack } from '../studio';
import { IClip } from '../clips/iclip';
import { ProjectJSON } from '../json-serialization';
export declare class TimelineModel {
    private studio;
    tracks: StudioTrack[];
    clips: IClip[];
    constructor(studio: Studio);
    getTrackById(trackId: string): StudioTrack | undefined;
    getClipById(clipId: string): IClip | undefined;
    findTrackIdByClipId(clipId: string): string | undefined;
    getTrackIndex(trackId: string): number;
    /**
     * Add a new track to the studio
     */
    addTrack(track: {
        name: string;
        type: string;
        id?: string;
    }, index?: number): StudioTrack;
    /**
     * Remove a track and all its clips
     */
    removeTrack(trackId: string): Promise<void>;
    /**
     * Move a track to a new index
     */
    moveTrack(trackId: string, newIndex: number): Promise<void>;
    /**
     * Set the order of tracks by ID
     */
    setTrackOrder(trackIds: string[]): Promise<void>;
    /**
     * Add a Transition clip at the join where the selected clip starts.
     */
    addTransition(transitionKey: string, duration?: number, fromClipId?: string | null, toClipId?: string | null, id?: string): Promise<void>;
    /**
     * Add a clip (or clips) to the studio
     */
    addClip(clipOrClips: IClip | IClip[], options?: {
        trackId?: string;
        audioSource?: string | File | Blob;
    } | string | File | Blob): Promise<void>;
    private normalizeAddClipOptions;
    private prepareClipForTimeline;
    private addClipToTrack;
    private setupClipVisuals;
    private emitAddClipEvents;
    removeClip(clip: IClip, options?: {
        permanent: boolean;
    }): Promise<void>;
    /**
     * Remove multiple clips in a batch
     */
    removeClips(clips: IClip[], options?: {
        permanent: boolean;
    }): Promise<void>;
    removeClipById(clipId: string): Promise<void>;
    updateClip(clipId: string, updates: Partial<IClip>): Promise<void>;
    updateClips(updates: {
        id: string;
        updates: Partial<IClip>;
    }[]): Promise<void>;
    /**
     * Replace all clips with the same source with new clips generated by a factory.
     * Useful for replacing placeholders with actual assets.
     */
    replaceClipsBySource(src: string, newClipFactory: (oldClip: IClip) => Promise<IClip>): Promise<void>;
    private applyClipUpdate;
    private updateTransformer;
    /**
     * Export current project state to JSON
     */
    exportToJSON(): ProjectJSON;
    /**
     * Load clips from JSON
     */
    loadFromJSON(json: ProjectJSON): Promise<void>;
    /**
     * Delete all currently selected clips
     */
    deleteSelected(): Promise<void>;
    /**
     * Duplicate all currently selected clips
     */
    duplicateSelected(): Promise<void>;
    /**
     * Split the selected clip at the given time or current time
     */
    splitSelected(splitTime?: number): Promise<void>;
    /**
     * Trim the selected clip from a specified time
     * @param trimFromSeconds - Number of seconds to trim from the start of the clip
     */
    trimSelected(trimFromSeconds: number): Promise<void>;
    updateSelected(updates: Partial<IClip>): Promise<void>;
    setTracks(tracks: StudioTrack[]): Promise<void>;
    /**
     * Reconciles the tracks list with the available clips.
     * 1. Filters each track's clipIds to only include IDs present in this.clips.
     * 2. Removes any tracks that are then empty.
     * This is used as a safety net to ensure no orphaned empty tracks or dangling references remain.
     */
    reconcileTracks(): void;
    private ensureFontsForClips;
    recalculateMaxDuration(): Promise<void>;
    private setupPlaybackForClip;
    private isPlaybackCapable;
    clear(): Promise<void>;
    /**
     * Remove a time range from the entire timeline and shift subsequent content left.
     * This is a ripple delete operation.
     * @param fromUs Start time in microseconds
     * @param toUs End time in microseconds
     */
    rippleDelete(fromUs: number, toUs: number): Promise<void>;
}
