From cfd6858f6ea12d334b250c3f65cbf762ad194ef2 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 20 Nov 2022 20:10:45 +0000 Subject: [PATCH] window.umami typing --- src/@types/matomo.d.ts | 32 -------------------------------- src/@types/umami.d.ts | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 32 deletions(-) delete mode 100644 src/@types/matomo.d.ts create mode 100644 src/@types/umami.d.ts diff --git a/src/@types/matomo.d.ts b/src/@types/matomo.d.ts deleted file mode 100644 index 781fee7..0000000 --- a/src/@types/matomo.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -interface Dimensions { - dimension1?: string - dimension2?: string - dimension3?: string - dimension4?: string - dimension5?: string - dimension6?: string - dimension7?: string - dimension8?: string - dimension9?: string - dimension10?: string -} - -declare global { - interface Window { - _paq?: - | ( - | Dimensions - | number[] - | string[] - | number - | string - | null - | undefined - )[][] - | null - } -} - -window._paq = window._paq || {} - -export {} diff --git a/src/@types/umami.d.ts b/src/@types/umami.d.ts new file mode 100644 index 0000000..5f2a358 --- /dev/null +++ b/src/@types/umami.d.ts @@ -0,0 +1,17 @@ +declare global { + interface Window { + umami?: (eventName: string) => void | { + trackEvent: ( + event_name: string, + event_data?: { [key: string]: string }, + url?: string, + website_id?: string + ) => void + trackView: (url: string, referrer?: string, website_id?: string) => void + } + } +} + +window.umami = window.umami || {} + +export {}