TSDoc Style Guide

Documentation standards and conventions.

SpineEditor docs describe contracts, invariants, and behavior. Keep prose minimal.

Rules

  1. @packageDocumentation appears only in package index.ts.
  2. The first line is a one-line summary.
  3. @remarks describes invariants, behavior, and limits.
  4. No section divider comments, no speculative prose.
  5. Keep public API docs implementation-aligned.

Anti-drift notes

  1. TextSelection is factory-constructed via textSelection(anchor, head, options?).
  2. Selection kinds are "text" | "node" | "block".
  3. Pos is a branded non-negative integer created via pos(value).
  4. Tests must match implementation semantics exactly.