@player-ui/metrics-plugin 0.8.0--canary.307.9645 → 0.8.0-next.1

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,9 +1,9 @@
1
- import { PlayerPlugin, Player } from '@player-ui/player';
2
- import { SyncBailHook, SyncHook } from 'tapable-ts';
3
- import { BeaconPluginPlugin, BeaconPlugin } from '@player-ui/beacon-plugin';
4
-
5
- declare const defaultGetTime: () => number;
6
- declare type Timing = {
1
+ import type { Player, PlayerPlugin } from "@player-ui/player";
2
+ import { SyncHook, SyncBailHook } from "tapable-ts";
3
+ import type { BeaconPluginPlugin } from "@player-ui/beacon-plugin";
4
+ import { BeaconPlugin } from "@player-ui/beacon-plugin";
5
+ export declare const defaultGetTime: () => number;
6
+ export type Timing = {
7
7
  /** Time this duration started (ms) */
8
8
  startTime: number;
9
9
  } & ({
@@ -17,19 +17,19 @@ declare type Timing = {
17
17
  /** The elapsed time of this event (ms) */
18
18
  duration: number;
19
19
  });
20
- declare type NodeMetrics = Timing & {
20
+ export type NodeMetrics = Timing & {
21
21
  /** The type of the flow-state */
22
22
  stateType: string;
23
23
  /** The name of the flow-state */
24
24
  stateName: string;
25
25
  };
26
- declare type NodeRenderMetrics = NodeMetrics & {
26
+ export type NodeRenderMetrics = NodeMetrics & {
27
27
  /** Timing representing the initial render */
28
28
  render: Timing;
29
29
  /** An array of timings representing updates to the view */
30
30
  updates: Array<Timing>;
31
31
  };
32
- interface PlayerFlowMetrics {
32
+ export interface PlayerFlowMetrics {
33
33
  /** All metrics about a running flow */
34
34
  flow?: {
35
35
  /** The id of the flow these metrics are for */
@@ -43,14 +43,14 @@ interface PlayerFlowMetrics {
43
43
  } & Timing;
44
44
  }
45
45
  /** Context structure for 'viewed' beacons rendering metrics */
46
- interface MetricsViewBeaconPluginContext {
46
+ export interface MetricsViewBeaconPluginContext {
47
47
  /** Represents the time taken before the view is first rendered */
48
48
  renderTime?: number;
49
49
  /** request time */
50
50
  requestTime?: number;
51
51
  }
52
52
  /** Simple [BeaconPluginPlugin] that adds renderTime to 'viewed' beacons data */
53
- declare class MetricsViewBeaconPlugin implements BeaconPluginPlugin {
53
+ export declare class MetricsViewBeaconPlugin implements BeaconPluginPlugin {
54
54
  static Symbol: symbol;
55
55
  readonly symbol: symbol;
56
56
  private metricsPlugin;
@@ -61,7 +61,7 @@ declare class MetricsViewBeaconPlugin implements BeaconPluginPlugin {
61
61
  private getRenderTime;
62
62
  private getRequestTime;
63
63
  }
64
- interface MetricsWebPluginOptions {
64
+ export interface MetricsWebPluginOptions {
65
65
  /** Called when a flow starts */
66
66
  onFlowBegin?: (update: PlayerFlowMetrics) => void;
67
67
  /** Called when a flow ends */
@@ -98,7 +98,7 @@ interface MetricsWebPluginOptions {
98
98
  /**
99
99
  * A plugin that enables request time metrics
100
100
  */
101
- declare class RequestTimeWebPlugin {
101
+ export declare class RequestTimeWebPlugin {
102
102
  getRequestTime: () => number | undefined;
103
103
  name: string;
104
104
  constructor(getRequestTime: () => number | undefined);
@@ -107,7 +107,7 @@ declare class RequestTimeWebPlugin {
107
107
  /**
108
108
  * A plugin that enables gathering of render metrics
109
109
  */
110
- declare class MetricsCorePlugin implements PlayerPlugin {
110
+ export declare class MetricsCorePlugin implements PlayerPlugin {
111
111
  name: string;
112
112
  static Symbol: symbol;
113
113
  readonly symbol: symbol;
@@ -139,8 +139,5 @@ declare class MetricsCorePlugin implements PlayerPlugin {
139
139
  renderEnd(): void;
140
140
  apply(player: Player): void;
141
141
  }
142
-
143
- declare const MetricsCorePluginSymbol: unique symbol;
144
- declare const MetricsViewBeaconPluginContextSymbol: unique symbol;
145
-
146
- export { MetricsCorePlugin, MetricsCorePluginSymbol, MetricsViewBeaconPlugin, MetricsViewBeaconPluginContext, MetricsViewBeaconPluginContextSymbol, MetricsWebPluginOptions, NodeMetrics, NodeRenderMetrics, PlayerFlowMetrics, RequestTimeWebPlugin, Timing, defaultGetTime };
142
+ export default MetricsCorePlugin;
143
+ //# sourceMappingURL=metrics.d.ts.map
@@ -0,0 +1,3 @@
1
+ export declare const MetricsCorePluginSymbol: unique symbol;
2
+ export declare const MetricsViewBeaconPluginContextSymbol: unique symbol;
3
+ //# sourceMappingURL=symbols.d.ts.map