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; /** * Move a track to a new index */ moveTrack(trackId: string, newIndex: number): Promise; /** * Set the order of tracks by ID */ setTrackOrder(trackIds: string[]): Promise; /** * Add a Transition clip at the join where the selected clip starts. */ addTransition(transitionKey: string, duration?: number, fromClipId?: string | null, toClipId?: string | null): Promise; /** * Add a clip (or clips) to the studio */ addClip(clipOrClips: IClip | IClip[], options?: { trackId?: string; audioSource?: string | File | Blob; } | string | File | Blob): Promise; private normalizeAddClipOptions; private prepareClipForTimeline; private addClipToTrack; private setupClipVisuals; private emitAddClipEvents; removeClip(clip: IClip, options?: { permanent: boolean; }): Promise; /** * Remove multiple clips in a batch */ removeClips(clips: IClip[], options?: { permanent: boolean; }): Promise; removeClipById(clipId: string): Promise; updateClip(clipId: string, updates: Partial): Promise; updateClips(updates: { id: string; updates: Partial; }[]): Promise; /** * 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): Promise; private applyClipUpdate; private updateTransformer; /** * Export current project state to JSON */ exportToJSON(): ProjectJSON; /** * Load clips from JSON */ loadFromJSON(json: ProjectJSON): Promise; /** * Delete all currently selected clips */ deleteSelected(): Promise; /** * Duplicate all currently selected clips */ duplicateSelected(): Promise; /** * Split the selected clip at the given time or current time */ splitSelected(splitTime?: number): Promise; /** * 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; updateSelected(updates: Partial): Promise; setTracks(tracks: StudioTrack[]): Promise; private ensureFontsForClips; recalculateMaxDuration(): Promise; private setupPlaybackForClip; private isPlaybackCapable; clear(): Promise; /** * 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; }