1 | import { CLSMetric, MetricRatingThresholds, ReportOpts } from './types.js';
|
2 | /** Thresholds for CLS. See https://web.dev/articles/cls#what_is_a_good_cls_score */
|
3 | export declare const CLSThresholds: MetricRatingThresholds;
|
4 | /**
|
5 | * Calculates the [CLS](https://web.dev/articles/cls) value for the current page and
|
6 | * calls the `callback` function once the value is ready to be reported, along
|
7 | * with all `layout-shift` performance entries that were used in the metric
|
8 | * value calculation. The reported value is a `double` (corresponding to a
|
9 | * [layout shift score](https://web.dev/articles/cls#layout_shift_score)).
|
10 | *
|
11 | * If the `reportAllChanges` configuration option is set to `true`, the
|
12 | * `callback` function will be called as soon as the value is initially
|
13 | * determined as well as any time the value changes throughout the page
|
14 | * lifespan.
|
15 | *
|
16 | * _**Important:** CLS should be continually monitored for changes throughout
|
17 | * the entire lifespan of a page—including if the user returns to the page after
|
18 | * it's been hidden/backgrounded. However, since browsers often [will not fire
|
19 | * additional callbacks once the user has backgrounded a
|
20 | * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),
|
21 | * `callback` is always called when the page's visibility state changes to
|
22 | * hidden. As a result, the `callback` function might be called multiple times
|
23 | * during the same page load._
|
24 | */
|
25 | export declare const onCLS: (onReport: (metric: CLSMetric) => void, opts?: ReportOpts) => void;
|