import { Uint8Array } from '@hazae41/bytes'; import { ZeroHexString, RawHexString } from '@hazae41/hexane'; import { Copiable } from '../../libs/copiable/index.js'; /** * Decode an utf-8 string-like to a zero-hex string */ declare namespace ZeroHexAsUtf8 { type From = string | Uint8Array | ZeroHexString; function fromZeroHexOrThrow(value: ZeroHexString): ZeroHexString; function fromBytesOrThrow(value: Uint8Array): ZeroHexString; function fromStringOrThrow(value: string): ZeroHexString; function fromOrThrow(value: From): ZeroHexString; } /** * Decode an utf-8 string-like to a raw-hex string */ declare namespace RawHexAsUtf8 { type From = string | Uint8Array | ZeroHexString; function fromZeroHexOrThrow(value: ZeroHexString): RawHexString; function fromBytesOrThrow(value: Uint8Array): RawHexString; function fromStringOrThrow(value: string): RawHexString; function fromOrThrow(value: From): RawHexString; } /** * Decode an utf-8 string-like to bytes */ declare namespace BytesAsUtf8 { type From = string | Uint8Array | ZeroHexString; function fromBytesOrThrow(value: Uint8Array): Uint8Array; function fromZeroHexOrThrow(value: ZeroHexString): Uint8Array; function fromStringOrThrow(value: string): Uint8Array; function fromOrThrow(value: From): Uint8Array; } /** * Decode an utf-8 string-like to a string */ declare namespace StringAsUtf8 { type From = string | Uint8Array | ZeroHexString; function fromStringOrThrow(value: string): string; function fromBytesOrThrow(value: Uint8Array): string; function fromZeroHexOrThrow(value: ZeroHexString): string; function fromOrThrow(from: From): string; } /** * Convert an integer-like to a bigint */ declare namespace BigIntAsInteger { type From = string | bigint | number | Uint8Array | ZeroHexString; function fromBigIntOrThrow(value: bigint): bigint; function fromNumberOrThrow(value: number): bigint; function fromZeroHexOrThrow(value: ZeroHexString): bigint; function fromBytesOrThrow(value: Uint8Array): bigint; function fromStringOrThrow(value: string): bigint; function fromOrThrow(value: From): bigint; } /** * Convert an integer-like to a number */ declare namespace NumberAsInteger { type From = string | bigint | number | Uint8Array | ZeroHexString; function fromNumberOrThrow(value: number): number; function fromBigIntOrThrow(value: bigint): number; function fromZeroHexOrThrow(value: ZeroHexString): number; function fromBytesOrThrow(value: Uint8Array): number; function fromStringOrThrow(value: string): number; function fromOrThrow(value: From): number; } /** * Convert an integer-like to a zero-hex string */ declare namespace ZeroHexAsInteger { type From = string | bigint | number | Uint8Array | ZeroHexString; function fromZeroHexOrThrow(value: ZeroHexString): ZeroHexString; function fromBigIntOrThrow(value: bigint): ZeroHexString; function fromNumberOrThrow(value: number): ZeroHexString; function fromBytesOrThrow(value: Uint8Array): ZeroHexString; function fromStringOrThrow(value: string): ZeroHexString; function fromOrThrow(value: From): ZeroHexString; namespace Length { function fromOrThrow(value: ZeroHexAsInteger.From, byteLength: N): ZeroHexString; } } /** * Convert an integer-like to a raw-hex string */ declare namespace RawHexAsInteger { type From = string | bigint | number | Uint8Array | ZeroHexString; function fromZeroHexOrThrow(value: ZeroHexString): RawHexString; function fromBigIntOrThrow(value: bigint): RawHexString; function fromNumberOrThrow(value: number): RawHexString; function fromBytesOrThrow(value: Uint8Array): RawHexString; function fromStringOrThrow(value: string): RawHexString; function fromOrThrow(value: From): RawHexString; namespace Length { function fromOrThrow(value: RawHexAsInteger.From, byteLength: N): RawHexString; } } /** * Convert an integer-like to bytes */ declare namespace BytesAsInteger { type From = string | bigint | number | Uint8Array | ZeroHexString; function fromBigIntOrThrow(value: bigint): Uint8Array; function fromNumberOrThrow(value: number): Uint8Array; function fromZeroHexOrThrow(value: ZeroHexString): Uint8Array; function fromStringOrThrow(value: string): Uint8Array; function fromOrThrow(value: From): Uint8Array; namespace Length { function fromOrThrow(value: BytesAsInteger.From, byteLength: N): Uint8Array; } } declare namespace CopiableBytesAsInteger { type From = string | bigint | number | Uint8Array | ZeroHexString; function fromBytesOrThrow(value: Uint8Array): Copiable; function fromBigIntOrThrow(value: bigint): Copiable; function fromNumberOrThrow(value: number): Copiable; function fromZeroHexOrThrow(value: ZeroHexString): Copiable; function fromStringOrThrow(value: string): Copiable; function fromOrThrow(value: From): Copiable; namespace Length { function fromOrThrow(value: CopiableBytesAsInteger.From, byteLength: N): Copiable>; } } /** * Convert an integer-like to a string */ declare namespace StringAsInteger { type From = string | bigint | number | Uint8Array | ZeroHexString; function fromBigIntOrThrow(value: bigint): string; function fromNumberOrThrow(value: number): string; function fromZeroHexOrThrow(value: ZeroHexString): string; function fromBytesOrThrow(value: Uint8Array): string; function fromOrThrow(value: From): string; } export { BigIntAsInteger, BytesAsInteger, BytesAsUtf8, CopiableBytesAsInteger, NumberAsInteger, RawHexAsInteger, RawHexAsUtf8, StringAsInteger, StringAsUtf8, ZeroHexAsInteger, ZeroHexAsUtf8 };