w3c_encoding.js (1471B)
1 /* 2 * Copyright 2015 The Closure Compiler Authors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /** 18 * @fileoverview Definitions for W3C's Encoding specification 19 * https://encoding.spec.whatwg.org 20 * @externs 21 */ 22 23 /** 24 * @constructor 25 * @param {string=} encoding 26 * @param {Object=} options 27 */ 28 function TextDecoder(encoding, options) {} 29 30 /** @type {string} **/ TextDecoder.prototype.encoding; 31 /** @type {boolean} **/ TextDecoder.prototype.fatal; 32 /** @type {boolean} **/ TextDecoder.prototype.ignoreBOM; 33 34 /** 35 * @param {!Uint8Array} input 36 * @param {Object=} options 37 * @return {string} 38 */ 39 TextDecoder.prototype.decode = function decode(input, options) {}; 40 41 /** 42 * @constructor 43 * @param {string=} encoding 44 * @param {Object=} options 45 */ 46 function TextEncoder(encoding, options) {} 47 48 /** @type {string} **/ TextEncoder.prototype.encoding; 49 50 /** 51 * @param {string} input 52 * @return {!Uint8Array} 53 */ 54 TextEncoder.prototype.encode = function(input) {};