mustard-app
Version:
个人前端微应用建设中。。。
48 lines (47 loc) • 1.46 kB
TypeScript
import App from './app';
import { EventCenterMicroApp } from './communication';
import { MustardApp } from './element';
export type TFunction = (...arg: unknown[]) => unknown;
export declare const AppName = "mustard-app";
export declare const LocationPrefix = "mApp-";
export type IApp = App;
export declare const MainMustardApp = "main";
export type MustardName = string;
export type MustardURL = string;
export declare enum IAppStatus {
create = 0,// 初始化
loading = 1,// 数据加载中
mount = 2,// dom节点 挂载完成阶段
unmount = 3,// dom节点 卸载
destory = 4,// 销毁应用
error = -100
}
export type IAppStatusCN = keyof typeof IAppStatus;
export declare const APPStAtUSCNKEYS: IAppStatusCN[];
export interface SpurceValue {
code: string;
isExternal?: boolean;
}
export interface IAppConstructor {
name: MustardName;
url: MustardURL;
container: MustardApp;
}
declare global {
interface HTMLElementTagNameMap {
'mustard-app': MustardApp;
}
interface Window {
mustardAppInfos: {
currentReadDocMAppName?: MustardName;
appInstanceMap: Map<MustardName, IApp>;
getAppProxyWindow: (appName: MustardName) => IApp['sandbox']['proxyWindow'];
};
microApp: EventCenterMicroApp;
}
}
export declare abstract class AMustardApp extends HTMLElement {
url: MustardURL;
name: MustardName;
abstract reload: void;
}