fix(nitro): fix type inference for $fetch (#938)

This commit is contained in:
Daniel Roe 2021-10-13 13:04:41 +01:00 committed by GitHub
parent d8332d6ad6
commit ece0e014a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,9 +23,9 @@ export declare type TypedInternalResponse<Route, Default> =
: MiddlewareOf<Route> : MiddlewareOf<Route>
: Default : Default
export declare interface $Fetch<T = unknown, R extends FetchRequest = FetchRequest> { export declare interface $Fetch<DefaultT = unknown, DefaultR = FetchRequest> {
(request: R, opts?: FetchOptions): Promise<TypedInternalResponse<R, T>> <T = DefaultT, R extends FetchRequest = DefaultR> (request: R, opts?: FetchOptions): Promise<TypedInternalResponse<R, T>>
raw (request: R, opts?: FetchOptions): Promise<FetchResponse<TypedInternalResponse<R, T>>> raw<T = DefaultT, R extends FetchRequest = DefaultR> (request: R, opts?: FetchOptions): Promise<FetchResponse<TypedInternalResponse<R, T>>>
} }
declare global { declare global {