Re: How to represent at key-value map in WebIDL

On Wed, Feb 13, 2013 at 7:17 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 2/13/13 10:06 AM, Adam Bergkvist wrote:
>> What is the correct way to represent a key-value map in WebIDL that is
>> to be returned from a function?
>
> Is this a key-value map with an unbounded set of possible keys?  If so,

If it's a bounded set of possible keys, on the other hand, it's fairly
simple, depending on how you'd like to implement it.

You can either define a dictionary that the method returns, which
translates into a plain JS object with the given keys, or define an
interface, which translates into an object of that class.

~TJ

Received on Wednesday, 13 February 2013 16:48:34 UTC