summaryrefslogtreecommitdiff
path: root/node_modules/@jet/environment/types/metrics.js
blob: 83c4077487692b0ccb2562a83429502994c733df (plain)
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
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.notInstrumented = exports.PageInvocationPoint = exports.EMPTY_LINTED_METRICS_EVENT = void 0;
/**
 * An empty linted metrics event.
 *
 * The empty events should be skipped from recording
 * by metrics event recorders.
 */
exports.EMPTY_LINTED_METRICS_EVENT = {
    fields: {},
    issues: [],
};
var PageInvocationPoint;
(function (PageInvocationPoint) {
    PageInvocationPoint["pageEnter"] = "pageEnter";
    PageInvocationPoint["pageExit"] = "pageExit";
    PageInvocationPoint["appExit"] = "appExit";
    PageInvocationPoint["appEnter"] = "appEnter";
    PageInvocationPoint["backButton"] = "backButton";
})(PageInvocationPoint = exports.PageInvocationPoint || (exports.PageInvocationPoint = {}));
/**
 * Returns an empty metrics instance of the specified metrics type.
 * @param metricsType - Type of the metrics data to return.
 *
 * @deprecated Do not use, all metrics events should be instrumented.
 */
function notInstrumented(metricsType) {
    switch (metricsType) {
        case 0 /* NotInstrumentedMetricsType.ActionMetrics */:
            return {
                data: [],
                custom: {},
            };
        case 1 /* NotInstrumentedMetricsType.FetchTimingMetrics */:
            return {};
        case 2 /* NotInstrumentedMetricsType.PageMetrics */:
            return {
                instructions: [],
                custom: {},
            };
        case 3 /* NotInstrumentedMetricsType.ImpressionMetrics */:
            return {
                id: {
                    id: "",
                    impressionIndex: -1,
                },
                fields: {},
                custom: {},
            };
        default:
            return {};
    }
}
exports.notInstrumented = notInstrumented;
// endregion
//# sourceMappingURL=metrics.js.map