-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #470 This commit increases exe size out/release/deno 48M -> 52M
- Loading branch information
Showing
6 changed files
with
92 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright 2018 the Deno authors. All rights reserved. MIT license. | ||
// In order to avoid importing all of lib.dom.d.ts we include type defintiions | ||
// for text-encoding polyfill below. Ideally we could use @types/text-encoding | ||
// but it depends on lib.dom.d.ts. | ||
// https://github.com/DefinitelyTyped/DefinitelyTyped/commit/f9a3f3c2da18980f7c5b089eb6d298dc0fd3797b#r30007625 | ||
|
||
type BufferSource = ArrayBufferView | ArrayBuffer; | ||
|
||
interface TextDecodeOptions { | ||
stream?: boolean; | ||
} | ||
|
||
interface TextDecoderOptions { | ||
fatal?: boolean; | ||
ignoreBOM?: boolean; | ||
} | ||
|
||
interface TextDecoder { | ||
/** | ||
* Returns encoding's name, lowercased. | ||
*/ | ||
readonly encoding: string; | ||
/** | ||
* Returns true if error mode is "fatal", and false | ||
* otherwise. | ||
*/ | ||
readonly fatal: boolean; | ||
/** | ||
* Returns true if ignore BOM flag is set, and false otherwise. | ||
*/ | ||
readonly ignoreBOM: boolean; | ||
/** | ||
* Returns the result of running encoding's decoder. The | ||
* method can be invoked zero or more times with options's stream set to | ||
* true, and then once without options's stream (or set to false), to process | ||
* a fragmented stream. If the invocation without options's stream (or set to | ||
* false) has no input, it's clearest to omit both arguments. | ||
* var string = "", decoder = new TextDecoder(encoding), buffer; | ||
* while(buffer = next_chunk()) { | ||
* string += decoder.decode(buffer, {stream:true}); | ||
* } | ||
* string += decoder.decode(); // end-of-stream | ||
* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError. | ||
*/ | ||
decode(input?: BufferSource, options?: TextDecodeOptions): string; | ||
} | ||
|
||
interface TextEncoder { | ||
/** | ||
* Returns "utf-8". | ||
*/ | ||
readonly encoding: string; | ||
/** | ||
* Returns the result of running UTF-8's encoder. | ||
*/ | ||
encode(input?: string): Uint8Array; | ||
} | ||
|
||
declare module "text-encoding" { | ||
export let TextDecoder: { | ||
prototype: TextDecoder; | ||
new (label?: string, options?: TextDecoderOptions): TextDecoder; | ||
}; | ||
|
||
export let TextEncoder: { | ||
prototype: TextEncoder; | ||
new (): TextEncoder; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule third_party
updated
6 files