UNPKG

opnet

Version:

The perfect library for building Bitcoin-based applications.

25 lines (24 loc) 716 B
export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue; }; export interface FetchRequest { url: string; payload: JsonValue; timeout?: number; headers?: Record<string, string>; } export interface IJsonThreader { readonly stats: { pending: number; queued: number; available: number; total: number; processed: number; failed: number; }; parse<T = JsonValue>(json: string): Promise<T>; parseBuffer<T = JsonValue>(buffer: ArrayBuffer): Promise<T>; stringify(data: JsonValue): Promise<string>; fetch<T = JsonValue>(request: FetchRequest): Promise<T>; terminate(): Promise<void>; }