1 | import { IInsights, IStatSerialized, InsightsDependencies, InsightsOptions } from './definitions';
|
2 |
|
3 |
|
4 |
|
5 | export declare class Stat {
|
6 | appId: string;
|
7 | stat: string;
|
8 | value: number;
|
9 | created: Date;
|
10 | constructor(appId: string, stat: string, value?: number);
|
11 | toJSON(): IStatSerialized;
|
12 | }
|
13 | /**
|
14 | * A client for Insights that handles batching, user activity insight, and
|
15 | * sending insights at an interval.
|
16 | *
|
17 | * @hidden
|
18 | */
|
19 | export declare class Insights implements IInsights {
|
20 | options: InsightsOptions;
|
21 | |
22 |
|
23 |
|
24 | private app;
|
25 | |
26 |
|
27 |
|
28 | private storage;
|
29 | |
30 |
|
31 |
|
32 | private config;
|
33 | |
34 |
|
35 |
|
36 | private client;
|
37 | |
38 |
|
39 |
|
40 | private logger;
|
41 | |
42 |
|
43 |
|
44 | private batch;
|
45 | constructor(deps: InsightsDependencies, options?: InsightsOptions);
|
46 | /**
|
47 | * Track an insight.
|
48 | *
|
49 | * @param stat - The insight name.
|
50 | * @param value - The number by which to increment this insight.
|
51 | */
|
52 | track(stat: string, value?: number): void;
|
53 | protected checkActivity(): void;
|
54 | protected markActive(): void;
|
55 | protected trackStat(stat: Stat): void;
|
56 | protected shouldSubmit(): boolean;
|
57 | protected submit(): void;
|
58 | }
|