Codeboard.
Technical referenceAPI signatures

Project and artwork API

Create documents, address stable IDs, and edit individual layers or elements. Read project concepts for ownership and the quickstart for a minimal executable operation.

Use the signatures below to check arguments and return types. A value after = is the default; ? marks an optional input. Named data shapes are listed in API types.

StoryboardProject

create

Code
static create(options: ProjectOptions): StoryboardProject;

fromJSON

Code
static fromJSON(input: unknown, options: {
    actor?: string;
} = {}): StoryboardProject;

open

Code
static async open(path: string, options: {
    actor?: string;
} = {}): Promise<StoryboardProject>;

id

Code
get id(): string;

title

Code
get title(): string;

canUndo

Code
get canUndo(): boolean;

canRedo

Code
get canRedo(): boolean;

version

Code
get version(): number;

toJSON

Code
toJSON(): StoryboardDocument;

previewComponentUpgrade

Code
previewComponentUpgrade(instanceId: string, options: ComponentUpgradeOptions = {}): {
    conflicts: ValueMergeConflict[];
    incomingChanges: string[];
    retainedLocalChanges: string[];
    version: number;
    instanceId: string;
    sourceVersion: number;
    owner: { kind: "panel" | "animation"; id: string; };
    inputHash: string;
    conflictsResolved: boolean;
};

componentOriginData

Code
componentOriginData(instanceId: string, options: PageOptions = {}): {
    version: number;
    instanceId: string;
    componentId: string;
    baselineVersion: number;
    sha256: string;
    instanceState: "missing" | "detached" | "matching" | "stale";
    instanceSource: { id: Id; version: number; } | null;
    libraryVersion: number | null;
    offset: number;
    limit: number;
    total: number;
    nextOffset: number | null;
    items: { location: "missing" | "instance" | "elsewhere"; sourceId: string; copyId: string; }[];
};

shotDependencyData

Code
shotDependencyData(animationId: string, options: PageOptions = {}): {
    version: number;
    animationId: string;
    dependencyHash: string;
    total: number;
    offset: number;
    limit: number;
    nextOffset: number | null;
    items: ShotDependency[];
};

studio

Code
get studio(): import("../model/types/studio.js").StudioContent;

boardPanels

Code
boardPanels(options: PageOptions = {}): { id: string; shotId: string; startFrame: number; durationFrames: number; transition: Transition; width: number; height: number; revision: number; }[];

shotAnimation

Code
shotAnimation(id: string): ShotAnimation;

editorialSequence

Code
editorialSequence(id: string): EditorialSequence;

shotCoordinates

Code
shotCoordinates(animationId: string, targetId: string, options: CoordinateOptions = {}): ShotCoordinateSpace;

shotControllerData

Code
shotControllerData(animationId: string, controllerId: string, query: ShotControllerQuery = { collection: "keyframes" }): { collection: "targets" | "keyframes"; total: number; nextOffset: number | null; items: { frame: number; weight: number; easing: Easing; index: number; }[]; animationId: string; controllerId: string; name: string; mode: "replace" | "additive"; stackIndex: number; staticWeight: number; activeRange: { startFrame: number; endFrame: number; } | null; frame: number | null; evaluatedWeight: number | null; counts: { targets: number; keyframes: number; }; offset: number; limit: number; } | { collection: "targets" | "keyframes"; total: number; nextOffset: number | null; items: { evaluatedState: EvaluatedLayerState | null; layerId: string; values: Partial<Record<LayerChannel, number>>; index: number; }[]; animationId: string; controllerId: string; name: string; mode: "replace" | "additive"; stackIndex: number; staticWeight: number; activeRange: { startFrame: number; endFrame: number; } | null; frame: number | null; evaluatedWeight: number | null; counts: { targets: number; keyframes: number; }; offset: number; limit: number; };

shotMeshData

