Remove types from VCS

This commit is contained in:
willclarktech
2021-02-09 14:57:24 +00:00
parent 31cdd91991
commit 1c6f3ee9a5
151 changed files with 0 additions and 11856 deletions
-46
View File
@@ -1,46 +0,0 @@
import { Uint32, Uint53, Uint64 } from "./integers";
/**
* A type for arbitrary precision, non-negative decimals.
*
* Instances of this class are immutable.
*/
export declare class Decimal {
static fromUserInput(input: string, fractionalDigits: number): Decimal;
static fromAtomics(atomics: string, fractionalDigits: number): Decimal;
private static verifyFractionalDigits;
static compare(a: Decimal, b: Decimal): number;
get atomics(): string;
get fractionalDigits(): number;
private readonly data;
private constructor();
toString(): string;
/**
* Returns an approximation as a float type. Only use this if no
* exact calculation is required.
*/
toFloatApproximation(): number;
/**
* a.plus(b) returns a+b.
*
* Both values need to have the same fractional digits.
*/
plus(b: Decimal): Decimal;
/**
* a.minus(b) returns a-b.
*
* Both values need to have the same fractional digits.
* The resulting difference needs to be non-negative.
*/
minus(b: Decimal): Decimal;
/**
* a.multiply(b) returns a*b.
*
* We only allow multiplication by unsigned integers to avoid rounding errors.
*/
multiply(b: Uint32 | Uint53 | Uint64): Decimal;
equals(b: Decimal): boolean;
isLessThan(b: Decimal): boolean;
isLessThanOrEqual(b: Decimal): boolean;
isGreaterThan(b: Decimal): boolean;
isGreaterThanOrEqual(b: Decimal): boolean;
}
-2
View File
@@ -1,2 +0,0 @@
export { Decimal } from "./decimal";
export { Int53, Uint32, Uint53, Uint64 } from "./integers";
-61
View File
@@ -1,61 +0,0 @@
/** Internal interface to ensure all integer types can be used equally */
interface Integer {
readonly toNumber: () => number;
readonly toString: () => string;
}
interface WithByteConverters {
readonly toBytesBigEndian: () => Uint8Array;
readonly toBytesLittleEndian: () => Uint8Array;
}
export declare class Uint32 implements Integer, WithByteConverters {
/** @deprecated use Uint32.fromBytes */
static fromBigEndianBytes(bytes: ArrayLike<number>): Uint32;
/**
* Creates a Uint32 from a fixed length byte array.
*
* @param bytes a list of exactly 4 bytes
* @param endianess defaults to big endian
*/
static fromBytes(bytes: ArrayLike<number>, endianess?: "be" | "le"): Uint32;
static fromString(str: string): Uint32;
protected readonly data: number;
constructor(input: number);
toBytesBigEndian(): Uint8Array;
toBytesLittleEndian(): Uint8Array;
toNumber(): number;
toString(): string;
}
export declare class Int53 implements Integer {
static fromString(str: string): Int53;
protected readonly data: number;
constructor(input: number);
toNumber(): number;
toString(): string;
}
export declare class Uint53 implements Integer {
static fromString(str: string): Uint53;
protected readonly data: Int53;
constructor(input: number);
toNumber(): number;
toString(): string;
}
export declare class Uint64 implements Integer, WithByteConverters {
/** @deprecated use Uint64.fromBytes */
static fromBytesBigEndian(bytes: ArrayLike<number>): Uint64;
/**
* Creates a Uint64 from a fixed length byte array.
*
* @param bytes a list of exactly 8 bytes
* @param endianess defaults to big endian
*/
static fromBytes(bytes: ArrayLike<number>, endianess?: "be" | "le"): Uint64;
static fromString(str: string): Uint64;
static fromNumber(input: number): Uint64;
private readonly data;
private constructor();
toBytesBigEndian(): Uint8Array;
toBytesLittleEndian(): Uint8Array;
toString(): string;
toNumber(): number;
}
export {};