From 8fcf35037f5ed17cf50c4ca6d09eb313e788e13a Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Thu, 31 Jan 2019 13:46:46 +0100 Subject: [PATCH] [node] correct SlowBuffer --- types/node/buffer.d.ts | 10 ++++++++-- types/node/globals.d.ts | 10 ---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/types/node/buffer.d.ts b/types/node/buffer.d.ts index 86fdfdb36c..1d618f2c4b 100644 --- a/types/node/buffer.d.ts +++ b/types/node/buffer.d.ts @@ -1,6 +1,12 @@ declare module "buffer" { export const INSPECT_MAX_BYTES: number; const BuffType: typeof Buffer; - const SlowBuffType: typeof SlowBuffer; - export { BuffType as Buffer, SlowBuffType as SlowBuffer }; + + export const SlowBuffer: { + /** @deprecated since v6.0.0, use Buffer.allocUnsafeSlow() */ + new(size: number): Buffer; + prototype: Buffer; + }; + + export { BuffType as Buffer }; } diff --git a/types/node/globals.d.ts b/types/node/globals.d.ts index e4f6f40fd1..f95386c9cd 100644 --- a/types/node/globals.d.ts +++ b/types/node/globals.d.ts @@ -249,16 +249,6 @@ declare var module: NodeModule; // Same as module.exports declare var exports: any; -declare const SlowBuffer: { - new(str: string, encoding?: string): Buffer; - new(size: number): Buffer; - new(size: Uint8Array): Buffer; - new(array: any[]): Buffer; - prototype: Buffer; - isBuffer(obj: any): boolean; - byteLength(string: string, encoding?: string): number; - concat(list: Buffer[], totalLength?: number): Buffer; -}; // Buffer class type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex";