Skip to content

Commit

Permalink
vue2.7-compatible variant
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Mar 9, 2023
1 parent a2cb49f commit 0feb9fe
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions packages/types/app/vue.d.ts
Expand Up @@ -7,6 +7,7 @@ import type { MetaInfo } from 'vue-meta'
import type { Route } from 'vue-router'
import type { RecordPropsDefinition, PropsDefinition, ComponentOptions } from 'vue/types/options'
import type { CombinedVueInstance, ExtendedVue } from 'vue/types/vue'
import type { ComponentOptionsMixin } from 'vue/types/v3-component-options'
import type { NuxtRuntimeConfig } from '../config/runtime'
import type { Context, Middleware, Transition, NuxtApp } from './index'

Expand All @@ -18,8 +19,22 @@ type DefaultComputed = { [key: string]: any }
type DefaultAsyncData<V> = ((this: V, context: Context) => Promise<object | void> | object | void)

declare module 'vue/types/options' {
interface ComponentOptions<V extends Vue> {
asyncData?: DefaultAsyncData<V>
interface ComponentOptions<
V extends Vue,
/* eslint-disable no-unused-vars,@typescript-eslint/no-unused-vars */
Data = DefaultData<V>,
Methods = DefaultMethods<V>,
Computed = DefaultComputed,
PropsDef = PropsDefinition<DefaultProps>,
Props = DefaultProps,
RawBindings = {},
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
/* eslint-enable no-unused-vars,@typescript-eslint/no-unused-vars */
AsyncData = DefaultAsyncData<V>
> {
// eslint-disable-next-line @typescript-eslint/ban-types
asyncData?: AsyncData
fetch?(ctx: Context): Promise<void> | void
fetchKey?: string | ((getKey: (id: string) => number) => string)
fetchDelay?: number
Expand Down

0 comments on commit 0feb9fe

Please sign in to comment.