Interface

UseTimelineClipsResult

Result returned by `useTimelineClips`.

Usage notes

The result combines a flattened clip list, selected-clip metadata, geometry helpers, source-time mapping helpers, and safe edit commands. Use it for command bars, inspectors, context menus, and custom clip panels. For live drag affordances, combine it with useTimelineClipDrag and useTimelineClipDropFeedback.

Signature

Type Definition
Interface UseTimelineClipsResult

Type parameters

NameConstraintDefaultDescription
TrackKindNonestringApp-defined track kind values carried by returned track entries, such as `"visual" | "audio"`.

Properties

NameSignatureDescription
canMoveClip(clipId: string): booleanWhether a clip can be moved by headless edit controls.
canSlideClip(clipId: string): booleanWhether a clip can be slid by headless edit controls.
canSlipClip(clipId: string): booleanWhether a clip can be slipped by headless edit controls.
canTrimClip(clipId: string): booleanWhether a clip can be trimmed by headless edit controls.
clipsclips: TimelineClipEntry<TrackKind>[]Flattened timeline clips in track order.
getClip(clipId: string): { clip: Clip; clipIndex: number; track: Track; trackIndex: number } | undefinedReturns a clip lookup from the engine, including containing track and indexes.
getClipAtPoint(input: ClipHitTestInput): ClipHitTestResult | nullHit-tests timeline clips in viewport coordinates.
getClipRect(clipId: string, geometry: TimelineInteractionGeometry = {}): ClipViewportRect | nullReturns the current viewport rectangle for a clip.
getClipSourceRange(clipIdOrClip: string | Clip): ClipSourceRange | undefinedComputes the source-media range covered by a clip.
getClipSyncKey(clipIdOrClip: string | Clip): string | undefinedReturns a stable sync key for timing-affecting clip fields.
selectClip(clipId: string | null): TimelineCommandResultSelects a clip by id, or clears clip selection when passed null.
selectedClipselectedClip: Clip | nullCurrently selected clip, or null when no clip is selected.
selectedClipIdselectedClipId: string | nullID of the currently selected clip, or null when no clip is selected.
selectedClipIdsselectedClipIds: string[]IDs of all selected clips in track order.
selectedClipsselectedClips: Clip[]All selected clips in track order.
selectedClipTrackIdselectedClipTrackId: string | nullID of the track containing the selected clip, or null when no clip is selected.
selectedGroupselectedGroup: TimelineClipGroup | nullSelected group when the primary selected clip belongs to one.
selectedGroupIdselectedGroupId: string | nullSelected group id when the primary selected clip belongs to one.
sourceTimeToTimelineTime(clipIdOrClip: string | Clip, sourceTime: RationalTime): RationalTime | undefinedMaps a source-media timestamp within a clip back to timeline time.
timelineTimeToSourceTime(clipIdOrClip: string | Clip, timelineTime: RationalTime = ...): RationalTime | undefinedMaps a timeline timestamp within a clip to matching source-media time.
updateClip(clipId: string, properties: TimelineClipUpdate): TimelineCommandResultUpdates editable clip presentation fields.