diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-29 22:38:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 22:38:10 +0200 |
commit | d308e8d0c0469419517e05a36ba070633168dc67 (patch) | |
tree | 1b9b76c8a443cb781f6c557e964ebae73d64c4bc /cli/js/lib.deno.ns.d.ts | |
parent | b51c863550cb377f6e720bccf4f1485ed8d97222 (diff) |
BREAKING: remove custom implementation of Deno.Buffer.toString() (#4992)
Keep in mind Buffer.toString() still exists, but returns [object Object].
Reason for removal of Buffer.toString() was that it implicitly used
TextDecoder with fixed "utf-8" encoding and no way to customize
the encoding.
Diffstat (limited to 'cli/js/lib.deno.ns.d.ts')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index d7d885b5b..aca0fc114 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -847,12 +847,6 @@ declare namespace Deno { * least until the next buffer modification, so immediate changes to the * slice will affect the result of future reads. */ bytes(): Uint8Array; - /** Returns the contents of the unread portion of the buffer as a `string`. - * - * **Warning**: if multibyte characters are present when data is flowing - * through the buffer, this method may result in incorrect strings due to a - * character being split. */ - toString(): string; /** Returns whether the unread portion of the buffer is empty. */ empty(): boolean; /** A read only number of bytes of the unread portion of the buffer. */ @@ -873,9 +867,15 @@ declare namespace Deno { readSync(p: Uint8Array): number | null; /** Reads the next `p.length` bytes from the buffer or until the buffer is * drained. Resolves to the number of bytes read. If the buffer has no - * data to return, resolves to EOF (`null`). */ + * data to return, resolves to EOF (`null`). + * + * NOTE: This methods reads bytes sychronously; it's provided for + * compatibility with `Reader` interfaces. + */ read(p: Uint8Array): Promise<number | null>; writeSync(p: Uint8Array): number; + /** NOTE: This methods writes bytes sychronously; it's provided for + * compatibility with `Writer` interface. */ write(p: Uint8Array): Promise<number>; /** Grows the buffer's capacity, if necessary, to guarantee space for * another `n` bytes. After `.grow(n)`, at least `n` bytes can be written to |