Re: [whatwg/encoding] Add Streams support (#72)

New attempt at the IDL, getting closer to what I'd like to standardise. I've attempted to improve the naming. PTAL.

```idl
dictionary TextDecoderOptions {
  boolean fatal = false;
  boolean ignoreBOM = false;
};

dictionary TextDecodeOptions {
  boolean stream = false;
};

interface mixin TextEncoderAttributes {
  readonly attribute DOMString encoding;
};

interface mixin TextDecoderAttributes {
  readonly attribute DOMString encoding;
  readonly attribute boolean fatal;  
  readonly attribute boolean ignoreBOM;
};

[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
 Exposed=(Window,Worker)]
interface TextDecoder {
  USVString decode(optional BufferSource input, optional TextDecodeOptions options);
};

TextDecoder includes TextDecoderAttributes;

[Constructor,
 Exposed=(Window,Worker)]
interface TextEncoder {
  [NewObject] Uint8Array encode(optional USVString input = "");
};

TextEncoder includes TextEncoderAttributes;

interface mixin GenericTransformStream {
  readonly attribute ReadableStream readable;
  readonly attribute WritableStream writable;
};

[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
 Exposed=(Window,Worker)]
interface TextDecoderStream {
};

TextDecoderStream includes TextDecoderAttributes;
TextDecoderStream includes GeneralTransformStream;

[Constructor,
 Exposed=(Window,Worker)]
interface TextEncoderStream {
};

TextEncoderStream includes GeneralTransformStream;
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/72#issuecomment-398299823

Received on Tuesday, 19 June 2018 07:19:40 UTC