kernel-rpc-client/dist/index.d.ts

41 lines
2.0 KiB
TypeScript
Raw Normal View History

2022-08-31 01:39:52 +00:00
/// <reference types="node" />
2022-07-20 07:36:21 +00:00
import { ErrTuple } from "libskynet";
2022-08-31 01:39:52 +00:00
import type { RPCRequest } from "@lumeweb/relay-types";
import { RpcQueryOptions, StreamHandlerFunction, StreamingRpcQueryOptions } from "@lumeweb/dht-rpc-client";
import { Buffer } from "buffer";
2022-07-20 07:36:21 +00:00
export declare class RpcNetwork {
private _actionQueue;
2022-07-21 04:58:47 +00:00
private _addQueue;
private _removeQueue;
2022-07-20 07:36:21 +00:00
get ready(): Promise<ErrTuple>;
addRelay(pubkey: string): void;
removeRelay(pubkey: string): void;
clearRelays(): void;
2022-07-21 04:58:47 +00:00
private static deleteItem;
2022-08-31 01:39:52 +00:00
wisdomQuery(method: string, module: string, data?: object | any[], bypassCache?: boolean, options?: RpcQueryOptions): WisdomRpcQuery;
streamingQuery(relay: Buffer | string, method: string, module: string, streamHandler: StreamHandlerFunction, data?: object | any[], options?: RpcQueryOptions): StreamingRpcQuery;
simpleQuery(relay: Buffer | string, method: string, module: string, data?: object | any[], options?: RpcQueryOptions): SimpleRpcQuery;
2022-07-20 07:36:21 +00:00
processQueue(): Promise<void>;
}
2022-08-31 01:39:52 +00:00
export declare abstract class RpcQueryBase {
protected _promise?: Promise<any>;
protected _network: RpcNetwork;
protected _query: RPCRequest;
protected _options: RpcQueryOptions;
protected _queryType: string;
constructor(network: RpcNetwork, query: RPCRequest, options: RpcQueryOptions | undefined, queryType: string);
run(): this;
2022-07-20 07:36:21 +00:00
get result(): Promise<any>;
}
2022-08-31 01:39:52 +00:00
export declare class SimpleRpcQuery extends RpcQueryBase {
constructor(network: RpcNetwork, relay: string | Buffer, query: RPCRequest, options: RpcQueryOptions);
}
export declare class StreamingRpcQuery extends RpcQueryBase {
protected _options: StreamingRpcQueryOptions;
constructor(network: RpcNetwork, relay: string | Buffer, query: RPCRequest, options: StreamingRpcQueryOptions);
run(): this;
}
export declare class WisdomRpcQuery extends RpcQueryBase {
constructor(network: RpcNetwork, query: RPCRequest, options?: RpcQueryOptions);
}
2022-07-20 07:36:21 +00:00
//# sourceMappingURL=index.d.ts.map