import { ByteVector } from "./byteVector"; export declare class Guards { private static readonly MAX_LONG; private static readonly MAX_ULONG; private static readonly MIN_LONG; static all(value: TElement[], guard: (val: TElement, name: string) => void, name: string): void; static betweenExclusive(value: number, minValue: number, maxValue: number, name: string): void; static betweenInclusive(value: number, minValue: number, maxValue: number, name: string): void; static byte(value: number, name: string): void; static greaterThanInclusive(value: number, lowerBound: number, name: string): void; static equals(value: number, expectedValue: number, name: string): void; static int(value: number, name: string): void; static lessThanInclusive(value: number, upperBound: number, name: string): void; static long(value: bigint, name: string): void; static notNullOrUndefined(value: unknown, name: string): void; static optionalByte(value: number | undefined, name: string): void; /** * Throws if the provided value is not a safe, integer. Use this method instead of * {@link Guards.int()} if validating an argument for use in file manipulation. * @param value Value to validate * @param name Name of the parameter in calling function */ static safeInt(value: number, name: string): void; /** * Throws if the provided value is not a safe, positive integer. Use this method instead of * {@link Guards.uint()} if validating an argument for use in file manipulation. * @param value Value to validate * @param name Name of the parameter in calling function */ static safeUint(value: number, name: string): void; static short(value: number, name: string): void; static truthy(value: object | string, name: string): void; static uint(value: number, name: string, allowZero?: boolean): void; static ushort(value: number, name: string): void; static ulong(value: bigint, name: string): void; } export declare class StringComparison { static caseInsensitive(a: string, b: string): boolean; static caseSensitive(a: string, b: string): boolean; } export declare class FileUtils { static getExtension(name: string): string; } export declare class ArrayUtils { static remove(array: T[], callbackFn: (e: T, i: number) => boolean): void; static isFalsyOrEmpty(array: unknown[]): boolean; static safePush(array: T[], element: T): void; static safePushRange(array: T[], elements: T[]): void; } export declare class NumberUtils { static readonly BIG_ZERO: bigint; static readonly BIG_ONE: bigint; static readonly BIG_TWO: bigint; static readonly BIG_ONE_THOUSAND: bigint; static readonly TICKS_PER_MILLISECOND_BIG: bigint; static readonly TICKS_PER_MILLISECOND_NUM = 10000; static readonly MAX_UINT = 4294967295; static bigPow(x: bigint, y: number): bigint; static hasFlag(haystack: number, needle: number, strict?: boolean): boolean; /** * Performs the same operation as ldexp does in C/C++ * @param x Number to be multiplied by 2^y * @param y Power to raise 2 to * @returns Number x * 2^y */ static ldexp(x: number, y: number): number; /** * Converts .NET DateTime ticks (100 nanosecond units) into milliseconds * @param ticks 100 nanosecond ticks to convert */ static ticksToMilli(ticks: bigint | number): number; /** * Provides way to do unsigned bitwise AND without all the mess of parenthesis. * @param x Left operand * @param y Right operand * @returns Number (x & y) >>> 0 */ static uintAnd(x: number, y: number): number; /** * Provides way to do unsigned bitwise OR without all the mess of parenthesis. * @param numbers Operands to bitwise or together * @returns Number (x | y | ...) >>> 0 */ static uintOr(...numbers: number[]): number; /** * Provides way to do unsigned bitwise XOR without all the mess of parenthesis. * @param x Left operand * @param y Right operant * @returns Number (x ^ y) >>> 0 */ static uintXor(x: number, y: number): number; /** * Provides way to do unsigned bitshift left without all the mess of parenthesis. * @param x Number * @param y Bits to shift to the left * @returns Number (x << y) >>> 0; */ static uintLShift(x: number, y: number): number; /** * Provides unified way to do unsigned right bitshift. * @param x Number * @param y Bits to shift to the right */ static uintRShift(x: number, y: number): number; /** * Converts IEEE 80-bit floating point numbers (SANE "extended" type) to double precision * floating point number. * @source http://www33146ue.sakura.ne.jp/staff/iz/formats/ieee.c */ static convertFromIeeeExtended(bytes: ByteVector): number; } export declare class StringUtils { static readonly BCP47_REGEX: RegExp; static readonly ISO369_2_REGEX: RegExp; static readonly PRINTABLE_REGEX: RegExp; static findLastByteFromRight(haystack: string, needle: number): number; static isBcp47(value: string): boolean; static isIso3692(value: string): boolean; static trimStart(toTrim: string, chars: string): string; } export declare class DateUtils { /** * Formats a date as a YYYY-MM-ddThh:mm:ss. */ static format(date: Date | undefined): string | undefined; private static padNumber; }