Developer
TSDoc Authoring Standard
Alpha
DSAR is currently in alpha. APIs, package surfaces, configuration, and documentation may change as the project evolves.
This repository uses TSDoc to make public APIs self-documenting in editor hover, autocomplete, and generated declarations.
Scope
Apply these rules to exported symbols in package source files:
packages/*/src/**/*.{ts,tsx}packages/internals/*/src/**/*.{ts,tsx}
Skip generated code and re-export-only barrel files.
Required for Exported Symbols
- Add a concise summary sentence on every exported declaration.
- For exported function-like APIs, document each argument with
@param. - For exported generic APIs, document each generic with
@typeParam. - For exported non-void function-like APIs, add
@returns. - For exported interfaces, document each property with a short property comment.
Balanced Depth (Default)
Use concise, accurate comments by default. Add richer sections only when they clarify important behavior.
- Use
@remarksfor behavior caveats, defaults, and lifecycle semantics. - Use
@examplefor high-impact entrypoints and integration setup APIs. - Use
@throwswhen callers need to branch on failures.
Formatting
- Use TSDoc tags (not JSDoc type braces):
@param name - Description@typeParam T - Description@returns Description
- Keep summaries imperative and behavior-focused.
- Prefer documenting contract semantics over implementation details.
Example
Property Comment Pattern
Use property-level comments so tooltips are visible during object construction: