// https://github.com/umami-software/umami/blob/aaa1f9dc58feafe6af54248c5f0611112786fddf/src/tracker/index.d.ts#L84 interface UmamiTracker { track: { /** * Track a page view * * @example ``` * umami.track(); * ``` */ (): Promise /** * Track an event with a given name * * NOTE: event names will be truncated past 50 characters * * @example ``` * umami.track('signup-button'); * ``` */ (eventName: string): Promise /** * Tracks an event with dynamic data. * * NOTE: event names will be truncated past 50 characters * * When tracking events, the default properties are included in the payload. This is equivalent to running: * * ```js * umami.track(props => ({ * ...props, * name: 'signup-button', * data: { * name: 'newsletter', * id: 123 * } * })); * ``` * * @example ``` * umami.track('signup-button', { name: 'newsletter', id: 123 }); * ``` */ (eventName: string, obj: EventData): Promise /** * Tracks a page view with custom properties * * @example ``` * umami.track({ website: 'e676c9b4-11e4-4ef1-a4d7-87001773e9f2', url: '/home', title: 'Home page' }); * ``` */ (properties: PageViewProperties): Promise /** * Tracks an event with fully customizable dynamic data * If you don't specify any `name` and/or `data`, it will be treated as a page view * * @example ``` * umami.track((props) => ({ ...props, url: path })); * ``` */ (eventFunction: CustomEventFunction): Promise } } declare global { interface Window { umami?: UmamiTracker } } export {}