@das-fed/mframe 0.0.32 → 0.0.34

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.
Files changed (4) hide show
  1. package/es5.js +5017 -4839
  2. package/index.d.ts +21 -8
  3. package/index.js +4295 -4122
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import { Emitter } from 'mitt';
2
2
 
3
+ /**
4
+ * 获取 bus 通道
5
+ * 对于 mainApp 通道,确保 event 属性始终使用 window.__MFRAME_MAIN_APP_EVENT__ 上的单例
6
+ * 这解决了模块被多次加载时 mitt 实例不一致的问题
7
+ */
3
8
  export declare const bus: <T extends keyof BusChannel>(name: T) => BusChannel[T];
4
9
 
5
10
  declare type BusChannel = ContainerChannelType & MainAppChannelType & MicroAppChannelType;
@@ -74,7 +79,9 @@ declare const channelItem: {
74
79
  }>, opt?: {
75
80
  notMerge?: boolean;
76
81
  } | undefined) => void;
77
- get: (keys?: ("visible" | "frameVisible" | "navVisible" | "menuVisible" | "tabVisible" | "mountVisible" | "navRect" | "menuRect" | "tabRect" | "mountRect" | "microApps" | "activeMicroAppName" | "activeMicroAppItem" | "navItems" | "activeNavItem" | "menuItems" | "activeMenuItem" | "fullNavItems" | "tabItems" | "activeTabItem" | "microAppStickStatus" | "initOptions")[] | undefined) => {
82
+ get: (keys?: ("visible" | "frameVisible" | "navVisible" | "menuVisible" | "tabVisible" | "mountVisible" | "navRect" | "menuRect" | "tabRect" | "mountRect" | "microApps" | "activeMicroAppName" | "activeMicroAppItem" | "navItems" | "activeNavItem" | "menuItems" | "activeMenuItem" | "fullNavItems" | "tabItems" | "activeTabItem" | "microAppStickStatus" | "initOptions")[] | undefined, options?: {
83
+ clone?: boolean;
84
+ } | undefined) => {
78
85
  /** 整个容器是否显示,默认为true,包括内容区域 */
79
86
  visible: boolean | undefined;
80
87
  /** 外框是否显示,默认为true,外框包括顶部导航栏,左侧菜单栏,tab标签栏 */
@@ -284,11 +291,13 @@ declare const channelItem_2: {
284
291
  set: (payload: Partial<{}>, opt?: {
285
292
  notMerge?: boolean;
286
293
  } | undefined) => void;
287
- get: (keys?: never[] | undefined) => {};
294
+ get: (keys?: never[] | undefined, options?: {
295
+ clone?: boolean;
296
+ } | undefined) => {};
288
297
  watch: (cb: (newData: {}, oldData: {}) => any, watchKeys?: never[] | undefined) => () => void;
289
298
  };
290
299
  cors: {
291
- send: (microAppName: string, key: ChildernListener, data?: any) => Promise<any[]>;
300
+ send: (microAppName: string, key: ChildrenListener, data?: any) => Promise<any[]>;
292
301
  on: (name: ParentListener, opt1: any, opt2?: any) => {
293
302
  cancel: () => void;
294
303
  };
@@ -310,7 +319,9 @@ declare const channelItem_3: {
310
319
  }>, opt?: {
311
320
  notMerge?: boolean;
312
321
  } | undefined) => void;
313
- get: (keys?: "appInfo"[] | undefined) => {
322
+ get: (keys?: "appInfo"[] | undefined, options?: {
323
+ clone?: boolean;
324
+ } | undefined) => {
314
325
  appInfo: MicroAppItem;
315
326
  };
316
327
  watch: (cb: (newData: {
@@ -321,19 +332,19 @@ declare const channelItem_3: {
321
332
  };
322
333
  cors: {
323
334
  send: (key: ParentListener_2, data?: any) => Promise<any[]>;
324
- on: (name: ChildernListener_2, opt1?: any, opt2?: any) => {
335
+ on: (name: ChildernListener, opt1?: any, opt2?: any) => {
325
336
  cancel: () => void;
326
337
  };
327
- once: (name: ChildernListener_2, opt1?: any, opt2?: any) => {
338
+ once: (name: ChildernListener, opt1?: any, opt2?: any) => {
328
339
  cancel: () => void;
329
340
  };
330
341
  };
331
342
  event: Emitter<Event_4>;
332
343
  };
333
344
 
334
- declare type ChildernListener = 'layoutDataChange' | 'syncRouter' | 'customEventFromMain';
345
+ declare type ChildernListener = 'layoutDataChange' | 'syncRouter' | 'customEventFromMain' | 'customEventFromMicro' | 'messageFromParent';
335
346
 
336
- declare type ChildernListener_2 = 'layoutDataChange' | 'syncRouter' | 'customEventFromMain' | 'customEventFromMicro';
347
+ declare type ChildrenListener = 'layoutDataChange' | 'syncRouter' | 'customEventFromMain' | 'messageFromParent';
337
348
 
338
349
  /**
339
350
  * 清除实例的所有 bus 数据
@@ -691,6 +702,8 @@ export declare interface NestedAppOptions extends Omit<MainAppContainerInitOptio
691
702
  debug?: boolean;
692
703
  /** 是否隔离路由(true: 嵌套实例路由独立,不与浏览器URL同步;false: 路由同步到URL) */
693
704
  isolateRouter?: boolean;
705
+ /** 是否隐藏子应用的外框(nav/menu/tab),默认为 true */
706
+ hideChildFrame?: boolean;
694
707
  }
695
708
 
696
709
  export declare interface NestedAppResult {