silgi 0.53.4 → 0.53.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types.d.mts +7 -2
- package/package.json +1 -1
package/dist/types.d.mts
CHANGED
|
@@ -98,8 +98,13 @@ interface ResolveContext<TCtx, TInput, TErrors extends ErrorDef> {
|
|
|
98
98
|
type RouterDef = {
|
|
99
99
|
[key: string]: ProcedureDef<any, any, any, any> | TaskDef<any, any> | RouterDef;
|
|
100
100
|
};
|
|
101
|
-
/**
|
|
102
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Return type wrapper — every procedure call resolves through the link's
|
|
103
|
+
* async `call`, so the client always returns a `Promise`. Subscriptions
|
|
104
|
+
* resolve to an `AsyncIterableIterator` (the open SSE/WS stream); queries
|
|
105
|
+
* and mutations resolve to the procedure's output value.
|
|
106
|
+
*/
|
|
107
|
+
type ProcedureResult<TType extends ProcedureType, TOutput> = TType extends 'subscription' ? Promise<AsyncIterableIterator<TOutput>> : Promise<TOutput>;
|
|
103
108
|
/** Infer client type from router */
|
|
104
109
|
type InferClient<T> = T extends ProcedureDef<infer TType, infer TInput, infer TOutput> ? undefined extends TInput ? () => ProcedureResult<TType, TOutput> : (input: TInput) => ProcedureResult<TType, TOutput> : T extends Record<string, unknown> ? { [K in keyof T]: InferClient<T[K]> } : never;
|
|
105
110
|
//#endregion
|