blob: 1a16fdabdd5a1d36a30eeb9f6e4354318b43f9ec (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { AnalyticsCollector } from './analytics-collector';
export declare const AnalyticsProperties: {
AngularCliProd: string;
AngularCliStaging: string;
readonly AngularCliDefault: string;
};
/**
* This is the ultimate safelist for checking if a package name is safe to report to analytics.
*/
export declare const analyticsPackageSafelist: (string | RegExp)[];
export declare function isPackageNameSafeForAnalytics(name: string): boolean;
/**
* Set analytics settings. This does not work if the user is not inside a project.
* @param level Which config to use. "global" for user-level, and "local" for project-level.
* @param value Either a user ID, true to generate a new User ID, or false to disable analytics.
*/
export declare function setAnalyticsConfig(level: 'global' | 'local', value: string | boolean): void;
/**
* Prompt the user for usage gathering permission.
* @param force Whether to ask regardless of whether or not the user is using an interactive shell.
* @return Whether or not the user was shown a prompt.
*/
export declare function promptGlobalAnalytics(force?: boolean): Promise<boolean>;
/**
* Prompt the user for usage gathering permission for the local project. Fails if there is no
* local workspace.
* @param force Whether to ask regardless of whether or not the user is using an interactive shell.
* @return Whether or not the user was shown a prompt.
*/
export declare function promptProjectAnalytics(force?: boolean): Promise<boolean>;
export declare function hasGlobalAnalyticsConfiguration(): Promise<boolean>;
/**
* Get the global analytics object for the user. This returns an instance of UniversalAnalytics,
* or undefined if analytics are disabled.
*
* If any problem happens, it is considered the user has been opting out of analytics.
*/
export declare function getGlobalAnalytics(): Promise<AnalyticsCollector | undefined>;
export declare function hasWorkspaceAnalyticsConfiguration(): Promise<boolean>;
/**
* Get the workspace analytics object for the user. This returns an instance of AnalyticsCollector,
* or undefined if analytics are disabled.
*
* If any problem happens, it is considered the user has been opting out of analytics.
*/
export declare function getWorkspaceAnalytics(): Promise<AnalyticsCollector | undefined>;
/**
* Return the usage analytics sharing setting, which is either a property string (GA-XXXXXXX-XX),
* or undefined if no sharing.
*/
export declare function getSharedAnalytics(): Promise<AnalyticsCollector | undefined>;
|