mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +00:00
fix(nuxt3): fix type inference for FetchResult
(#1269)
This commit is contained in:
parent
c49f9ca648
commit
f950fe0d8a
@ -1,11 +1,11 @@
|
|||||||
import type { FetchOptions } from 'ohmyfetch'
|
import type { FetchOptions, FetchRequest } from 'ohmyfetch'
|
||||||
import type { $Fetch } from '@nuxt/nitro'
|
import type { $Fetch } from '@nuxt/nitro'
|
||||||
import { murmurHashV3 } from 'murmurhash-es'
|
import { murmurHashV3 } from 'murmurhash-es'
|
||||||
import type { AsyncDataOptions, _Transform, KeyOfRes } from './asyncData'
|
import type { AsyncDataOptions, _Transform, KeyOfRes } from './asyncData'
|
||||||
import { useAsyncData } from './asyncData'
|
import { useAsyncData } from './asyncData'
|
||||||
|
|
||||||
export type Awaited<T> = T extends Promise<infer U> ? U : T
|
export type Awaited<T> = T extends Promise<infer U> ? U : T
|
||||||
export type FetchResult<ReqT extends string> = Awaited<ReturnType<$Fetch<unknown, ReqT>>>
|
export type FetchResult<ReqT extends FetchRequest> = Awaited<ReturnType<$Fetch<unknown, ReqT>>>
|
||||||
|
|
||||||
export type UseFetchOptions<
|
export type UseFetchOptions<
|
||||||
DataT,
|
DataT,
|
||||||
|
Loading…
Reference in New Issue
Block a user