@micro-zoe/micro-app 1.0.0-alpha.6 → 1.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +73 -14
- package/lib/index.esm.js +440 -108
- package/lib/index.esm.js.map +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.map +1 -1
- package/lib/index.umd.js +1 -1
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/typings/global.d.ts +26 -14
package/package.json
CHANGED
package/typings/global.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare module '@micro-app/types' {
|
|
|
7
7
|
|
|
8
8
|
type microAppWindowType = Window & any
|
|
9
9
|
|
|
10
|
-
type
|
|
10
|
+
type AppName = string
|
|
11
11
|
|
|
12
12
|
type SourceAddress = string
|
|
13
13
|
|
|
@@ -27,6 +27,7 @@ declare module '@micro-app/types' {
|
|
|
27
27
|
umdMode: boolean
|
|
28
28
|
keepRouteState: boolean
|
|
29
29
|
clearEventSource: boolean
|
|
30
|
+
clearData: boolean
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
interface SandBoxInterface {
|
|
@@ -99,6 +100,13 @@ declare module '@micro-app/types' {
|
|
|
99
100
|
disablePatchRequest: boolean
|
|
100
101
|
fiber: boolean
|
|
101
102
|
esmodule: boolean
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface UnmountParam {
|
|
107
|
+
destroy: boolean,
|
|
108
|
+
clearData: boolean
|
|
109
|
+
unmountcb?: CallableFunction
|
|
102
110
|
}
|
|
103
111
|
|
|
104
112
|
// app instance
|
|
@@ -135,7 +143,7 @@ declare module '@micro-app/types' {
|
|
|
135
143
|
mount (mountParams: MountParam): void
|
|
136
144
|
|
|
137
145
|
// unmount app
|
|
138
|
-
unmount (
|
|
146
|
+
unmount (unmountParam: UnmountParam): void
|
|
139
147
|
|
|
140
148
|
// app rendering error
|
|
141
149
|
onerror (e: Error): void
|
|
@@ -149,7 +157,7 @@ declare module '@micro-app/types' {
|
|
|
149
157
|
actionsForCompletelyDestroy (): void
|
|
150
158
|
|
|
151
159
|
// hidden app when disconnectedCallback with keep-alive
|
|
152
|
-
hiddenKeepAliveApp (): void
|
|
160
|
+
hiddenKeepAliveApp (callback?: CallableFunction): void
|
|
153
161
|
|
|
154
162
|
// show app when connectedCallback with keep-alive
|
|
155
163
|
showKeepAliveApp (container: HTMLElement | ShadowRoot): void
|
|
@@ -187,14 +195,14 @@ declare module '@micro-app/types' {
|
|
|
187
195
|
|
|
188
196
|
// lifeCycles
|
|
189
197
|
interface lifeCyclesType {
|
|
190
|
-
created
|
|
191
|
-
beforemount
|
|
192
|
-
mounted
|
|
193
|
-
unmount
|
|
194
|
-
error
|
|
195
|
-
beforeshow
|
|
196
|
-
aftershow
|
|
197
|
-
afterhidden
|
|
198
|
+
created(e: CustomEvent): void
|
|
199
|
+
beforemount(e: CustomEvent): void
|
|
200
|
+
mounted(e: CustomEvent): void
|
|
201
|
+
unmount(e: CustomEvent): void
|
|
202
|
+
error(e: CustomEvent): void
|
|
203
|
+
beforeshow(e: CustomEvent): void
|
|
204
|
+
aftershow(e: CustomEvent): void
|
|
205
|
+
afterhidden(e: CustomEvent): void
|
|
198
206
|
}
|
|
199
207
|
|
|
200
208
|
type AssetsChecker = (url: string) => boolean;
|
|
@@ -246,8 +254,7 @@ declare module '@micro-app/types' {
|
|
|
246
254
|
css?: string[],
|
|
247
255
|
}
|
|
248
256
|
|
|
249
|
-
|
|
250
|
-
tagName?: string
|
|
257
|
+
interface MicroAppConfig {
|
|
251
258
|
shadowDOM?: boolean
|
|
252
259
|
destroy?: boolean
|
|
253
260
|
destory?: boolean
|
|
@@ -263,9 +270,14 @@ declare module '@micro-app/types' {
|
|
|
263
270
|
'keep-router-state'?: boolean
|
|
264
271
|
'hidden-router'?: boolean
|
|
265
272
|
'keep-alive'?: boolean
|
|
273
|
+
'clear-data'?: boolean
|
|
266
274
|
esmodule?: boolean
|
|
267
275
|
ssr?: boolean
|
|
268
276
|
fiber?: boolean
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
interface OptionsType extends MicroAppConfig {
|
|
280
|
+
tagName?: string
|
|
269
281
|
lifeCycles?: lifeCyclesType
|
|
270
282
|
preFetchApps?: prefetchParamList
|
|
271
283
|
plugins?: plugins
|
|
@@ -275,7 +287,7 @@ declare module '@micro-app/types' {
|
|
|
275
287
|
}
|
|
276
288
|
|
|
277
289
|
// MicroApp config
|
|
278
|
-
interface
|
|
290
|
+
interface MicroAppBaseType {
|
|
279
291
|
tagName: string
|
|
280
292
|
options: OptionsType
|
|
281
293
|
preFetch(apps: prefetchParamList): void
|