lucacasonato / proposal-binary-encoding

A proposal to add modern, easy to use binary encoders to the web platform.
Other
40 stars 1 forks source link

Should there be a streaming variant of the API? #2

Open lucacasonato opened 3 years ago

lucacasonato commented 3 years ago

Three questions that should be answered:

  1. Should there be a streaming variant of this API?
  2. Should it be using a TransformStream style API (TextEncoderStream / TextDecoderStream), or should we use a synchronous API (TextDecoder style)? Or should we have both?
  3. Should these be included in the first iteration of this proposal, or should this be an extension for later?
saschanaz commented 1 year ago

Maybe we can have streaming variants + static functions? (#8)

[Exposed=*]
interface BinaryDecoder {
  constructor(BinaryEncoding encoding);

  readonly attribute BinaryEncoding encoding;

  [NewObject] static Uint8Array decode(BinaryEncoding encoding, DOMString input);
};
BinaryDecoder includes GenericTransformStream;