htmx
htmx copied to clipboard
Add TypeScript union string type for custom event names
Description
This adds more type-safety to extension developers, since the event name in onEvent is now no longer of type string, but uses a. new union-type of all available event names as string.
The type and the available events are based on what's written in the docs.
Corresponding issue: there is no issue atm. please let me know when I should create one.
Testing
This only changes the type definition, not the actual source-code, therefore no tests are provided.
Checklist
- [x] I have read the contribution guidelines
- [x] I have targeted this PR against the correct branch (
masterfor website changes,devfor source changes) - [ ] This is either a bugfix, a documentation update, or a new feature that has been explicitly approved via an issue
- [ ] I ran the test suite locally (
npm run test) and verified that it succeeded