[webrtc-pc] Can RTCStatsReport use a union type instead of object?

saschanaz has just created a new issue for https://github.com/w3c/webrtc-pc:

== Can RTCStatsReport use a union type instead of object? ==
Currently RTCStatsReport uses object:

http://w3c.github.io/webrtc-pc/#rtcstatsreport-object

```webidl
[Exposed=Window]
interface RTCStatsReport {
    readonly maplike<DOMString, object>;
};
```

...where the object means a finite set of subdictionaries of RTCStats defined in [WEBRTC-STATS](https://www.w3.org/TR/webrtc-stats/).

How about:

```webidl
typedef RTCTypedStats = (
  RTCCodecStats or
  RTCInboundRtpStreamStats or
  ...
);

[Exposed=Window]
interface RTCStatsReport {
    // replace object with RTCTypedStats
    readonly maplike<DOMString, RTCTypedStats>;
};

dictionary RTCStats {
    required DOMHighResTimeStamp timestamp;
    // replace enum RTCStatsType with DOMString
    required DOMString           type;
    required DOMString           id;
};
```

... so that we can remove vague `object`s from IDL?

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1905 using your GitHub account

Received on Wednesday, 20 June 2018 01:45:45 UTC