Code
shotMeshData(animationId: string, layerId: string, query: ShotMeshQuery = { collection: "keyframes" }): { animationId: string; layerId: string; bindingKind: "skin" | "mesh" | "curve" | "envelope"; curveRest: CurveMeshPose | null; curveSegments: number | null; envelopeRest: EnvelopeMeshPose | null; envelopeGrid: { columns: number; rows: number; } | null; collection: "joints"; offset: number; limit: number; total: number; nextOffset: number | null; counts: { joints: number; weights: number; vertices: number; triangles: number; keyframes: number; }; items: { layerId: string; id: string; bind: Readonly<AffineMatrix>; index: number; }[]; } | { animationId: string; layerId: string; bindingKind: "skin" | "mesh" | "curve" | "envelope"; curveRest: CurveMeshPose | null; curveSegments: number | null; envelopeRest: EnvelopeMeshPose | null; envelopeGrid: { columns: number; rows: number; } | null; collection: "weights"; offset: number; limit: number; total: number; nextOffset: number | null; counts: { joints: number; weights: number; vertices: number; triangles: number; keyframes: number; }; items: { index: number; influences: readonly { jointId: string; weight: number; }[]; }[]; } | { animationId: string; layerId: string; bindingKind: "skin" | "mesh" | "curve" | "envelope"; curveRest: CurveMeshPose | null; curveSegments: number | null; envelopeRest: EnvelopeMeshPose | null; envelopeGrid: { columns: number; rows: number; } | null; collection: "triangles"; offset: number; limit: number; total: number; nextOffset: number | null; counts: { joints: number; weights: number; vertices: number; triangles: number; keyframes: number; }; items: { index: number; vertices: number[]; }[]; } | { animationId: string; layerId: string; bindingKind: "skin" | "mesh" | "curve" | "envelope"; curveRest: CurveMeshPose | null; curveSegments: number | null; envelopeRest: EnvelopeMeshPose | null; envelopeGrid: { columns: number; rows: number; } | null; collection: "keyframes"; offset: number; limit: number; total: number; nextOffset: number | null; counts: { joints: number; weights: number; vertices: number; triangles: number; keyframes: number; }; items: { index: number; frame: number; easing: Easing; }[]; } | { frame: number | null; animationId: string; layerId: string; bindingKind: "skin" | "mesh" | "curve" | "envelope"; curveRest: CurveMeshPose | null; curveSegments: number | null; envelopeRest: EnvelopeMeshPose | null; envelopeGrid: { columns: number; rows: number; } | null; collection: "vertices"; offset: number; limit: number; total: number; nextOffset: number | null; counts: { joints: number; weights: number; vertices: number; triangles: number; keyframes: number; }; items: { x: number; y: number; index: number; }[]; };

shotPointCoordinates

Code
shotPointCoordinates(animationId: string, targetId: string, point: {
    x: number;
    y: number;
}, options: ShotPointOptions): {
    animationId: string;
    targetId: string;
    frame: number;
    direction: "localToFrame" | "frameToLocal";
    candidates: ShotPointCandidate[];
};

editorialClips

Code
editorialClips(sequenceId: string, options: PageOptions = {}): EditorialClip[];

scriptSummary

Code
scriptSummary(): { id: string; title: string; revision: number; entryCount: number; } | null;

palettes

Code
palettes(options: PageOptions = {}): { id: string; name: string; swatchCount: number; }[];

paletteSwatches

Code
paletteSwatches(id: string, options: PageOptions = {}): PaletteSwatch[];

paletteBindings

Code
paletteBindings(swatchId: string, options: PageOptions = {}): PaletteBindingUsage[];

putPalette

Code
putPalette(palette: Palette): this;

removePalette

Code
removePalette(id: string): this;

setColorBinding

Code
setColorBinding(elementId: string, channel: ColorChannel, binding: ColorBinding | null): this;

scriptEntries

Code
scriptEntries(options: PageOptions = {}): ScriptEntry[];

replaceScript

Code
replaceScript(input: ScriptInput, expectedRevision: number): ScriptChangeReport;

shotBoardPanels

Code
shotBoardPanels(animationId: string, options: PageOptions = {}): { id: Id; shotId: Id; number: string; title: string; width: number; height: number; durationFrames: number; startFrame: number; transition: Transition; status: "working" | "review" | "approved"; action: string; dialogue: string; camera: string; notes: string; revision: number; }[];

studioAudioTracks

Code
studioAudioTracks(ownerId: string, options: PageOptions = {}): { clipCount: number; id: string; name: string; muted: boolean; }[];

studioAudioClips

Code
studioAudioClips(ownerId: string, trackId: string, options: PageOptions = {}): StudioAudioClip[];

addShotElement

Code
addShotElement(animationId: string, layerId: string, element: DrawingElement): this;

removeShotElements

Code
removeShotElements(animationId: string, layerId: string, ids: readonly string[]): this;

reviseShotElement

Code
reviseShotElement(animationId: string, layerId: string, id: string, element: DrawingElement): this;

patchShotPixels

Code
patchShotPixels(animationId: string, layerId: string, id: string, x: number, y: number, patch: import("../model/types.js").PixelBuffer): this;

setStudio

Code
setStudio(content: import("../model/types/studio.js").StudioContent): this;

capturePanelAnimation

