vovk 3.0.0-draft.4 → 3.0.0-draft.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +18 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "3.0.0-draft.4",
3
+ "version": "3.0.0-draft.6",
4
4
  "description": "RESTful RPC for Next.js - Transforms Next.js into a powerful REST API platform with RPC capabilities.",
5
5
  "repository": {
6
6
  "type": "git",
package/types.d.ts CHANGED
@@ -106,21 +106,24 @@ export type _VovkClientParams<T extends (options: OPTIONS) => _KnownAny, OPTIONS
106
106
  } = Parameters<T>[0], P = _KnownAny> = Parameters<T>[0]['params'];
107
107
  export type _VovkClientYieldType<T extends (...args: _KnownAny[]) => unknown> = T extends (...args: _KnownAny[]) => Promise<StreamAsyncIterator<infer Y>> ? Y : never;
108
108
  export type _VovkClientReturnType<T extends (...args: _KnownAny) => unknown> = Awaited<ReturnType<T>>;
109
- export type _VovkBody<T> = T extends ((...args: _KnownAny[]) => _KnownAny) & {
109
+ type ClientStaticMethod = ((...args: _KnownAny[]) => _KnownAny) & {
110
110
  __isClientMethod: boolean;
111
- } ? _VovkClientBody<T> : T extends _ControllerStaticMethod<_KnownAny, _KnownAny> ? _VovkControllerBody<T> : never;
112
- export type _VovkQuery<T> = T extends ((...args: _KnownAny[]) => _KnownAny) & {
113
- __isClientMethod: boolean;
114
- } ? _VovkClientQuery<T> : T extends _ControllerStaticMethod<_KnownAny, _KnownAny> ? _VovkControllerQuery<T> : never;
115
- export type _VovkParams<T> = T extends ((...args: _KnownAny[]) => _KnownAny) & {
116
- __isClientMethod: boolean;
117
- } ? _VovkClientParams<T> : T extends _ControllerStaticMethod<_KnownAny, _KnownAny> ? _VovkControllerParams<T> : never;
118
- export type _VovkYieldType<T> = T extends ((...args: _KnownAny[]) => _KnownAny) & {
119
- __isClientMethod: boolean;
120
- } ? _VovkClientYieldType<T> : T extends _ControllerStaticMethod<_KnownAny, _KnownAny> ? _VovkControlerYieldType<T> : never;
121
- export type _VovkReturnType<T> = T extends ((...args: _KnownAny[]) => _KnownAny) & {
122
- __isClientMethod: boolean;
123
- } ? _VovkClientReturnType<T> : T extends _ControllerStaticMethod<_KnownAny, _KnownAny> ? _VovkControllerReturnType<T> : never;
111
+ };
112
+ export type _VovkBody<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
113
+ [key: string]: string;
114
+ } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientBody<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControllerBody<T, REQ, PARAMS> : never;
115
+ export type _VovkQuery<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
116
+ [key: string]: string;
117
+ } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientQuery<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControllerQuery<T, REQ, PARAMS> : never;
118
+ export type _VovkParams<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
119
+ [key: string]: string;
120
+ } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientParams<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControllerParams<T, REQ, PARAMS> : never;
121
+ export type _VovkYieldType<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
122
+ [key: string]: string;
123
+ } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientYieldType<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControlerYieldType<T, REQ, PARAMS> : never;
124
+ export type _VovkReturnType<T extends ClientStaticMethod | _ControllerStaticMethod<REQ, PARAMS>, REQ extends _VovkRequest<undefined, _KnownAny> = Parameters<T>[0], PARAMS extends {
125
+ [key: string]: string;
126
+ } = _KnownAny> = T extends ClientStaticMethod ? _VovkClientReturnType<T> : T extends _ControllerStaticMethod<REQ, PARAMS> ? _VovkControllerReturnType<T, REQ, PARAMS> : never;
124
127
  export type _StreamAbortMessage = {
125
128
  isError: true;
126
129
  reason: _KnownAny;
@@ -185,3 +188,4 @@ export declare enum _HttpStatus {
185
188
  GATEWAY_TIMEOUT = 504,
186
189
  HTTP_VERSION_NOT_SUPPORTED = 505
187
190
  }
191
+ export {};