Installation
pnpm add @techsquidtv/canvas-timeline-utilsnpm install @techsquidtv/canvas-timeline-utilsyarn add @techsquidtv/canvas-timeline-utilsbun add @techsquidtv/canvas-timeline-utilsWhen to use it
Common imports
import { formatTime, fromSeconds, toSeconds,} from '@techsquidtv/canvas-timeline-utils';import { fromSeconds } from '@techsquidtv/canvas-timeline-utils/time';Usage notes
- •Implements pure `RationalTime` arithmetic and conversion functions to eliminate decimal precision drifting and ensure frame-perfect math.
- •Lightweight and decoupled, suitable for usage in backend services, export routines, or external metadata stores that require time semantic compatibility.
- •Provides core utilities like `fromSeconds`, `toSeconds`, and `formatTime` alongside shared math functions such as clamping and rounding.
API Surface
Explore the key components, hooks, and classes exported by this package. Click any symbol to view its full TSDoc parameter signatures.
Key Entry Points
Converts seconds to rational timeline time at the requested tick rate.
Converts a rational timeline time to seconds.
Formats a rational timeline time as mm:ss.
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.
Adds two rational timeline times.
Subpath Imports
Import specific files or modules directly to reduce bundle size or target specialized package layers.
| Import Path | Description |
|---|---|
| @techsquidtv/canvas-timeline-utils | Time and math helper exports. |
| @techsquidtv/canvas-timeline-utils/time | RationalTime conversions and formatting. |
| @techsquidtv/canvas-timeline-utils/math | Shared clamp and rounding helpers. |