interface LongConstructor {
    new LongConstructornew (low: number, high?: number, unsigned?: boolean): Long.Long;
    MAX_UNSIGNED_VALUE: Long.Long;
    MAX_VALUE: Long.Long;
    MIN_VALUE: Long.Long;
    NEG_ONE: Long.Long;
    ONE: Long.Long;
    prototype: Long.Long;
    UONE: Long.Long;
    UZERO: Long.Long;
    ZERO: Long.Long;
    fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long.Long;
    fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long.Long;
    fromBytesBE(bytes: number[], unsigned?: boolean): Long.Long;
    fromBytesLE(bytes: number[], unsigned?: boolean): Long.Long;
    fromInt(value: number, unsigned?: boolean): Long.Long;
    fromNumber(value: number, unsigned?: boolean): Long.Long;
    fromString(str: string, unsigned?: number | boolean, radix?: number): Long.Long;
    fromValue(val:
        | string
        | number
        | Long.Long
        | {
            high: number;
            low: number;
            unsigned: boolean;
        }, unsigned?: boolean): Long.Long;
    isLong(obj: any): obj is Long.Long;
}

Constructors

  • Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs.

    Parameters

    • low: number
    • Optionalhigh: number
    • Optionalunsigned: boolean

    Returns Long.Long

Properties

MAX_UNSIGNED_VALUE: Long.Long

Maximum unsigned value.

MAX_VALUE: Long.Long

Maximum signed value.

MIN_VALUE: Long.Long

Minimum signed value.

NEG_ONE: Long.Long

Signed negative one.

ONE: Long.Long

Signed one.

prototype: Long.Long
UONE: Long.Long

Unsigned one.

UZERO: Long.Long

Unsigned zero.

ZERO: Long.Long

Signed zero

Methods

  • Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits.

    Parameters

    • lowBits: number
    • highBits: number
    • Optionalunsigned: boolean

    Returns Long.Long

  • Creates a Long from its byte representation.

    Parameters

    • bytes: number[]
    • Optionalunsigned: boolean
    • Optionalle: boolean

    Returns Long.Long

  • Creates a Long from its little endian byte representation.

    Parameters

    • bytes: number[]
    • Optionalunsigned: boolean

    Returns Long.Long

  • Creates a Long from its little endian byte representation.

    Parameters

    • bytes: number[]
    • Optionalunsigned: boolean

    Returns Long.Long

  • Returns a Long representing the given 32 bit integer value.

    Parameters

    • value: number
    • Optionalunsigned: boolean

    Returns Long.Long

  • Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.

    Parameters

    • value: number
    • Optionalunsigned: boolean

    Returns Long.Long

  • Returns a Long representation of the given string, written using the specified radix.

    Parameters

    • str: string
    • Optionalunsigned: number | boolean
    • Optionalradix: number

    Returns Long.Long

  • Converts the specified value to a Long.

    Parameters

    • val:
          | string
          | number
          | Long.Long
          | {
              high: number;
              low: number;
              unsigned: boolean;
          }
    • Optionalunsigned: boolean

    Returns Long.Long

  • Tests if the specified object is a Long.

    Parameters

    • obj: any

    Returns obj is Long.Long