W3C home > Mailing lists > Public > public-webrtc@w3.org > June 2018

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

From: Kagami Sascha Rosylight via GitHub <sysbot+gh@w3.org>
Date: Wed, 20 Jun 2018 01:45:42 +0000
To: public-webrtc@w3.org
Message-ID: <issues.opened-333895777-1529459139-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:18:42 UTC