Skip to content

API reference

@video-ultra/core

The engine without React: the project format, every edit as a function, export and devices.

npm install @video-ultra/core

Functions

addAsset

function

Registers an imported media file.

function addAsset(project: Project, asset: Asset): void;

addCaptions

function

Adds captions to the caption row (made on first use, on top of everything). replace clears the row first (new auto captions or an imported file) — only the captions touching range when it's given (a part heard again). Captions are snapped to frames and never overlap; new ones take the row's current look (or preset for a new row). Returns the row's id.

function addCaptions(project: Project, captions: readonly CaptionInput[], ids: IdFactory, options?: {
  replace?: boolean;
  preset?: CaptionPreset;
  range?: {
    start: Time;
    end: Time;
  };
}): string;

addMarker

function

Adds a marker at time (snapped to a frame, inside the video). Returns its id.

function addMarker(project: Project, time: Time, ids: IdFactory, label?: string): string;

addToLane

function

Adds an item to a lane (text, stickers, picture-in-picture, audio) at item.start.

function addToLane(project: Project, item: Item, ids: IdFactory, trackId?: string): void;

Every track list in the project: its own, then each combined clip's.

function allTrackLists(project: Project): Track[][];

Checks and applies actions (from a model: unknown values) to project in order. Throws an EditError naming the first bad action — run it inside one editor edit so nothing is applied then (the whole set is one undo step otherwise). Returns the number applied.

function applyEditActions(project: Project, actions: unknown[], ids: IdFactory): number;

Adds a template at at (usually the playhead): its elements as lane items, filled with values, grouped when there are several. Returns the new ids (empty when every text was left empty).

function applyTemplate(project: Project, template: TemplatePreset, values: Readonly<Record<string, string>>, at: Time, ids: IdFactory): string[];

arrangeItem

function

Moves an element up or down the stack of what is on screen at t (Bring forward / Send backward / Bring to front / Send to back). Stacking follows lane order (later lanes draw on top), so the element's lane moves — or, when the lane holds other items too, the element moves to a new lane at that place and the others stay where they are. The main video is always at the back. Throws when there is nowhere to go.

function arrangeItem(project: Project, itemId: string, to: ArrangeTo, t: Time, ids: IdFactory): void;

assetInUse

function

Whether any item (on the timeline or inside a combined clip) uses the asset.

function assetInUse(project: Project, assetId: string): boolean;

bezierAt

function

A cubic Bézier curve's y at x (Newton steps on x(t), then bisection as a fallback).

function bezierAt(curve: Readonly<Bezier>, x: number): number;

captionTrack

function

The project's caption row, if it has one.

function captionTrack(project: Project): Track | null;

captionWords

function

The words of text as the screen shows them.

function captionWords(text: string): string[];

Each shown word's start / end relative to the caption's start (flicks).

function captionWordTimes(item: Pick<TextItem, 'text' | 'duration' | 'words'>): CaptionWord[];

Rules every project must satisfy after any edit. The edit operations keep them; the property tests prove it with random edit sequences. Returns a list of violations (empty = valid).

function checkInvariants(project: Project): string[];

Removes every keyframe of prop (or of all properties): the property keeps the value it has at bakeAt (flicks from the item's start) as its plain value.

function clearKeyframes(project: Project, itemId: string, prop?: KeyframeProp, bakeAt?: Time): void;

combineItems

function

Combines items into one clip (a video item playing a new compound asset). Main-track clips must sit next to each other: the combined clip takes their place on the main track (the transition into the first one comes along); the selected layers inside their span go into it. Only layers: the combined clip goes on a layer at the first one's start. Captions stay out. Returns the combined clip's id.

function combineItems(project: Project, itemIds: readonly string[], ids: IdFactory, name?: string): string;

Whether combined clip assetId contains itself (directly or through another one).

function compoundCycle(project: Project, assetId: string): boolean;

Length of a combined clip's content (its last item's end), at least one frame.

function compoundLength(project: Project, tracks: readonly Track[]): Time;

What to send the model when the editor rejected its answer (error from applyEditActions), to get a corrected one for the same instruction.

function correctionRequest(instruction: string, error: string): string;

createEditor

function

Creates an editor around project.

function createEditor(project: Project, options?: EditorOptions): Editor;

A new, empty project with one (empty) main track.

function createProject(options?: CreateProjectOptions): Project;

curveAt

function

A keyframe curve's progress at 0…1.

function curveAt(ease: Ease | Readonly<Bezier> | undefined, p: number): number;

deleteItem

function

Deletes an item. The main track closes the gap; empty lanes disappear.

function deleteItem(project: Project, itemId: string): void;

deleteLut

function

