API Reference

@techsquidtv/canvas-timeline

packages/timeline/src/index.ts

Common Entry Points

Start with these essential APIs, then check the full reference index below.

API Index

Exhaustive list of all public exports grouped by category.

Hooks

54
useActiveClips

Returns clips that intersect the current playhead time. A clip is active when the playhead is at or after `timelineStart` and before `timelineEnd`. Clips on hidden tracks, muted tracks, and clips marked `disabled` are omitted. The returned array contains clips only; read the timeline state when you also need the containing track id.

useActiveLayers

Returns active timeline layers at a timeline time. The hook is collection-first: each named layer returns every matching active clip in stable track order. `primary` is only a convenience first match.

useActiveMarkers

Subscribes to live marker proximity derived from the current playhead. Use this focused live hook for readouts and marker navigation UI that should update during playback or scrubbing. Use `useTimelineMarkers` for ordinary marker lists and marker editing commands.

useClipEditPreview

Reads the transient edit-preview state for a clip. Use this for custom clip UIs that need to render live editing affordances, such as overwrite cut indicators, without depending on internal engine flags.

usePlaybackEffect

Subscribes to real-time playback events (enter, update, leave) for a specific clip as the global playhead crosses the clip's boundary timestamps.

useRangeScrollbar

Derives geometry and controlled update helpers for a generic range scrollbar.

useTimeline

Reads the timeline engine and synchronized state from React context. Use this hook inside components wrapped by `TimelineProvider` when you need to call imperative engine commands and read the latest React-rendered state in the same component. Prefer narrower hooks such as `useTimelineState`, `useTimelinePlayback`, or `useTimelineClips` when a component only needs one slice of timeline behavior.

useTimelineCanvasLayer

Wires an app-owned canvas to timeline geometry and redraw events. Drawing is imperative and scheduled through requestAnimationFrame so dense visual layers do not push scroll or zoom updates through React state.

useTimelineClipboard

Provides access to clipboard operations for copying, cutting, and pasting clips.

useTimelineClipDrag

Headless clip body drag behavior shared by canvas and custom timeline UIs.

useTimelineClipDropFeedback

Subscribes to live cross-track clip drop feedback. This is a focused live interaction hook intended for custom drag affordances.

useTimelineClipNavigation

Provides constant-DOM keyboard navigation and commands for canvas clips. The hook flattens canvas-rendered clips into a navigable model without mounting one DOM element per clip. Consumers can use the returned `focusTargetProps` on a single focused element, or wire the navigation and edit commands into their own shortcut system and selected-clip inspector.

useTimelineClipRects

Returns viewport-space geometry for every timeline clip. The hook subscribes to geometry-affecting timeline events and intentionally does not subscribe to playhead-only updates.

useTimelineClips

Provides the canonical clip collection and editing actions for React editor UI.

useTimelineEditCommands

Exposes command-layer edit APIs for React product chrome. The hook is a thin adapter over `TimelineEngine` command methods; it does not implement edit math or range mutation rules in React.

useTimelineEditImpacts

Subscribes to live edit impacts produced by active timeline interactions. This is a live interaction hook: it can update during drag and trim gestures. Use it for custom headless UI affordances that show which clips are trimmed, split, or removed by the active edit.

useTimelineEditMode

Owns local edit-mode state for product toolbar chrome. The selected mode does not mutate engine state by itself. Compose it with `useTimelineEditCommands` to build and preview typed edit commands.

useTimelineEditPreview

Subscribes to live command-layer edit previews. This is a focused live hook. It updates when command previews change and does not broaden provider state with drag-time edit consequences.

useTimelineEvent

Subscribes to a typed TimelineEngine event with a React-safe latest handler. The hook keeps the event subscription stable while updating the callback ref every render, avoiding stale closures without resubscribing for handler-only changes.

useTimelineHistory

Provides canonical undo/redo history access for timeline editor chrome.

useTimelineInOutRangeControl

Adapts timeline In/Out points to a Base UI-compatible range slider. The hook keeps loop or export boundaries in sync with `TimelineEngine` `inPoint` and `outPoint` values while returning semantic labels and `aria-valuetext` strings for each thumb. `Timeline.RangeSelector.Root` uses this hook internally; consumers can call it directly when composing their own Base UI slider surface.

useTimelineKeyboard

Provides focus-scoped timeline keyboard shortcuts. The hook never installs global listeners. It handles shortcuts only from the element that spreads `scopeProps` or one of that element's descendants.

useTimelineKeyframeCurveDrag

Headless Bezier curve handle drag behavior shared by package and custom timeline UIs.

useTimelineKeyframeCurves

Reads timeline keyframe curve geometry and exposes Bezier easing commands.

useTimelineKeyframeDrag

Headless keyframe drag behavior shared by canvas and custom timeline UIs.

useTimelineKeyframes

Reads timeline keyframe geometry and exposes canonical keyframe commands.

useTimelineMarkers

Accesses and manages bookmark/annotation pins (markers). This canonical marker hook does not subscribe to live playhead ticks. Compose it with `useActiveMarkers` when UI needs marker proximity at the current playhead.

useTimelineMediaPlayback

Coordinates timeline playback with an external media clock. The hook is media-library agnostic. Apps provide a clock and a single layer sync callback while the hook advances the TimelineEngine playhead and decides when active layer clips need to be resynchronized.

useTimelineMediaSync

High-level synchronization for external media surfaces. The hook remains media-library agnostic: apps provide an adapter for decoding, rendering, and audio scheduling, while the hook handles active layer lookup, first-content seeking, external-clock playback, rate changes, and pause state.

useTimelinePanControl

