@node-dlc/messaging
Version:
DLC Messaging Protocol
14 lines (13 loc) • 624 B
TypeScript
export declare function sleep(ms: number): Promise<void>;
/**
* Safely converts various input types to BigInt
* @param value Value to convert to BigInt
* @returns BigInt representation of the value, or BigInt(0) for null/undefined
*/
export declare function toBigInt(value: string | number | bigint | null | undefined): bigint;
/**
* Safely converts BigInt to number, preserving precision for safe integers
* @param value BigInt value to convert
* @returns Number if within safe range, otherwise returns the BigInt as-is for JSON serialization
*/
export declare function bigIntToNumber(value: bigint): number | any;