import { RuntimeConfig, AppConfig } from '@nuxt/schema'; import { PartialDeep } from 'type-fest'; interface NuxtPrepareResult { /** * Whether the prepare script ran successfully. If an async operation * inside your prepare script fails, you can return `ok: false` to let the * Nuxt Prepare module know that the script failed. * * @default true */ ok?: boolean; /** * Runtime config to merge with `nuxt.options.runtimeConfig`. */ runtimeConfig?: PartialDeep; /** * App config to merge with `nuxt.options.appConfig`. */ appConfig?: PartialDeep; /** * Custom state to pass to Nuxt and import anywhere from `#nuxt-prepare`. * * @remarks * Use this to prefetch data, i.e. populate the Pinia store with data from * your API. * * @example * // `stores/todo.ts` * import { defineStore } from 'pinia' * import { todos } from '#nuxt-prepare' * * export const useTodos = defineStore('todos', { * state: () => ({ * todos: todos || [], * }) * }) */ state?: Record; } declare function defineNuxtPrepareHandler(init: T | (() => T | Promise)): Promise; export { defineNuxtPrepareHandler };