File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ export async function writeTypes(nitro: Nitro) {
92
92
routeTypes [ mw . route ] [ method ] = [ ] ;
93
93
}
94
94
routeTypes [ mw . route ] [ method ] . push (
95
- `Awaited<ReturnType<typeof import('${ relativePath } ').default>>`
95
+ `Simplify<Serialize< Awaited<ReturnType<typeof import('${ relativePath } ').default>> >>`
96
96
) ;
97
97
}
98
98
@@ -117,6 +117,7 @@ export async function writeTypes(nitro: Nitro) {
117
117
118
118
const routes = [
119
119
"// Generated by nitro" ,
120
+ "import type { Serialize, Simplify } from 'nitropack'" ,
120
121
"declare module 'nitropack' {" ,
121
122
" type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T" ,
122
123
" interface InternalApi {" ,
Original file line number Diff line number Diff line change 1
1
import type { RouterMethod } from "h3" ;
2
2
import type { FetchRequest , FetchOptions , FetchResponse } from "ofetch" ;
3
- import type { Serialize } from "./serialize" ;
4
3
import type { MatchedRoutes } from "./utils" ;
5
4
6
5
// An interface to extend in a local project
@@ -13,12 +12,11 @@ export type NitroFetchRequest =
13
12
// eslint-disable-next-line @typescript-eslint/ban-types
14
13
| ( string & { } ) ;
15
14
16
- // TODO: re-enable Simplify
17
15
export type MiddlewareOf <
18
16
Route extends string ,
19
17
Method extends RouterMethod | "default"
20
18
> = Method extends keyof InternalApi [ MatchedRoutes < Route > ]
21
- ? Exclude < Serialize < InternalApi [ MatchedRoutes < Route > ] [ Method ] > , Error | void >
19
+ ? Exclude < InternalApi [ MatchedRoutes < Route > ] [ Method ] , Error | void >
22
20
: never ;
23
21
24
22
export type TypedInternalResponse <
Original file line number Diff line number Diff line change 1
1
export * from "./fetch" ;
2
+ export * from "./serialize" ;
2
3
export * from "./nitro" ;
3
4
export * from "./handler" ;
4
5
export * from "./utils" ;
You can’t perform that action at this time.
0 commit comments