diff --git a/types/options.d.ts b/types/options.d.ts index f6d92b97a16..a65f088b8c6 100644 --- a/types/options.d.ts +++ b/types/options.d.ts @@ -15,12 +15,24 @@ export type Component, Methods=DefaultMethods, Co interface EsModuleComponent { default: Component } + +export type AsyncComponent, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> + = AsyncComponentPromise + | AsyncComponentFactory -export type AsyncComponent, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> = ( +export type AsyncComponentPromise, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> = ( resolve: (component: Component) => void, reject: (reason?: any) => void ) => Promise | void; +export type AsyncComponentFactory, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> = () => { + component: AsyncComponentPromise; + loading?: Component | EsModuleComponent; + error?: Component | EsModuleComponent; + delay?: number; + timeout?: number; +} + /** * When the `Computed` type parameter on `ComponentOptions` is inferred, * it should have a property with the return type of every get-accessor.