UNPKG

1.56 kBTypeScriptView Raw
1import type { LoadState, Metric } from './base.js';
2/**
3 * An FID-specific version of the Metric object.
4 */
5export interface FIDMetric extends Metric {
6 name: 'FID';
7 entries: PerformanceEventTiming[];
8}
9/**
10 * An object containing potentially-helpful debugging information that
11 * can be sent along with the FID value for the current page visit in order
12 * to help identify issues happening to real-users in the field.
13 */
14export interface FIDAttribution {
15 /**
16 * A selector identifying the element that the user interacted with. This
17 * element will be the `target` of the `event` dispatched.
18 */
19 eventTarget: string;
20 /**
21 * The time when the user interacted. This time will match the `timeStamp`
22 * value of the `event` dispatched.
23 */
24 eventTime: number;
25 /**
26 * The `type` of the `event` dispatched from the user interaction.
27 */
28 eventType: string;
29 /**
30 * The `PerformanceEventTiming` entry corresponding to FID.
31 */
32 eventEntry: PerformanceEventTiming;
33 /**
34 * The loading state of the document at the time when the first interaction
35 * occurred (see `LoadState` for details). If the first interaction occurred
36 * while the document was loading and executing script (e.g. usually in the
37 * `dom-interactive` phase) it can result in long input delays.
38 */
39 loadState: LoadState;
40}
41/**
42 * An FID-specific version of the Metric object with attribution.
43 */
44export interface FIDMetricWithAttribution extends FIDMetric {
45 attribution: FIDAttribution;
46}