TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
[WebRTC] A lot of metrics are missing
If you look at RTCStats and its subdirectory you'll notice the metrics are very much not up to date.
For example RTCOutboundRtpStreamStats in dom.generated.d.ts appears to be missing 20-30 or so metrics compared to the spec. This is not a case of "not implemented by more than one browser", as we can see in the Web Platform Tests dashboard there are a lot of metrics implemented by multiple browsers that are not present here.
I don't know how the generator works, but it's worth noting that WebRTC stats do not have a WebIDL definition in the Chromium code base since these metrics objects are JS dictionaries that get converted from lower layer C++ classes so this is automatic.
@aboba FYI
This generator uses https://github.com/mdn/browser-compat-data (bcd) for them. Perhaps this one: https://github.com/mdn/browser-compat-data/blob/499d5fa0371c2919eb3caf43bc11b2805ae99772/api/RTCRtpStreamStats.json
If the data is wrong in bcd these must be corrected or added. Then this generator will add them into dom.generated.d.ts
BCD indeed is used for interfaces, but dictionaries are manually managed because it's not straightforward to map them to BCD.
https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/321faea739848ceade8d40aa5db16fadf8cd25c2/inputfiles/removedTypes.jsonc#L468-L507
PR welcome.