diff --git a/packages/nuxt/src/app/composables/asyncData.ts b/packages/nuxt/src/app/composables/asyncData.ts index adf7f49820..e2de01ef25 100644 --- a/packages/nuxt/src/app/composables/asyncData.ts +++ b/packages/nuxt/src/app/composables/asyncData.ts @@ -31,6 +31,8 @@ export type KeyOfRes = KeysOf | object)[] +export type AsyncDataStrategy = 'lazy' | 'parallel' | 'blocking' + export interface AsyncDataOptions< ResT, DataT = ResT, @@ -40,7 +42,7 @@ export interface AsyncDataOptions< server?: boolean /** @deprecated Use strategy: 'lazy' */ lazy?: boolean - strategy?: 'lazy' | 'parallel' | 'blocking' + strategy?: AsyncDataStrategy default?: () => DefaultT | Ref transform?: _Transform pick?: PickKeys diff --git a/packages/nuxt/src/app/nuxt.ts b/packages/nuxt/src/app/nuxt.ts index 069952286a..9f66006e52 100644 --- a/packages/nuxt/src/app/nuxt.ts +++ b/packages/nuxt/src/app/nuxt.ts @@ -14,7 +14,7 @@ import type { RenderResponse } from 'nitropack' import type { NuxtIslandContext } from '../core/runtime/nitro/renderer' import type { RouteMiddleware } from '../../app' import type { NuxtError } from '../app/composables/error' -import type { AsyncDataOptions, AsyncDataRequestStatus } from '../app/composables/asyncData' +import type { AsyncDataRequestStatus, AsyncDataStrategy } from '../app/composables/asyncData' const nuxtAppCtx = /* #__PURE__ */ getContext('nuxt-app') @@ -103,7 +103,7 @@ interface _NuxtApp { [key: string]: unknown /** @internal */ - _asyncDataPromises: Record & { strategy?: AsyncDataOptions['strategy'] } | undefined> + _asyncDataPromises: Record & { strategy?: AsyncDataStrategy } | undefined> /** @internal */ _asyncData: Record