Skip to content

docs(types): add TSDoc comments to public exports - #308

Merged
smalluban merged 1 commit into
mainfrom
docs-typings-tsdoc
Aug 5, 2026
Merged

docs(types): add TSDoc comments to public exports#308
smalluban merged 1 commit into
mainfrom
docs-typings-tsdoc

Conversation

@smalluban

Copy link
Copy Markdown
Contributor

The TypeScript declaration file only exposed the names and signatures of the public API, so editors showed no explanation when a user hovered over or autocompleted an export. Users had to leave the editor and look up the documentation site to understand what each export does.

This adds short TSDoc comments to every main export in types/index.d.ts, each with a description, @param/@returns where useful, a small usage snippet for the most-used APIs, and a @see deep link to the matching section on hybrids.js.org. The content is derived from the existing /docs pages, so it stays consistent with the published documentation. No type signatures were changed.

Covered exports:

  • Component model: Property, Descriptor (incl. value, connect, observe, reflect), UpdateFunction, RenderFunction, RenderDescriptor, ComponentBase, Component, HybridElement
  • Definition: define, define.compile, define.from, mount
  • Factories: parent, children
  • Store: model types, Storage options, the store() factory, and all store.* methods
  • Router: ViewOptions, the router() factory, and all router.* methods
  • Localization: Messages, localize, localize.languages, msg, msg.html, msg.svg
  • Utils: dispatch, debug
  • Template engine: UpdateFunctionWithMethods, EventHandler, html, html.*, svg

Additionally, types/index.d.ts had pre-existing Prettier violations. The file is now formatted, and ./types was added to the format npm script so it stays covered going forward.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@smalluban
smalluban force-pushed the docs-typings-tsdoc branch from 61c8832 to de2e4d9 Compare August 5, 2026 11:22
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 99.957%. remained the same — docs-typings-tsdoc into main

@smalluban
smalluban merged commit 90c7b13 into main Aug 5, 2026
2 checks passed
@smalluban
smalluban deleted the docs-typings-tsdoc branch August 5, 2026 11:44
@smalluban smalluban mentioned this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants