/** * @author Kuitos * @since 2023-04-25 */ import type { LoaderOpts } from '@qiankunjs/loader'; import type { LifeCycles as ParcelLifeCycles, Parcel, RegisterApplicationConfig } from 'single-spa'; declare global { interface Window { __POWERED_BY_QIANKUN__?: boolean; __INJECTED_PUBLIC_PATH_BY_QIANKUN__?: string; __QIANKUN_DEVELOPMENT__?: boolean; Zone?: CallableFunction; __zone_symbol__setTimeout?: Window['setTimeout']; } } export type ObjectType = Record; export type HTMLEntry = string; type AppMetadata = { name: string; entry: HTMLEntry; }; export type LoadableApp = AppMetadata & { container: HTMLElement; props?: T; }; export type RegistrableApp = LoadableApp & { loader?: (loading: boolean) => void; activeRule: RegisterApplicationConfig['activeWhen']; }; export type AppConfiguration = Partial> & { sandbox?: boolean; globalContext?: WindowProxy; }; export type LifeCycleFn = (app: LoadableApp, global: WindowProxy) => Promise; export type LifeCycles = { beforeLoad?: LifeCycleFn | Array>; beforeMount?: LifeCycleFn | Array>; afterMount?: LifeCycleFn | Array>; beforeUnmount?: LifeCycleFn | Array>; afterUnmount?: LifeCycleFn | Array>; }; export type MicroApp = Parcel; type ExtraProps = { container: HTMLElement; }; type FlattenArray = T extends Array ? U : T; type FlattenArrayValue = { [P in keyof T]: FlattenArray; }; export type MicroAppLifeCycles = FlattenArrayValue>; export {};