feat: add global htmx type declaration for TypeScript
Add htmx to Window interface in alpine.ts to support: - TypeScript type checking for htmx.trigger() calls - Shared type declaration across bookshelf.ts and bookPicker.ts - No imports needed - globally available via window.htmx Declaration: - trigger(element: HTMLElement | string, event: string): void Used by bookshelf and bookPicker modules for HTMX programmatic triggers.
This commit is contained in:
@@ -4,6 +4,9 @@ import Alpine from "alpinejs";
|
|||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
Alpine: typeof Alpine;
|
Alpine: typeof Alpine;
|
||||||
|
htmx: {
|
||||||
|
trigger: (element: HTMLElement | string, event: string) => void;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user