UNPKG

@lastboy/vue2

Version:

Fork of Vue 2.7.16 with patched CVE-2024-9506 (regex ReDoS vulnerability)

27 lines (22 loc) 659 B
import { AsyncComponent, Component } from './options' export type AsyncComponentResolveResult<T = Component> = T | { default: T } // es modules export type AsyncComponentLoader<T = any> = () => Promise< AsyncComponentResolveResult<T> > export interface AsyncComponentOptions { loader: AsyncComponentLoader loadingComponent?: Component errorComponent?: Component delay?: number timeout?: number // suspensible?: boolean onError?: ( error: Error, retry: () => void, fail: () => void, attempts: number ) => any } export function defineAsyncComponent( source: AsyncComponentLoader | AsyncComponentOptions ): AsyncComponent