Merge pull request #28900 from ljharb/buffer_constructor

`node`: [fix] node buffers have a `constructor` property
This commit is contained in:
Jesse Trinity
2018-09-21 16:16:22 -07:00
committed by GitHub
2 changed files with 2 additions and 0 deletions

View File

@@ -270,6 +270,7 @@ declare var SlowBuffer: {
// Buffer class
type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex";
interface Buffer extends Uint8Array {
constructor: typeof Buffer;
write(string: string, offset?: number, length?: number, encoding?: string): number;
toString(encoding?: string, start?: number, end?: number): string;
toJSON(): { type: 'Buffer', data: any[] };

View File

@@ -260,6 +260,7 @@ declare var SlowBuffer: {
// Buffer class
type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex";
interface Buffer extends Uint8Array {
constructor: typeof Buffer;
write(string: string, offset?: number, length?: number, encoding?: string): number;
toString(encoding?: string, start?: number, end?: number): string;
toJSON(): { type: 'Buffer', data: any[] };