mirror of
https://github.com/codedread/bitjs
synced 2025-10-04 01:59:15 +02:00
Update Typescript types for 1.1.0
This commit is contained in:
parent
63e84dadb0
commit
3120bba0df
12 changed files with 388 additions and 242 deletions
85
types/io/bytebuffer.d.ts
vendored
85
types/io/bytebuffer.d.ts
vendored
|
@ -1,41 +1,46 @@
|
|||
export const ByteBuffer: {
|
||||
new (numBytes: number): {
|
||||
/**
|
||||
* @type {Uint8Array}
|
||||
* @public
|
||||
*/
|
||||
data: Uint8Array;
|
||||
/**
|
||||
* @type {number}
|
||||
* @public
|
||||
*/
|
||||
ptr: number;
|
||||
/**
|
||||
* @param {number} b The byte to insert.
|
||||
*/
|
||||
insertByte(b: number): void;
|
||||
/**
|
||||
* @param {Array.<number>|Uint8Array|Int8Array} bytes The bytes to insert.
|
||||
*/
|
||||
insertBytes(bytes: Array<number> | Uint8Array | Int8Array): void;
|
||||
/**
|
||||
* Writes an unsigned number into the next n bytes. If the number is too large
|
||||
* to fit into n bytes or is negative, an error is thrown.
|
||||
* @param {number} num The unsigned number to write.
|
||||
* @param {number} numBytes The number of bytes to write the number into.
|
||||
*/
|
||||
writeNumber(num: number, numBytes: number): void;
|
||||
/**
|
||||
* Writes a signed number into the next n bytes. If the number is too large
|
||||
* to fit into n bytes, an error is thrown.
|
||||
* @param {number} num The signed number to write.
|
||||
* @param {number} numBytes The number of bytes to write the number into.
|
||||
*/
|
||||
writeSignedNumber(num: number, numBytes: number): void;
|
||||
/**
|
||||
* @param {string} str The ASCII string to write.
|
||||
*/
|
||||
writeASCIIString(str: string): void;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* A write-only Byte buffer which uses a Uint8 Typed Array as a backing store.
|
||||
*/
|
||||
export class ByteBuffer {
|
||||
/**
|
||||
* @param {number} numBytes The number of bytes to allocate.
|
||||
*/
|
||||
constructor(numBytes: number);
|
||||
/**
|
||||
* @type {Uint8Array}
|
||||
* @public
|
||||
*/
|
||||
public data: Uint8Array;
|
||||
/**
|
||||
* @type {number}
|
||||
* @public
|
||||
*/
|
||||
public ptr: number;
|
||||
/**
|
||||
* @param {number} b The byte to insert.
|
||||
*/
|
||||
insertByte(b: number): void;
|
||||
/**
|
||||
* @param {Array.<number>|Uint8Array|Int8Array} bytes The bytes to insert.
|
||||
*/
|
||||
insertBytes(bytes: Array<number> | Uint8Array | Int8Array): void;
|
||||
/**
|
||||
* Writes an unsigned number into the next n bytes. If the number is too large
|
||||
* to fit into n bytes or is negative, an error is thrown.
|
||||
* @param {number} num The unsigned number to write.
|
||||
* @param {number} numBytes The number of bytes to write the number into.
|
||||
*/
|
||||
writeNumber(num: number, numBytes: number): void;
|
||||
/**
|
||||
* Writes a signed number into the next n bytes. If the number is too large
|
||||
* to fit into n bytes, an error is thrown.
|
||||
* @param {number} num The signed number to write.
|
||||
* @param {number} numBytes The number of bytes to write the number into.
|
||||
*/
|
||||
writeSignedNumber(num: number, numBytes: number): void;
|
||||
/**
|
||||
* @param {string} str The ASCII string to write.
|
||||
*/
|
||||
writeASCIIString(str: string): void;
|
||||
}
|
||||
//# sourceMappingURL=bytebuffer.d.ts.map
|
Loading…
Add table
Add a link
Reference in a new issue