Skip to content

[kumo] Correct Toast manager docs and return types - #762

Open
ftzi wants to merge 1 commit into
cloudflare:mainfrom
ftzi:fix/toast-manager-api-types
Open

[kumo] Correct Toast manager docs and return types#762
ftzi wants to merge 1 commit into
cloudflare:mainfrom
ftzi:fix/toast-manager-api-types

Conversation

@ftzi

@ftzi ftzi commented Aug 31, 2026

Copy link
Copy Markdown

Issue

  • packages/kumo/ai/USAGE.md and Toasty JSDoc use Toast.useToastManager().notify(), but the manager exposes add().
  • Generated declarations for wrapped Toast managers return any for add, update, and promise, losing Base UI's return types and promise callback inference.

Solution

  • Docs: Replace the stale notify() examples with add().
  • Signatures: Add explicit Base UI-compatible generic signatures so add returns string, update returns void, and promise preserves Promise<Value> and callback inference.
  • Regression coverage: Add focused runtime and type tests for the wrapped return values and promise inference.
  • Preserved behavior: Keep existing forwarding and duplicate-ID handling unchanged.
  • Changeset: Add a patch changeset for @cloudflare/kumo.

Validation

  • pnpm run format:check, pnpm run lint, pnpm run typecheck, and pnpm run ci:typecheck
  • pnpm run test (52 files, 1,276 tests) and pnpm run test:ci (9 tests)
  • clean pnpm --filter @cloudflare/kumo build with declaration and registry generation, attw, and publint; generated-declaration consumer typecheck; changeset validation
  • No browser testing was performed; the patch does not change rendered behavior.

AI disclosure

This change and pull request description were prepared by an AI coding agent at the contributor's direction.


  • Reviews
    • bonk has reviewed the change
    • automated review not possible because: bonk review requires invocation by a repository collaborator
  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant