Package

React Timeline Editor Core Engine

UI-agnostic state, editing, snapping, playback, and markers.

Use the core package when your integration needs the timeline model and editing operations without React or canvas rendering concerns.

Installation

pnpm
pnpm add @techsquidtv/canvas-timeline-core

When to use it

You are building a timeline in a non-React environment (e.g., Vue, Svelte, or native platforms) and need to own rendering yourself.
You want a clean, framework-agnostic engine to manage track models, edit history, snapping, and clipboard operations.
You need to write fast, isolated unit tests around timeline business logic without loading browser DOM elements or UI chrome.

Common imports

Engine and state types
import {
TimelineEngine,
type TimelineEditCommand,
type TimelineState,
type Track,
} from '@techsquidtv/canvas-timeline-core';
Typed edit commands
import { fromSeconds } from '@techsquidtv/canvas-timeline-utils';
const preview = engine.previewEdit({
type: 'move',
clipId: 'clip-intro',
startTime: fromSeconds(4),
});
if (preview.valid) {
engine.commitEdit(preview.command);
}
Snapping helpers
import { SnapIndex } from '@techsquidtv/canvas-timeline-core/snapping';

Usage notes

  • Manages the serializable `TimelineState` source of truth, encapsulating tracks, clips, playback cursor, markers, and range selection.
  • Encapsulates typed edit commands (`validateEdit`, `previewEdit`, `commitEdit`, and `cancelEdit`), playback loops, history stacks (undo/redo), and typed snapping logic in a UI-agnostic environment.
  • Ideal for headless testing or custom platform integrations (such as Node.js or alternative rendering engines) due to zero DOM or UI dependencies.

API Surface

Explore the key components, hooks, and classes exported by this package. Click any symbol to view its full TSDoc parameter signatures.

Subpath Imports

Import specific files or modules directly to reduce bundle size or target specialized package layers.

Import PathDescription
@techsquidtv/canvas-timeline-coreTypes, engine, and snapping utilities.
@techsquidtv/canvas-timeline-core/engineTimelineEngine entrypoint.
@techsquidtv/canvas-timeline-core/typesTrack, Clip, Marker, and TimelineState types.
@techsquidtv/canvas-timeline-core/snappingSnapIndex helpers for snapping and lookups.