Adapts horizontal timeline scroll to a Base UI-compatible scalar slider. Use this hook when an application wants a semantic pan control for `TimelineEngine.scrollLeft`. It overlaps with `useTimelineViewport` only at the engine command layer; this hook adds slider props, bounds, and formatted ARIA value text for custom UI primitives.

useTimelinePlayback

Provides canonical transport, playhead command, and in/out range commands. Compose this with `useTimelinePlayheadTime` when a component also needs a live clock readout.

useTimelinePlayheadControl

Adapts the timeline playhead to a Base UI-compatible scalar slider. Use this hook when an application wants its own playhead scrubber, time field, or transport control while preserving the shared `TimelineEngine` state. It composes with `useTimelinePlayback`, which exposes imperative transport commands without subscribing to live playhead ticks.

useTimelinePlayheadTime

Hook to subscribe directly to playhead scrubbing changes. Bypasses root-level context state updates to keep scrubbing high-performance.

useTimelineRangeSelection

Adapts timeline In/Out points to command-layer range selection. The hook treats a complete In/Out pair as the selected edit range and delegates range mutations to `useTimelineEditCommands`.

useTimelineRulerTicks

Returns shared viewport-space ruler ticks for DOM and custom timeline chrome. The hook subscribes to geometry-affecting timeline events and intentionally does not subscribe to playhead-only updates.

useTimelineScrollLeft

Hook to subscribe directly to scroll left position changes. Bypasses root-level context state updates for smooth scroll navigation.

useTimelineScrollTop

Hook to subscribe directly to scroll top position changes. Bypasses root-level context state updates for smooth vertical navigation.

useTimelineSelection

Provides the canonical selected clip/track model for timeline editor chrome.

useTimelineSnapping

Provides the canonical snapping state and commands for editor UI.

useTimelineState

Reads the current synchronized timeline state. This is a render-focused shortcut for components that need track, playhead, zoom, scroll, marker, or playback state without calling engine methods. The returned value updates when `TimelineProvider` receives engine state events.

useTimelineTimePosition

Imperatively positions a low-count DOM affordance at a timeline time. The returned transform is viewport-space: `seconds * zoomScale - scrollLeft`. Use it for standalone affordances such as the playhead grabber. Range controls that already live inside a transformed timeline overlay should use their local control primitive positioning instead.

useTimelineTrack

Accesses one timeline track with canvas-aligned row geometry and commands.

useTimelineTrackDropTargets

Builds headless track drop targets for cross-track clip movement.

useTimelineTrackHeader

Adapts one timeline track into DOM-ready track header state.

useTimelineTrackLockControl

Adapts one timeline track into a semantic lock toggle button.

useTimelineTracks

Accesses and manages the list of timeline tracks.

useTimelineVerticalRangeControl

Adds formatted accessibility values to the vertical timeline scrollbar adapter.

useTimelineVerticalScrollbar

Adapts generic range scrollbar state to the timeline's vertical track viewport. The hook derives a controlled `{ start, end }` value from `scrollTop`, `viewportHeight`, and track-stack bounds. Thumb changes pan the engine-owned vertical scroll position so canvas rows and external DOM chrome can stay in sync. Handle changes scale expanded track heights, giving the range handles a vertical zoom behavior that matches the horizontal viewport scrollbar's shape.

useTimelineViewport

Provides canonical viewport metrics and setters for custom timeline chrome.

useTimelineViewportRangeControl

Adds formatted accessibility values to the timeline viewport range adapter. This hook builds on `useTimelineViewportScrollbar`, preserving the same lean viewport scrollbar geometry and keyboard behavior while adding `aria-valuetext` formatting for the thumb and resize handles. Use it with the generic `RangeScrollbar` primitive when composing a custom viewport control.

useTimelineViewportScrollbar

Adapts generic range scrollbar state to the current timeline viewport. The hook derives a controlled `{ start, end }` value from timeline `scrollLeft`, `zoomScale`, `viewportWidth`, and content duration. Thumb changes pan the engine, while handle changes update zoom and then restore the requested range start.

useTimelineVisibleClips

Returns viewport-intersecting timeline clips with clipped time/source ranges. This is the preferred hook for custom DOM clip renderers and custom canvas layers that only need visible or near-visible clips.

useTimelineZoomControl

Adapts timeline zoom scale to a Base UI-compatible scalar slider. Use this hook when a product toolbar needs a focused, semantic zoom control rather than broad viewport commands from `useTimelineViewport`. The returned root props mutate `TimelineEngine.zoomScale`; thumb props provide the default label and formatted `aria-valuetext`.

useTimelineZoomScale

Hook to subscribe directly to zoom changes. Bypasses root-level context state updates for low-latency zoom interaction.

Interface

217
ActiveClip

Clip that is active at a timeline time, including its mapped source time.

ActiveClipQuery

Filters for selecting active clips at a timeline time.

ActiveLayerOptions

Options for selecting active timeline layers at a timeline time. Use this when integrations need named layers such as `visuals`, `audio`, `subtitles`, or `effects` instead of one flat active-clip list. The same active clip can match more than one layer.

ActiveLayerResult

Active timeline layer lookup result. Results include every active clip matched by the requested selectors plus convenience `primary` entries for apps that only need the first match in each layer. Each `ActiveClip` includes mapped source time and source range data for preview and playback synchronization.

CanvasRendererError

Renderer setup or worker failure details.

CanvasRendererProps

Props for the timeline canvas renderer layer.

CanvasRendererStats

Diagnostic timing details emitted after a canvas renderer draw pass.

Clip

Represents an individual media clip node positioned at a specific timeline interval.

ClipCreatedEvent

Payload emitted by `clip:created` for committed clip creation.

ClipDoubleClickDetails

Details passed to a clip double-click or double-tap callback.

ClipEditPreview

Transient edit-preview state attached to clips while an interaction is active. This state is not intended to be persisted with project data. UI layers can use it to render live editing affordances such as overwrite cut indicators.

ClipHitTestInput

Viewport-space pointer query for timeline clip hit testing.

ClipHitTestResult

Hit-test result for a clip pointer target.

ClipInteractionLayerProps

Props for the delegated clip interaction layer.

ClipKeyframeChangeEvent

Keyframe add/update event payload.

ClipKeyframeRemoveEvent

Keyframe removal event payload.

ClipKeyframeSelectEvent

Keyframe selection change event payload.

ClipMoveEvent

Live clip movement event payload.

ClipPlayheadEvent

Event payload emitted when the playhead enters, updates within, or leaves a clip.

ClipRemovedEvent

Payload emitted by `clip:removed` for committed clip removal.

ClipResizeEvent

Live clip resizing event payload.

ClipSelectEvent

Clip selection change event payload.

ClipSlipEvent

Live clip slip event payload.

ClipSnapOptions

Persistent snap settings for one clip.

ClipSourceRange

Source-media interval covered by a timeline clip.

ClipSplitEvent

Payload emitted by `clip:split` for committed clip split.

ClipViewportRect

Viewport-space rectangle for a clip and its containing track.

EngineEventMap

Central event mapping definition for all engine events.

HistoryChangeEvent

Undo/redo history state change event payload.

InOutChangeEvent

Selection in/out point boundary change event payload.

KeyboardScopeProps

Props for the focus-scoped timeline keyboard shortcut wrapper.

KeyframeCurveHandleDoubleClickDetails

Details passed to a Bezier curve handle double-click or double-tap callback.

KeyframeCurveInteractionLayerProps

Props for the delegated Bezier curve interaction layer.

KeyframeDeleteDetails

Details passed to a keyframe keyboard delete callback.

KeyframeDoubleClickDetails

Details passed to a keyframe double-click or double-tap callback.

KeyframeInteractionLayerProps

Props for the delegated keyframe interaction layer.

Marker

Represents a bookmark or annotation pin on the timeline's top time ruler.

MarkerChangeEvent

Marker change event payload (add, remove, update).

MarkerSnapOptions

Persistent snap settings for one marker.

ParseTimecodeToRationalTimeOptions

Options for parsing editable timecode text into `RationalTime`.

PlaybackOptions

Options for starting timeline playback.

PlayheadAreaProps

Props for the interactive playhead scrub area.

PlayheadGrabberProps

Props for the draggable playhead handle.

RangeChangeDetails

Change metadata emitted by Base UI range slider interactions.

RangeScrollbarAriaValueTextDetails

Context passed to a range scrollbar `aria-valuetext` formatter.

RangeScrollbarHandleProps

Props for a range scrollbar resize handle.

RangeScrollbarRootProps

Props for the controlled range scrollbar root.

RangeScrollbarThumbProps

Props for the draggable range scrollbar thumb.

RangeScrollbarValue

Controlled numeric range represented by a range scrollbar. `start` and `end` use the caller's domain units. For a timeline adapter those units might be seconds; for a chart they might be indexes, prices, or pixels.

RangeScrollbarValueChangeDetails

Details passed with a controlled range scrollbar value change.

RangeSelectorGrabberRenderProps

Render-prop payload for custom range selector grabber children.

RangeSelectorProps

Props for the high-level timeline range selector overlay.

RangeSelectorRootProps

Props for the RangeSelector Root component.

RationalTime

Stores a timeline time as integer ticks at a fixed rate.

SnapTargetOptions

Controls which built-in timeline boundaries are indexed as magnetic snap targets.

SourceFrame

Exact source-frame timestamp returned by a media integration.

SourceFrameResolver

App or media-player supplied exact source-frame resolver.

TimecodeFieldCommitDetails

Details passed when a `TimecodeField` commits a valid value.

TimecodeFieldInputProps

Props for the temporary typed timecode editor.

TimecodeFieldRootProps

Props for the compact inline timecode editing root.

TimecodeFieldTriggerProps

Props for the compact displayed timecode value.

TimecodeFormatOptions

Options for formatting a seconds value into editable timecode text.

TimecodeInputProps

Props for the timecode text input primitive. Extends Base UI `Input` props, so controlled and uncontrolled React input patterns both work. Use `onValueChange` for the current text value as the user types, or `onChange` when composing with native form handlers. By default it renders as a plain text input, disables browser autocomplete, and disables spellcheck so punctuation-heavy values such as `1:02:03.04` stay visually stable. Pass explicit native input props when a form needs different behavior.

TimecodeParseOptions

Options for parsing editable timecode text into seconds.

TimeGrabberRenderProps

Render-prop payload for custom draggable time grabber children.

TimelineCanvasLayerDrawContext

Context passed to a custom canvas layer draw callback.

TimelineCanvasLayerHandle

Imperative handle returned by `useTimelineCanvasLayer`.

TimelineCanvasLayerProps

Props for the package custom canvas layer component.

TimelineCanvasLayerViewport

Viewport metrics supplied to a custom canvas layer draw callback.

TimelineClipDragMoveInput

Pointer data needed to update a clip body drag.

TimelineClipDragStartInput

Pointer data needed to begin a clip body drag.

TimelineClipDropFeedback

Transient feedback for a live cross-track clip drag.

TimelineClipEntry

Flattened clip metadata shared by core geometry APIs, React hooks, and custom renderers.

TimelineClipMoveOptions

Options for moving a clip in time and optionally into another track.

TimelineClipMoveResult

Result metadata for a committed or previewed clip move.

TimelineClipNavigationOptions

Options for constant-DOM canvas clip navigation.

TimelineClipRect

Clip entry with viewport geometry and editing/display state.

TimelineCommandResult

Consistent result returned by React hook command APIs.

TimelineContextValue

Interface representing the context bundle of the timeline provider.

TimelineCubicBezier

Cubic Bezier easing control points used by Bezier keyframe interpolation.

TimelineDeleteRangeEditCommand

Command that removes a timeline range and ripples later clips closed by default.

TimelineEditAffectedRange

Range of timeline content affected by an edit command.

TimelineEditCommitResult

Result returned after committing an edit command.

TimelineEditImpact

Describes how an active timeline edit affects one clip. This state is transient and is intended for headless UI affordances during live editing interactions. It is not part of the persisted project model.

TimelineEditImpacts

Active live edit impacts for the current interaction. The model is operation-based so editing modes share the same headless React surface.

TimelineEditPolicy

App-defined behavioral policy for timeline edit commands.

TimelineEditPolicyContext

Context passed to product-defined edit policy callbacks.

TimelineEditPreview

Shared preview result produced for every edit command.

TimelineEditValidationResult

Result returned by command validation and policy callbacks.

TimelineEventOptions

Options for `useTimelineEvent`.

TimelineInOutRangeControlOptions

Options for adapting timeline In/Out points to a range control.

TimelineInsertEditCommand

Command that inserts a new clip and pushes later clips forward.

TimelineInteractionGeometry

Canvas-aligned geometry settings for clip hit testing and affordance placement.

TimelineKeyBinding

Single keyboard chord mapped to a timeline command.

TimelineKeyboardBindingOptions

Options for creating preset timeline keyboard bindings.

TimelineKeyboardEventLike

Keyboard-event fields used by the pure shortcut matcher.

TimelineKeyboardOptions

Options for `useTimelineKeyboard`.

TimelineKeyframe

One clip-scoped property keyframe positioned at an absolute timeline time.

TimelineKeyframeCurveDragMoveInput

Pointer data needed to update a Bezier curve handle drag.

TimelineKeyframeCurveDragStartInput

Pointer data needed to begin a Bezier curve handle drag.

TimelineKeyframeCurveDragUpdate

Successful Bezier curve handle drag update payload.

TimelineKeyframeCurveEasingUpdateInput

Input for updating one keyframe's Bezier easing.

TimelineKeyframeCurveGeometryOptions

Options for keyframe curve segment and handle geometry.

TimelineKeyframeCurveHandle

Bezier curve handle entry with viewport geometry and edit state.

TimelineKeyframeCurveHandleViewportRect

Viewport-space rectangle for one keyframe curve handle affordance.

TimelineKeyframeCurveHitTestInput

Viewport-space pointer query for keyframe curve handle hit testing.

TimelineKeyframeCurvePoint

Viewport-space point used by keyframe curve segments and handles.

TimelineKeyframeCurveSegment

Keyframe curve segment entry with viewport geometry and optional Bezier handles.

TimelineKeyframeDragMoveInput

Pointer data needed to update a keyframe drag.

TimelineKeyframeDragStartInput

Pointer data needed to begin a keyframe drag.

TimelineKeyframeDragUpdate

Successful keyframe drag update payload.

TimelineKeyframeGeometryOptions

Options for keyframe geometry and hit-testing.

TimelineKeyframeHitTestInput

Viewport-space pointer query for timeline keyframe hit testing.

TimelineKeyframeMutationOptions

Options for committing or previewing keyframe mutations.

TimelineKeyframePointInput

Inputs for mapping a keyframe time/value pair into viewport space.

TimelineKeyframeRect

Keyframe entry with viewport geometry and edit/display state.

TimelineKeyframeViewportRect

Viewport-space rectangle for one keyframe affordance.

TimelineLayerSyncDetails

Details passed to external media sync callbacks.

TimelineLiftRangeEditCommand

Command that removes a timeline range while leaving the gap in place.

TimelineMediaSyncAdapter

Adapter callbacks used to connect timeline playback to an external media clock.

TimelineMoveEditCommand

Command that moves an existing clip.

TimelineNavigableClip

Metadata for one canvas-rendered clip exposed through clip navigation.

TimelineOverwriteEditCommand

Command that places a new clip and removes or trims overlaps on the target track.

TimelinePanControlOptions

Options for adapting horizontal timeline scroll to a scalar control.

TimelinePlaceClipCommand

Clip placement command shared by insert and overwrite edits.

TimelinePlayheadControlOptions

Options for adapting the timeline playhead to a scalar control.

TimelineProviderProps

Props for wiring a TimelineEngine into React context.

TimelineRangeSelection

Timeline range selected for range edit commands.

TimelineRangeValueFormatOptions

Options for formatting a timeline start/end range for assistive technology.

TimelineRendererTheme

Core rendering theme settings used by the Offscreen Canvas Web Worker to draw the timeline grid.

TimelineRenderOptions

Toggles optional canvas feedback overlays that may be paired with separate interactive layers.

TimelineRippleTrimEditCommand

Command that trims one boundary and ripples later clips on the same track.

TimelineRollTrimEditCommand

Command that rolls the shared boundary between two adjacent clips.

TimelineRulerTick

One viewport-space ruler tick for canvas, DOM, or custom rendering.

TimelineRulerTickOptions

Options for building shared headless timeline ruler ticks.

TimelineSelectionState

