*Update dist
This commit is contained in:
parent
6a91a5f4fd
commit
1a77bb0469
|
@ -1,36 +1,41 @@
|
||||||
import type { JSONSchemaType } from "ajv";
|
import type { JSONSchemaType } from "ajv";
|
||||||
export interface RPCRequest {
|
export interface RPCRequest {
|
||||||
bypassCache?: boolean;
|
bypassCache?: boolean;
|
||||||
module: string;
|
module: string;
|
||||||
method: string;
|
method: string;
|
||||||
data: any;
|
data: any;
|
||||||
}
|
}
|
||||||
export interface RPCResponse {
|
export interface RPCResponse {
|
||||||
updated?: number;
|
updated?: number;
|
||||||
data?: any;
|
data?: any;
|
||||||
error?: string;
|
error?: string;
|
||||||
}
|
}
|
||||||
export interface RPCMethod {
|
export interface RPCMethod {
|
||||||
cacheable: boolean;
|
cacheable: boolean;
|
||||||
handler: (request: RPCRequest, sendStream: (stream: AsyncIterable<Uint8Array>) => void) => Promise<RPCResponse | null>;
|
handler: (
|
||||||
|
request: RPCRequest,
|
||||||
|
sendStream: (stream: AsyncIterable<Uint8Array>) => void
|
||||||
|
) => Promise<RPCResponse | null>;
|
||||||
}
|
}
|
||||||
export declare const RPC_REQUEST_SCHEMA: JSONSchemaType<RPCRequest>;
|
export declare const RPC_REQUEST_SCHEMA: JSONSchemaType<RPCRequest>;
|
||||||
export interface StreamFileResponse {
|
export interface StreamFileResponse {
|
||||||
data?: Uint8Array;
|
data?: Uint8Array;
|
||||||
done: boolean;
|
done: boolean;
|
||||||
}
|
}
|
||||||
export interface PluginAPI {
|
export interface PluginAPI {
|
||||||
config: any;
|
config: any;
|
||||||
registerMethod: (methodName: string, method: RPCMethod) => void;
|
registerMethod: (methodName: string, method: RPCMethod) => void;
|
||||||
loadPlugin: (moduleName: string) => Promise<Plugin>;
|
loadPlugin: (moduleName: string) => Promise<Plugin>;
|
||||||
getMethods: () => string[];
|
getMethods: () => string[];
|
||||||
}
|
}
|
||||||
export declare type PluginFunction = (api: PluginAPI) => Promise<void>;
|
export declare type PluginFunction = (api: PluginAPI) => Promise<void>;
|
||||||
export interface Plugin {
|
export interface Plugin {
|
||||||
name: string;
|
name: string;
|
||||||
plugin: PluginFunction;
|
plugin: PluginFunction;
|
||||||
exports?: any;
|
exports?: any;
|
||||||
default?: Plugin;
|
default?: Plugin;
|
||||||
}
|
}
|
||||||
export declare type RPCStreamHandler = (stream: AsyncIterable<Uint8Array>) => Promise<RPCResponse>;
|
export declare type RPCStreamHandler = (
|
||||||
//# sourceMappingURL=index.d.ts.map
|
stream: AsyncIterable<Uint8Array>
|
||||||
|
) => Promise<RPCResponse>;
|
||||||
|
//# sourceMappingURL=index.d.ts.map
|
||||||
|
|
Loading…
Reference in New Issue