Skip to content
HomePagesHomePages template kit

composeCanvases

Key the authored canvases: the object key is the canvas id (stable identity: renaming a label must not move it) and object insertion order is canvas bar order.

Key the authored canvases: the object key is the canvas id (stable identity: renaming a label must not move it) and object insertion order is canvas bar order. Takes the handles composePages returned, so a canvas references pages typed — renaming a page breaks the build, never the editor.

Import from @homepages/template-kit.

function composeCanvases<T extends { [K in keyof T]: AuthoredCanvas; }>(canvases: T): { readonly [K in keyof T]: T[K] & { readonly id: string; }; }
Name Type Required Description
canvases T required

{ readonly [K in keyof T]: T[K] & { readonly id: string; }; }