Skip to content

Complete TSDoc coverage for intentional public exports #173

Description

@woksin

Problem

@cratis/components is a framework library, so exported TypeScript is product surface. Components 4 documents the changed foundation APIs, stable parts/tokens, migration aliases, Canvas core, and command-field part types, but a static export audit still finds older exported declarations with missing TSDoc—especially PivotViewer internals, Filter helpers, notification dispatch types, lower-level Canvas chat/emoji/mention helpers, schema types, and TimeMachine types.

Missing source documentation makes editor IntelliSense incomplete and blurs whether a symbol is a supported contract or an implementation detail accidentally re-exported by a broad barrel.

Direction

Do not add prose indiscriminately to implementation internals. First decide whether each symbol should remain public:

  1. Build the actual export graph from every Source/package.json subpath and barrel.
  2. Remove/narrow accidental exports in a semver-appropriate release.
  3. Add concise TSDoc to every intentional exported declaration and every public member/property.
  4. Include defaults, units, controlled/uncontrolled behavior, callback timing, precedence, accessibility expectations, token/part stability, and deprecated/no-op compatibility semantics where relevant.
  5. Generate or validate API reference output from declarations so documentation cannot silently regress.

Acceptance criteria

  • Every intentional exported interface, type, enum, function, class, component, and constant has TSDoc.
  • Every property/method of an exported interface/class has a useful description.
  • Public component props document defaults and state ownership.
  • Exported part types identify the rendered semantic element for each key.
  • Deprecated/compatibility members carry @deprecated and migration guidance.
  • The gate follows package subpaths/barrels rather than scanning all source exports (internal files may export locally without becoming package API).
  • A CI check fails when an intentional public declaration/member loses documentation.
  • The published Components reference links generated API material from each component page where useful.

Initial audit groups

  • PivotViewer/** engine/hooks/utils and component props
  • Filter/** state and histogram helper types
  • Notifications/toast.ts dispatch/options/record types
  • lower-level Canvas/shapes/ChatBubble/** avatar/emoji/mention/helper contracts
  • types/JsonSchema.ts, types/TypeFormat.ts
  • TimeMachine data types and remaining helper components

This is follow-up documentation debt, not a reason to expose React Aria or other implementation-library types. Public contracts remain Cratis-owned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions