File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ export type EntriesToObject<T extends readonly [string, any][]> = {
1212 * - action: A function that performs an action (no data returned)
1313 * - event: A function that emits an event (no data returned), and does not wait for a response
1414 * - query: A function that queries a resource
15+ *
16+ * By default, the function is a query function.
1517 */
1618export type RpcFunctionType = 'static' | 'action' | 'event' | 'query'
1719
@@ -35,13 +37,13 @@ export interface RpcFunctionSetupResult<
3537
3638export interface RpcFunctionDefinition <
3739 NAME extends string ,
38- TYPE extends RpcFunctionType ,
40+ TYPE extends RpcFunctionType = 'query' ,
3941 ARGS extends any [ ] = [ ] ,
4042 RETURN = void ,
4143 CONTEXT = undefined ,
4244> {
4345 name : NAME
44- type : TYPE
46+ type ? : TYPE
4547 setup ?: ( context : CONTEXT ) => Thenable < RpcFunctionSetupResult < ARGS , RETURN > >
4648 handler ?: ( ...args : ARGS ) => RETURN
4749 __resolved ?: RpcFunctionSetupResult < ARGS , RETURN >
You can’t perform that action at this time.
0 commit comments