import { Metric } from "../../Metrics/Metric.mjs"; import { Plugin } from "../../Plugin/Plugin.mjs"; import { PageLoadJSON } from "./types.mjs"; //#region src/Plugins/PageLoad/PageLoadPlugin.d.ts /** * Page Load Plugin * * This plugin allows metrics to reference the browser's most * recent navigation when recording start times. Because the * browser's navigation takes place before an application * can completely bootstrap, Metrics on their own, cannot produce * the durations relative to the applications initial load. By * adding this plugin to a metric, its `startTime` is set equal * to the browser's most recent navigation * * ```typescript * const metric = new Metric("My Metric", { * pageLoad: new PageLoadPlugin() * }); * ``` */ declare class PageLoadPlugin = Metric> extends Plugin { private static timing; private static enabled; transition: boolean; initialLoad: boolean; constructor(); /** * Start * * Sets the target Metric's `startTime` equal to the browser's * most recent navigation. */ protected start(metric: T): void; /** * Reset * * Resets the `transition` and `initialLoad` properties of the * instance */ protected reset(): void; /** * Enable * * Records a high-resolution timestamp each time `History.pushState()` * is called and caches it. These high-resolution timestamps are then * used by Metrics looking to record durations beginning with the * browser's most recent navigation */ static enable(): void; /** * Set Timing * * Sets the plugin's `timing` property to a high-resolution timestamp */ static setTiming(): void; /** * To JSON * * Modifies the return value of the `PageLoadPlugin` interface when passed * to `JSON.stringify` */ toJSON(): PageLoadJSON; } //#endregion export { PageLoadPlugin };