Improve JSDoc comments with cross-references and clarifications (#254)
Key improvements:
- Add `{@link}` cross-references throughout the codebase to make API
documentation navigable and help AI models understand relationships
- Use `{@link module!Export}` syntax for cross-module references
- Add backticks for inline code formatting (`ResizeObserver`, `App`, etc)
- Fix `PostMessageTransport` examples to show required two-argument form
- Clarify `onteardown` callback return type requirement
- Document React hooks cleanup behavior and Strict Mode considerations
- Add tool visibility example for `registerAppTool`
- Add CSP example for `registerAppResource`
- Fix notification direction documentation in `spec.types.ts`
TypeDoc config migrated from `typedoc.json` to `typedoc.config.mjs` to:
- Support custom `@description` block tag
- Add `intentionallyNotExported` for internal types
- Include `src/server/index.ts` entry point
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
978d8e6fff
commit
d48e35d88a
1 changed files with 359 additions and 231 deletions
|
|
@ -4,15 +4,17 @@ import { App } from "../app";
|
|||
/**
|
||||
* React hook that automatically reports UI size changes to the host.
|
||||
*
|
||||
* Uses ResizeObserver to watch `document.body` and `document.documentElement` for
|
||||
* Uses `ResizeObserver` to watch `document.body` and `document.documentElement` for
|
||||
* size changes and sends `ui/notifications/size-changed` notifications.
|
||||
*
|
||||
* The hook automatically cleans up the `ResizeObserver` when the component unmounts.
|
||||
*
|
||||
* **Note**: This hook is rarely needed since the {@link useApp} hook automatically enables
|
||||
* auto-resize by default. This hook is provided for advanced cases where you
|
||||
* create the {@link App} manually with `autoResize: false` and want to add auto-resize
|
||||
* behavior later.
|
||||
*
|
||||
* @param app - The connected App instance, or null during initialization
|
||||
* @param app - The connected {@link App} instance, or null during initialization
|
||||
* @param elementRef - Currently unused. The hook always observes `document.body`
|
||||
* and `document.documentElement` regardless of this value. Passing a ref will
|
||||
* cause unnecessary effect re-runs; omit this parameter.
|
||||
|
|
@ -31,7 +33,7 @@ import { App } from "../app";
|
|||
* { autoResize: false } // Disable default auto-resize
|
||||
* );
|
||||
*
|
||||
* const transport = new PostMessageTransport(window.parent);
|
||||
* const transport = new PostMessageTransport(window.parent, window.parent);
|
||||
* myApp.connect(transport)
|
||||
* .then(() => setApp(myApp))
|
||||
* .catch((err) => setError(err));
|
||||
|
|
|
|||
Loading…
Reference in a new issue