Commit c968c91
fix(search): type-safe programmatic dispatch of the search event
`window.DECO.events.dispatch` exists at runtime (framework bootstrap), but
@decocms/apps' ambient `Window.DECO` type (website/components/Analytics.tsx)
declares `events` with only `subscribe` — and that declaration wins the merge
over the site's globals.d.ts, so `tsc` errored:
src/components/search/Searchbar/Form.tsx(61,27): Property 'dispatch' does not
exist on type '{ subscribe: (fn: (event: any) => void) => void; }'.
Cast through the real runtime shape to dispatch programmatically (the search
term is dynamic, so the attribute-based useSendEvent doesn't fit here).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d4c70a6 commit c968c91
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
0 commit comments