Selected clip and track state derived from the current timeline snapshot.

TimelineSetClipKeyframeOptions

Input for creating or upserting a clip keyframe.

TimelineSlideEditCommand

Command that moves an existing clip by a relative timeline offset.

TimelineSlipEditCommand

Command that shifts an existing clip's source start without moving timeline bounds.

TimelineSnapFeedback

Transient snap feedback consumed by canvas rendering and focused hooks.

TimelineSnapProviderContext

Context passed to runtime snap target providers.

TimelineSnapResult

Result of resolving a candidate time against the prepared snap index.

TimelineSnapTarget

One timeline time that can attract an edited boundary.

TimelineState

Represents the complete, serialized state model of the high performance timeline.

TimelineTimeValueFormatOptions

Options for formatting a single timeline time value for assistive technology.

TimelineTrackDropContext

Context passed to custom clip track-drop guards.

TimelineTrackDropResult

Result of resolving whether a clip may drop on a track.

TimelineTrackGeometryOptions

Options for building track viewport geometry.

TimelineTrackHeightBatchOptions

Options for batching row-height updates with related viewport state.

TimelineTrackHeightUpdate

Expanded row height update for a timeline track.

TimelineTrackHitTestResult

Hit-test result for a timeline track row.

TimelineTrackRect

Viewport-space rectangle for a timeline track row.

TimelineTrimEditCommand

Command that trims one existing clip boundary.

TimelineUpdateClipKeyframeOptions

Input for updating one existing clip keyframe.

TimelineViewportRangeControlOptions

Options for viewport scrollbar accessibility formatting.

TimelineZoomConstraints

Engine-owned constraints for horizontal timeline zoom.

TimelineZoomControlOptions

Options for adapting timeline zoom to a scalar control.

Track

A horizontal timeline lane containing clips and editing state. Tracks are app-owned rows in the timeline model. The engine uses each track's stable id for editing operations, reads the ordered clip list for rendering and hit testing, and honors view/editing flags such as visible, collapsed, locked, and muted.

TrackChangeEvent

Track change event payload (add, remove).

TrackHeaderListProps

Props for the track header list column.

TrackHeaderProps

Props for one timeline track header row.

TrackHeaderResizeHandleProps

Props for the track header resize handle.

TrackHitTestInput

Viewport-space pointer query for timeline track hit testing.

TrackItemProps

Props for a timeline track row bound to a track id.

TrackLockEvent

Track lock change event payload.

TrackMuteEvent

Track mute change event payload.

TrackResizeEvent

Track resize event payload.

TrackSelectEvent

Track selection change event payload.

TrackSnapOptions

Persistent snap settings for one track and its clips.

TrackVisibilityEvent

Track visibility change event payload.

UseActiveMarkersResult

Result returned by `useActiveMarkers`.

UseRangeScrollbarOptions

Options for deriving generic range scrollbar state and update helpers.

UseRangeScrollbarResult

Generic range scrollbar geometry and mutation helpers.

UseTimelineCanvasLayerOptions

Options for `useTimelineCanvasLayer`.

UseTimelineClipboardResult

Result returned by `useTimelineClipboard`.

UseTimelineClipDragOptions

Options accepted by `useTimelineClipDrag`.

UseTimelineClipDragResult

Result returned by `useTimelineClipDrag`.

UseTimelineClipDropFeedbackResult

Result returned by `useTimelineClipDropFeedback`.

UseTimelineClipsResult

Result returned by `useTimelineClips`.

UseTimelineEditCommandsResult

Result returned by `useTimelineEditCommands`.

UseTimelineEditImpactsResult

Result returned by `useTimelineEditImpacts`.

UseTimelineEditModeResult

Result returned by `useTimelineEditMode`.

UseTimelineEditPreviewResult

Result returned by `useTimelineEditPreview`.

UseTimelineHistoryResult

Result returned by `useTimelineHistory`.

UseTimelineKeyboardResult

Result returned by `useTimelineKeyboard`.

UseTimelineKeyframeCurveDragResult

Result returned by `useTimelineKeyframeCurveDrag`.

UseTimelineKeyframeCurvesOptions

Options accepted by `useTimelineKeyframeCurves`.

UseTimelineKeyframeCurvesResult

Result returned by `useTimelineKeyframeCurves`.

UseTimelineKeyframeDragOptions

Options accepted by `useTimelineKeyframeDrag`.

UseTimelineKeyframeDragResult

Result returned by `useTimelineKeyframeDrag`.

UseTimelineKeyframesOptions

Options accepted by `useTimelineKeyframes`.

UseTimelineKeyframesResult

Result returned by `useTimelineKeyframes`.

UseTimelineMarkersResult

Result returned by `useTimelineMarkers`.

UseTimelineMediaPlaybackOptions

Options for coordinating timeline playback with an external media clock.

UseTimelineMediaPlaybackResult

Result returned by `useTimelineMediaPlayback`.

UseTimelineMediaSyncOptions

Options for high-level timeline media synchronization.

UseTimelineMediaSyncResult

Result returned by `useTimelineMediaSync`.

UseTimelinePlaybackResult

Result returned by `useTimelinePlayback`.

UseTimelineRangeSelectionResult

Result returned by `useTimelineRangeSelection`.

UseTimelineSelectionResult

Result returned by `useTimelineSelection`.

UseTimelineSnappingResult

Result returned by `useTimelineSnapping`.

UseTimelineTimePositionOptions

Options for `useTimelineTimePosition`.

UseTimelineTimePositionResult

Result returned by `useTimelineTimePosition`.

UseTimelineTrackDropTargetsOptions

Options accepted by `useTimelineTrackDropTargets`.

UseTimelineTrackDropTargetsResult

Result returned by `useTimelineTrackDropTargets`.

UseTimelineTrackHeaderResult

Result returned by `useTimelineTrackHeader`.

UseTimelineTrackLockControlResult

Result returned by `useTimelineTrackLockControl`.

UseTimelineTrackResult

Result returned by `useTimelineTrack`.

UseTimelineTracksResult

Result returned by `useTimelineTracks`.

UseTimelineVerticalRangeControlResult

State and formatted accessibility props for a vertical timeline scrollbar.

UseTimelineVerticalScrollbarResult

State and control props for rendering a vertical timeline scrollbar.

UseTimelineViewportResult

Result returned by `useTimelineViewport`.

UseTimelineViewportScrollbarOptions

Options for adapting a generic range scrollbar to the timeline viewport.

UseTimelineViewportScrollbarResult

State and control props for rendering a timeline viewport scrollbar.

ViewportScrollbarRootProps

Props for the timeline viewport scrollbar root.

VisibleTimelineClip

Viewport-intersecting clip entry with clipped timeline and source-media ranges.

VisibleTimelineClipOptions

Options for building viewport-intersecting clip geometry.

Type Alias

75
ActiveLayerSelector

Filters for one named active layer. A layer selector describes the kind of active clips an app wants to drive, such as visual previews, audio playback, subtitles, effects, or a particular source asset. Selectors are matched against the active clips returned for a single timeline time.

CanvasRendererRenderReason

Reason the worker rendered a new canvas timeline frame.

ClipCreatedReason

Reason a committed engine command created a new clip.

ClipHitRegion

Region of a timeline clip hit by pointer interaction.

ClipRemovedReason

Reason a committed engine command removed a clip.

DeepPartial

Makes every nested property in a type optional.

InOutBoundary

Timeline range boundary controlled by an In/Out grabber.

MaybePromise

A value that may be available immediately or after asynchronous media lookup.

PlaybackClockSource

Clock responsible for advancing playback. Internal playback uses the engine's requestAnimationFrame loop. External playback lets a media player or audio clock drive playhead updates.

RangeScrollbarChangeReason

Reason a range scrollbar requested a controlled value change.

RangeScrollbarHandleSide

Side of the range scrollbar thumb controlled by a resize handle.

RangeScrollbarOrientation

Visual and interaction axis used by a range scrollbar.

RangeSelectorGrabberChildren

Custom node or render prop used inside an In/Out range selector grabber.

SnapPreparationOptions

Options for building snap targets before a drag, trim, or range-boundary edit.

SourceFrameResolveMode

Source-frame lookup strategy for media integrations.

TimecodeFieldCommitReason

Reason a `TimecodeField` committed the current draft text.

TimecodeFormat

Display shape used when formatting seconds for editable timecode text. `auto` keeps common decimal clock text unless a frame rate is provided. With a frame rate, `auto` formats frame timecode. `seconds`, `minutes`, and `hours` keep decimal centiseconds. `frames` formats `HH:MM:SS:FF`, and `drop-frame` formats `HH:MM:SS;FF`.

TimecodeFrameRate

Frame rate accepted by frame-based timecode helpers. Pass a number for simple rates such as `24`, `25`, `30`, or `60`. Pass a rational object for exact fractional media rates such as `{ numerator: 30000, denominator: 1001 }`.

TimecodeInputFormat

Display shape used when formatting seconds for a `TimecodeInput`. `auto` keeps common decimal clock text unless a frame rate is provided. With a frame rate, `auto` formats frame timecode. `seconds`, `minutes`, and `hours` keep decimal centiseconds. `frames` formats `HH:MM:SS:FF`, and `drop-frame` formats `HH:MM:SS;FF`.

TimecodeInputFormatOptions

Options for formatting a seconds value into editable `TimecodeInput` text.

TimecodeInputParseOptions

Options for parsing editable `TimecodeInput` text into seconds.

TimecodeInputParseRounding

Rounding policy used when parsing editable `TimecodeInput` text. `none` preserves the decimal precision entered by the user, within normal JavaScript number limits. `centisecond` rounds parsed seconds to two decimal places for legacy or display-like workflows.

TimecodeParseRounding

Rounding policy used when parsing editable timecode text. `none` preserves the decimal precision entered by the user, within normal JavaScript number limits. `centisecond` rounds the parsed seconds to two decimal places for legacy or display-like workflows.

TimeGrabberChildren

Custom node or render prop used inside a draggable time grabber.

TimelineCanvasLayerDraw

Draw callback used by custom canvas layers.

TimelineCanvasLayerRenderReason

Reason a custom canvas layer redraw was requested.

TimelineClipDropFailureReason

Reason a clip cannot currently be dropped on a track.

TimelineClipGeometryOptions

Options for building all clip viewport geometry.

TimelineClipUpdate

Editable presentation fields accepted by `useTimelineClips().updateClip`.

TimelineCommandFailureReason

Machine-readable reason a timeline command could not be applied.

TimelineContentPlaybackStatus

Status emitted by the timeline media playback hook.

TimelineEditCommand

First-class edit command accepted by TimelineEngine edit APIs.

TimelineEditImpactEffect

Consequence of an active edit for an affected clip.

TimelineEditMode

Current tool or intent family selected by product editor chrome.

TimelineEditOperation

Editing operation that can produce live edit impacts.

TimelineEditRejectionReason

Machine-readable reason an edit command cannot be resolved or committed.

TimelineEventHandler

Callback signature for a typed TimelineEngine event subscription.

TimelineKeyboardBindings

Command-to-bindings map accepted by `useTimelineKeyboard`.

TimelineKeyboardCommand

Timeline command names supported by the keyboard scope.

TimelineKeyboardPlatform

Platform bucket used for platform-specific professional editor bindings.

TimelineKeyboardPreset

Named shortcut presets for `useTimelineKeyboard`.

TimelineKeyframeCurveHandleHitTestResult

Hit-test result for a keyframe curve handle pointer target.

TimelineKeyframeCurveHandleKind

Bezier control handle edited by a curve interaction.

TimelineKeyframeHitTestResult

Hit-test result for a timeline keyframe pointer target.

TimelineKeyframeInterpolation

Segment interpolation mode used from one keyframe to the next.

TimelineKeyframeProperty

First-party clip property that can be animated with timeline keyframes.

TimelineMarkerUpdate

Editable marker fields accepted by `useTimelineMarkers().updateMarker`.

TimelineMediaPlayFailureReason

Reason high-level media-synchronized playback could not begin.

TimelineMediaPlayResult

Result returned from a media-synchronized timeline play request. This high-level media adapter result is intentionally richer than `TimelineCommandResult` because failures include user-facing adapter messages in addition to machine-readable reasons.

TimelineMediaSyncReason

Reason an external media callback is being synchronized.

TimelineRendererThemeInput

Partial renderer theme overrides merged with the built-in canvas defaults.

TimelineRulerLabelFormat

Label style used by timeline ruler ticks.

TimelineRulerOptions

Optional ruler behavior for canvas-painted timeline ticks and labels.

TimelineRulerTickKind

Ruler tick visual weight.

TimelineSnapInteractionOperation

Timeline interaction currently preparing or resolving snap targets.

TimelineSnapProvider

Runtime source of app-defined snap targets such as grids, beats, and captions.

TimelineSnapTargetKind

Built-in and application-defined magnetic snap target categories.

TimelineTimePositionEvent

Engine events that should refresh an imperatively positioned timeline element.

TimelineTrackDropGuard

Custom policy for accepting or rejecting track drop targets.

TimelineTrackHeaderRootProps

DOM props returned for a track header row.

TimelineTrackLockControlButtonProps

Props returned for a track lock button.

TimelineVerticalScrollbarRangeProps

Controlled props required by `RangeScrollbar.Root` for vertical timeline scrolling.

TimelineViewportScrollbarRangeProps

Controlled props required by `RangeScrollbar.Root` for a timeline viewport.

TrackHeaderChildren

Render prop accepted by `Timeline.TrackHeader`.

UseTimelineClipRectsOptions

Options accepted by `useTimelineClipRects`.

UseTimelineKeyframeCurveDragOptions

Options accepted by `useTimelineKeyframeCurveDrag`.

UseTimelineRulerTicksOptions

Options accepted by `useTimelineRulerTicks`.

UseTimelineVisibleClipsOptions

Options accepted by `useTimelineVisibleClips`.

VerticalScrollbarHandleProps

Props for a timeline vertical scrollbar resize handle.

VerticalScrollbarRootProps

Props for the timeline vertical scrollbar root.

VerticalScrollbarThumbProps

Props for the timeline vertical scrollbar thumb.

ViewportScrollbarHandleProps

Props for a timeline viewport scrollbar resize handle.

ViewportScrollbarThumbProps

Props for the timeline viewport scrollbar thumb.

VisibleTimelineKeyframe

Viewport-intersecting keyframe entry.

VisibleTimelineKeyframeCurveSegment

Viewport-intersecting keyframe curve segment.

Variable

16
COLOR_PRESETS

List of aesthetic color presets available for custom clip colors.

defaultTimelineCubicBezier

Default ease-in-out curve used when a Bezier keyframe omits easing control points.

defaultTimelineInteractionGeometry

Geometry defaults shared by canvas-aligned interaction layers.

defaultTimelineMaxPixelsPerFrame

Default zoom-in density when a frame rate constrains timeline zoom.

defaultTimelineRendererTheme

Built-in renderer defaults. These values are serializable and safe to send to a Worker.

minimalTimelineKeyboardBindings

Minimal keyboard preset: playback only.

professionalEditorTimelineKeyboardBindings

Professional editor preset bindings that do not depend on frame rate or platform.

RangeScrollbar

Namespace of generic controlled range scrollbar primitives.

RangeScrollbarHandle

Resize handle for moving one side of the visible range.

RangeScrollbarRoot

Root element for a controlled generic range scrollbar.

RangeScrollbarThumb

Draggable thumb representing the visible range within a larger domain.

TimecodeField

Compact timecode field parts. `TimecodeField.Root` owns editing state. `TimecodeField.Trigger` renders the compact displayed value, and `TimecodeField.Input` renders the temporary `TimecodeInput` used for typed edits.

TimecodeInput

Text input for entering timeline positions as timecode. Use `TimecodeInput` when a toolbar, inspector, or properties panel needs a native text input for clip starts, clip ends, playhead positions, or range boundaries. It keeps flexible entry open to the user (`90`, `1:30.25`, `1:02:03.4567`, and `00:01:30:12` can all represent timeline positions) while the companion helpers parse precise input and format display text consistently. This component renders only the input. Pair it with `parseTimecodeInput` to validate the current text, pass `invalid` when parsing returns `null`, and convert valid seconds back to `RationalTime` with `fromSeconds(parsed, rate)` at your timeline boundary. The rendered input receives `data-slot="timecode-input"` and a `timecode-input` class before consumer classes, which keeps it compatible with shadcn-style slot selectors and Canvas Timeline's semantic stylesheet approach. It forwards refs to the underlying native input element.

