From 804c6cce56dfbeec2d5b1ed4ae142ed0e845d025 Mon Sep 17 00:00:00 2001 From: Kannan Goundan Date: Fri, 10 May 2019 00:45:58 -0700 Subject: [PATCH] lib/node: Add util.TextDecoder/TextEncoder --- lib/node.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/node.js b/lib/node.js index dda05cc2f60..1b5906f4f37 100644 --- a/lib/node.js +++ b/lib/node.js @@ -2023,6 +2023,25 @@ declare module "util" { declare function deprecate(f: Function, string: string): Function; declare function promisify(f: Function): Function; declare function callbackify(f: Function): Function; + + declare class TextDecoder { + constructor(encoding?: string, options: { + fatal?: boolean, + ignoreBOM?: boolean, + }); + decode(input?: ArrayBuffer | DataView | $TypedArray, options?: { + stream?: boolean, + }): string; + encoding: string; + fatal: boolean; + ignoreBOM: boolean; + } + + declare class TextEncoder { + constructor(); + encode(input?: string): Uint8Array; + encoding: string; + } } type vm$ScriptOptions = {