Skip to content

Commit

Permalink
Add ReportCallback type back but deprecate it
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwalton committed May 20, 2024
1 parent 27f5d87 commit 5e48429
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/types/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ export type MetricWithAttribution =
*/
export type MetricRatingThresholds = [number, number];

/**
* @deprecated Use metric-specific function types instead, such as:
* `(metric: LCPMetric) => void`. If a single callback type is needed for
* multiple metrics, use `(metric: MetricType) => void`.
*/
export interface ReportCallback {
(metric: MetricType): void;
}

export interface ReportOpts {
reportAllChanges?: boolean;
durationThreshold?: number;
Expand Down

0 comments on commit 5e48429

Please sign in to comment.