|
1 |
| -// Type definitions for angular-google-analytics v1.1.0 |
2 |
| -// Project: https://github.com/revolunet/angular-google-analytics |
3 |
| -// Definitions by: Matt Wheatley <https://github.com/terrawheat> |
4 |
| -// Definitions: https://github.com/borisyankov/DefinitelyTyped |
5 |
| - |
6 |
| -declare module angular.google.analytics { |
7 |
| - interface AnalyticsService { |
8 |
| - /** |
9 |
| - * @summary If logging is enabled then all outbound calls are accessible via an in-memory array. |
10 |
| - * This is useful for troubleshooting and seeing the order of outbound calls with parameters. |
11 |
| - */ |
12 |
| - log: Array<Object>; |
13 |
| - |
14 |
| - /** |
15 |
| - * @summary If in offline mode then all calls are queued to an in-memory array for future processing. |
16 |
| - * All calls queued to the offlineQueue are not outbound calls yet and hence do not show up in the log. |
17 |
| - */ |
18 |
| - offlineQueue: Array<Object>; |
19 |
| - |
20 |
| - /** |
21 |
| - * @summary Returns the current URL that would be sent if a `trackPage` call was made. |
22 |
| - * @return {string} The URL |
23 |
| - */ |
24 |
| - getUrl: () => string; |
25 |
| - |
26 |
| - /** |
27 |
| - * @summary Manually create classic analytics (ga.js) script tag |
28 |
| - */ |
29 |
| - createScriptTag: () => void; |
30 |
| - |
31 |
| - /** |
32 |
| - * @summary Manually create universal analytics (analytics.js) script tag |
33 |
| - */ |
34 |
| - createAnalyticsScriptTag: () => void; |
35 |
| - |
36 |
| - /** |
37 |
| - * @summary Allows for advanced configuration and definitions in univeral analytics only. This is a no-op when using classic analytics. |
38 |
| - */ |
39 |
| - set: (key: string, value: any, accountName?: string) => void; |
40 |
| - |
41 |
| - /** |
42 |
| - * @summary Creates a new page view event |
43 |
| - * @param {string} pageURL URL of page view |
44 |
| - * @param {string} title Page Title |
45 |
| - * @param {Object} dimensions Additional dimensions and metrics |
46 |
| - */ |
47 |
| - trackPage: (pageURL: string, title?: string, dimensions?: { [expr: string]: any }) => void; |
48 |
| - |
49 |
| - /** |
50 |
| - * @summary Create a new event |
51 |
| - */ |
52 |
| - trackEvent: (category: string, action: string, label: string, value?: any, nonInteractionFlag?: boolean, dimensions?: { [expr: string]: any }) => void; |
53 |
| - |
54 |
| - trackException: (descrption: string, isFatal: boolean) => void; |
55 |
| - |
56 |
| - /** |
57 |
| - * @summary While in offline mode, no calls to the ga function or pushes to the gaq array are made. |
58 |
| - * This will queue all calls for later sending once offline mode is reset to false. |
59 |
| - */ |
60 |
| - offline: (offlineMode: boolean) => void; |
61 |
| - } |
62 |
| -} |
| 1 | +// Type definitions for angular-google-analytics v1.1.0 |
| 2 | +// Project: https://github.com/revolunet/angular-google-analytics |
| 3 | +// Definitions by: Matt Wheatley <https://github.com/terrawheat> |
| 4 | +// Definitions: https://github.com/borisyankov/DefinitelyTyped |
| 5 | + |
| 6 | +declare module angular.google.analytics { |
| 7 | + interface AnalyticsService { |
| 8 | + /** |
| 9 | + * @summary If logging is enabled then all outbound calls are accessible via an in-memory array. |
| 10 | + * This is useful for troubleshooting and seeing the order of outbound calls with parameters. |
| 11 | + */ |
| 12 | + log: Array<Object>; |
| 13 | + |
| 14 | + /** |
| 15 | + * @summary If in offline mode then all calls are queued to an in-memory array for future processing. |
| 16 | + * All calls queued to the offlineQueue are not outbound calls yet and hence do not show up in the log. |
| 17 | + */ |
| 18 | + offlineQueue: Array<Object>; |
| 19 | + |
| 20 | + /** |
| 21 | + * @summary Returns the current URL that would be sent if a `trackPage` call was made. |
| 22 | + * @return {string} The URL |
| 23 | + */ |
| 24 | + getUrl: () => string; |
| 25 | + |
| 26 | + /** |
| 27 | + * @summary Manually create classic analytics (ga.js) script tag |
| 28 | + */ |
| 29 | + createScriptTag: () => void; |
| 30 | + |
| 31 | + /** |
| 32 | + * @summary Manually create universal analytics (analytics.js) script tag |
| 33 | + */ |
| 34 | + createAnalyticsScriptTag: () => void; |
| 35 | + |
| 36 | + /** |
| 37 | + * @summary Allows for advanced configuration and definitions in univeral analytics only. This is a no-op when using classic analytics. |
| 38 | + */ |
| 39 | + set: (key: string, value: any, accountName?: string) => void; |
| 40 | + |
| 41 | + /** |
| 42 | + * @summary Creates a new page view event |
| 43 | + * @param {string} pageURL URL of page view |
| 44 | + * @param {string} title Page Title |
| 45 | + * @param {Object} dimensions Additional dimensions and metrics |
| 46 | + */ |
| 47 | + trackPage: (pageURL: string, title?: string, dimensions?: { [expr: string]: any }) => void; |
| 48 | + |
| 49 | + /** |
| 50 | + * @summary Create a new event |
| 51 | + */ |
| 52 | + trackEvent: (category: string, action: string, label: string, value?: any, nonInteractionFlag?: boolean, dimensions?: { [expr: string]: any }) => void; |
| 53 | + |
| 54 | + trackException: (descrption: string, isFatal: boolean) => void; |
| 55 | + |
| 56 | + /** |
| 57 | + * @summary While in offline mode, no calls to the ga function or pushes to the gaq array are made. |
| 58 | + * This will queue all calls for later sending once offline mode is reset to false. |
| 59 | + */ |
| 60 | + offline: (offlineMode: boolean) => void; |
| 61 | + } |
| 62 | +} |
0 commit comments