Skip to main content
A sheet names a template by its id and gives the field values.

Import

Example

Notes

  • The default template is registered, unless seedDefault is false.
  • register() replaces a template that has the same id.
  • get() returns undefined for an unknown id.
  • Template geometry is in paper millimetres.
  • The registry is not saved in the project file. Give it again when you export, through the templates option.
Inheritance: implements TitleblockTemplateRegistry

Constructor

Methods

register

get

resolveTitleblock

Resolve a template + instance + context to absolute paper-mm drawables.

DEFAULT_TITLEBLOCK_ID

DEFAULT_TITLEBLOCK_TEMPLATE

A bottom-right A-series title block that works out of the box: project name, sheet name, an editable sheet number, ISO date, scale, and page x/of y.

Types

TitleblockTemplateRegistry

The package does not export this type by name.

TitleblockTemplate

A reusable title-block: static graphics + named fields, authored once and placed via a TitleblockInstance (.spec/debt.md “Paper / drawing layer”).
string
required
string
required
{ width: number; height: number; }
required
Block size in paper units (mm).
"bottom-right" | "bottom" | "right" | "top" | "free"
required
{ x: number; y: number; }
Absolute paper-mm origin, for anchor: "free". Ignored otherwise.
TitleblockElement[]
required

TitleblockContext

Inputs used to compute auto-fields when resolving a title block. The package does not export this type by name.
PageSpec
required
string
required
string
number
number
string
Pre-formatted scale label, e.g. “1:50”.
string
ISO date (YYYY-MM-DD). Defaults to today.

ResolvedTitleblock

A title block resolved to absolute paper-mm drawables. The package does not export this type by name.

TitleblockElement

ResolvedStatic

The package does not export this type by name.

ResolvedText

The package does not export this type by name.

TitleblockStatic

The package does not export this type by name.
"line" | "rect" | "image"
required
Rect
required
Relative to the block origin (top-left). line runs corner→corner.
string
string
string

TitleblockField

The package does not export this type by name.
"field"
required
string
required
Bound by name from TitleblockInstance.values, unless auto is set.
TitleblockAutoField
Rect
required
Relative to the block origin (top-left).
number
required
"left" | "center" | "right"
string
Optional caption drawn before the value.

Rect

Rectangle in paper units (mm). The package does not export this type by name.

TitleblockAutoField

The package does not export this type by name.
Last modified on October 11, 2026