Skip to content

Commit

Permalink
fix: NextResponse types
Browse files Browse the repository at this point in the history
  • Loading branch information
finom committed May 12, 2024
1 parent a661189 commit 79e5f19
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 60 deletions.
50 changes: 0 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
_VovkControllerParams,
} from '../types';
import { _StreamResponse as StreamResponse } from '../StreamResponse';
import type { NextResponse } from 'next/server';
import { NextResponse } from 'next/server';

export type _StaticMethodInput<T extends _ControllerStaticMethod> = (_VovkControllerBody<T> extends undefined | void
? { body?: undefined }
Expand Down Expand Up @@ -46,10 +46,10 @@ type ClientMethod<
| Iterator<infer U>
| AsyncIterator<infer U>
? Promise<_StreamAsyncIterator<U>>
: R extends NextResponse<infer U>
? U
: R extends object
? Promise<R>
: R extends object
? Promise<R>
: ReturnType<T> extends NextResponse<infer U> | Promise<NextResponse<infer U>>
? ToPromise<U>
: ToPromise<ReturnType<T>>;

type OmitNever<T> = {
Expand Down
8 changes: 4 additions & 4 deletions test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"next": "14.1.0",
"react": "^18",
"react-dom": "^18",
"vovk": "^2.0.1",
"vovk": "^2.0.2-beta.1",
"vovk-client": "^0.0.2",
"vovk-zod": "^0.1.2"
},
Expand Down

0 comments on commit 79e5f19

Please sign in to comment.