import type { Buff } from './class/buff.js' import type { Stream } from './class/stream.js' /** * Types that can be converted to a Buff. * Includes byte representations (Bytes), numbers, and bigints. */ export type Buffable = Bytes | number | bigint /** * Types that represent raw byte data. * - string: Hexadecimal string (e.g., 'ff00') * - Uint8Array: Native byte array * - Buff: Buff instance * - Stream: Stream instance (consumed from current position) */ export type Bytes = string | Uint8Array | Buff | Stream /** * Byte order for multi-byte values. * - 'le': Little-endian (least significant byte first) * - 'be': Big-endian (most significant byte first) */ export type Endian = 'le' | 'be' /** * Function for transforming values during JSON.stringify(). * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#the_replacer_parameter */ export type Replacer = (this : unknown, key : string, value : unknown) => unknown /** * Function for transforming values during JSON.parse(). * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#the_reviver_parameter */ export type Reviver = (this : unknown, key : string, value : unknown) => unknown