mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 01:15:58 +00:00
fix(nitro): fix type inference for $fetch
(#938)
This commit is contained in:
parent
d8332d6ad6
commit
ece0e014a4
6
packages/nitro/types/fetch.d.ts
vendored
6
packages/nitro/types/fetch.d.ts
vendored
@ -23,9 +23,9 @@ export declare type TypedInternalResponse<Route, Default> =
|
||||
: MiddlewareOf<Route>
|
||||
: Default
|
||||
|
||||
export declare interface $Fetch<T = unknown, R extends FetchRequest = FetchRequest> {
|
||||
(request: R, opts?: FetchOptions): Promise<TypedInternalResponse<R, T>>
|
||||
raw (request: R, opts?: FetchOptions): Promise<FetchResponse<TypedInternalResponse<R, T>>>
|
||||
export declare interface $Fetch<DefaultT = unknown, DefaultR = FetchRequest> {
|
||||
<T = DefaultT, R extends FetchRequest = DefaultR> (request: R, opts?: FetchOptions): Promise<TypedInternalResponse<R, T>>
|
||||
raw<T = DefaultT, R extends FetchRequest = DefaultR> (request: R, opts?: FetchOptions): Promise<FetchResponse<TypedInternalResponse<R, T>>>
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
Loading…
Reference in New Issue
Block a user