UNPKG

873 BTypeScriptView Raw
1import { LCPMetric, MetricRatingThresholds, ReportOpts } from './types.js';
2/** Thresholds for LCP. See https://web.dev/articles/lcp#what_is_a_good_lcp_score */
3export declare const LCPThresholds: MetricRatingThresholds;
4/**
5 * Calculates the [LCP](https://web.dev/articles/lcp) value for the current page and
6 * calls the `callback` function once the value is ready (along with the
7 * relevant `largest-contentful-paint` performance entry used to determine the
8 * value). The reported value is a `DOMHighResTimeStamp`.
9 *
10 * If the `reportAllChanges` configuration option is set to `true`, the
11 * `callback` function will be called any time a new `largest-contentful-paint`
12 * performance entry is dispatched, or once the final value of the metric has
13 * been determined.
14 */
15export declare const onLCP: (onReport: (metric: LCPMetric) => void, opts?: ReportOpts) => void;