-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.d.ts
41 lines (35 loc) · 995 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
declare interface MicroAppOption {
id?: string;
entry?: string;
route?: RegExp;
shadowMode?: ShadowRootMode;
runtimePath?: string;
fetchOption?: object;
beforeReady?: (win: Window) => void;
initialUrl?: string;
initialState?: any;
publicPath?: string;
}
declare interface MicroAppRoot extends ShadowRoot {
frameElement: HTMLIFrameElement;
documentElement: HTMLHtmlElement;
head: HTMLHeadElement;
body: HTMLBodyElement;
host: MicroAppElement;
document: HTMLElement;
}
declare interface MicroAppElement extends HTMLElement {
_option: MicroAppOption;
}
declare interface HTMLElement {
replaceChildren(...nodes: (string | Node)[]): void;
}
declare interface Window {
mRoot?: MicroAppRoot;
HTMLElement: Function;
ShadowRoot: Function;
History: Function;
Node: Function;
Function: (...args: string[]) => Function
}
declare function setAppOption(id: string, option: MicroAppOption, merge?: boolean)