Files
bookhoard/web/src/alpine.ts
T
john-okeefe 026eb4c086 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.
2026-03-20 11:47:13 -04:00

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 };