@capacitor-firebase/performance 0.3.1 → 0.5.1-dev.01021f0.1659726888

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,102 +1,102 @@
1
- export interface FirebasePerformancePlugin {
2
- /**
3
- * Starts a trace.
4
- *
5
- * @since 0.1.0
6
- */
7
- startTrace(options: StartTraceOptions): Promise<void>;
8
- /**
9
- * Stops a trace.
10
- *
11
- * @since 0.1.0
12
- */
13
- stopTrace(options: StopTraceOptions): Promise<void>;
14
- /**
15
- * Atomically increments the metric with the given name for the selected trace by the `incrementBy` value.
16
- *
17
- * @since 0.1.0
18
- */
19
- incrementMetric(options: IncrementMetricOptions): Promise<void>;
20
- /**
21
- * Enables or disables performance monitoring.
22
- * Will be applied with the next start of the app.
23
- *
24
- * @since 0.1.0
25
- */
26
- setPerformanceCollectionEnabled(options: SetPerformanceCollectionEnabledOptions): Promise<void>;
27
- /**
28
- * Determines whether performance monitoring is enabled or disabled.
29
- *
30
- * @since 0.1.0
31
- */
32
- isPerformanceCollectionEnabled(): Promise<IsPerformanceCollectionEnabledResult>;
33
- }
34
- /**
35
- * @since 0.1.0
36
- */
37
- export interface StartTraceOptions {
38
- /**
39
- * Custom trace name.
40
- *
41
- * Names for custom code traces must meet the following requirements:
42
- * no leading or trailing whitespace, no leading underscore (_) character,
43
- * and max length is 100 characters.
44
- *
45
- * @since 0.1.0
46
- */
47
- traceName: string;
48
- }
49
- /**
50
- * @since 0.1.0
51
- */
52
- export interface StopTraceOptions {
53
- /**
54
- * Name of the trace that was set with `startTrace`.
55
- *
56
- * @since 0.1.0
57
- */
58
- traceName: string;
59
- }
60
- /**
61
- * @since 0.1.0
62
- */
63
- export interface IncrementMetricOptions {
64
- /**
65
- * Name of the trace that was set with `startTrace`.
66
- *
67
- * @since 0.1.0
68
- */
69
- traceName: string;
70
- /**
71
- * Name of the metric to be incremented.
72
- *
73
- * @since 0.1.0
74
- */
75
- metricName: string;
76
- /**
77
- * Amount by which the metric has to be incremented.
78
- *
79
- * @default 1
80
- * @since 0.1.0
81
- */
82
- incrementBy?: number;
83
- }
84
- /**
85
- * @since 0.1.0
86
- */
87
- export interface SetPerformanceCollectionEnabledOptions {
88
- /**
89
- * Should performance monitoring be enabled.
90
- *
91
- * @since 0.1.0
92
- */
93
- enabled: boolean;
94
- }
95
- export interface IsPerformanceCollectionEnabledResult {
96
- /**
97
- * `true` if performance monitoring is enabled, otherwise `false`.
98
- *
99
- * @since 0.1.0
100
- */
101
- enabled: boolean;
102
- }
1
+ export interface FirebasePerformancePlugin {
2
+ /**
3
+ * Starts a trace.
4
+ *
5
+ * @since 0.1.0
6
+ */
7
+ startTrace(options: StartTraceOptions): Promise<void>;
8
+ /**
9
+ * Stops a trace.
10
+ *
11
+ * @since 0.1.0
12
+ */
13
+ stopTrace(options: StopTraceOptions): Promise<void>;
14
+ /**
15
+ * Atomically increments the metric with the given name for the selected trace by the `incrementBy` value.
16
+ *
17
+ * @since 0.1.0
18
+ */
19
+ incrementMetric(options: IncrementMetricOptions): Promise<void>;
20
+ /**
21
+ * Enables or disables performance monitoring.
22
+ * Will be applied with the next start of the app.
23
+ *
24
+ * @since 0.1.0
25
+ */
26
+ setEnabled(options: SetEnabledOptions): Promise<void>;
27
+ /**
28
+ * Determines whether performance monitoring is enabled or disabled.
29
+ *
30
+ * @since 0.1.0
31
+ */
32
+ isEnabled(): Promise<IsEnabledResult>;
33
+ }
34
+ /**
35
+ * @since 0.1.0
36
+ */
37
+ export interface StartTraceOptions {
38
+ /**
39
+ * Custom trace name.
40
+ *
41
+ * Names for custom code traces must meet the following requirements:
42
+ * no leading or trailing whitespace, no leading underscore (_) character,
43
+ * and max length is 100 characters.
44
+ *
45
+ * @since 0.1.0
46
+ */
47
+ traceName: string;
48
+ }
49
+ /**
50
+ * @since 0.1.0
51
+ */
52
+ export interface StopTraceOptions {
53
+ /**
54
+ * Name of the trace that was set with `startTrace`.
55
+ *
56
+ * @since 0.1.0
57
+ */
58
+ traceName: string;
59
+ }
60
+ /**
61
+ * @since 0.1.0
62
+ */
63
+ export interface IncrementMetricOptions {
64
+ /**
65
+ * Name of the trace that was set with `startTrace`.
66
+ *
67
+ * @since 0.1.0
68
+ */
69
+ traceName: string;
70
+ /**
71
+ * Name of the metric to be incremented.
72
+ *
73
+ * @since 0.1.0
74
+ */
75
+ metricName: string;
76
+ /**
77
+ * Amount by which the metric has to be incremented.
78
+ *
79
+ * @default 1
80
+ * @since 0.1.0
81
+ */
82
+ incrementBy?: number;
83
+ }
84
+ /**
85
+ * @since 0.1.0
86
+ */
87
+ export interface SetEnabledOptions {
88
+ /**
89
+ * Should performance monitoring be enabled.
90
+ *
91
+ * @since 0.1.0
92
+ */
93
+ enabled: boolean;
94
+ }
95
+ export interface IsEnabledResult {
96
+ /**
97
+ * `true` if performance monitoring is enabled, otherwise `false`.
98
+ *
99
+ * @since 0.1.0
100
+ */
101
+ enabled: boolean;
102
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=definitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface FirebasePerformancePlugin {\n /**\n * Starts a trace.\n *\n * @since 0.1.0\n */\n startTrace(options: StartTraceOptions): Promise<void>;\n /**\n * Stops a trace.\n *\n * @since 0.1.0\n */\n stopTrace(options: StopTraceOptions): Promise<void>;\n /**\n * Atomically increments the metric with the given name for the selected trace by the `incrementBy` value.\n *\n * @since 0.1.0\n */\n incrementMetric(options: IncrementMetricOptions): Promise<void>;\n /**\n * Enables or disables performance monitoring.\n * Will be applied with the next start of the app.\n *\n * @since 0.1.0\n */\n setPerformanceCollectionEnabled(\n options: SetPerformanceCollectionEnabledOptions,\n ): Promise<void>;\n /**\n * Determines whether performance monitoring is enabled or disabled.\n *\n * @since 0.1.0\n */\n isPerformanceCollectionEnabled(): Promise<IsPerformanceCollectionEnabledResult>;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface StartTraceOptions {\n /**\n * Custom trace name.\n *\n * Names for custom code traces must meet the following requirements:\n * no leading or trailing whitespace, no leading underscore (_) character,\n * and max length is 100 characters.\n *\n * @since 0.1.0\n */\n traceName: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface StopTraceOptions {\n /**\n * Name of the trace that was set with `startTrace`.\n *\n * @since 0.1.0\n */\n traceName: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface IncrementMetricOptions {\n /**\n * Name of the trace that was set with `startTrace`.\n *\n * @since 0.1.0\n */\n traceName: string;\n /**\n * Name of the metric to be incremented.\n *\n * @since 0.1.0\n */\n metricName: string;\n /**\n * Amount by which the metric has to be incremented.\n *\n * @default 1\n * @since 0.1.0\n */\n incrementBy?: number;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface SetPerformanceCollectionEnabledOptions {\n /**\n * Should performance monitoring be enabled.\n *\n * @since 0.1.0\n */\n enabled: boolean;\n}\n\nexport interface IsPerformanceCollectionEnabledResult {\n /**\n * `true` if performance monitoring is enabled, otherwise `false`.\n *\n * @since 0.1.0\n */\n enabled: boolean;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface FirebasePerformancePlugin {\r\n /**\r\n * Starts a trace.\r\n *\r\n * @since 0.1.0\r\n */\r\n startTrace(options: StartTraceOptions): Promise<void>;\r\n /**\r\n * Stops a trace.\r\n *\r\n * @since 0.1.0\r\n */\r\n stopTrace(options: StopTraceOptions): Promise<void>;\r\n /**\r\n * Atomically increments the metric with the given name for the selected trace by the `incrementBy` value.\r\n *\r\n * @since 0.1.0\r\n */\r\n incrementMetric(options: IncrementMetricOptions): Promise<void>;\r\n /**\r\n * Enables or disables performance monitoring.\r\n * Will be applied with the next start of the app.\r\n *\r\n * @since 0.1.0\r\n */\r\n setEnabled(options: SetEnabledOptions): Promise<void>;\r\n /**\r\n * Determines whether performance monitoring is enabled or disabled.\r\n *\r\n * @since 0.1.0\r\n */\r\n isEnabled(): Promise<IsEnabledResult>;\r\n}\r\n\r\n/**\r\n * @since 0.1.0\r\n */\r\nexport interface StartTraceOptions {\r\n /**\r\n * Custom trace name.\r\n *\r\n * Names for custom code traces must meet the following requirements:\r\n * no leading or trailing whitespace, no leading underscore (_) character,\r\n * and max length is 100 characters.\r\n *\r\n * @since 0.1.0\r\n */\r\n traceName: string;\r\n}\r\n\r\n/**\r\n * @since 0.1.0\r\n */\r\nexport interface StopTraceOptions {\r\n /**\r\n * Name of the trace that was set with `startTrace`.\r\n *\r\n * @since 0.1.0\r\n */\r\n traceName: string;\r\n}\r\n\r\n/**\r\n * @since 0.1.0\r\n */\r\nexport interface IncrementMetricOptions {\r\n /**\r\n * Name of the trace that was set with `startTrace`.\r\n *\r\n * @since 0.1.0\r\n */\r\n traceName: string;\r\n /**\r\n * Name of the metric to be incremented.\r\n *\r\n * @since 0.1.0\r\n */\r\n metricName: string;\r\n /**\r\n * Amount by which the metric has to be incremented.\r\n *\r\n * @default 1\r\n * @since 0.1.0\r\n */\r\n incrementBy?: number;\r\n}\r\n\r\n/**\r\n * @since 0.1.0\r\n */\r\nexport interface SetEnabledOptions {\r\n /**\r\n * Should performance monitoring be enabled.\r\n *\r\n * @since 0.1.0\r\n */\r\n enabled: boolean;\r\n}\r\n\r\nexport interface IsEnabledResult {\r\n /**\r\n * `true` if performance monitoring is enabled, otherwise `false`.\r\n *\r\n * @since 0.1.0\r\n */\r\n enabled: boolean;\r\n}\r\n"]}
@@ -1,4 +1,4 @@
1
- import type { FirebasePerformancePlugin } from './definitions';
2
- declare const FirebasePerformance: FirebasePerformancePlugin;
3
- export * from './definitions';
4
- export { FirebasePerformance };
1
+ import type { FirebasePerformancePlugin } from './definitions';
2
+ declare const FirebasePerformance: FirebasePerformancePlugin;
3
+ export * from './definitions';
4
+ export { FirebasePerformance };
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { registerPlugin } from '@capacitor/core';
2
- const FirebasePerformance = registerPlugin('FirebasePerformance', {
3
- web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),
4
- });
5
- export * from './definitions';
6
- export { FirebasePerformance };
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const FirebasePerformance = registerPlugin('FirebasePerformance', {
3
+ web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { FirebasePerformance };
7
7
  //# sourceMappingURL=index.js.map
package/dist/esm/web.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { WebPlugin } from '@capacitor/core';
2
- import type { FirebasePerformancePlugin, IncrementMetricOptions, IsPerformanceCollectionEnabledResult, SetPerformanceCollectionEnabledOptions, StartTraceOptions, StopTraceOptions } from './definitions';
3
- export declare class FirebasePerformanceWeb extends WebPlugin implements FirebasePerformancePlugin {
4
- private traces;
5
- startTrace(options: StartTraceOptions): Promise<void>;
6
- stopTrace(options: StopTraceOptions): Promise<void>;
7
- incrementMetric(options: IncrementMetricOptions): Promise<void>;
8
- setPerformanceCollectionEnabled(options: SetPerformanceCollectionEnabledOptions): Promise<void>;
9
- isPerformanceCollectionEnabled(): Promise<IsPerformanceCollectionEnabledResult>;
10
- }
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { FirebasePerformancePlugin, IncrementMetricOptions, IsEnabledResult, SetEnabledOptions, StartTraceOptions, StopTraceOptions } from './definitions';
3
+ export declare class FirebasePerformanceWeb extends WebPlugin implements FirebasePerformancePlugin {
4
+ private traces;
5
+ startTrace(options: StartTraceOptions): Promise<void>;
6
+ stopTrace(options: StopTraceOptions): Promise<void>;
7
+ incrementMetric(options: IncrementMetricOptions): Promise<void>;
8
+ setEnabled(options: SetEnabledOptions): Promise<void>;
9
+ isEnabled(): Promise<IsEnabledResult>;
10
+ }
package/dist/esm/web.js CHANGED
@@ -1,41 +1,41 @@
1
- import { WebPlugin } from '@capacitor/core';
2
- import { getPerformance, trace as createTrace } from 'firebase/performance';
3
- export class FirebasePerformanceWeb extends WebPlugin {
4
- constructor() {
5
- super(...arguments);
6
- this.traces = {};
7
- }
8
- async startTrace(options) {
9
- const perf = getPerformance();
10
- const trace = createTrace(perf, options.traceName);
11
- trace.start();
12
- this.traces[options.traceName] = trace;
13
- }
14
- async stopTrace(options) {
15
- const trace = this.traces[options.traceName];
16
- if (!trace) {
17
- return;
18
- }
19
- trace.stop();
20
- }
21
- async incrementMetric(options) {
22
- const trace = this.traces[options.traceName];
23
- if (!trace) {
24
- return;
25
- }
26
- trace.incrementMetric(options.metricName, options.incrementBy);
27
- }
28
- async setPerformanceCollectionEnabled(options) {
29
- const perf = getPerformance();
30
- perf.instrumentationEnabled = options.enabled;
31
- perf.dataCollectionEnabled = options.enabled;
32
- }
33
- async isPerformanceCollectionEnabled() {
34
- const perf = getPerformance();
35
- const result = {
36
- enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,
37
- };
38
- return result;
39
- }
40
- }
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import { getPerformance, trace as createTrace } from 'firebase/performance';
3
+ export class FirebasePerformanceWeb extends WebPlugin {
4
+ constructor() {
5
+ super(...arguments);
6
+ this.traces = {};
7
+ }
8
+ async startTrace(options) {
9
+ const perf = getPerformance();
10
+ const trace = createTrace(perf, options.traceName);
11
+ trace.start();
12
+ this.traces[options.traceName] = trace;
13
+ }
14
+ async stopTrace(options) {
15
+ const trace = this.traces[options.traceName];
16
+ if (!trace) {
17
+ return;
18
+ }
19
+ trace.stop();
20
+ }
21
+ async incrementMetric(options) {
22
+ const trace = this.traces[options.traceName];
23
+ if (!trace) {
24
+ return;
25
+ }
26
+ trace.incrementMetric(options.metricName, options.incrementBy);
27
+ }
28
+ async setEnabled(options) {
29
+ const perf = getPerformance();
30
+ perf.instrumentationEnabled = options.enabled;
31
+ perf.dataCollectionEnabled = options.enabled;
32
+ }
33
+ async isEnabled() {
34
+ const perf = getPerformance();
35
+ const result = {
36
+ enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,
37
+ };
38
+ return result;
39
+ }
40
+ }
41
41
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAW5E,MAAM,OAAO,sBACX,SAAQ,SAAS;IADnB;;QAGU,WAAM,GAAoD,EAAE,CAAC;IAwCvE,CAAC;IAtCQ,KAAK,CAAC,UAAU,CAAC,OAA0B;QAChD,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QACnD,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,OAAyB;QAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QACD,KAAK,CAAC,IAAI,EAAE,CAAC;IACf,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,OAA+B;QAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QACD,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,+BAA+B,CAC1C,OAA+C;QAE/C,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;QAC9C,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,8BAA8B;QACzC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAyC;YACnD,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,qBAAqB;SACnE,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PerformanceTrace } from 'firebase/performance';\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\n\nimport type {\n FirebasePerformancePlugin,\n IncrementMetricOptions,\n IsPerformanceCollectionEnabledResult,\n SetPerformanceCollectionEnabledOptions,\n StartTraceOptions,\n StopTraceOptions,\n} from './definitions';\n\nexport class FirebasePerformanceWeb\n extends WebPlugin\n implements FirebasePerformancePlugin {\n private traces: { [key: string]: PerformanceTrace | undefined } = {};\n\n public async startTrace(options: StartTraceOptions): Promise<void> {\n const perf = getPerformance();\n const trace = createTrace(perf, options.traceName);\n trace.start();\n this.traces[options.traceName] = trace;\n }\n\n public async stopTrace(options: StopTraceOptions): Promise<void> {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.stop();\n }\n\n public async incrementMetric(options: IncrementMetricOptions): Promise<void> {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.incrementMetric(options.metricName, options.incrementBy);\n }\n\n public async setPerformanceCollectionEnabled(\n options: SetPerformanceCollectionEnabledOptions,\n ): Promise<void> {\n const perf = getPerformance();\n perf.instrumentationEnabled = options.enabled;\n perf.dataCollectionEnabled = options.enabled;\n }\n\n public async isPerformanceCollectionEnabled(): Promise<IsPerformanceCollectionEnabledResult> {\n const perf = getPerformance();\n const result: IsPerformanceCollectionEnabledResult = {\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,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C,OAAO,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,SAAS;QACpB,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAoB;YAC9B,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,qBAAqB;SACnE,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\r\nimport type { PerformanceTrace } from 'firebase/performance';\r\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\r\n\r\nimport type {\r\n FirebasePerformancePlugin,\r\n IncrementMetricOptions,\r\n IsEnabledResult,\r\n SetEnabledOptions,\r\n StartTraceOptions,\r\n StopTraceOptions,\r\n} from './definitions';\r\n\r\nexport class FirebasePerformanceWeb\r\n extends WebPlugin\r\n implements FirebasePerformancePlugin\r\n{\r\n private traces: { [key: string]: PerformanceTrace | undefined } = {};\r\n\r\n public async startTrace(options: StartTraceOptions): Promise<void> {\r\n const perf = getPerformance();\r\n const trace = createTrace(perf, options.traceName);\r\n trace.start();\r\n this.traces[options.traceName] = trace;\r\n }\r\n\r\n public async stopTrace(options: StopTraceOptions): Promise<void> {\r\n const trace = this.traces[options.traceName];\r\n if (!trace) {\r\n return;\r\n }\r\n trace.stop();\r\n }\r\n\r\n public async incrementMetric(options: IncrementMetricOptions): Promise<void> {\r\n const trace = this.traces[options.traceName];\r\n if (!trace) {\r\n return;\r\n }\r\n trace.incrementMetric(options.metricName, options.incrementBy);\r\n }\r\n\r\n public async setEnabled(options: SetEnabledOptions): Promise<void> {\r\n const perf = getPerformance();\r\n perf.instrumentationEnabled = options.enabled;\r\n perf.dataCollectionEnabled = options.enabled;\r\n }\r\n\r\n public async isEnabled(): Promise<IsEnabledResult> {\r\n const perf = getPerformance();\r\n const result: IsEnabledResult = {\r\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\r\n };\r\n return result;\r\n }\r\n}\r\n"]}
@@ -5,47 +5,47 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var core = require('@capacitor/core');
6
6
  var performance = require('firebase/performance');
7
7
 
8
- const FirebasePerformance = core.registerPlugin('FirebasePerformance', {
9
- web: () => Promise.resolve().then(function () { return web; }).then(m => new m.FirebasePerformanceWeb()),
8
+ const FirebasePerformance = core.registerPlugin('FirebasePerformance', {
9
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.FirebasePerformanceWeb()),
10
10
  });
11
11
 
12
- class FirebasePerformanceWeb extends core.WebPlugin {
13
- constructor() {
14
- super(...arguments);
15
- this.traces = {};
16
- }
17
- async startTrace(options) {
18
- const perf = performance.getPerformance();
19
- const trace = performance.trace(perf, options.traceName);
20
- trace.start();
21
- this.traces[options.traceName] = trace;
22
- }
23
- async stopTrace(options) {
24
- const trace = this.traces[options.traceName];
25
- if (!trace) {
26
- return;
27
- }
28
- trace.stop();
29
- }
30
- async incrementMetric(options) {
31
- const trace = this.traces[options.traceName];
32
- if (!trace) {
33
- return;
34
- }
35
- trace.incrementMetric(options.metricName, options.incrementBy);
36
- }
37
- async setPerformanceCollectionEnabled(options) {
38
- const perf = performance.getPerformance();
39
- perf.instrumentationEnabled = options.enabled;
40
- perf.dataCollectionEnabled = options.enabled;
41
- }
42
- async isPerformanceCollectionEnabled() {
43
- const perf = performance.getPerformance();
44
- const result = {
45
- enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,
46
- };
47
- return result;
48
- }
12
+ class FirebasePerformanceWeb extends core.WebPlugin {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.traces = {};
16
+ }
17
+ async startTrace(options) {
18
+ const perf = performance.getPerformance();
19
+ const trace = performance.trace(perf, options.traceName);
20
+ trace.start();
21
+ this.traces[options.traceName] = trace;
22
+ }
23
+ async stopTrace(options) {
24
+ const trace = this.traces[options.traceName];
25
+ if (!trace) {
26
+ return;
27
+ }
28
+ trace.stop();
29
+ }
30
+ async incrementMetric(options) {
31
+ const trace = this.traces[options.traceName];
32
+ if (!trace) {
33
+ return;
34
+ }
35
+ trace.incrementMetric(options.metricName, options.incrementBy);
36
+ }
37
+ async setEnabled(options) {
38
+ const perf = performance.getPerformance();
39
+ perf.instrumentationEnabled = options.enabled;
40
+ perf.dataCollectionEnabled = options.enabled;
41
+ }
42
+ async isEnabled() {
43
+ const perf = performance.getPerformance();
44
+ const result = {
45
+ enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,
46
+ };
47
+ return result;
48
+ }
49
49
  }
50
50
 
51
51
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst FirebasePerformance = registerPlugin('FirebasePerformance', {\n web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),\n});\nexport * from './definitions';\nexport { FirebasePerformance };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\nexport class FirebasePerformanceWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.traces = {};\n }\n async startTrace(options) {\n const perf = getPerformance();\n const trace = createTrace(perf, options.traceName);\n trace.start();\n this.traces[options.traceName] = trace;\n }\n async stopTrace(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.stop();\n }\n async incrementMetric(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.incrementMetric(options.metricName, options.incrementBy);\n }\n async setPerformanceCollectionEnabled(options) {\n const perf = getPerformance();\n perf.instrumentationEnabled = options.enabled;\n perf.dataCollectionEnabled = options.enabled;\n }\n async isPerformanceCollectionEnabled() {\n const perf = getPerformance();\n const result = {\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\n };\n return result;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","getPerformance","createTrace"],"mappings":";;;;;;;AACK,MAAC,mBAAmB,GAAGA,mBAAc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Q,MAAM,IAAI,GAAGD,0BAAc,EAAE,CAAC;AACtC,QAAQ,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;AACtD,QAAQ,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;AACrD,KAAK;AACL,IAAI,MAAM,8BAA8B,GAAG;AAC3C,QAAQ,MAAM,IAAI,GAAGA,0BAAc,EAAE,CAAC;AACtC,QAAQ,MAAM,MAAM,GAAG;AACvB,YAAY,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,qBAAqB;AAC9E,SAAS,CAAC;AACV,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\r\nconst FirebasePerformance = registerPlugin('FirebasePerformance', {\r\n web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),\r\n});\r\nexport * from './definitions';\r\nexport { FirebasePerformance };\r\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\r\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\r\nexport class FirebasePerformanceWeb extends WebPlugin {\r\n constructor() {\r\n super(...arguments);\r\n this.traces = {};\r\n }\r\n async startTrace(options) {\r\n const perf = getPerformance();\r\n const trace = createTrace(perf, options.traceName);\r\n trace.start();\r\n this.traces[options.traceName] = trace;\r\n }\r\n async stopTrace(options) {\r\n const trace = this.traces[options.traceName];\r\n if (!trace) {\r\n return;\r\n }\r\n trace.stop();\r\n }\r\n async incrementMetric(options) {\r\n const trace = this.traces[options.traceName];\r\n if (!trace) {\r\n return;\r\n }\r\n trace.incrementMetric(options.metricName, options.incrementBy);\r\n }\r\n async setEnabled(options) {\r\n const perf = getPerformance();\r\n perf.instrumentationEnabled = options.enabled;\r\n perf.dataCollectionEnabled = options.enabled;\r\n }\r\n async isEnabled() {\r\n const perf = getPerformance();\r\n const result = {\r\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\r\n };\r\n return result;\r\n }\r\n}\r\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","getPerformance","createTrace"],"mappings":";;;;;;;AACK,MAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;AAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;AACxE,CAAC;;ACDM,MAAM,sBAAsB,SAASC,cAAS,CAAC;AACtD,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;AAC5B,QAAQ,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;AACzB,KAAK;AACL,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;AAC9B,QAAQ,MAAM,IAAI,GAAGC,0BAAc,EAAE,CAAC;AACtC,QAAQ,MAAM,KAAK,GAAGC,iBAAW,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;AAC3D,QAAQ,KAAK,CAAC,KAAK,EAAE,CAAC;AACtB,QAAQ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;AAC/C,KAAK;AACL,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE;AAC7B,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACrD,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,YAAY,OAAO;AACnB,SAAS;AACT,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AACnC,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACrD,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,YAAY,OAAO;AACnB,SAAS;AACT,QAAQ,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;AACvE,KAAK;AACL,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;AAC9B,QAAQ,MAAM,IAAI,GAAGD,0BAAc,EAAE,CAAC;AACtC,QAAQ,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;AACtD,QAAQ,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;AACrD,KAAK;AACL,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,MAAM,IAAI,GAAGA,0BAAc,EAAE,CAAC;AACtC,QAAQ,MAAM,MAAM,GAAG;AACvB,YAAY,OAAO,EAAE,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,qBAAqB;AAC9E,SAAS,CAAC;AACV,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -1,47 +1,47 @@
1
1
  var capacitorFirebasePerformance = (function (exports, core, performance) {
2
2
  'use strict';
3
3
 
4
- const FirebasePerformance = core.registerPlugin('FirebasePerformance', {
5
- web: () => Promise.resolve().then(function () { return web; }).then(m => new m.FirebasePerformanceWeb()),
4
+ const FirebasePerformance = core.registerPlugin('FirebasePerformance', {
5
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.FirebasePerformanceWeb()),
6
6
  });
7
7
 
8
- class FirebasePerformanceWeb extends core.WebPlugin {
9
- constructor() {
10
- super(...arguments);
11
- this.traces = {};
12
- }
13
- async startTrace(options) {
14
- const perf = performance.getPerformance();
15
- const trace = performance.trace(perf, options.traceName);
16
- trace.start();
17
- this.traces[options.traceName] = trace;
18
- }
19
- async stopTrace(options) {
20
- const trace = this.traces[options.traceName];
21
- if (!trace) {
22
- return;
23
- }
24
- trace.stop();
25
- }
26
- async incrementMetric(options) {
27
- const trace = this.traces[options.traceName];
28
- if (!trace) {
29
- return;
30
- }
31
- trace.incrementMetric(options.metricName, options.incrementBy);
32
- }
33
- async setPerformanceCollectionEnabled(options) {
34
- const perf = performance.getPerformance();
35
- perf.instrumentationEnabled = options.enabled;
36
- perf.dataCollectionEnabled = options.enabled;
37
- }
38
- async isPerformanceCollectionEnabled() {
39
- const perf = performance.getPerformance();
40
- const result = {
41
- enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,
42
- };
43
- return result;
44
- }
8
+ class FirebasePerformanceWeb extends core.WebPlugin {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.traces = {};
12
+ }
13
+ async startTrace(options) {
14
+ const perf = performance.getPerformance();
15
+ const trace = performance.trace(perf, options.traceName);
16
+ trace.start();
17
+ this.traces[options.traceName] = trace;
18
+ }
19
+ async stopTrace(options) {
20
+ const trace = this.traces[options.traceName];
21
+ if (!trace) {
22
+ return;
23
+ }
24
+ trace.stop();
25
+ }
26
+ async incrementMetric(options) {
27
+ const trace = this.traces[options.traceName];
28
+ if (!trace) {
29
+ return;
30
+ }
31
+ trace.incrementMetric(options.metricName, options.incrementBy);
32
+ }
33
+ async setEnabled(options) {
34
+ const perf = performance.getPerformance();
35
+ perf.instrumentationEnabled = options.enabled;
36
+ perf.dataCollectionEnabled = options.enabled;
37
+ }
38
+ async isEnabled() {
39
+ const perf = performance.getPerformance();
40
+ const result = {
41
+ enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,
42
+ };
43
+ return result;
44
+ }
45
45
  }
46
46
 
47
47
  var web = /*#__PURE__*/Object.freeze({
@@ -55,5 +55,5 @@ var capacitorFirebasePerformance = (function (exports, core, performance) {
55
55
 
56
56
  return exports;
57
57
 
58
- }({}, capacitorExports, firebasePerformanceExports));
58
+ })({}, capacitorExports, firebasePerformanceExports);
59
59
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst FirebasePerformance = registerPlugin('FirebasePerformance', {\n web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),\n});\nexport * from './definitions';\nexport { FirebasePerformance };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\nexport class FirebasePerformanceWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.traces = {};\n }\n async startTrace(options) {\n const perf = getPerformance();\n const trace = createTrace(perf, options.traceName);\n trace.start();\n this.traces[options.traceName] = trace;\n }\n async stopTrace(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.stop();\n }\n async incrementMetric(options) {\n const trace = this.traces[options.traceName];\n if (!trace) {\n return;\n }\n trace.incrementMetric(options.metricName, options.incrementBy);\n }\n async setPerformanceCollectionEnabled(options) {\n const perf = getPerformance();\n perf.instrumentationEnabled = options.enabled;\n perf.dataCollectionEnabled = options.enabled;\n }\n async isPerformanceCollectionEnabled() {\n const perf = getPerformance();\n const result = {\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\n };\n return result;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","getPerformance","createTrace"],"mappings":";;;AACK,UAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;IAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;IACxE,CAAC;;ICDM,MAAM,sBAAsB,SAASC,cAAS,CAAC;IACtD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;IAC5B,QAAQ,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACzB,KAAK;IACL,IAAI,MAAM,UAAU,CAAC,OAAO,EAAE;IAC9B,QAAQ,MAAM,IAAI,GAAGC,0BAAc,EAAE,CAAC;IACtC,QAAQ,MAAM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K;IACL;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\r\nconst FirebasePerformance = registerPlugin('FirebasePerformance', {\r\n web: () => import('./web').then(m => new m.FirebasePerformanceWeb()),\r\n});\r\nexport * from './definitions';\r\nexport { FirebasePerformance };\r\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\r\nimport { getPerformance, trace as createTrace } from 'firebase/performance';\r\nexport class FirebasePerformanceWeb extends WebPlugin {\r\n constructor() {\r\n super(...arguments);\r\n this.traces = {};\r\n }\r\n async startTrace(options) {\r\n const perf = getPerformance();\r\n const trace = createTrace(perf, options.traceName);\r\n trace.start();\r\n this.traces[options.traceName] = trace;\r\n }\r\n async stopTrace(options) {\r\n const trace = this.traces[options.traceName];\r\n if (!trace) {\r\n return;\r\n }\r\n trace.stop();\r\n }\r\n async incrementMetric(options) {\r\n const trace = this.traces[options.traceName];\r\n if (!trace) {\r\n return;\r\n }\r\n trace.incrementMetric(options.metricName, options.incrementBy);\r\n }\r\n async setEnabled(options) {\r\n const perf = getPerformance();\r\n perf.instrumentationEnabled = options.enabled;\r\n perf.dataCollectionEnabled = options.enabled;\r\n }\r\n async isEnabled() {\r\n const perf = getPerformance();\r\n const result = {\r\n enabled: perf.instrumentationEnabled || perf.dataCollectionEnabled,\r\n };\r\n return result;\r\n }\r\n}\r\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin","getPerformance","createTrace"],"mappings":";;;AACK,UAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;IAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;IACxE,CAAC;;ICDM,MAAM,sBAAsB,SAASC,cAAS,CAAC;IACtD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG,SAA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