Code
capturePanelAnimation(panelId: string, options: PanelCaptureOptions): PanelCaptureResult;

duplicateShotAnimation

Code
duplicateShotAnimation(sourceAnimationId: string, options: ShotDuplicateOptions): ShotDuplicateResult;

instantiateShotCharacter

Code
instantiateShotCharacter(sourceAnimationId: string, options: CharacterInstanceOptions): CharacterInstanceResult;

editShotAnimation

Code
editShotAnimation(id: string, edits: readonly import("../model/types/shot.js").ShotAnimationEdit[]): this;

putShotAnimation

Code
putShotAnimation(animation: ShotAnimation): this;

putEditorialSequence

Code
putEditorialSequence(sequence: EditorialSequence): this;

editStudioAudio

Code
editStudioAudio(ownerId: string, edits: readonly import("../model/types/studio-audio.js").StudioAudioEdit[]): this;

setStudioAudio

Code
setStudioAudio(ownerId: string, tracks: readonly import("../model/types/studio-audio.js").StudioAudioTrack[]): this;

editEditorial

Code
editEditorial(id: string, edits: readonly EditorialEdit[]): this;

removeShotAnimation

Code
removeShotAnimation(id: string): this;

removeEditorialSequence

Code
removeEditorialSequence(id: string): this;

plan

Code
/** Validate serializable changes on an isolated draft, without changing this session. */
plan(label: string, commands: EditCommand[]): EditPlan;

commit

Code
/** Atomically save a plan and its receipt to this session's existing .cboard. */
async commit(input: EditPlan, options: {
    requestId: string;
}): Promise<CommitResult>;

readAsset

Code
readAsset(id: string): Buffer;

captureAssetReader

Code
/** Capture the saved media source independently of later session saves or Save As. */
captureAssetReader(): (id: string) => Buffer;

save

Code
async save(path: string, options: {
    overwrite?: boolean;
    expectedVersion?: number;
    assetRoot?: string;
} = {}): Promise<void>;

transaction

Code
transaction<T>(label: string, work: () => T): T;

undo

Code
undo(): boolean;

redo

Code
redo(): boolean;

setMetadata

Code
setMetadata(key: string, value: string): this;

configure

Code
configure(changes: ProjectChanges): this;

addScene

Code
addScene(name: string, id?: Id): SceneHandle;

addSequence

Code
addSequence(name: string, id?: Id): SequenceHandle;

scene

Code
scene(id: Id): SceneHandle;

panel

Code
panel(id: Id): PanelHandle;

panelCaptions

Code
panelCaptions(id: Id): {
    id: string;
    title: string;
    action: string;
    dialogue: string;
    camera: string;
    notes: string;
};

select

Code
select(query: {
    panelId: Id;
    layerId?: Id;
    elementIds?: Id[];
}): Selection;

migrateProject

Code
/** Copy the current saved document; never replaces a source or existing destination. */
export async function migrateProject(sourcePath: string, targetPath: string, options: {
    expectedVersion?: number;
} = {}): Promise<ProjectMigrationReport>;

SequenceHandle

addScene

Code
addScene(name: string, id?: Id): SceneHandle;

SceneHandle

addShot

Code
addShot(name: string, id?: Id): ShotHandle;

ShotHandle

addPanel

Code
addPanel(options: PanelOptions = {}): PanelHandle;

PanelHandle

addRasterLayer

Code
addRasterLayer(name: string, options: LayerOptions = {}, parentGroupId?: Id): LayerHandle;

addVectorLayer

Code
addVectorLayer(name: string, options: LayerOptions = {}, parentGroupId?: Id): LayerHandle;

addGroup

Code
addGroup(name: string, options: LayerOptions = {}, parentGroupId?: Id): LayerHandle;

addMotion

Code
addMotion(label: string, from: Point, to: Point, color = "#d14a32", id?: Id): Id;

revise

Code
revise(changes: Partial<Pick<Panel, "title" | "durationFrames" | "action" | "dialogue" | "camera" | "notes">>): this;

layer

Code
layer(id: Id): LayerHandle;

LayerHandle

scene3D

Code
scene3D(scene: Scene3D, options: Partial<Pick<Scene3DElement, "id" | "name" | "matrix" | "opacity" | "visible">> = {}): Id;

rasterSurface

Code
rasterSurface(image: PixelBuffer, options: Partial<Pick<RasterSurface, "id" | "name" | "matrix" | "opacity" | "visible">> = {}): Id;

readPixels

Code
readPixels(elementId: Id, region?: PixelRegion): PixelBuffer;

editPixels

