From 026eb4c086506f7d45ff8ac4e7b8202e6f76e45f Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 20 Mar 2026 11:41:59 -0400 Subject: [PATCH] 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. --- web/src/alpine.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/src/alpine.ts b/web/src/alpine.ts index b348965..75a73da 100644 --- a/web/src/alpine.ts +++ b/web/src/alpine.ts @@ -4,6 +4,9 @@ import Alpine from "alpinejs"; declare global { interface Window { Alpine: typeof Alpine; + htmx: { + trigger: (element: HTMLElement | string, event: string) => void; + }; } }