Convert toast.js to TypeScript (issue #17)
- Add ts/toast.ts: typed port of the Alpine toast store + window.toast + window.fetchWithHtmxTriggers. Toast / ToastStore / ToastMessage interfaces type the store and the show-toast CustomEvent detail; Alpine declared as a type-only ambient global - Declare window.toast in ts/globals.d.ts - Stays a classic (non-module) script — no import/export — so it keeps defining globals; layout.py now serves dist/toast.js Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -364,7 +364,7 @@ def Page(
|
||||
" <!-- hx-swap-oob makes sure the modal gets removed upon any HTMX response -->\n"
|
||||
' <div id="global-modal-container" hx-swap-oob="true"></div>\n'
|
||||
f" {_TOAST_CONTAINER}\n"
|
||||
f' <script src="{static("js/toast.js")}"></script>\n'
|
||||
f' <script src="{static("js/dist/toast.js")}"></script>\n'
|
||||
" </body>\n</html>\n"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user