Deletes a LUT look: every item using it (combined clips' insides too) goes back to no LUT, and the look leaves the project. Returns how many items used it. Undo brings both back (the file stays in storage).

function deleteLut(project: Project, assetId: string): number;

A compact, model-friendly description of project (ids, kinds, times in seconds, texts).

function describeProject(project: Project): ProjectDescription;

Detects what the current browser and device support and suggests a DeviceTier. Runs in the browser only; takes a few milliseconds (codec checks are async).

function detectCapabilities(): Promise<Capabilities>;

Duplicates an item right after itself. Returns the new id. A locked item can be duplicated; the copy is unlocked and outside any group.

function duplicateItem(project: Project, itemId: string, ids: IdFactory): string;

The audio bitrate (bits/s) for each quality: AAC / Opus stereo.

function exportAudioBitrate(quality: ExportOptions['quality']): number;

The video bitrate (bits/s) an export uses: set from the picture size, frame rate and quality, so the same choice gives about the same file size in every browser (encoders' own "quality" presets differed up to 4×). The export dialog's size estimate uses the same numbers.

function exportBitrate(width: number, height: number, fps: number, quality: ExportOptions['quality'], codec?: keyof typeof CODEC_FACTOR): number;

exportLimits

function

Asks the browser's encoders which export resolutions work here (capped by maxExportHeight for the tier; checked as 16:9 at 30 fps). Plain WebCodecs checks, safe on the main thread; takes a few milliseconds.

function exportLimits(tier: DeviceTier): Promise<ExportLimits>;

exportSize

function

Output size: the shorter side = shortSide, the longer one keeps the project's aspect ratio.

function exportSize(projectW: number, projectH: number, shortSide: number): {
  width: number;
  height: number;
};

text with {variable}s filled from values (falling back to the template's examples).

function fillTemplateText(text: string, template: Pick<TemplatePreset, 'variables'>, values?: Readonly<Record<string, string>>): string;

The preset with this id in this slot, or undefined.

function findAnimationPreset(slot: AnimationSlot, id: string): AnimationPreset | undefined;

findItem

function

Finds an item and the track holding it.

function findItem(project: Project, itemId: string): {
  track: Track;
  item: Item;
  index: number;
} | null;

The preset for a stored transition type, including ids from before the library (slide-left → Push, left). Undefined for unknown ids (they play as a dissolve).

function findTransitionPreset(type: string): TransitionPreset | undefined;

formatSrt

function

Cues as a SubRip (.srt) file.

function formatSrt(cues: readonly SubtitleCue[]): string;

formatTime

function

m:ss.cc for display, e.g. 1:04.25. Hours appear only when needed.

function formatTime(time: Time): string;

formatVtt

function

Cues as a WebVTT (.vtt) file.

function formatVtt(cues: readonly SubtitleCue[]): string;

fps

function

Frames per second as a float (for display and encoder settings only).

function fps(rate: FrameRate): number;

Length of one frame in flicks. Exact for every rate in FRAME_RATES.

function frameDuration(rate: FrameRate): Time;

frameIndex

function

Index of the frame that contains time (frames start at 0).

function frameIndex(time: Time, rate: FrameRate): number;

freezeFrame

function

Inserts a still frame of a main-track video at at, lasting duration (default 3 s). Returns the freeze item's id.

function freezeFrame(project: Project, itemId: string, at: Time, ids: IdFactory, duration?: Time): string;

Microseconds (WebCodecs timestamps) → flicks.

function fromMicroseconds(us: number): Time;

fromSeconds

function

Seconds → flicks (rounded to the nearest flick).

function fromSeconds(seconds: number): Time;

Groups words (seconds, from the start of the sound) into captions, placed at offset on the timeline. Words keep their own times; a caption runs from its first word's start to its last word's end (at least 0.4 s).

function groupCaptions(words: readonly TranscriptWord[], offset?: Time, options?: GroupOptions): GroupedCaption[];

groupItems

function

Groups lane items (two or more) so they select, move and scale together. Members of other groups join the new one. Locked items can join (they still don't move). Returns the group id.

function groupItems(project: Project, itemIds: readonly string[], ids: IdFactory): string;

groupOf

function

The ids an item moves and selects with: every member of its group, or just the item itself when it isn't grouped.

function groupOf(project: Project, itemId: string): string[];

hasKeyframes

function

True when any property has keyframes.

function hasKeyframes(keyframes: Readonly<Keyframes> | undefined): boolean;

insertMain

function

Adds a video / photo / freeze item to the main track at index (default: the end).

function insertMain(project: Project, item: Item, index?: number): void;

itemEnd

function

End of an item on the timeline.

function itemEnd(item: Item): Time;

The transform at t (flicks from the item's start) into out (reused — no allocation): keyframed properties sampled, the rest from base. Opacity is kept in 0…1, scale above 0.

function keyedTransform(base: Readonly<Transform>, keyframes: Readonly<Keyframes> | undefined, t: Time, out: Transform): Transform;

keyedValue

function

The value of one keyed property at t (flicks from the item's start), or null if not keyed.

function keyedValue(keyframes: Readonly<Keyframes> | undefined, prop: KeyframeProp, t: Time): number | null;

keyTime

function

A keyframe's time as the item sees it (flicks from its start).

function keyTime(keyframes: Readonly<Keyframes>, k: Readonly<Keyframe>): Time;

A caption row's look from a preset.

function lookFromPreset(preset: CaptionPreset): CaptionLook;

mainTrack

function

The single main track.

function mainTrack(project: Project): Track;

Marks a caption as checked: the "check this" mark goes.

function markCaptionChecked(project: Project, itemId: string): void;

Highest export resolution (shorter side) for a device tier.

function maxExportHeight(tier: DeviceTier): ExportHeight;

Joins a caption with the next one on its row (text, time and words).

function mergeCaptionWithNext(project: Project, itemId: string): void;

moveItem

function

Moves a lane item in time (and optionally to another lane of the same kind).

function moveItem(project: Project, itemId: string, start: Time, ids: IdFactory, trackId?: string): void;

Moves a lane item to a brand-new lane inserted at track position atIndex (1 = right under the main track), starting at start. Returns the new track's id. The timeline uses it when a clip is dropped between lanes or where it would overlap.

function moveItemToNewLane(project: Project, itemId: string, start: Time, ids: IdFactory, atIndex: number): string;

moveKeyframe

function

Moves a keyframe of prop from from to to (and to value, when given).

function moveKeyframe(project: Project, itemId: string, prop: KeyframeProp, from: Time, to: Time, value?: number): void;

Puts a picture from an overlay lane into the main sequence at position toIndex (the clips after it move later). Stickers can't join the main track.

function moveLaneToMain(project: Project, itemId: string, toIndex: number): void;

Lifts a main-track clip onto a brand-new overlay lane at track position atIndex, starting at start: the clip becomes a layer over the video, and the main track closes the gap. A clip still at full-frame size shrinks to LAYER_SCALE so it shows as an element (and its own animation, filter and so on visibly apply to it alone). Returns the new lane's id.

function moveMainToLane(project: Project, itemId: string, start: Time, ids: IdFactory, atIndex: number): string;

parseProject

function

Opens a project from untrusted JSON (a saved file, the host's database, a crash-recovery snapshot): migrates old versions, validates the shape, and repairs broken timing so a damaged file still opens. Never throws.

function parseProject(input: unknown, ids?: IdFactory): ParseResult;

Reads SRT or VTT text into cues (in time order; empty and broken cues are skipped).

function parseSubtitles(text: string): SubtitleCue[];

pasteItems

function

Pastes copied items at at (usually the playhead), keeping their timing relative to each other. Copies get new ids; groups stay groups (as new groups). Clips copied from the main video go back into it, after the clip under at; everything else goes to a lane. Media the project doesn't have yet (copied from another project) is added from assets. Returns the new ids, in the order given.

function pasteItems(project: Project, copied: readonly CopiedItem[], assets: Readonly<Record<string, Asset>>, at: Time, ids: IdFactory): string[];

pitchRatio

function

How much the pitch-shifter raises the pitch: the semitones asked for and, with keepPitch, the inverse of the speed (clamped to 0.5×…2×, where a shifter still sounds natural).

function pitchRatio(fx: AudioFx | undefined, speed: number): number;

presetFits

function

True when a project of width × height already has the preset's frame shape (within 1%).

function presetFits(preset: ExportPreset, width: number, height: number): boolean;

Total length of the project: the end of the last item on any track.

function projectDuration(project: Project): Time;

projectFrame

function

One frame of the project's frame rate, in flicks.

function projectFrame(project: Project): Time;

randomId

function

Random 12-character base-36 ids (≈ 62 bits).

const randomId: IdFactory;

After the inside of combined clip assetId changed: its length and sound follow the content, and clips that play it are shortened if they now read past its end.

function refreshCompound(project: Project, assetId: string): void;

relinkAsset

function

Points an asset at a new copy of its file (the person picked it again because the old one was moved, deleted or cleared from the device). Items keep their times; only where the bytes live and their size change.

function relinkAsset(project: Project, assetId: string, source: Asset['source'], size: number): void;

removeAsset

function

Removes a media file that no item uses any more.

function removeAsset(project: Project, assetId: string): void;

Removes the keyframe of prop at t (if there is one).

function removeKeyframe(project: Project, itemId: string, prop: KeyframeProp, t: Time): void;

removeMarker

function

Removes a marker.

function removeMarker(project: Project, markerId: string): void;

renameAsset

function

Renames an asset (a LUT look, a media file): trimmed, at most 200 characters. An empty name keeps the old one.

function renameAsset(project: Project, assetId: string, name: string): void;

Renames the project.

function renameProject(project: Project, name: string): void;

reorderMain

function

Moves a main-track item to a new position in the sequence.

function reorderMain(project: Project, itemId: string, toIndex: number): void;

Fixes timing problems in place: drops items whose media is gone, re-packs the main track, moves overlapping lane items to new lanes, removes empty lanes. Returns what it changed.

function repairProject(project: Project, ids?: IdFactory): string[];

replayLog

function

Rebuilds a project from a snapshot plus the log entries written after it (crash recovery). Entries with seq ≤ snapshotSeq are skipped.

function replayLog(snapshot: Project, snapshotSeq: number, entries: readonly LogEntry[]): Project;

The part of a duration-long timeline an export covers: range clamped to the timeline, or all of it. Returns null when the range is empty after clamping.

function resolveExportRange(range: ExportRange | undefined | null, duration: Time): ExportRange | null;

Keyframes for a part of the item that starts offset later in its old timing (split, trim from the start): the same keyframes, shifted, so the part plays its share of the motion exactly — even inside a curve.

function retimeKeyframes(keyframes: Readonly<Keyframes>, offset: Time): Keyframes;

rollEdit

function

Roll edit: moves the cut between an item and the one right after it (touching, same track) by delta — one gets longer, the other shorter by the same amount, so nothing else moves. Clamped to the media both have and to one frame each. Returns the applied delta.

function rollEdit(project: Project, itemId: string, delta: Time): Time;

The value of keyframes at t (flicks from the item's start). list is in time order.

function sampleKeyframes(list: readonly Keyframe[], t: Time): number;

separateItem

function

Puts a combined clip's pieces back on the timeline where it plays them (its trim and speed applied to them; its own look, size and sound settings don't carry over). Pieces get new ids, so another clip playing the same combined clip keeps it. Returns the new items' ids.

function separateItem(project: Project, itemId: string, ids: IdFactory): string[];

Deterministic ids for tests: id1, id2, …

function sequentialIds(prefix?: string): IdFactory;

setAnimation

function

Sets (or clears, with null) one animation of a lane item — text, sticker or picture-in-picture video / photo: its entrance (in), exit (out) or repeating loop. Entrance and exit lengths are snapped to frames and clamped to the item (the slot being set wins: the other one is shortened so they never overlap); loop speed is clamped to 0.25–4. Unknown preset ids are stored as given (they play as nothing).

function setAnimation<S extends 'in' | 'out' | 'loop'>(project: Project, itemId: string, slot: S, value: (S extends 'loop' ? AnimationLoop : AnimationClip) | null): void;

Sets what shows behind the main track (colour or blurred video).

function setBackground(project: Project, background: Background): void;

Changes the canvas size (aspect ratio). Item positions are relative, so layouts follow.

function setCanvasSize(project: Project, width: number, height: number): void;

Restyles all captions (they share one look).

function setCaptionLook(project: Project, patch: CaptionLookPatch): void;

Changes one caption's text; its word times stay when the words still line up.

function setCaptionText(project: Project, itemId: string, text: string): void;

Sets (or clears, with null) the part of the timeline to export — the in / out points. Times are rounded to whole flicks; the range must not be empty. It isn't clamped to the video's length here (edits may shorten the video later); exports clamp it.

function setExportRange(project: Project, range: {
  start: Time;
  end: Time;
} | null): void;

setItemFlags

function

Locks (can be selected, not moved or edited) or hides (not drawn) an item. Works on locked items — it's how they are unlocked.

function setItemFlags(project: Project, itemId: string, flags: {
  locked?: boolean;
  hidden?: boolean;
}): void;

setKeyframe

function

Sets a keyframe of prop at t (flicks from the item's start, snapped to a frame and kept inside the item): replaces one there, else adds one. The first keyframe of a property makes it follow its keyframes instead of the transform.

function setKeyframe(project: Project, itemId: string, prop: KeyframeProp, t: Time, value: number, ease?: Ease | Bezier): void;

Sets the curve from the keyframe of prop at t to the next (null: the default).

function setKeyframeEase(project: Project, itemId: string, prop: KeyframeProp, t: Time, ease: Ease | Bezier | null): void;

setSpeed

function

Changes playback speed; the item gets shorter or longer on the timeline.

function setSpeed(project: Project, itemId: string, speed: number, ids: IdFactory): void;

Mutes, hides or locks a track.

function setTrackFlags(project: Project, trackId: string, flags: Partial<Pick<Track, 'muted' | 'hidden' | 'locked'>>): void;

Sets an item's transform as it should look at timeline time at (the playhead): keyframed properties get a keyframe there (added, or changed to the new value); the others change for the whole item, as without keyframes. What stage drags, sliders and align use.

function setTransformAt(project: Project, itemId: string, transform: Readonly<Transform>, at: Time): void;

Sets (or clears, with null) the transition into an item from the one before it: on the main track, or on a layer where the two pictures touch.

function setTransition(project: Project, itemId: string, transition: Transition | null): void;

How much of a point shows (0…1) for a mask: x, y in the picture's box (−1…1, y down), the box's width / height, edge the anti-aliasing width in shape units, feather 0…1.

function shapeCoverage(p: Readonly<ShapePreset>, qx: number, qy: number, boxAspect: number, edge: number, feather: number, invert: boolean): number;

Signed distance from the shape's edge at (x, y) — negative inside. Coordinates: the shape's own space (y down), where proportional shapes fit the unit circle and stretched shapes fill ±aspect × ±1. Same maths as the shader.

function shapeDistance(p: Readonly<ShapePreset>, x: number, y: number, aspect?: number): number;

shapePreset

function

The shape preset with this id, or undefined.

function shapePreset(id: string): ShapePreset | undefined;

shiftItems

function

Moves several lane items in time by the same amount — a group, or a selection dragged together. Clamped so none starts before 0. Each keeps its lane when it fits there (the moved items never block each other); one that would overlap a neighbour moves to a free lane of its kind. Returns the applied shift.

function shiftItems(project: Project, itemIds: readonly string[], delta: Time, ids: IdFactory): Time;

slideItem

function

Slide: moves a main-video clip by delta between its neighbours — the one before gets longer (or shorter), the one after shorter (or longer); the clip itself and the video's length don't change. Returns the applied delta.

function slideItem(project: Project, itemId: string, delta: Time): Time;

slipItem

function

Slip: shows a different part of a video or sound in the same place — the clip keeps its spot and length, the media slides under it by delta (flicks of timeline time; > 0 shows later media). Returns the applied delta.

function slipItem(project: Project, itemId: string, delta: Time): Time;

snapToFrame

function

Rounds time to the nearest frame boundary.

function snapToFrame(time: Time, rate: FrameRate): Time;

sourceSpan

function

Media items read a span of their source: [sourceIn, sourceIn + duration × speed).

function sourceSpan(item: Extract<Item, {
  speed: number;
}>): Time;

speechAt

function
function speechAt(times: readonly CaptionWord[], local: Time, out?: SpeechPosition): SpeechPosition;

splitItem

function

Splits an item in two at at. Returns the id of the second part.

function splitItem(project: Project, itemId: string, at: Time, ids: IdFactory): string;

splitItemAt

function

Splits an item at every time in times (timeline flicks; e.g. scene cuts) in one edit. Times outside the item or within a frame of its ends or of each other are skipped. Returns the ids of the item's parts in order (the first is itemId).

function splitItemAt(project: Project, itemId: string, times: readonly Time[], ids: IdFactory): string[];

The template with this id, or undefined.

function templatePreset(id: string): TemplatePreset | undefined;

Flicks → microseconds (WebCodecs timestamps), rounded.

function toMicroseconds(time: Time): number;

toSeconds

function

Flicks → seconds.

function toSeconds(time: Time): number;

transformAt

function

An item's transform at timeline time at (keyframes sampled; a new object).

function transformAt(item: Item, at: Time): Transform | null;

trimItem

function

Moves an edge of an item by delta (positive = later on the timeline), clamped to what the media and neighbours allow. Dragging the start edge left reveals earlier media. On the main track the following items ripple; on lanes neighbours act as walls.

function trimItem(project: Project, itemId: string, edge: 'start' | 'end', delta: Time): void;

ungroupItems

function

Ungroups: the members become separate elements again (they stay where they are).

function ungroupItems(project: Project, groupId: string): void;

updateItem

function

Changes look/sound properties of an item (transform, filter, volume, text, …).

function updateItem(project: Project, itemId: string, patch: ItemPatch): void;

updateMarker

function

Changes a marker's time or label (an empty label removes it).

function updateMarker(project: Project, markerId: string, patch: {
  time?: Time;
  label?: string;
}): void;

Classes

An edit that couldn't be applied. The project is unchanged.

class EditError extends Error {
  readonly code: EditErrorCode;
  constructor(code: EditErrorCode, message: string);
}

Constants

ADJUST_KEYS

constant

The adjustment sliders (keys of item.adjust), in display order.

const ADJUST_KEYS: readonly AdjustKey[];

AdjustSchema

constant

Each value −1…1; 0 = unchanged. Missing = 0.

const AdjustSchema: z.ZodMiniObject<{
  brightness: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  contrast: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  saturation: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  warmth: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  tint: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  highlights: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  shadows: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  sharpen: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  vignette: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
}, z.core.$strip>;

Animation groups with their labels, in display order (AnimationPreset.category).

const ANIMATION_CATEGORIES: readonly {
  readonly id: string;
  readonly label: string;
}[];

Animations of lane items (text, stickers, picture-in-picture): entrances, then exits (each the mirror of an entrance), then loops, each in display order.

const ANIMATION_PRESETS: readonly AnimationPreset[];

One entrance or exit animation of a lane item: a preset id and how long it plays.

const AnimationClipSchema: z.ZodMiniObject<{
  type: z.ZodMiniString<string>;
  duration: z.ZodMiniInt;
}, z.core.$strip>;

A repeating animation of a lane item, from its start to its end.

const AnimationLoopSchema: z.ZodMiniObject<{
  type: z.ZodMiniString<string>;
  speed: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
}, z.core.$strip>;

AssetSchema

constant
const AssetSchema: z.ZodMiniObject<…>;

Ready-made sound looks (each sets the whole effect; sliders fine-tune it).

const AUDIO_FX_PRESETS: readonly {
  id: string;
  fx: AudioFx;
}[];

Sound effects on a clip's audio (file version 4+, v0.4). Every field optional; missing = off.

const AudioFxSchema: z.ZodMiniObject<{
  eq: z.ZodMiniOptional<z.ZodMiniObject<{
    low: z.ZodMiniNumber<number>;
    mid: z.ZodMiniNumber<number>;
    high: z.ZodMiniNumber<number>;
  }, z.core.$strip>>;
  compress: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  pitch: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  keepPitch: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
  denoise: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
}, z.core.$strip>;
const AudioItemSchema: z.ZodMiniObject<{
  kind: z.ZodMiniLiteral<"audio">;
  assetId: z.ZodMiniString<string>;
  sourceIn: z.ZodMiniInt;
  speed: z.ZodMiniNumber<number>;
  volume: z.ZodMiniNumber<number>;
  muted: z.ZodMiniBoolean<boolean>;
  fadeIn: z.ZodMiniInt;
  fadeOut: z.ZodMiniInt;
  duck: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  audioFx: z.ZodMiniOptional<z.ZodMiniObject<{
    eq: z.ZodMiniOptional<z.ZodMiniObject<{
      low: z.ZodMiniNumber<number>;
      mid: z.ZodMiniNumber<number>;
      high: z.ZodMiniNumber<number>;
    }, z.core.$strip>>;
    compress: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
    pitch: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
    keepPitch: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
    denoise: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  }, z.core.$strip>>;
  id: z.ZodMiniString<string>;
  start: z.ZodMiniInt;
  duration: z.ZodMiniInt;
  name: z.ZodMiniOptional<z.ZodMiniString<string>>;
  locked: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
  hidden: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
  groupId: z.ZodMiniOptional<z.ZodMiniString<string>>;
}, z.core.$strip>;
const BackgroundSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
  type: z.ZodMiniLiteral<"color">;
  color: z.ZodMiniString<string>;
}, z.core.$strip>, z.ZodMiniObject<{
  type: z.ZodMiniLiteral<"blur">;
  amount: z.ZodMiniNumber<number>;
}, z.core.$strip>], "type">;

BezierSchema

constant

A cubic Bézier timing curve [x1, y1, x2, y2] (CSS cubic-bezier; x in 0…1).

const BezierSchema: z.ZodMiniTuple<readonly [z.ZodMiniNumber<number>, z.ZodMiniNumber<number>, z.ZodMiniNumber<number>, z.ZodMiniNumber<number>], null>;

How a layer mixes with the pictures under it (file version 3+, optional; missing = normal). Lane items only — the main video is the bottom of the stack.

const BlendModeSchema: z.ZodMiniEnum<{
  normal: "normal";
  multiply: "multiply";
  screen: "screen";
  overlay: "overlay";
  "soft-light": "soft-light";
  add: "add";
  lighten: "lighten";
  darken: "darken";
  difference: "difference";
}>;

How a caption row looks beyond each caption's own text style (file version 3+): the style preset it came from, and the word highlight (karaoke) as words are spoken.

const CaptionLookSchema: z.ZodMiniObject<{
  preset: z.ZodMiniString<string>;
  highlight: z.ZodMiniEnum<{
    type: "type";
    fill: "fill";
    none: "none";
    word: "word";
    box: "box";
    reveal: "reveal";
  }>;
  highlightColor: z.ZodMiniString<string>;
}, z.core.$strip>;

One spoken word of a caption: its text and when it's said, relative to the caption's start.

const CaptionWordSchema: z.ZodMiniObject<{
  text: z.ZodMiniString<string>;
  start: z.ZodMiniInt;
  end: z.ZodMiniInt;
}, z.core.$strip>;

Green screen (file version 3+, optional): pixels close to color become transparent. Values 0…1: tolerance widens the range of removed colours, softness feathers the edge, spill takes the key colour's tint off what remains (green fringes on hair).

const ChromaKeySchema: z.ZodMiniObject<{
  color: z.ZodMiniString<string>;
  tolerance: z.ZodMiniNumber<number>;
  softness: z.ZodMiniNumber<number>;
  spill: z.ZodMiniNumber<number>;
}, z.core.$strip>;

CropSchema

constant
const CropSchema: z.ZodMiniObject<{
  left: z.ZodMiniNumber<number>;
  top: z.ZodMiniNumber<number>;
  right: z.ZodMiniNumber<number>;
  bottom: z.ZodMiniNumber<number>;
}, z.core.$strip>;

CutoutSchema

constant

A picture with its background removed (file version 4+): the engine draws this image asset (same size, transparent background) instead of the item's own. The original stays, so restoring the background is removing this.

const CutoutSchema: z.ZodMiniObject<{
  assetId: z.ZodMiniString<string>;
}, z.core.$strip>;

Which way a transition (or a directional animation) moves.

const DirectionSchema: z.ZodMiniEnum<{
  left: "left";
  right: "right";
  up: "up";
  down: "down";
}>;

EaseSchema

constant

Timing curve of a transition: smooth (default), linear, snappy or bounce.

const EaseSchema: z.ZodMiniEnum<{
  linear: "linear";
  smooth: "smooth";
  "ease-in": "ease-in";
  "ease-out": "ease-out";
  snappy: "snappy";
  expo: "expo";
  back: "back";
  anticipate: "anticipate";
  bounce: "bounce";
  elastic: "elastic";
  ball: "ball";
  "slow-mo": "slow-mo";
  steps: "steps";
}>;

For the model's instructions: what each action does.

const EDIT_ACTIONS_GUIDE = "You edit a video project for the person. Answer with JSON only:\n{\"reply\": \"<for the person>\", \"actions\": [<actions>]}.\n\"reply\" is one short sentence about what you did; when the person asks about the project (e.g. \"list\nthe media\", \"how long is it\"), answer fully in \"reply\" instead, one entry per line, using names\npeople see, never ids.\nTimes are seconds on the timeline. Use only item ids from the project description.\nWhen the person names a file, match it to \"name\" in the tracks' items (on the timeline) or in\n\"media\" (the media library); a file not on the timeline must be added before it can be edited.\n\"This\", \"it\" and \"the selected one\" mean the items in \"selection\". Change only what the person asked\nfor: touch every item only when they ask for all of them.\nActions:\n- {\"action\":\"split\",\"itemId\",\"at\"} cut a clip in two at a timeline time inside it\n- {\"action\":\"trim\",\"itemId\",\"from\"?,\"to\"?} keep only from\u2026to seconds of the clip itself (0 = its start)\n- {\"action\":\"delete\",\"itemIds\":[\u2026]}\n- {\"action\":\"move\",\"itemId\",\"start\"} text, stickers, sounds, picture-in-picture only\n- {\"action\":\"speed\",\"itemId\",\"speed\"} 0.1\u201310 (video, sound)\n- {\"action\":\"sound\",\"itemId\",\"volume\"?(0\u20132),\"muted\"?,\"fadeIn\"?,\"fadeOut\"?,\"preset\"?(catalog.soundPresets)}\n- {\"action\":\"filter\",\"itemId\",\"filter\"(catalog.filters or null),\"intensity\"?(0\u20131)}\n- {\"action\":\"adjust\",\"itemId\",\"brightness\"?,\"contrast\"?,\"saturation\"?,\"warmth\"?} each \u22121\u20261\n- {\"action\":\"transition\",\"itemId\",\"transition\"(catalog.transitions or null),\"duration\"?} into a main-video clip from the one before\n- {\"action\":\"addText\",\"ref\"?,\"text\",\"start\",\"duration\"?,\"position\"?(\"top\"|\"center\"|\"bottom\"),\"color\"?(#rrggbb),\"size\"?(\"small\"|\"medium\"|\"large\")}\n- {\"action\":\"editText\",\"itemId\",\"text\"?,\"color\"?,\"size\"?}\n- {\"action\":\"animate\",\"itemId\",\"in\"?(catalog.animationsIn or null),\"out\"?(catalog.animationsOut or null)} text, stickers and layers only, never main-video clips\n- {\"action\":\"place\",\"itemId\",\"x\"?,\"y\"?,\"scale\"?,\"rotation\"?,\"opacity\"?} position (centre; x 0 = left \u2026 1 = right, y 0 = top \u2026 1 = bottom), size (1 = as added), turn in degrees clockwise, see-through (0\u20131). Diagonal across the video from bottom-left to top-right: rotation \u221245 (top-left to bottom-right: 45), centred (x 0.5, y 0.5) and bigger (scale about 2) so it spans the frame\n- {\"action\":\"canvas\",\"ratio\"(\"9:16\"|\"16:9\"|\"1:1\"|\"4:5\"|\"4:3\"|\"21:9\")}\n- {\"action\":\"marker\",\"time\",\"label\"?}\n- {\"action\":\"rename\",\"name\"} rename the video\n- {\"action\":\"addMedia\",\"mediaId\",\"ref\"?,\"start\"?,\"asLayer\"?} put a \"media\" file on the timeline: a sound on a sound lane at start; a video / photo into the main video before the clip at start (at the end without start), or on a layer at start with asLayer:true\nTo edit something you add in the same answer, give it a \"ref\" (e.g. \"new1\") and use that as the\nitemId in the actions after it.\nTo make main-video clips flow (\"smoother\", \"more polished\"), use transitions between them.\nIf the request is unclear or impossible, return no actions and ask or explain in \"reply\".";

The actions a model may ask for. Times are seconds on the timeline unless said otherwise.

const EditActionSchema: z.ZodMiniDiscriminatedUnion<…>;

EQ_BANDS

constant

The equaliser's band frequencies (Hz).

const EQ_BANDS: {
  readonly low: 120;
  readonly mid: 1000;
  readonly high: 8000;
};

All export heights, smallest first.

const EXPORT_HEIGHTS: readonly ExportHeight[];

Ready-made export settings: vertical 9:16, widescreen 16:9 and square 1:1, all 1080p MP4. A preset doesn't reshape the picture: when the project's frame shape differs, the editor offers to change the canvas (an undoable edit) and otherwise exports the project's own shape.

const EXPORT_PRESETS: readonly ExportPreset[];

Filter groups with their labels, in display order.

const FILTER_CATEGORIES: readonly {
  readonly id: FilterCategory;
  readonly label: string;
}[];

Colour filters for video, photo and freeze clips, in display order (grouped by category; the first 16 ids shipped in v0.1). "No filter" is not in the list: it is item.filter = null.

const FILTER_PRESETS: readonly FilterPreset[];

FilterSchema

constant
const FilterSchema: z.ZodMiniObject<{
  id: z.ZodMiniString<string>;
  intensity: z.ZodMiniNumber<number>;
}, z.core.$strip>;

FONT_PRESETS

constant

Text styles, in display order. Only system and generic font stacks, so text looks right offline and costs no downloads; each platform shows its closest installed face.

const FONT_PRESETS: readonly FontPreset[];

FRAME_RATES

constant

Common frame rates.

const FRAME_RATES: {
  readonly fps23976: {
    readonly num: 24000;
    readonly den: 1001;
  };
  readonly fps24: {
    readonly num: 24;
    readonly den: 1;
  };
  readonly fps25: {
    readonly num: 25;
    readonly den: 1;
  };
  readonly fps2997: {
    readonly num: 30000;
    readonly den: 1001;
  };
  readonly fps30: {
    readonly num: 30;
    readonly den: 1;
  };
  readonly fps50: {
    readonly num: 50;
    readonly den: 1;
  };
  readonly fps5994: {
    readonly num: 60000;
    readonly den: 1001;
  };
  readonly fps60: {
    readonly num: 60;
    readonly den: 1;
  };
};
const FrameRateSchema: z.ZodMiniObject<{
  num: z.ZodMiniInt;
  den: z.ZodMiniInt;
}, z.core.$strip>;

A still frame taken from a video at sourceTime.

const FreezeItemSchema: z.ZodMiniObject<…>;

Entrance (in), exit (out) and repeating (loop) animations of a lane item (text, sticker, picture-in-picture video / photo). Played from the item's own time, in preview and export.

const ItemAnimationSchema: z.ZodMiniObject<{
  in: z.ZodMiniOptional<z.ZodMiniObject<{
    type: z.ZodMiniString<string>;
    duration: z.ZodMiniInt;
  }, z.core.$strip>>;
  out: z.ZodMiniOptional<z.ZodMiniObject<{
    type: z.ZodMiniString<string>;
    duration: z.ZodMiniInt;
  }, z.core.$strip>>;
  loop: z.ZodMiniOptional<z.ZodMiniObject<{
    type: z.ZodMiniString<string>;
    speed: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
  }, z.core.$strip>>;
}, z.core.$strip>;

ItemSchema

constant
const ItemSchema: z.ZodMiniDiscriminatedUnion<…>;

Properties that take keyframes (the transform's).

const KEYFRAME_PROPS: readonly ["x", "y", "scale", "rotation", "opacity"];
const KeyframeSchema: z.ZodMiniObject<{
  t: z.ZodMiniInt;
  v: z.ZodMiniNumber<number>;
  ease: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniEnum<{
    linear: "linear";
    smooth: "smooth";
    "ease-in": "ease-in";
    "ease-out": "ease-out";
    snappy: "snappy";
    expo: "expo";
    back: "back";
    anticipate: "anticipate";
    bounce: "bounce";
    elastic: "elastic";
    ball: "ball";
    "slow-mo": "slow-mo";
    steps: "steps";
  }>, z.ZodMiniTuple<readonly [z.ZodMiniNumber<number>, z.ZodMiniNumber<number>, z.ZodMiniNumber<number>, z.ZodMiniNumber<number>], null>]>>;
}, z.core.$strip>;

LAYER_SCALE

constant

Size a full-frame clip takes when it becomes a layer, so it reads as an element over the video.

const LAYER_SCALE = 0.6;

LutRefSchema

constant

A 3D LUT look (file version 3+, optional): a .cube file stored as a lut asset, applied after the filter and adjustments, mixed in by intensity.

const LutRefSchema: z.ZodMiniObject<{
  assetId: z.ZodMiniString<string>;
  intensity: z.ZodMiniNumber<number>;
}, z.core.$strip>;

MarkerSchema

constant

A named point on the timeline (file version 4+): the editor shows it on the ruler.

const MarkerSchema: z.ZodMiniObject<{
  id: z.ZodMiniString<string>;
  time: z.ZodMiniInt;
  label: z.ZodMiniOptional<z.ZodMiniString<string>>;
}, z.core.$strip>;

NO_CROP

constant
const NO_CROP: Readonly<Crop>;

The project file format. Plain JSON, validated on load, versioned with migrations (see migrate.ts). Everything an edit changes lives here — media files are never modified.

Conventions:

  • Times are integer flicks (see time.ts).
  • Positions are fractions of the canvas (0…1, centre = 0.5) and scale is relative to the size that fits the item inside the canvas, so changing the aspect ratio keeps layouts sensible.
const PROJECT_VERSION = 6;

A blurred or pixelated area (file version 3+): hides what is under it (faces, number plates) for its time on a picture layer. The box is width × height (fractions of the canvas width and height) at transform.scale 1, centred at transform.x / y and turned by transform.rotation; transform.opacity fades the effect.

const RegionItemSchema: z.ZodMiniObject<…>;

Picker groups, in order.

const SHAPE_CATEGORIES: readonly ["basic", "polygons", "stars", "flowers", "organic", "symbols"];

Every mask shape, in picker order (117).

const SHAPE_PRESETS: readonly ShapePreset[];

ShapeFamily

constant

Shape families (the shader's shape.x).

const ShapeFamily: {
  readonly none: 0;
  readonly polygon: 1;
  readonly star: 2;
  readonly roundedBox: 3;
  readonly ellipse: 4;
  readonly heart: 5;
  readonly cross: 6;
  readonly ring: 7;
  readonly flower: 8;
  readonly squircle: 9;
  readonly crescent: 10;
  readonly arrow: 11;
  readonly cog: 12;
  readonly blob: 13;
  readonly bubble: 14;
  readonly cloud: 15;
};

A shape mask (file version 4+, optional): the picture shows only inside the shape (or only outside it, invert). The shape fits the picture's box (effects/shapes.ts).

const ShapeMaskSchema: z.ZodMiniObject<{
  shape: z.ZodMiniString<string>;
  feather: z.ZodMiniNumber<number>;
  invert: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
}, z.core.$strip>;

Common emoji for the sticker panel (stored as sticker.emoji). Drawn with the system's font.

const STICKER_EMOJI: readonly string[];

Template groups, in picker order.

const TEMPLATE_CATEGORIES: readonly ["intro", "lower-third", "quote", "social", "sale", "list", "event", "vlog", "outro"];

Every template: each layout in each theme (27 × 6 = 162).

const TEMPLATE_PRESETS: readonly TemplatePreset[];

The looks every layout comes in.

const TEMPLATE_THEMES: readonly Theme[];

Text look. Units (engine/text.ts): font size = size × canvas height × transform.scale; letterSpacing in em; lineHeight, outline.width, background.padding and background.radius × font size; shadow blur / x / y in px at a 1080-px-tall canvas.

const TextStyleSchema: z.ZodMiniObject<{
  fontFamily: z.ZodMiniString<string>;
  fontWeight: z.ZodMiniInt;
  italic: z.ZodMiniBoolean<boolean>;
  size: z.ZodMiniNumber<number>;
  color: z.ZodMiniString<string>;
  align: z.ZodMiniEnum<{
    left: "left";
    right: "right";
    center: "center";
  }>;
  lineHeight: z.ZodMiniNumber<number>;
  letterSpacing: z.ZodMiniNumber<number>;
  outline: z.ZodMiniNullable<z.ZodMiniObject<{
    color: z.ZodMiniString<string>;
    width: z.ZodMiniNumber<number>;
  }, z.core.$strip>>;
  shadow: z.ZodMiniNullable<z.ZodMiniObject<{
    color: z.ZodMiniString<string>;
    blur: z.ZodMiniNumber<number>;
    x: z.ZodMiniNumber<number>;
    y: z.ZodMiniNumber<number>;
  }, z.core.$strip>>;
  background: z.ZodMiniNullable<z.ZodMiniObject<{
    color: z.ZodMiniString<string>;
    padding: z.ZodMiniNumber<number>;
    radius: z.ZodMiniNumber<number>;
  }, z.core.$strip>>;
}, z.core.$strip>;

TrackSchema

constant
const TrackSchema: z.ZodMiniObject<…>;
const TransformSchema: z.ZodMiniObject<{
  x: z.ZodMiniNumber<number>;
  y: z.ZodMiniNumber<number>;
  scale: z.ZodMiniNumber<number>;
  rotation: z.ZodMiniNumber<number>;
  opacity: z.ZodMiniNumber<number>;
  flipX: z.ZodMiniBoolean<boolean>;
  flipY: z.ZodMiniBoolean<boolean>;
}, z.core.$strip>;

Transition groups with their labels, in display order.

const TRANSITION_CATEGORIES: readonly {
  readonly id: TransitionCategory;
  readonly label: string;
}[];

Transitions between main-track clips, in display order (grouped by category). Each plays over a window centred on the cut (half before, half after).

const TRANSITION_PRESETS: readonly TransitionPreset[];
const TransitionSchema: z.ZodMiniObject<{
  type: z.ZodMiniString<string>;
  duration: z.ZodMiniInt;
  direction: z.ZodMiniOptional<z.ZodMiniEnum<{
    left: "left";
    right: "right";
    up: "up";
    down: "down";
  }>>;
  ease: z.ZodMiniOptional<z.ZodMiniEnum<{
    linear: "linear";
    smooth: "smooth";
    "ease-in": "ease-in";
    "ease-out": "ease-out";
    snappy: "snappy";
    expo: "expo";
    back: "back";
    anticipate: "anticipate";
    bounce: "bounce";
    elastic: "elastic";
    ball: "ball";
    "slow-mo": "slow-mo";
    steps: "steps";
  }>>;
}, z.core.$strip>;

UNSURE_BELOW

constant

Captions whose words average a confidence under this are marked to check.

const UNSURE_BELOW = 0.6;

VERSION

constant
const VERSION = "0.0.0";

Types

Adjust

type
type Adjust = z.infer<typeof AdjustSchema>;

One adjustment slider. Every value is −1…1 and 0 means unchanged.

interface AdjustKey {
  readonly key: keyof Adjust;
  readonly label: string;
}

An entrance or exit animation (animation.in / animation.out).

type AnimationClip = z.infer<typeof AnimationClipSchema>;

A repeating animation (animation.loop).

type AnimationLoop = z.infer<typeof AnimationLoopSchema>;

An animation the user can pick, for one slot.

interface AnimationPreset {
  /** Unique across all slots; stored in `item.animation[slot].type`. */
  readonly id: string;
  readonly label: string;
  readonly slot: AnimationSlot;
  /** Group for the UI (see {@link ANIMATION_CATEGORIES}). */
  readonly category: string;
  /** Only for text items (typewriter, word by word); elsewhere they play as a fade. */
  readonly textOnly?: boolean;
  /** Suggested length in seconds (entrances and exits). */
  readonly defaultDuration?: number;
}

Which part of an item's life an animation plays in.

type AnimationSlot = 'in' | 'out' | 'loop';
interface ApplyOptions {
  /**
   * Consecutive edits with the same key within `coalesceMs` merge into one undo step
   * (a slider dragged for two seconds = one undo).
   */
  coalesceKey?: string;
  coalesceMs?: number;
}

Where arrangeItem moves an element in the stack.

type ArrangeTo = 'forward' | 'backward' | 'front' | 'back';

Asset

type

An imported media file.

type Asset = z.infer<typeof AssetSchema>;

Sound-only export formats: AAC in .m4a, Opus in .ogg, or uncompressed 16-bit .wav.

type AudioExportFormat = 'm4a' | 'ogg' | 'wav';

What to export when exporting only the sound (the same mix as a video export).

interface AudioExportOptions {
  format: AudioExportFormat;
  /** Sets the bitrate of AAC / Opus (96 / 128 / 192 kb/s); WAV is always lossless. */
  quality: ExportOptions['quality'];
  /** Export only this part of the timeline; omitted = the whole video. */
  range?: ExportRange;
}

A finished sound-only export (48 kHz stereo).

interface AudioExportResult {
  /** The sound file (OPFS-backed like video exports, or in memory as a fallback). */
  blob: Blob;
  mimeType: string;
  extension: AudioExportFormat;
  /** `aac`, `opus` or `pcm-s16`. */
  codec: string;
  sampleRate: number;
  channels: number;
  durationSeconds: number;
  storage: 'opfs' | 'memory';
  /** Wall time of the export, seconds. */
  elapsedSeconds: number;
  warnings: string[];
}
type AudioFx = z.infer<typeof AudioFxSchema>;
type AudioItem = z.infer<typeof AudioItemSchema>;
type Background = z.infer<typeof BackgroundSchema>;
interface BackgroundRemovalRequest {
  /** The picture (any format the browser decodes). */
  image: Blob;
  signal: AbortSignal;
  onProgress?: (progress: {
    stage: 'download' | 'work';
    fraction: number;
  }) => void;
}

Makes a picture's background transparent. Implement it to use your own service.

interface BackgroundRemover {
  /** The picture with its background removed: a PNG with transparency, the same size. */
  remove(request: BackgroundRemovalRequest): Promise<Blob>;
  check?(): Promise<BackgroundRemoverCheck>;
  /** Frees its model / worker (optional). */
  dispose?(): void;
}

Whether and how background removal can run here.

interface BackgroundRemoverCheck {
  available: boolean;
  /** True when it runs on the device (nothing is uploaded). */
  onDevice: boolean;
  /** One-time download in MB (first use only), if any. */
  downloadMB?: number;
  reason?: string;
}

Bezier

type

A custom timing curve [x1, y1, x2, y2].

type Bezier = z.infer<typeof BezierSchema>;

How a layer mixes with what's under it.

type BlendMode = z.infer<typeof BlendModeSchema>;

What the current browser and device can do. Produced by detectCapabilities.

interface Capabilities {
  /** `navigator.gpu` exists and an adapter could be requested. */
  webgpu: boolean;
  /** A WebGL2 context can be created. */
  webgl2: boolean;
  /** `VideoDecoder`, `VideoEncoder`, `AudioDecoder` and `AudioEncoder` exist. */
  webcodecs: {
    video: boolean;
    audio: boolean;
  };
  /** `OffscreenCanvas` exists and can be transferred to a worker. */
  offscreenCanvas: boolean;
  /** Origin Private File System is available. */
  opfs: boolean;
  /** File System Access API (`showOpenFilePicker`) is available — Chromium desktop only. */
  fileSystemAccess: boolean;
  /** Video codecs the device can decode at 1080p. */
  decode: {
    avc: boolean;
    hevc: boolean;
    vp9: boolean;
    av1: boolean;
  };
  /** Codecs the device can encode. */
  encode: {
    avc1080: boolean;
    avc4k: boolean;
    vp9: boolean;
    aac: boolean;
    opus: boolean;
  };
  /** Approximate RAM in GB (`navigator.deviceMemory`), or `null` when the browser hides it. */
  deviceMemoryGb: number | null;
  /** Logical CPU cores. */
  cores: number;
  /** Phone or tablet. */
  mobile: boolean;
  /** GPU description, when the browser exposes it. */
  gpu: string | null;
  /** Suggested performance tier. */
  tier: DeviceTier;
  /** Everything needed to edit video is present. */
  supported: boolean;
}

A caption to add: when it shows, its text, and (optionally) its words' times within it.

interface CaptionInput {
  start: Time;
  end: Time;
  text: string;
  words?: CaptionWord[];
  /** The speech was hard to hear: marked to check. */
  unsure?: boolean;
}

A caption row's look: preset and word highlight.

type CaptionLook = z.infer<typeof CaptionLookSchema>;

A change to every caption's look at once.

interface CaptionLookPatch {
  /** Apply a preset (text style, place and highlight). */
  preset?: CaptionPreset;
  highlight?: CaptionLook['highlight'];
  highlightColor?: string;
  style?: Partial<TextStyle>;
  /** Where captions sit (centre, fractions of the canvas) and their size. */
  x?: number;
  y?: number;
  scale?: number;
}

Caption style presets (v0.2 A3): a text style, where captions sit, and how the word being said is highlighted. Our own designs; fonts are the editor's font presets (system fonts).

interface CaptionPreset {
  id: string;
  label: string;
  style: TextStyle;
  /** Vertical centre as a fraction of the canvas (0.82 ≈ lower third). */
  y: number;
  highlight: CaptionLook['highlight'];
  highlightColor: string;
}

One spoken word of a caption (times relative to the caption's start).

type CaptionWord = z.infer<typeof CaptionWordSchema>;

Green-screen settings of a picture.

type ChromaKey = z.infer<typeof ChromaKeySchema>;

A copied item and whether it was a clip of the main video (see pasteItems).

interface CopiedItem {
  item: Item;
  fromMain: boolean;
}

Options for createProject.

interface CreateProjectOptions {
  name?: string;
  /** Canvas size in pixels. Default 1080 × 1920 (9:16, phone video). */
  width?: number;
  height?: number;
  frameRate?: FrameRate;
  ids?: IdFactory;
  /** ISO timestamp; defaults to now. */
  now?: string;
}

Crop

type
type Crop = z.infer<typeof CropSchema>;

Cutout

type

A picture with its background removed.

type Cutout = z.infer<typeof CutoutSchema>;

Performance tier of the current device. Sets preview resolution, export limits and cache sizes.

type DeviceTier = 'high' | 'mid' | 'low';

Which way a transition moves.

type Direction = z.infer<typeof DirectionSchema>;

Ease

type

A transition's timing curve.

type Ease = z.infer<typeof EaseSchema>;

Context passed to every edit recipe.

interface EditContext {
  ids: IdFactory;
}

Why an edit was refused.

type EditErrorCode = 'not-found' | 'locked' | 'invalid';

Turns an instruction into edit actions — implement it with your own model endpoint (keys stay on your server). @video-ultra/ai has createChatAssistant for OpenAI-compatible endpoints.

interface EditingAssistant {
  edit(request: EditingRequest): Promise<EditingResponse>;
}

What an EditingAssistant gets.

interface EditingRequest {
  /** What the person asked, in their words. */
  instruction: string;
  /** {@link describeProject} of the project now. */
  project: ProjectDescription;
  /** Ids of the selected items (the person may say "this clip"). */
  selection: string[];
  /** Playhead, seconds ("here"). */
  playhead: number;
  /** Earlier turns of this conversation (oldest first). */
  history: {
    instruction: string;
    reply: string;
  }[];
  signal: AbortSignal;
}

What an EditingAssistant answers.

interface EditingResponse {
  /** A short sentence for the person (what was done, or a question back). */
  reply: string;
  /** Edits to apply (may be empty: a question or "can't do that"). */
  actions: unknown[];
}

Editor

type

The editor's state container: project + undo/redo + operation log.

interface Editor {
  readonly store: StoreApi<EditorState>;
  getProject(): Project;
  /**
   * Runs an edit. `recipe` mutates a draft (use the functions from `ops.ts`). If it throws, the
   * project is unchanged and the error is re-thrown. Returns the recipe's return value.
   */
  apply<R>(label: string, recipe: (draft: Project, ctx: EditContext) => R, options?: ApplyOptions): R;
  undo(): boolean;
  redo(): boolean;
  /** The history as a list, for showing it. */
  history(): HistoryView;
  /**
   * Undoes or redoes until `position` steps are applied (see {@link HistoryView}). Each step is
   * logged as its own undo / redo. Returns false if `position` is out of range.
   */
  goTo(position: number): boolean;
  /** Replaces the project (e.g. opening another one); clears history. */
  load(project: Project): void;
  /** Called after every commit, undo and redo — persist the entry for autosave/crash recovery. */
  onCommit(listener: (entry: LogEntry, project: Project) => void): () => void;
}
interface EditorOptions {
  ids?: IdFactory;
  /** Max undo steps kept in memory. Default 300. */
  historyLimit?: number;
  /** Clock for coalescing (tests). */
  now?: () => number;
}

State of the editor store. Subscribe with selectors to re-render only what changed.

interface EditorState {
  project: Project;
  canUndo: boolean;
  canRedo: boolean;
  /** Label of the edit that undo would revert. */
  undoLabel: string | null;
  redoLabel: string | null;
}

Output resolutions offered, named by the output's shorter side in pixels.

type ExportHeight = 480 | 720 | 1080 | 1440 | 2160;

What this device can export. From exportLimits.

interface ExportLimits {
  /** Heights (shorter side) both allowed for the tier and accepted by an encoder, per format. */
  mp4: ExportHeight[];
  webm: ExportHeight[];
  /** AAC (MP4 sound) needs a downloaded encoder here (about 280 KB, loaded only when exporting). */
  aacFallback: boolean;
  /** Opus (WebM sound) can be encoded. Without it a WebM export has no sound. */
  opus: boolean;
  /** Heights HEVC (H.265, in MP4) and AV1 (MP4 / WebM) can be encoded at, if any (v0.4). */
  hevc: ExportHeight[];
  av1: ExportHeight[];
}

What to export.

interface ExportOptions {
  /** `mp4` = H.264 + AAC (plays everywhere); `webm` = VP9 (or VP8) + Opus. */
  format: 'mp4' | 'webm';
  /**
   * The output's **shorter side** in pixels (720 = 720 × 1280 for a 9:16 project, 1280 × 720 for
   * 16:9). The longer side follows the project's aspect ratio, rounded to even pixels.
   */
  height: ExportHeight;
  fps: 24 | 30 | 60;
  quality: 'low' | 'medium' | 'high';
  /**
   * The video codec (v0.4): `auto` (default — H.264 for MP4, VP9 / VP8 for WebM), or a newer one
   * for a smaller file where this device can encode it ({@link ExportLimits}): `hevc` (H.265,
   * MP4) or `av1` (MP4 or WebM); `h264` / `vp9` ask for the default one by name.
   */
  videoCodec?: ExportVideoCodec;
  /**
   * Export only this part of the timeline (flicks, `start` inclusive, `end` exclusive). Omitted:
   * the whole video. Clamped to the video's length; transitions, animations and sound at the
   * edges are exactly what plays at those times.
   */
  range?: ExportRange;
}

A ready-made export setting for a common destination.

interface ExportPreset {
  /** Stable id: `vertical`, `widescreen` or `square`. */
  id: 'vertical' | 'widescreen' | 'square';
  /** The frame shape it is made for (`9:16`, `16:9`, `1:1`) as a canvas size. */
  aspect: {
    width: number;
    height: number;
  };
  /** Shorter side in pixels. */
  height: ExportHeight;
  /** Frame rate; `null` keeps the project's own (24, 30 or 60). */
  fps: ExportOptions['fps'] | null;
  format: ExportOptions['format'];
  quality: ExportOptions['quality'];
}

Export progress, reported about 4 times a second.

interface ExportProgress {
  /** 0…1 */
  fraction: number;
  framesDone: number;
  framesTotal: number;
  /** Estimated seconds left, once a few frames have been measured. */
  etaSeconds: number | null;
}

A part of the timeline, in flicks: from start up to (not including) end.

interface ExportRange {
  start: Time;
  end: Time;
}

A finished export.

interface ExportResult {
  /**
   * The video file. With `storage: 'opfs'` it is backed by a file in the origin-private file
   * system and stays readable until the next export starts (which deletes it).
   */
  blob: Blob;
  mimeType: string;
  extension: 'mp4' | 'webm';
  width: number;
  height: number;
  durationSeconds: number;
  /** Where the file was written while exporting: on disk (OPFS) or, as a fallback, in memory. */
  storage: 'opfs' | 'memory';
  /** Frames written. */
  frames: number;
  /** Codecs used, e.g. `avc` + `aac`; audio null when the project has no sound. */
  videoCodec: string;
  audioCodec: string | null;
  /** Wall time of the export, seconds. */
  elapsedSeconds: number;
  /**
   * The file is see-through where the project's background is transparent (WebM with VP9 / VP8
   * alpha). False for every other export, including MP4 of a transparent project (black there).
   */
  transparent: boolean;
  /** Things the user should know (e.g. no Opus encoder → video without sound). */
  warnings: string[];
}

Filter

type
type Filter = z.infer<typeof FilterSchema>;

Filter groups, in display order.

type FilterCategory = 'natural' | 'vivid' | 'warm' | 'cool' | 'film' | 'vintage' | 'cinematic' | 'moody' | 'pastel' | 'bw' | 'retro' | 'food' | 'portrait' | 'landscape' | 'night';

A filter the user can pick. id goes into item.filter.id.

interface FilterPreset {
  readonly id: string;
  readonly label: string;
  /** Group for the UI (see {@link FILTER_CATEGORIES}). */
  readonly category: FilterCategory;
}

A text style preset: a font stack the device already has (nothing is downloaded).

interface FontPreset {
  readonly id: string;
  readonly label: string;
  /** CSS font-family list for `TextStyle.fontFamily`. */
  readonly family: string;
  /** CSS font weight for `TextStyle.fontWeight`. */
  readonly weight: number;
}

One frame saved as a picture, drawn by the same compositor as the export.

interface FrameImage {
  blob: Blob;
  mimeType: string;
  extension: 'png' | 'jpg';
  width: number;
  height: number;
}

Still-image formats for saving a frame.

type FrameImageFormat = 'png' | 'jpeg';

Options for saving one frame of the video as a picture.

interface FrameImageOptions {
  format: FrameImageFormat;
  /** JPEG quality 0…1 (default 0.92). Ignored for PNG. */
  quality?: number;
  /**
   * The picture's shorter side in pixels; omitted = the project's own size (its canvas, e.g.
   * 1080 × 1920). The longer side follows the project's aspect ratio.
   */
  height?: number;
}

A frame rate as a rational number, e.g. 29.97 fps = { num: 30000, den: 1001 }.

interface FrameRate {
  num: number;
  den: number;
}
type FreezeItem = z.infer<typeof FreezeItemSchema>;

A caption made from words: its time on the timeline, text, and word times within it.

interface GroupedCaption {
  start: Time;
  end: Time;
  text: string;
  words: CaptionWord[];
  /** Its words were heard with little confidence: worth checking. */
  unsure?: boolean;
}

Options of groupCaptions.

interface GroupOptions {
  /**
   * Most characters on screen at once (one line ≈ 32; a Chinese / Japanese character counts
   * two). Default 32.
   */
  maxChars?: number;
  /** Longest a caption stays (s). Default 3.5. */
  maxSeconds?: number;
  /** A silence this long (s) starts a new caption. Default 0.6. */
  pauseSeconds?: number;
}

The undo history as a list (the History panel).

interface HistoryView {
  /** Step labels, oldest first: the undoable steps, then the redoable ones. */
  labels: readonly string[];
  /**
   * How many steps are applied: 0 = the project as opened ("Original"), `labels.length` = latest.
   * Steps after it are the ones redo would bring back.
   */
  position: number;
}

Makes unique ids. Injectable so tests are deterministic.

type IdFactory = () => string;
type ImageItem = z.infer<typeof ImageItemSchema>;

Item

type

Anything that sits on a track.

type Item = z.infer<typeof ItemSchema>;

A lane item's animations.

type ItemAnimation = z.infer<typeof ItemAnimationSchema>;
type ItemKind = Item['kind'];

Fields that updateItem may change. Timing and media references have their own operations.

interface ItemPatch {
  name?: string;
  transform?: Transform;
  crop?: Crop;
  fit?: 'fit' | 'fill';
  filter?: Filter | null;
  adjust?: Adjust;
  volume?: number;
  muted?: boolean;
  fadeIn?: Time;
  fadeOut?: Time;
  /** Lower under voice, 0…1 of the volume taken away while someone speaks; 0 = off. */
  duck?: number;
  /** Sound effects (EQ, compressor, pitch); `null` removes them. */
  audioFx?: AudioFx | null;
  text?: string;
  style?: TextStyle;
  /**
   * Texts: wrap width as a fraction of the canvas width at scale 1 (clamped to 0.05…1); `null`
   * removes it (lines break only where the text does).
   */
  maxWidth?: number | null;
  emoji?: string | null;
  /** Green screen; `null` turns it off. */
  key?: ChromaKey | null;
  /** LUT look (the asset must be a `lut`); `null` removes it. */
  lut?: LutRef | null;
  /** Lane items; `'normal'` (or `null`) removes the field. */
  blend?: BlendMode | null;
  /** Pictures: shape mask (the shape must be one of `SHAPE_PRESETS`); `null` removes it. */
  mask?: ShapeMask | null;
  /** Photos and image stickers: background removed (an image asset); `null` restores it. */
  cutout?: Cutout | null;
  /** Blurred areas. */
  effect?: RegionItem['effect'];
  shape?: RegionItem['shape'];
  amount?: number;
  width?: number;
  height?: number;
}

One keyframe: a time (flicks from the item's start), a value, the curve to the next.

type Keyframe = z.infer<typeof KeyframeSchema>;

A property that takes keyframes.

type KeyframeProp = (typeof KEYFRAME_PROPS)[number];

An item's keyframes, per transform property (time order).

type Keyframes = z.infer<typeof KeyframesSchema>;

One committed edit, as stored in the operation log.

interface LogEntry {
  /** Increases by one per commit, across undo/redo too. */
  seq: number;
  /** What the user did, e.g. "Split clip". Shown in history UI. */
  label: string;
  /** Applying these to the previous project gives the next one. */
  patches: Patch[];
  /** Applying these undoes the entry. */
  inverse: Patch[];
  /** `edit`, or `undo` / `redo` of an earlier entry. */
  kind: 'edit' | 'undo' | 'redo';
}

LutRef

type

A picture's LUT look.

type LutRef = z.infer<typeof LutRefSchema>;

Marker

type

A named point on the timeline.

type Marker = z.infer<typeof MarkerSchema>;

Result of parseProject.

type ParseResult = {
  ok: true;
  project: Project; /** Things that were fixed while loading. */
  warnings: string[];
} | {
  ok: false;
  error: string;
};

A whole project: settings, media and tracks.

type Project = z.infer<typeof ProjectSchema>;

The compact view of a project a model reads.

interface ProjectDescription {
  /** The video's name. */
  name: string;
  canvas: {
    width: number;
    height: number;
  };
  duration: number;
  tracks: {
    kind: string;
    items: Record<string, string | number | boolean | null>[];
  }[];
  markers: {
    time: number;
    label?: string;
  }[];
  /** The media library: every imported video, photo and sound, on the timeline or not. */
  media: {
    id: string;
    name: string;
    kind: string;
    duration?: number;
    onTimeline: boolean;
  }[];
  catalog: {
    filters: string[];
    transitions: string[];
    animationsIn: string[];
    animationsOut: string[];
    soundPresets: string[];
  };
}

A blurred / pixelated area on a picture layer.

type RegionItem = z.infer<typeof RegionItemSchema>;

Which GPU API a renderer uses.

type RenderBackend = 'webgpu' | 'webgl2';

A picture's shape mask.

type ShapeMask = z.infer<typeof ShapeMaskSchema>;

One mask shape.

interface ShapePreset {
  id: string;
  /** Picker group. */
  category: 'basic' | 'polygons' | 'stars' | 'flowers' | 'organic' | 'symbols';
  family: number;
  /** Family parameters (see each family in {@link shapeDistance}). */
  a: number;
  b: number;
  c: number;
  /** Turned by this many degrees (clockwise). */
  rotation: number;
  /** Stretches to the picture's box instead of keeping its proportions. */
  stretch: boolean;
}

Turns text into speech. Implement it to use your own service.

interface SpeechGenerator {
  /** The voices to offer (first = default). */
  voices(): SpeechVoice[] | Promise<SpeechVoice[]>;
  /** The speech as an audio file the browser can decode (MP3, WAV, Opus…). */
  speak(request: SpeechRequest): Promise<Blob>;
  /**
   * `true`: the service speaks at {@link SpeechRequest.speed} itself. Otherwise (the default) the
   * editor asks for normal speed and plays the added clip at the chosen speed with the voice's
   * pitch kept ("Keep the voice natural"), so the speed works with any service.
   */
  appliesSpeed?: boolean;
}

Where speech is at local time: the word being said (−1 before the first) and 0…1 through it.

interface SpeechPosition {
  /** Index of the current word; words before it are done. −1 before any word starts. */
  word: number;
  /** 0…1 through the current word (1 between words). */
  progress: number;
  /** Characters of the text done, counting the current word partly (for letter-by-letter). */
  chars: number;
  /** All characters (letters of the words, spaces excluded). */
  totalChars: number;
}
interface SpeechRequest {
  text: string;
  voice: string;
  /**
   * 0.5…2, 1 = normal. Always 1 unless the generator says it applies the speed itself
   * ({@link SpeechGenerator.appliesSpeed}).
   */
  speed: number;
  signal: AbortSignal;
}

A voice to pick.

interface SpeechVoice {
  id: string;
  /** Shown to people. */
  name: string;
  /** BCP-47 tag when known, e.g. `en`, `hi`. */
  language?: string;
}
type StickerItem = z.infer<typeof StickerItemSchema>;

One subtitle: when it shows and its text (lines joined with \n).

interface SubtitleCue {
  start: Time;
  end: Time;
  text: string;
}
type TemplateCategory = (typeof TEMPLATE_CATEGORIES)[number];

One element of a template. Times in seconds from the template's start.

interface TemplateElement {
  kind: 'text' | 'emoji';
  /** Text with `{variable}`s, or the emoji. */
  content: string;
  /** Centre, fractions of the canvas. */
  x: number;
  y: number;
  /** Emoji: size as a fraction of the canvas's shorter side. Text: ignored (style.size). */
  scale?: number;
  rotation?: number;
  style?: Partial<TextStyle>;
  /** Text wrap width, fraction of the canvas width. */
  maxWidth?: number;
  start: number;
  duration: number;
  in?: string;
  out?: string;
  loop?: string;
}

One template.

interface TemplatePreset {
  id: string;
  name: string;
  category: TemplateCategory;
  /** Look family (`TEMPLATE_THEMES`). */
  theme: string;
  /** Seconds. */
  duration: number;
  elements: readonly TemplateElement[];
  variables: readonly TemplateVariable[];
}

A template theme: the colours and fonts a template is drawn with.

interface Theme {
  id: string;
  name: string;
  title: string;
  body: string;
  ink: string;
  accent: string;
  boxInk: string;
  card: string;
  cardInk: string;
  /** Title look extras. */
  titleShadow: TextStyle['shadow'];
  titleOutline: TextStyle['outline'];
  letterSpacing: number;
  in: string;
  out: string;
}

A variable a template asks for.

interface TemplateVariable {
  key: string;
  /** What to ask ("Your name"). */
  label: string;
  /** Example value, filled in at first. */
  example: string;
}
type TextItem = z.infer<typeof TextItemSchema>;
type TextStyle = z.infer<typeof TextStyleSchema>;

Time

type

Timeline time is an integer number of flicks (1/705,600,000 s). Every common frame rate (23.976, 24, 25, 29.97, 30, 50, 59.94, 60, 120) and audio sample rate (44.1 / 48 / 96 kHz) divides a second into a whole number of flicks, so frame and sample boundaries are exact integers: splitting, trimming and summing durations never drift the way float seconds do. The largest safe value is ~147 days.

type Time = number;

Track

type
type Track = z.infer<typeof TrackSchema>;

Progress of a transcription, for a progress bar.

interface TranscribeProgress {
  /** `download`: fetching the speech model (first use only); `transcribe`: listening. */
  stage: 'download' | 'transcribe';
  /** 0…1. */
  fraction: number;
  /** Bytes downloaded so far / in total (download stage). */
  loaded?: number;
  total?: number;
}

Turns speech into timed words. Implement this to use your own speech service.

interface Transcriber {
  /**
   * Languages it hears (ISO 639-1), plus `'auto'` if it can detect the language. The Captions
   * panel offers only these, and shows no choice when there's one. Default: the panel's own
   * list and Detect.
   */
  readonly languages?: readonly string[];
  /** It uses `TranscribeRequest.vocabulary`: the Captions panel offers a "Names to spell right" field. */
  readonly takesVocabulary?: boolean;
  transcribe(request: TranscribeRequest): Promise<TranscribeResult>;
  /** Optional: whether and how `language` can be transcribed here, before starting. */
  check?(language: string): Promise<TranscriberCheck>;
  /** Frees its model / worker (optional). */
  dispose?(): void;
}

What transcribing a language would take on this device (shown before starting).

interface TranscriberCheck {
  /** False when it can't run here; `reason` says why. */
  available: boolean;
  /** True when it runs on the device (nothing is uploaded). */
  onDevice: boolean;
  /** One-time download in MB (first use only), if any. */
  downloadMB?: number;
  /** Roughly how many seconds of speech it hears per second (for "about N min"). */
  speed?: number;
  reason?: string;
  /**
   * True when it should work but may need more memory than this device can give (a large model
   * on a phone): the editor says so before the user starts.
   */
  memoryRisk?: boolean;
}

What the editor hands a transcriber.

interface TranscribeRequest {
  /**
   * The sound, as 16 kHz mono PCM in order, in pieces of at most 30 s (so memory stays flat on
   * long videos). Pieces follow each other with no gap.
   */
  audio: AsyncIterable<Float32Array>;
  /** Length of the whole sound in seconds (for progress). */
  duration: number;
  /**
   * Spoken language as an ISO 639-1 code (`'en'`, …), `'hi-Latn'` for Hinglish (Hindi written in
   * Latin letters), or `'auto'` to detect it (one of `languages`).
   */
  language: string;
  /**
   * Names and words that may be said (people, brands, places), so they're spelled right — for
   * transcribers with `takesVocabulary`. Optional.
   */
  vocabulary?: readonly string[];
  /** Cancels the transcription; the promise then rejects with an `AbortError`. */
  signal: AbortSignal;
  onProgress?: (progress: TranscribeProgress) => void;
}

The result: every word with its time, and the language heard.

interface TranscribeResult {
  words: TranscriptWord[];
  language: string;
}

One recognised word and when it is spoken (seconds from the start of the audio).

interface TranscriptWord {
  text: string;
  start: number;
  end: number;
  /**
   * How sure the recogniser is of this word, 0…1 (optional). Captions whose words average under
   * 0.6 are marked to check.
   */
  confidence?: number;
}
type Transform = z.infer<typeof TransformSchema>;
type Transition = z.infer<typeof TransitionSchema>;

Transition groups, in display order.

type TransitionCategory = 'basic' | 'slide' | 'wipe' | 'zoom' | 'blur' | 'light' | 'glitch' | 'shape' | 'distort' | '3d';

A transition the user can pick. id goes into item.transitionIn.type.

interface TransitionPreset {
  readonly id: string;
  readonly label: string;
  readonly category: TransitionCategory;
  /** Directions it can move in (`transitionIn.direction`); the first is the default. */
  readonly directions?: readonly Direction[];
  /** Suggested length in seconds (default 0.5). */
  readonly defaultDuration?: number;
  /** The curve it uses when `transitionIn.ease` is missing. */
  readonly ease: Ease;
}
type VideoItem = z.infer<typeof VideoItemSchema>;