@hazae41/binary
Advanced tools
Comparing version 1.0.9 to 1.1.0
@@ -1,10 +0,11 @@ | ||
declare class Binary { | ||
buffer: Buffer; | ||
declare class Binary<T extends Uint8Array> { | ||
bytes: T; | ||
offset: number; | ||
readonly view: DataView; | ||
readonly data: DataView; | ||
/** | ||
* An object with a Buffer and an offset | ||
* @param buffer Buffer | ||
* @param bytes Buffer | ||
*/ | ||
constructor(buffer: Buffer); | ||
constructor(bytes: T); | ||
get buffer(): Buffer; | ||
/** | ||
@@ -15,3 +16,3 @@ * Create a new Binary using Buffer.alloc | ||
*/ | ||
static alloc(length: number): Binary; | ||
static alloc(length: number): Binary<Buffer>; | ||
/** | ||
@@ -22,3 +23,3 @@ * Create a new Binary using Buffer.allocUnsafe | ||
*/ | ||
static allocUnsafe(length: number): Binary; | ||
static allocUnsafe(length: number): Binary<Buffer>; | ||
/** | ||
@@ -32,3 +33,3 @@ * @returns number of remaining bytes | ||
*/ | ||
get before(): Buffer; | ||
get before(): Uint8Array; | ||
/** | ||
@@ -38,3 +39,3 @@ * Get a slice of the buffer after the current offset | ||
*/ | ||
get after(): Buffer; | ||
get after(): Uint8Array; | ||
/** | ||
@@ -45,3 +46,3 @@ * Get a slice of the buffer | ||
*/ | ||
get(length: number): Buffer; | ||
get(length: number): Uint8Array; | ||
/** | ||
@@ -53,3 +54,3 @@ * Read a slice of the buffer | ||
*/ | ||
read(length: number): Buffer; | ||
read(length: number): Uint8Array; | ||
/** | ||
@@ -199,3 +200,3 @@ * Set an array to the buffer | ||
*/ | ||
getNulled(): Buffer; | ||
getNulled(): Uint8Array; | ||
/** | ||
@@ -205,3 +206,3 @@ * Read a NULL-terminated slice | ||
*/ | ||
readNulled(): Buffer; | ||
readNulled(): Uint8Array; | ||
/** | ||
@@ -246,3 +247,3 @@ * Set a NULL-terminated array | ||
*/ | ||
reread(offset: number): Buffer; | ||
reread(offset: number): Uint8Array; | ||
/** | ||
@@ -249,0 +250,0 @@ * @deprecated |
{ | ||
"type": "module", | ||
"name": "@hazae41/binary", | ||
"version": "1.0.9", | ||
"version": "1.1.0", | ||
"description": "Zero-copy Buffer reader and writer", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/hazae41/binary", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60913
16
1038