chore: add umami typing

This commit is contained in:
HorizonCode committed 2026-04-21 09:25:59 +02:00
1 parent 7375cccc05
commit 60e3ef4131
3 files changed
+43 -4

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
declare global {
const umami: Umami;
}
/**
* @see {@link https://umami.is/docs/tracker-functions|Umami Docs}
*/
interface Umami {
track(): Promise<string> | undefined;
track(
event_name: string,
event_data?: Record<string, unknown>,
): Promise<string> | undefined;
track(custom_payload: {
website: string;
[key: string]: unknown;
}): Promise<string> | undefined;
track(
callback: (props: {
hostname: string;
language: string;
referrer: string;
screen: string;
title: string;
url: string;
website: string;
}) => { website: string; [key: string]: unknown },
): Promise<string> | undefined;
/** Pass in your own ID to identify a user. */
identify(identity_id: string): Promise<void>;
/** Save data about the current session. */
identify(
identity_id: string,
data: Record<string, unknown>,
): Promise<void>;
/** To save data without a unique ID, pass in only a JSON object. */
identify(data: Record<string, unknown>): Promise<void>;
}
export {};