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.
18 lines
349 B
TypeScript
18 lines
349 B
TypeScript
import Alpine from "alpinejs";
|
|
|
|
// Extend Window interface to include Alpine
|
|
declare global {
|
|
interface Window {
|
|
Alpine: typeof Alpine;
|
|
htmx: {
|
|
trigger: (element: HTMLElement | string, event: string) => void;
|
|
};
|
|
}
|
|
}
|
|
|
|
// Initialize Alpine
|
|
window.Alpine = Alpine;
|
|
|
|
// Re-export Alpine for other modules to use
|
|
export { Alpine };
|