Timeline

Namespace of timeline UI components for composing an editor surface.

TimelineCanvasLayer

App-owned canvas layer for drawing custom dense timeline visuals.

TimelineContext

React context containing the global engine controller and its reactive state model.

Function

46
addRational

Adds two rational timeline times.

assertValidRationalTime

Asserts that a value is a finite rational timeline time.

CanvasRenderer

Renders the timeline canvas layer using an offscreen worker.

clamp

Restricts a number to an inclusive minimum and maximum range.

compareRational

Compares two rational timeline times.

createLeanMarkers

Creates a sanitized marker array for timeline state and history snapshots.

createTimelineKeyboardBindings

Creates the built-in keyboard binding map for a preset.

createTimelineRendererTheme

Creates a complete renderer theme from optional nested overrides.

deriveTimelineSelection

Derives selected clip and track metadata from timeline tracks.

flattenTimelineClips

Flattens timeline tracks into stable clip entries.

formatRationalTimecode

Formats a `RationalTime` as editable timecode text.

formatSeconds

Formats a rational timeline time as decimal seconds.

formatTime

Formats a rational timeline time as mm:ss.

formatTimecode

Formats seconds for flexible editable timecode text. Decimal formats are rounded to centiseconds and clamped at zero. Non-finite values are treated as zero. Frame formats round to the nearest frame for the supplied frame rate.

formatTimecodeInput

Formats seconds for editable `TimecodeInput` text. Decimal formats are rounded to centiseconds and clamped at zero. Frame formats round to the nearest frame for the supplied frame rate. Use this at UI boundaries after converting from `RationalTime` with `toSeconds`.

formatTimelineRangeValue

Formats a start/end timeline range for assistive technology.

formatTimelineTimeValue

Formats a timeline time for assistive technology. The result intentionally avoids timecode punctuation and raw floating point artifacts so controls can use it as `aria-valuetext`.

fromSeconds

Converts seconds to rational timeline time at the requested tick rate.

fromTimecodeFrameNumber

Converts a zero-based frame number to rational timeline time.

getClipAccessibleDescription

Returns a richer clip description without requiring one DOM node per clip.

getClipAccessibleName

Returns a concise clip name suitable for labels or active-item summaries.

getPresetColor

Generates a random color value from the predefined list of aesthetic presets. Used when creating new clips, markers, or dynamic color selections.

getTimelineCubicBezierProgress

Evaluates a Cubic Bezier easing curve at normalized time progress.

getTimelineKeyboardCommand

Resolves a keyboard event to the first matching command in stable command order.

getTimelineKeyframeBezierControlPoints

Returns viewport-space cubic Bezier control points between two keyframe points.

getTimelineKeyframeInterpolationProgress

Evaluates normalized segment progress for a keyframe interpolation mode.

getTimelineKeyframeValuePoint

Maps one keyframe value to the same viewport point used by canvas drawing and DOM handles.

getTimelineRulerTicks

Builds shared viewport-space ruler ticks for canvas, DOM, and custom renderers.

maxRational

Returns the later of two rational timeline times.

minRational

Returns the earlier of two rational timeline times.

normalizeTimelineCubicBezier

Validates and clamps Cubic Bezier control points to the timeline interpolation domain.

normalizeTimelineKeyframeInterpolation

Normalizes a keyframe interpolation mode. Unknown or omitted values are treated as linear.

parseTimecode

Parses flexible editable timecode text into seconds. Accepts plain seconds, decimal seconds, `m:ss`, `m:ss.cc`, `h:mm:ss`, `h:mm:ss.cc`, flexible single-digit colon segments such as `1:2`, and unit suffixes like `s` (seconds), `ms` (milliseconds), `m` (minutes), or `f` (frames, which requires a `frameRate` option). Invalid, negative, missing, or out-of-range user text returns `null`. Invalid developer options such as unsupported drop-frame rates throw `RangeError`.

parseTimecodeInput

Parses editable `TimecodeInput` text into seconds. Accepts plain seconds, decimal seconds, `m:ss`, `m:ss.cc`, `h:mm:ss`, `h:mm:ss.cc`, flexible single-digit colon segments such as `1:2`, and unit suffixes like `s` (seconds), `ms` (milliseconds), `m` (minutes), or `f` (frames, which requires a `frameRate` option). Invalid, negative, missing, or out-of-range user text returns `null`. Invalid developer options such as unsupported drop-frame rates throw `RangeError`.

parseTimecodeToRationalTime

Parses editable timecode text into `RationalTime`.

rationalEquals

Checks whether two rational timeline times represent the same moment.

resolveTimecodeFrameRate

Resolves a frame-rate option to frames per second. This uses the same validation and normalization path as the timecode formatter/parser helpers, so invalid rates throw the same `RangeError`.

resolveTimelineRendererThemeFromElement

Resolves shadcn/CSS custom properties into a serializable renderer theme. CSS is read on the main thread only. The returned object can be passed through postMessage to the worker without the worker touching DOM APIs.

round

Rounds a number to the requested number of decimal places.

shiftClipKeyframes

Shifts all keyframes on a clip by a timeline delta.

subRational

Subtracts one rational timeline time from another.

timelineCommandFail

Creates a failed timeline command result.

timelineCommandOk

Creates a successful timeline command result.

TimelineProvider

Sets up a bridge between the central event-driven `TimelineEngine` model and standard React functional layouts. Subscribes to settled state, selection, playback, content, and clipboard changes, pushing lightweight state updates downwards into hooks.

toSeconds

Converts a rational timeline time to seconds.

toTimecodeFrameNumber

Converts a rational time to the nearest source frame number.