You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interface Record {
/**
* Key defines all of the unique querying parameters needed to look up a user
* experience record.
*/
key?: Key;
/**
* Metrics is the map of user experience data available for the record defined
* in the key field. Metrics are keyed on the metric name.
*
* Allowed key values: ["first_contentful_paint",
* "first_input_delay", "largest_contentful_paint",
* "cumulative_layout_shift"]
*/
metrics?: Record<string, Metric>;
}
interface Record overrides built-in Record<K,T> which results in error Type 'Record' is not generic.
We should check that our interfaces do not override any TS specific terms/words. Utility Types are great starting point. Ideally, we should get these types list from TS dynamically instead of hardcoding.
The text was updated successfully, but these errors were encountered:
Actually, we can instead inline Record or any other built-in Utility Types that we use in generated typings: #206
Or, just re-define them with another name.
Downside: we're hard-coding current implementation of Record.
Maxim-Mazurok
changed the title
Don't allow interfaces with names that interfere with TS Utility Types
Some interfaces interfere with TS Utility Types
May 29, 2020
For example:
is generated for
gapi.client.chromeuxreport
.interface Record
overrides built-inRecord<K,T>
which results in errorType 'Record' is not generic.
We should check that our interfaces do not override any TS specific terms/words. Utility Types are great starting point. Ideally, we should get these types list from TS dynamically instead of hardcoding.
The text was updated successfully, but these errors were encountered: