import Vue from 'vue' export type AsyncComputedGetter = () => Promise export interface IAsyncComputedValue { default?: T | (() => T) get: AsyncComputedGetter watch?: string[] | (() => void) shouldUpdate?: () => boolean lazy?: boolean } export interface AsyncComputedObject { [K: string]: AsyncComputedGetter | IAsyncComputedValue } export interface IASyncComputedState { state: 'updating' | 'success' | 'error' updating: boolean success: boolean error: boolean exception: Error | null update: () => void } declare module 'vue/types/options' { interface ComponentOptions { asyncComputed?: AsyncComputedObject } } declare module 'vue/types/vue' { interface Vue { $asyncComputed: {[K: string]: IASyncComputedState} } }