2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-09-28 14:19:18 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
2012-10-25 06:03:21 +04:00
|
|
|
* http://encoding.spec.whatwg.org/#interface-textencoder
|
2012-09-28 14:19:18 +04:00
|
|
|
*
|
2012-10-25 06:03:21 +04:00
|
|
|
* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
2012-09-28 14:19:18 +04:00
|
|
|
*/
|
|
|
|
|
2018-12-17 19:44:43 +03:00
|
|
|
dictionary TextEncoderEncodeIntoResult {
|
|
|
|
unsigned long long read;
|
|
|
|
unsigned long long written;
|
|
|
|
};
|
|
|
|
|
2018-10-21 03:02:53 +03:00
|
|
|
[Constructor, Exposed=(Window,Worker)]
|
2012-09-28 14:19:18 +04:00
|
|
|
interface TextEncoder {
|
2012-12-26 02:00:15 +04:00
|
|
|
[Constant]
|
2012-09-28 14:19:18 +04:00
|
|
|
readonly attribute DOMString encoding;
|
2017-04-27 13:27:03 +03:00
|
|
|
/*
|
|
|
|
* This is spec-wise USVString but marking it as
|
|
|
|
* DOMString to avoid duplicate work. Since the
|
|
|
|
* UTF-16 to UTF-8 converter performs processing
|
|
|
|
* that's equivalent to first converting a
|
|
|
|
* DOMString to a USVString, let's avoid having
|
|
|
|
* the binding code doing it, too.
|
|
|
|
*/
|
2015-01-12 19:52:25 +03:00
|
|
|
[NewObject]
|
2017-04-27 13:27:03 +03:00
|
|
|
Uint8Array encode(optional DOMString input = "");
|
2018-12-17 19:44:43 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The same comment about USVString as above applies here.
|
|
|
|
*/
|
|
|
|
TextEncoderEncodeIntoResult encodeInto(DOMString source, Uint8Array destination);
|
2012-09-28 14:19:18 +04:00
|
|
|
};
|