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:
Vendored
+1
@@ -3,6 +3,7 @@ export {};
|
||||
declare global {
|
||||
interface Window {
|
||||
fetchWithHtmxTriggers(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
||||
toast(message: string, type?: string): void;
|
||||
readSearchSelect(form: HTMLElement): void;
|
||||
applyFilterBar(event: Event): boolean;
|
||||
clearFilterBar(formId: string, filterInputId: string): void;
|
||||
|
||||
Reference in New Issue
Block a user