feat: export hook-related TypeScript types (#427)#429
Conversation
Re-export Config, DOMPurify, DocumentFragmentHook, ElementHook, HookName, NodeHook, RemovedAttribute, RemovedElement, UponSanitizeAttributeHook, UponSanitizeAttributeHookEvent, UponSanitizeElementHook, UponSanitizeElementHookEvent, and WindowLike from dompurify so consumers can type addHook callbacks without redeclaring the signatures. Closes #427 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR exports TypeScript type definitions from the dompurify library through the main entry points ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Summary
NodeHook,ElementHook,DocumentFragmentHook,UponSanitizeElementHook,UponSanitizeAttributeHook,HookName) plus adjacent surface types (Config,DOMPurify,RemovedAttribute,RemovedElement,UponSanitizeAttributeHookEvent,UponSanitizeElementHookEvent,WindowLike) fromdompurifyso consumers can typeaddHookcallbacks without redeclaring the signatures.3.11.0(minor - additive type-only public surface).Closes #427
Test plan
pnpm typecheckclean (now also coverstests/)pnpm lintcleanpnpm test- 12/12 passing, including newtests/types.test.tssmoke assertions for bothsrc/indexandsrc/browserentriespnpm build- verifieddist/index.d.tsanddist/browser.d.tsre-export all 13 type names; runtimedist/*.jscorrectly omits the type-only re-exports🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests