Fixed a couple methods and types

This commit is contained in:
Weeco
2018-03-20 19:31:37 +01:00
parent 9dee7ddc7d
commit 117e46672d

View File

@@ -4,6 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Definitions by: SINTEF-9012 <https://github.com/SINTEF-9012>
/// <reference types="node" />
import Long = require("long");
declare namespace ByteBuffer {}
@@ -70,7 +71,7 @@ declare class ByteBuffer
/**
* Backing buffer.
*/
buffer: ArrayBuffer;
buffer: Buffer;
/**
* Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation.
@@ -130,12 +131,12 @@ declare class ByteBuffer
/**
* Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer.
*/
static calculateVariant32( value: number ): number;
static calculateVarint32( value: number ): number;
/**
* Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer.
*/
static calculateVariant64( value: number | Long ): number;
static calculateVarint64( value: number | Long ): number;
/**
* Concatenates multiple ByteBuffers into one.
@@ -330,7 +331,7 @@ declare class ByteBuffer
/**
* Reads a length as uint32 prefixed UTF8 encoded string.
*/
readIString( offset?: number ): string;
readIString( offset?: number ): string | { string: string; length: number };
/**
* Reads a 32bit signed integer.This is an alias of ByteBuffer#readInt32.
@@ -375,7 +376,7 @@ declare class ByteBuffer
/**
* Reads an UTF8 encoded string.
*/
readUTF8String( chars: number, offset?: number ): string;
readUTF8String( chars: number, metrics?: number, offset?: number ): string | { string: string; length: number };
/**
* Reads a 16bit unsigned integer.