mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:47:34 +00:00
LibWeb: Add constructor options to TextDecoder
This commit is contained in:
parent
9ed8c0b183
commit
f1ead552ce
5 changed files with 47 additions and 15 deletions
|
@ -1,13 +1,27 @@
|
|||
[Exposed=(Window,Worker)]
|
||||
interface TextDecoder {
|
||||
// FIXME: 'optional TextDecoderOptions options = {}'
|
||||
constructor(optional DOMString label = "utf-8");
|
||||
|
||||
// FIXME: [AllowShared] on the first parameter.
|
||||
// FIXME: 'optional TextDecodeOptions options = {}'
|
||||
USVString decode(optional BufferSource input);
|
||||
|
||||
// https://encoding.spec.whatwg.org/#textdecodercommon
|
||||
interface mixin TextDecoderCommon {
|
||||
readonly attribute DOMString encoding;
|
||||
readonly attribute boolean fatal;
|
||||
readonly attribute boolean ignoreBOM;
|
||||
};
|
||||
|
||||
// https://encoding.spec.whatwg.org/#textdecoderoptions
|
||||
dictionary TextDecoderOptions {
|
||||
boolean fatal = false;
|
||||
boolean ignoreBOM = false;
|
||||
};
|
||||
|
||||
// https://encoding.spec.whatwg.org/#textdecodeoptions
|
||||
dictionary TextDecodeOptions {
|
||||
boolean stream = false;
|
||||
};
|
||||
|
||||
// https://encoding.spec.whatwg.org/#textdecoder
|
||||
[Exposed=*]
|
||||
interface TextDecoder {
|
||||
constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options = {});
|
||||
|
||||
// FIXME: BufferSource is really a AllowSharedBufferSource
|
||||
USVString decode(optional BufferSource input, optional TextDecodeOptions options = {});
|
||||
};
|
||||
TextDecoder includes TextDecoderCommon;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue