From 8bf89a5e2b36452319e5cb9400841cd03864acbd Mon Sep 17 00:00:00 2001 From: Sergey Ukustov Date: Tue, 27 Aug 2019 16:50:41 +0400 Subject: [PATCH] Add reverse() method, and allow Buffer.from(Uint8Array) --- index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 623a6613..0227c9c2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -29,6 +29,7 @@ export class Buffer extends Uint8Array { readFloatBE(offset: number, noAssert?: boolean): number; readDoubleLE(offset: number, noAssert?: boolean): number; readDoubleBE(offset: number, noAssert?: boolean): number; + reverse(): this; swap16(): Buffer; swap32(): Buffer; swap64(): Buffer; @@ -113,7 +114,7 @@ export class Buffer extends Uint8Array { * * @param buffer */ - static from(buffer: Buffer): Buffer; + static from(buffer: Buffer | Uint8Array): Buffer; /** * Creates a new Buffer containing the given JavaScript string {str}. * If provided, the {encoding} parameter identifies the character encoding. @@ -182,4 +183,4 @@ export class Buffer extends Uint8Array { * @param size count of octets to allocate */ static allocUnsafeSlow(size: number): Buffer; -} \ No newline at end of file +}