From: Sergey Ukustov Date: Tue, 27 Aug 2019 12:50:41 +0000 (+0400) Subject: Add reverse() method, and allow Buffer.from(Uint8Array) X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=8bf89a5e2b36452319e5cb9400841cd03864acbd;p=buffer.git Add reverse() method, and allow Buffer.from(Uint8Array) --- diff --git a/index.d.ts b/index.d.ts index 623a661..0227c9c 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 +}