Typically, this is done in a stand-alone javascript file, rather than in an inline script tag.
...
Extensions can override the following default extension points to add or change functionality:
However the current typing doesn't allow this - it requires a fully populated HtmxExtension object defining all the methods:
Description
Docs for custom extensions show:
https://htmx.org/extensions/building/
However the current typing doesn't allow this - it requires a fully populated
HtmxExtension
object defining all the methods:Testing
I made a working extension in my project and ignored the typing errors. (This is what prompted making this PR)
Changing the type to
Partial<HtmxExtension>
in my installed copy ofhtmx.esm.d.ts
makes the typing errors go away and seems to reflect intended usage.Checklist
master
for website changes,dev
for source changes)npm run test
) and verified that it succeeded