@akiroz/pubsub-rpc
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -27,2 +27,2 @@ export declare type RPCRequest = { | ||
}; | ||
export declare function call(client: PubSubClient, topic: string, params?: RPCParamResult, opt?: Partial<typeof defaultCallOptions>): Promise<any>; | ||
export declare function call<P extends RPCParamResult, R extends RPCParamResult>(client: PubSubClient, topic: string, params?: P, opt?: Partial<typeof defaultCallOptions>): Promise<R>; |
{ | ||
"name": "@akiroz/pubsub-rpc", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"main": "dist/main.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/main.d.ts", |
@@ -51,8 +51,8 @@ import { EventEmitter } from "events"; | ||
export async function call( | ||
export async function call<P extends RPCParamResult, R extends RPCParamResult>( | ||
client: PubSubClient, | ||
topic: string, | ||
params: RPCParamResult = {}, | ||
params: P = {} as P, | ||
opt: Partial<typeof defaultCallOptions> = defaultCallOptions | ||
): Promise<any> { | ||
): Promise<R> { | ||
opt = Object.assign({}, defaultCallOptions, opt); | ||
@@ -59,0 +59,0 @@ const id = generateCallId(opt.idSize); |
Sorry, the diff of this file is not supported yet
27126923