1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { analytics } from '@angular-devkit/core';
|
9 | export declare const AnalyticsProperties: {
|
10 | AngularCliProd: string;
|
11 | AngularCliStaging: string;
|
12 | readonly AngularCliDefault: string;
|
13 | };
|
14 |
|
15 |
|
16 |
|
17 | export declare const analyticsPackageSafelist: (string | RegExp)[];
|
18 | export declare function isPackageNameSafeForAnalytics(name: string): boolean;
|
19 |
|
20 |
|
21 |
|
22 | export declare class UniversalAnalytics implements analytics.Analytics {
|
23 | private _ua;
|
24 | private _dirty;
|
25 | private _metrics;
|
26 | private _dimensions;
|
27 | |
28 |
|
29 |
|
30 |
|
31 | constructor(trackingId: string, uid: string);
|
32 | /**
|
33 | * Creates the dimension and metrics variables to pass to universal-analytics.
|
34 | * @private
|
35 | */
|
36 | private _customVariables;
|
37 | event(ec: string, ea: string, options?: analytics.EventOptions): void;
|
38 | screenview(cd: string, an: string, options?: analytics.ScreenviewOptions): void;
|
39 | pageview(dp: string, options?: analytics.PageviewOptions): void;
|
40 | timing(utc: string, utv: string, utt: string | number, options?: analytics.TimingOptions): void;
|
41 | flush(): Promise<void>;
|
42 | }
|
43 | /**
|
44 | * Set analytics settings. This does not work if the user is not inside a project.
|
45 | * @param level Which config to use. "global" for user-level, and "local" for project-level.
|
46 | * @param value Either a user ID, true to generate a new User ID, or false to disable analytics.
|
47 | */
|
48 | export declare function setAnalyticsConfig(level: 'global' | 'local', value: string | boolean): void;
|
49 | /**
|
50 | * Prompt the user for usage gathering permission.
|
51 | * @param force Whether to ask regardless of whether or not the user is using an interactive shell.
|
52 | * @return Whether or not the user was shown a prompt.
|
53 | */
|
54 | export declare function promptGlobalAnalytics(force?: boolean): Promise<boolean>;
|
55 | /**
|
56 | * Prompt the user for usage gathering permission for the local project. Fails if there is no
|
57 | * local workspace.
|
58 | * @param force Whether to ask regardless of whether or not the user is using an interactive shell.
|
59 | * @return Whether or not the user was shown a prompt.
|
60 | */
|
61 | export declare function promptProjectAnalytics(force?: boolean): Promise<boolean>;
|
62 | export declare function hasGlobalAnalyticsConfiguration(): Promise<boolean>;
|
63 | /**
|
64 | * Get the global analytics object for the user. This returns an instance of UniversalAnalytics,
|
65 | * or undefined if analytics are disabled.
|
66 | *
|
67 | * If any problem happens, it is considered the user has been opting out of analytics.
|
68 | */
|
69 | export declare function getGlobalAnalytics(): Promise<UniversalAnalytics | undefined>;
|
70 | export declare function hasWorkspaceAnalyticsConfiguration(): Promise<boolean>;
|
71 | /**
|
72 | * Get the workspace analytics object for the user. This returns an instance of UniversalAnalytics,
|
73 | * or undefined if analytics are disabled.
|
74 | *
|
75 | * If any problem happens, it is considered the user has been opting out of analytics.
|
76 | */
|
77 | export declare function getWorkspaceAnalytics(): Promise<UniversalAnalytics | undefined>;
|
78 | /**
|
79 | * Return the usage analytics sharing setting, which is either a property string (GA-XXXXXXX-XX),
|
80 | * or undefined if no sharing.
|
81 | */
|
82 | export declare function getSharedAnalytics(): Promise<UniversalAnalytics | undefined>;
|