GoogleChrome / web-vitals

Essential metrics for a healthy site.
https://web.dev/vitals
Apache License 2.0
7.59k stars 415 forks source link

Fix Metric types for better TypeScript support #356

Closed tunetheweb closed 1 year ago

tunetheweb commented 1 year ago

Fixes #351 Fixes #358

It appears you can't just change a type of an interface in Typescript by repeating it.

This PR uses Omit to completely replace the metric value, but then has to do an assertion for ReportCall of the more specific metric XXXReportCall type to the generic ReportCall type.

jantimon commented 1 year ago

fixes #358