*Update dist

This commit is contained in:
Derrick Hammer 2022-08-28 22:11:57 -04:00
parent 6a91a5f4fd
commit 1a77bb0469
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 26 additions and 21 deletions

45
dist/index.d.ts vendored
View File

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