UNPKG

@tdb/web

Version:

Common condiguration for serving a web-site and testing web-based UI components.

407 lines (323 loc) 10.2 kB
export default Long; declare class Long { /** * 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. */ constructor(low: number, high?: number, unsigned?: boolean); /** * Maximum unsigned value. */ public static MAX_UNSIGNED_VALUE: Long; /** * Maximum signed value. */ public static MAX_VALUE: Long; /** * Minimum signed value. */ public static MIN_VALUE: Long; /** * Signed negative one. */ public static NEG_ONE: Long; /** * Signed one. */ public static ONE: Long; /** * Unsigned one. */ public static UONE: Long; /** * Unsigned zero. */ public static UZERO: Long; /** * Signed zero */ public static ZERO: Long; /** * The high 32 bits as a signed value. */ public high: number; /** * The low 32 bits as a signed value. */ public low: number; /** * Whether unsigned or not. */ public unsigned: boolean; /** * 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. */ public static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; /** * Returns a Long representing the given 32 bit integer value. */ public static fromInt(value: number, unsigned?: boolean): Long; /** * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. */ public static fromNumber(value: number, unsigned?: boolean): Long; /** * Returns a Long representation of the given string, written using the specified radix. */ public static fromString(str: string, unsigned?: boolean | number, radix?: number): Long; /** * Creates a Long from its byte representation. */ public static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; /** * Creates a Long from its little endian byte representation. */ public static fromBytesLE(bytes: number[], unsigned?: boolean): Long; /** * Creates a Long from its little endian byte representation. */ public static fromBytesBE(bytes: number[], unsigned?: boolean): Long; /** * Tests if the specified object is a Long. */ public static isLong(obj: any): obj is Long; /** * Converts the specified value to a Long. */ public static fromValue(val: Long | number | string | {low: number, high: number, unsigned: boolean}, unsigned?: boolean): Long; /** * Returns the sum of this and the specified Long. */ public add(addend: number | Long | string): Long; /** * Returns the bitwise AND of this Long and the specified. */ public and(other: Long | number | string): Long; /** * Compares this Long's value with the specified's. */ public compare(other: Long | number | string): number; /** * Compares this Long's value with the specified's. */ public comp(other: Long | number | string): number; /** * Returns this Long divided by the specified. */ public divide(divisor: Long | number | string): Long; /** * Returns this Long divided by the specified. */ public div(divisor: Long | number | string): Long; /** * Tests if this Long's value equals the specified's. */ public equals(other: Long | number | string): boolean; /** * Tests if this Long's value equals the specified's. */ public eq(other: Long | number | string): boolean; /** * Gets the high 32 bits as a signed integer. */ public getHighBits(): number; /** * Gets the high 32 bits as an unsigned integer. */ public getHighBitsUnsigned(): number; /** * Gets the low 32 bits as a signed integer. */ public getLowBits(): number; /** * Gets the low 32 bits as an unsigned integer. */ public getLowBitsUnsigned(): number; /** * Gets the number of bits needed to represent the absolute value of this Long. */ public getNumBitsAbs(): number; /** * Tests if this Long's value is greater than the specified's. */ public greaterThan(other: Long | number | string): boolean; /** * Tests if this Long's value is greater than the specified's. */ public gt(other: Long | number | string): boolean; /** * Tests if this Long's value is greater than or equal the specified's. */ public greaterThanOrEqual(other: Long | number | string): boolean; /** * Tests if this Long's value is greater than or equal the specified's. */ public gte(other: Long | number | string): boolean; /** * Tests if this Long's value is greater than or equal the specified's. */ public ge(other: Long | number | string): boolean; /** * Tests if this Long's value is even. */ public isEven(): boolean; /** * Tests if this Long's value is negative. */ public isNegative(): boolean; /** * Tests if this Long's value is odd. */ public isOdd(): boolean; /** * Tests if this Long's value is positive. */ public isPositive(): boolean; /** * Tests if this Long's value equals zero. */ public isZero(): boolean; /** * Tests if this Long's value equals zero. */ public eqz(): boolean; /** * Tests if this Long's value is less than the specified's. */ public lessThan(other: Long | number | string): boolean; /** * Tests if this Long's value is less than the specified's. */ public lt(other: Long | number | string): boolean; /** * Tests if this Long's value is less than or equal the specified's. */ public lessThanOrEqual(other: Long | number | string): boolean; /** * Tests if this Long's value is less than or equal the specified's. */ public lte(other: Long | number | string): boolean; /** * Tests if this Long's value is less than or equal the specified's. */ public le(other: Long | number | string): boolean; /** * Returns this Long modulo the specified. */ public modulo(other: Long | number | string): Long; /** * Returns this Long modulo the specified. */ public mod(other: Long | number | string): Long; /** * Returns this Long modulo the specified. */ public rem(other: Long | number | string): Long; /** * Returns the product of this and the specified Long. */ public multiply(multiplier: Long | number | string): Long; /** * Returns the product of this and the specified Long. */ public mul(multiplier: Long | number | string): Long; /** * Negates this Long's value. */ public negate(): Long; /** * Negates this Long's value. */ public neg(): Long; /** * Returns the bitwise NOT of this Long. */ public not(): Long; /** * Tests if this Long's value differs from the specified's. */ public notEquals(other: Long | number | string): boolean; /** * Tests if this Long's value differs from the specified's. */ public neq(other: Long | number | string): boolean; /** * Tests if this Long's value differs from the specified's. */ public ne(other: Long | number | string): boolean; /** * Returns the bitwise OR of this Long and the specified. */ public or(other: Long | number | string): Long; /** * Returns this Long with bits shifted to the left by the given amount. */ public shiftLeft(numBits: number | Long): Long; /** * Returns this Long with bits shifted to the left by the given amount. */ public shl(numBits: number | Long): Long; /** * Returns this Long with bits arithmetically shifted to the right by the given amount. */ public shiftRight(numBits: number | Long): Long; /** * Returns this Long with bits arithmetically shifted to the right by the given amount. */ public shr(numBits: number | Long): Long; /** * Returns this Long with bits logically shifted to the right by the given amount. */ public shiftRightUnsigned(numBits: number | Long): Long; /** * Returns this Long with bits logically shifted to the right by the given amount. */ public shru(numBits: number | Long): Long; /** * Returns this Long with bits logically shifted to the right by the given amount. */ public shr_u(numBits: number | Long): Long; /** * Returns the difference of this and the specified Long. */ public subtract(subtrahend: number | Long | string): Long; /** * Returns the difference of this and the specified Long. */ public sub(subtrahend: number | Long |string): Long; /** * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ public toInt(): number; /** * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ public toNumber(): number; /** * Converts this Long to its byte representation. */ public toBytes(le?: boolean): number[]; /** * Converts this Long to its little endian byte representation. */ public toBytesLE(): number[]; /** * Converts this Long to its big endian byte representation. */ public toBytesBE(): number[]; /** * Converts this Long to signed. */ public toSigned(): Long; /** * Converts the Long to a string written in the specified radix. */ public toString(radix?: number): string; /** * Converts this Long to unsigned. */ public toUnsigned(): Long; /** * Returns the bitwise XOR of this Long and the given one. */ public xor(other: Long | number | string): Long; }