export type BIntegerStrict = number | bigint; export type BIntegerLoose = BIntegerStrict | boolean; export type BInteger = Strict extends true ? BIntegerStrict : BIntegerLoose; export type BByteStringStrict = string; export type BByteStringLoose = BByteStringStrict | ArrayBuffer; export type BByteString = Strict extends true ? BByteStringStrict : BByteStringLoose; export type BListStrict = BData[]; export type BListLoose = BData[]; export type BList = Strict extends true ? BListStrict : BListLoose; export interface BObjectStrict { [key: BByteString]: BData; } export interface BObjectLoose { [key: BByteString]: BData; } export type BObject = Strict extends true ? BObjectStrict : BObjectLoose; export type BMap = Map, BData>; export type BDictionaryStrict = BObject; export type BDictionaryLoose = BObject | BMap; export type BDictionary = Strict extends true ? BDictionaryStrict : BDictionaryLoose; export type BDataStrict = BInteger | BByteString | BList | BDictionary; export type BDataLoose = BInteger | BByteString | BList | BDictionary | undefined | null; export type BData = Strict extends true ? BDataStrict : BDataLoose; /** * bencode byte: l (stands for list start) */ export declare const BYTE_L = 108; /** * bencode buff: l (stands for list start) */ export declare const BUFF_L: Uint8Array; /** * bencode byte: d (stands for dictionary start) */ export declare const BYTE_D = 100; /** * bencode buff: d (stands for dictionary start) */ export declare const BUFF_D: Uint8Array; /** * bencode byte: e (stands for end) */ export declare const BYTE_E = 101; /** * bencode buff: e (stands for end) */ export declare const BUFF_E: Uint8Array; /** * bencode byte: i (stands for integer start) */ export declare const BYTE_I = 105; /** * bencode buff: i (stands for integer start) */ export declare const BUFF_I: Uint8Array; /** * bencode byte: : (stands for byte string length end) */ export declare const BYTE_COLON = 58; /** * bencode buff: : (stands for byte string length end) */ export declare const BUFF_COLON: Uint8Array; /** * bencode byte: - (stands for -) */ export declare const BYTE_MINUS = 45; /** * bencode buff: - (stands for -) */ export declare const BUFF_MINUS: Uint8Array; /** * bencode byte: 0 (stands for 0) */ export declare const BYTE_0 = 48; /** * bencode buff: 0 (stands for 0) */ export declare const BUFF_0: Uint8Array; /** * is byte digit * @param byte * @returns */ export declare function isDigitByte(byte: number): boolean;