Code
editPixels(elementId: Id, region: PixelRegion, edit: (patch: PixelBuffer) => void): this;

rasterStroke

Code
rasterStroke(points: Point[], brush: BrushPreset, options: StrokeOptions = {}): Id;

erase

Code
erase(points: Point[], brush: BrushPreset, options: Omit<StrokeOptions, "erase"> = {}): Id;

vectorStroke

Code
vectorStroke(points: Point[], options: VectorStrokeOptions = {}): Id;

path

Code
path(commands: PathCommand[], options: {
    id?: Id;
    name?: string;
    fill?: VectorFill;
    stroke?: string;
    strokeWidth?: number;
    opacity?: number;
} = {}): Id;

text

Code
text(text: string, x: number, y: number, options: {
    id?: Id;
    name?: string;
    color?: string;
    font?: string;
    align?: "left" | "center" | "right";
    opacity?: number;
} = {}): Id;

set

Code
set(changes: LayerChanges): this;

edit

Code
edit(elementId: Id, updater: (element: DrawingElement) => DrawingElement): this;

outlineStroke

Code
outlineStroke(elementId: Id): this;

booleanPath

Code
booleanPath(elementId: Id, tool: readonly PathCommand[], operation: PathBooleanOperation): this;

Selection

transform

Code
transform(transform: Partial<Transform>, options: {
    pivot?: Pivot;
} = {}): this;

opacity

Code
opacity(value: number): this;

remove

Code
remove(): void;

CodeboardError

toJSON

Code
toJSON(): {
    code: ErrorCode;
    message: string;
    retryable: boolean;
    details: Readonly<Record<string, unknown>>;
};

capabilities

Code
/** Implementation inventory, not a production qualification or codec guarantee. */
export async function capabilities(options: {
    probeDependencies?: boolean;
    ffmpegPath?: string;
    ffprobePath?: string;
} = {}): Promise<CapabilityReport>;

planDrawingElement

Code
function planDrawingElement(element: DrawingElement): PlanDrawingElement;

planShotElement

Code
function planShotElement(element: DrawingElement): PlanDrawingElement;

planShotAnimation

Code
function planShotAnimation(input: ShotAnimation): PlanShotAnimation;

planComponentSource

Code
function planComponentSource(input: readonly Layer[]): PlanStudioLayer[];

planCaptionImport

Code
/** Prepare an atomic caption-only plan; the caller persists it and commits with a request ID. */
export function planCaptionImport(project: StoryboardProject, input: readonly CaptionImportRow[]): CaptionImportReport;

importScriptCSV

Code
/** Import explicit stable entry IDs and panel links; does not mutate a project. */
export function importScriptCSV(csv: string, options: ScriptCSVOptions): ScriptInput;

exportScriptCSV

Code
/** Export editable script fields; callers retain project/script revision separately. */
export function exportScriptCSV(input: ScriptInput | ProductionScript): string;

inspectScriptFDX

Code
/** Inspect the supported screenplay subset and every omitted element/attribute before binding IDs. */
export function inspectScriptFDX(xml: string): FDXInspection;

importScriptFDX

Code
/** Import hash-bound, explicitly identified records; project revision and panel checks apply later. */
export function importScriptFDX(xml: string, input: FDXImportOptions): {
    script: ScriptInput;
    sourceSha256: string;
    losses: FDXLoss[];
};

planScriptBoard

Code
/** Create explicitly staged panels and append their script links in the same recoverable commit. */
export function planScriptBoard(project: StoryboardProject, input: readonly ScriptBoardPanel[]): ScriptBoardReport;

planBoardCapture

Code
/** Capture every board panel and conform its frozen incoming transitions in one version-pinned plan. */
export function planBoardCapture(project: StoryboardProject, input: BoardCaptureOptions): {
    plan: EditPlan;
    source: { projectId: string; version: number; durationFrames: number; };
    sequenceId: string;
    panels: { startFrame: number; durationFrames: number; revision: number; panelId: string; animationId: string; clipId: string; }[];
    audio: { mode: "omit" | "convert"; omittedTracks: number; mappings: { sourceId: string; targetId: string; }[]; quantizedPositions: number; };
};

planShotLipSync

Code
/** Replace only the selected local-frame window of an existing shot mouth drawing track. */
export function planShotLipSync(project: StoryboardProject, animationId: string, layerId: string, options: LipSyncOptions): EditPlan;

parseCaptionCSV

Code
/** Strict CSV: commas, escaped quotes and multiline quoted fields; no inferred panel matching. */
export function parseCaptionCSV(input: string): CaptionImportRow[];

On this page