Skip to content

Commit

Permalink
fix(nitro): fix type inference for $fetch (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Oct 13, 2021
1 parent 4c05a90 commit d9fdf29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/types/fetch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d9fdf29

Please sign in to comment.