UNPKG

1.58 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import type { CommandContext } from '../command-builder/command-module';
9import { EventCustomDimension, EventCustomMetric, PrimitiveTypes } from './analytics-parameters';
10export declare class AnalyticsCollector {
11 private context;
12 private trackingEventsQueue;
13 private readonly requestParameterStringified;
14 private readonly userParameters;
15 constructor(context: CommandContext, userId: string);
16 reportWorkspaceInfoEvent(parameters: Partial<Record<EventCustomMetric, string | boolean | number | undefined>>): void;
17 reportRebuildRunEvent(parameters: Partial<Record<EventCustomMetric & EventCustomDimension, string | boolean | number | undefined>>): void;
18 reportBuildRunEvent(parameters: Partial<Record<EventCustomMetric & EventCustomDimension, string | boolean | number | undefined>>): void;
19 reportArchitectRunEvent(parameters: Partial<Record<EventCustomDimension, PrimitiveTypes>>): void;
20 reportSchematicRunEvent(parameters: Partial<Record<EventCustomDimension, PrimitiveTypes>>): void;
21 reportCommandRunEvent(command: string): void;
22 private event;
23 /**
24 * Flush on an interval (if the event loop is waiting).
25 *
26 * @returns a method that when called will terminate the periodic
27 * flush and call flush one last time.
28 */
29 periodFlush(): () => Promise<void>;
30 flush(): Promise<void>;
31 private send;
32}