Created
August 13, 2019 23:01
-
-
Save tommedema/b1e51013f709e42e1fb577b5d537a377 to your computer and use it in GitHub Desktop.
index.d.ts for analytics.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference lib="dom"/> | |
declare function Analytics(opts: Analytics.IOptions): Analytics.IAnalytics | |
declare namespace Analytics { | |
interface IOptions { | |
app: string, | |
plugins: object[] | |
} | |
interface IPageData { | |
title?: string | |
url?: string | |
path?: string | |
referrer?: string | |
} | |
interface ITraits { | |
[key: string]: string | number | boolean | undefined | |
} | |
interface IAnalytics { | |
page: (data?: IPageData) => void, | |
track: (event: string, traits?: ITraits) => void, | |
identify: (userId: string, traits?: ITraits) => void, | |
ready: (cb: () => void) => void | |
} | |
} | |
export = Analytics |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment