mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 00:23:53 +00:00
fix(nuxt): correct type for useError
(#28996)
This commit is contained in:
parent
068d4ed677
commit
644b6fc1e8
@ -1,13 +1,15 @@
|
|||||||
import type { H3Error } from 'h3'
|
import type { H3Error } from 'h3'
|
||||||
import { createError as createH3Error } from 'h3'
|
import { createError as createH3Error } from 'h3'
|
||||||
import { toRef } from 'vue'
|
import { toRef } from 'vue'
|
||||||
|
import type { Ref } from 'vue'
|
||||||
import { useNuxtApp } from '../nuxt'
|
import { useNuxtApp } from '../nuxt'
|
||||||
|
import type { NuxtPayload } from '../nuxt'
|
||||||
import { useRouter } from './router'
|
import { useRouter } from './router'
|
||||||
|
|
||||||
export const NUXT_ERROR_SIGNATURE = '__nuxt_error'
|
export const NUXT_ERROR_SIGNATURE = '__nuxt_error'
|
||||||
|
|
||||||
/** @since 3.0.0 */
|
/** @since 3.0.0 */
|
||||||
export const useError = () => toRef(useNuxtApp().payload, 'error')
|
export const useError = (): Ref<NuxtPayload['error']> => toRef(useNuxtApp().payload, 'error')
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||||
export interface NuxtError<DataT = unknown> extends H3Error<DataT> {}
|
export interface NuxtError<DataT = unknown> extends H3Error<DataT> {}
|
||||||
|
Loading…
Reference in New Issue
Block a user