@embrace-io/web-sdk
Version:
70 lines • 3.6 kB
text/typescript
//#region src/instrumentations/web-vitals/WebVitalsInstrumentation/constants.d.ts
declare const WEB_VITAL_EVENT_NAME = "browser.web_vital";
declare const MAX_LOAF_SCRIPT_URL_LENGTH = 2048;
declare const MAX_LOAF_SCRIPT_ENTRIES = 250;
declare const MAX_CLS_LAYOUT_SHIFTS = 50;
declare const ALL_WEB_VITALS: readonly ["CLS", "INP", "LCP", "FCP", "TTFB"];
declare const WEB_VITALS_ID_TO_LISTENER: {
/**
* Cumulative Layout Shift (CLS)
* https://web.dev/articles/cls
*
* Measures _unexpected_ layout shifts throughout the lifespan of a page load. User-initiated shifts, e.g. showing
* a loading indicator after a user clicked a button that triggered a network request, are excluded since these are
* expected.
*
* onCLS is always called when the page's visibility state changes to hidden and may be called multiple times for
* a single page load.
*
* SPA Note: Since this is cumulative it could be misleading in a SPA, e.g. you might cross the threshold from
* good -> bad on Page 3 but the largest contributor to your score might have actually occurred on Page 1
*/
readonly CLS: (onReport: (metric: import("web-vitals").CLSMetricWithAttribution) => void, opts?: import("web-vitals").AttributionReportOpts) => void;
/**
* First Contentful Paint (FCP)
* https://web.dev/articles/fcp
*
* Measures from first hard page load to when the first "content" (text, image, svg elements, etc.) is rendered
*
* Only measured once per page load
*/
readonly FCP: (onReport: (metric: import("web-vitals").FCPMetricWithAttribution) => void, opts?: import("web-vitals").AttributionReportOpts) => void;
/**
* Largest Contentful Paint (LCP)
* https://web.dev/articles/lcp
*
* Uses heuristics to try and measure when the "main" content has been rendered on the page. Size is a factor, but
* certain elements that likely represent backgrounds or splash screens are excluded.
*
* As the page loads the element considered the largest could change, once the user interacts with the page these
* entries stop getting reported and the metric is ready
*
* Only measured once per page load
*/
readonly LCP: (onReport: (metric: import("web-vitals").LCPMetricWithAttribution) => void, opts?: import("web-vitals").AttributionReportOpts) => void;
/**
* Interaction to Next Paint (INP)
* https://web.dev/articles/inp
*
* Measures how long it takes from a user interaction until the next paint. The final INP value is the longest
* interaction observed, ignoring outliers.
*
* onINP is always called when the page's visibility state changes to hidden and may be called multiple times for
* a single page load.
*
* Each interaction is not reported even when setting reportAllChanges=true, just when an interaction causes an
* increase to INP.
*/
readonly INP: (onReport: (metric: import("web-vitals").INPMetricWithAttribution) => void, opts?: import("web-vitals").INPAttributionReportOpts) => void;
/**
* Time to First Byte (TTFB)
* https://web.dev/articles/ttfb
*
* Measures the time between the request for a resource and when the first byte of a response begins to arrive.
*/
readonly TTFB: (onReport: (metric: import("web-vitals").TTFBMetricWithAttribution) => void, opts?: import("web-vitals").AttributionReportOpts) => void;
readonly FID: undefined;
};
//#endregion
export { ALL_WEB_VITALS, MAX_CLS_LAYOUT_SHIFTS, MAX_LOAF_SCRIPT_ENTRIES, MAX_LOAF_SCRIPT_URL_LENGTH, WEB_VITALS_ID_TO_LISTENER, WEB_VITAL_EVENT_NAME };
//# sourceMappingURL=constants.d.cts.map