@micro-zoe/micro-app 1.0.0-rc.2 → 1.0.0-rc.4

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  // ../../@micro-app/types
5
5
 
6
6
  declare module '@micro-zoe/micro-app' {
7
- export { default, MicroApp, getActiveApps, getAllApps, unmountApp, unmountAllApps, reload, renderApp, } from '@micro-zoe/micro-app/micro_app';
7
+ export { default, MicroApp, getActiveApps, getAllApps, unmountApp, unmountAllApps, reload, renderApp, getAppStatus } from '@micro-zoe/micro-app/micro_app';
8
8
  export { default as preFetch, } from '@micro-zoe/micro-app/prefetch';
9
9
  export { removeDomScope, pureCreateElement, version, } from '@micro-zoe/micro-app/libs/utils';
10
10
  export { EventCenterForMicroApp, } from '@micro-zoe/micro-app/interact';
@@ -60,6 +60,12 @@ declare module '@micro-zoe/micro-app/micro_app' {
60
60
  * @returns Promise<boolean>
61
61
  */
62
62
  export function renderApp(options: RenderAppOptions): Promise<boolean>;
63
+ /**
64
+ * get app state
65
+ * @param appName app.name
66
+ * @returns app.state
67
+ */
68
+ export function getAppStatus(appName: string): string | void;
63
69
  export class MicroApp extends EventCenterForBaseApp implements MicroAppBaseType {
64
70
  tagName: string;
65
71
  hasInit: boolean;
@@ -72,6 +78,7 @@ declare module '@micro-zoe/micro-app/micro_app' {
72
78
  getAllApps: typeof getAllApps;
73
79
  reload: typeof reload;
74
80
  renderApp: typeof renderApp;
81
+ getAppStatus: typeof getAppStatus;
75
82
  start(options?: OptionsType): void;
76
83
  }
77
84
  const microApp: MicroApp;
@@ -125,7 +132,9 @@ declare module '@micro-zoe/micro-app/libs/utils' {
125
132
  };
126
133
  export const rawDefineProperty: (o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType<any>) => any;
127
134
  export const rawDefineProperties: (o: any, properties: PropertyDescriptorMap & ThisType<any>) => any;
135
+ export const rawToString: () => string;
128
136
  export const rawHasOwnProperty: (v: string | number | symbol) => boolean;
137
+ export const toTypeString: (value: unknown) => string;
129
138
  export function isUndefined(target: unknown): target is undefined;
130
139
  export function isNull(target: unknown): target is null;
131
140
  export function isString(target: unknown): target is string;
@@ -150,6 +159,7 @@ declare module '@micro-zoe/micro-app/libs/utils' {
150
159
  export function isBaseElement(target: unknown): target is HTMLBaseElement;
151
160
  export function isMicroAppBody(target: unknown): target is HTMLElement;
152
161
  export function isProxyDocument(target: unknown): target is Document;
162
+ export function includes(target: unknown[], searchElement: unknown, fromIndex?: number): boolean;
153
163
  /**
154
164
  * format error log
155
165
  * @param msg message
@@ -230,21 +240,14 @@ declare module '@micro-zoe/micro-app/libs/utils' {
230
240
  */
231
241
  export function promiseRequestIdle(callback: CallableFunction): Promise<void>;
232
242
  export function setCurrentAppName(appName: string | null): void;
233
- export function throttleDeferForSetAppName(appName: string): void;
234
243
  export function getCurrentAppName(): string | null;
235
- export function removeDomScope(): void;
244
+ export function removeDomScope(force?: boolean): void;
245
+ export function throttleDeferForSetAppName(appName: string): void;
236
246
  export function isSafari(): boolean;
237
247
  /**
238
248
  * Create pure elements
239
249
  */
240
250
  export function pureCreateElement<K extends keyof MicroAppElementTagNameMap>(tagName: K, options?: ElementCreationOptions): MicroAppElementTagNameMap[K];
241
- /**
242
- * clone origin elements to target
243
- * @param origin Cloned element
244
- * @param target Accept cloned elements
245
- * @param deep deep clone or transfer dom
246
- */
247
- export function cloneContainer<T extends Element | ShadowRoot, Q extends Element | ShadowRoot>(target: Q, origin: T, deep: boolean): Q;
248
251
  export function isInvalidQuerySelectorKey(key: string): boolean;
249
252
  export function isUniqueElement(key: string): boolean;
250
253
  /**