1 |
|
2 |
|
3 |
|
4 |
|
5 | import Vue from 'vue'
|
6 | import { MetaInfo } from 'vue-meta'
|
7 | import { Route } from 'vue-router'
|
8 | import { Context, Middleware, Transition, NuxtApp } from './index'
|
9 | import { NuxtRuntimeConfig } from '../config/runtime'
|
10 |
|
11 | declare module 'vue/types/options' {
|
12 | interface ComponentOptions<V extends Vue> {
|
13 | asyncData?(ctx: Context): Promise<object | void> | object | void
|
14 | fetch?(ctx: Context): Promise<void> | void
|
15 | fetchDelay?: number
|
16 | fetchOnServer?: boolean | (() => boolean)
|
17 | head?: MetaInfo | (() => MetaInfo)
|
18 | key?: string | ((to: Route) => string)
|
19 | layout?: string | ((ctx: Context) => string)
|
20 | loading?: boolean
|
21 | middleware?: Middleware | Middleware[]
|
22 | scrollToTop?: boolean
|
23 | transition?: string | Transition | ((to: Route, from: Route | undefined) => string | Transition)
|
24 | validate?(ctx: Context): Promise<boolean> | boolean
|
25 | watchQuery?: boolean | string[] | ((newQuery: Route['query'], oldQuery: Route['query']) => boolean)
|
26 | meta?: { [key: string]: any }
|
27 | }
|
28 | }
|
29 |
|
30 | declare module 'vue/types/vue' {
|
31 | interface Vue {
|
32 | $config: NuxtRuntimeConfig
|
33 | $nuxt: NuxtApp
|
34 | $fetch(): void
|
35 | $fetchState: {
|
36 | error: Error | null
|
37 | pending: boolean
|
38 | timestamp: number
|
39 | }
|
40 | }
|
41 | }
|
42 |
|
\ | No newline at end of file |