Fixes #482 by re-adding the ReportCallback type but marking it as deprecated.
In most cases developers should not need to explicitly type their metric function callbacks (e.g. the type can be inferred from usage), but in the event that you do, the recommended replacement for ReportCallback is either:
Specify a metric-specific function type, e.g. (meric: LCPMetric) => void, or
Specify a type that could be used for any metric function, e.g. (metric: MetricType) => void
The MetricType type can be imported as follows:
// If using the "standard" build:
import type {MetricType} from 'web-vitals';
// If using the "attribution" build:
import type {MetricType} from 'web-vitals/attribution';
Fixes #482 by re-adding the
ReportCallback
type but marking it as deprecated.In most cases developers should not need to explicitly type their metric function callbacks (e.g. the type can be inferred from usage), but in the event that you do, the recommended replacement for
ReportCallback
is either:(meric: LCPMetric) => void
, or(metric: MetricType) => void
The
MetricType
type can be imported as follows: