Open third774 opened 5 years ago
Doh! Tried to open a PR for this, but looks like the work is over in https://github.com/Microsoft/TSJS-lib-generator. Should I move this issue to that repo?
Waiting the feature.
any updates on this?
This is fixed since a few versions. Probably 4.4 or even earlier. https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1094#issuecomment-894845936
@HolgerJeromin That is a different issue that doesn't address the return type of getEntriesByType()
, see https://www.typescriptlang.org/play?ssl=14&ssc=1&pln=14&pc=61#code/PTAEAUFMCcDMHtoFsCGA7AxpAcigbgJYDmKALgfGgCoFIFpEDaAugFAaUDOpoa+xZCmgCiaUtAKROoALygA7vQAm8eQDoADjATJ0WNUUilR4yZwBCATyqWtACgDkfQiXKUHASgDcrViAjaiKiYkABKUvAArtBYNHQMLOxcPNAR0VjScopoKupacEF6kAZGJhJSVjb2AESpnFExkNXevv5QBbohALKQKJzRkIkcaNygSL39dbIKyqqagZ36hsZi5RbWtpB21eN9A80+fmDtOsFYXSjQANZDyWOXV5kzOXP5p0UlK6YVGzWo1wdWscFmdIOAUPRSHF6EQkiMeBoIWIntlcvMOqDPmUzJVNttEZCDkA
Ok, missed that detail. Current state models spec: https://w3c.github.io/performance-timeline/#extensions-to-the-performance-interface
But yes could be more clear by adding overridingTypes: https://github.com/microsoft/TypeScript-DOM-lib-generator#when-the-type-exists-but-is-wrong
BTW, added type debug information to your playground link.
Is someone aware of any available NPM package that provides the missing types as a workaround for now?
Search Terms
getEntriesByType PerformanceMark PerformanceMeasure PerformanceResourceTiming
Suggestion
Add types for the
getEntriesByType
APII found this old issue (Jul 5, 2018) and saw that experimental API's are not included in
lib.dom.d.ts
. The following API's don't appear to haveexperimental
warnings on them on the MDN docs. Hopefully this means these are no longer experimental and types can be added now?https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMark https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMeasure https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming
Use Cases
Getting specific strongly typed information for the entries when accessed via this API.
Examples
Checklist
My suggestion meets these guidelines (not sure about the first one):