yach.open.jssdk 4.4.3-beta5 → 4.4.4-beta.10

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 (306) hide show
  1. package/dist/yach_jssdk_4.4.4-beta.10.js +1 -0
  2. package/es/api/app/custom/talYoungFilesUpload.js +2 -0
  3. package/es/api/biz/chat/chooseConversationByCorpId.js +2 -0
  4. package/es/api/biz/chat/openSingleChat.js +2 -0
  5. package/es/api/biz/chat/openSquad.js +2 -0
  6. package/es/api/biz/chat/openTeamChat.js +2 -0
  7. package/es/api/biz/chat/pickConversation.js +2 -0
  8. package/es/api/biz/chat/sendP2PMsg.js +2 -0
  9. package/es/api/biz/contact/complexPicker.js +2 -0
  10. package/es/api/biz/contact/departmentsPicker.js +2 -0
  11. package/es/api/biz/group/groupComplexPicker.js +2 -0
  12. package/es/api/biz/map/multipointView.js +2 -0
  13. package/es/api/biz/map/view.js +2 -0
  14. package/es/api/biz/navigation/close.js +2 -0
  15. package/es/api/biz/navigation/goBack.js +2 -0
  16. package/es/api/biz/navigation/quit.js +2 -0
  17. package/es/api/biz/navigation/replace.js +2 -0
  18. package/es/api/biz/navigation/setIcon.js +2 -0
  19. package/es/api/biz/navigation/setLeft.js +2 -0
  20. package/es/api/biz/navigation/setMenu.js +2 -0
  21. package/es/api/biz/navigation/setPanGestureEnable.js +2 -0
  22. package/es/api/biz/navigation/setRight.js +2 -0
  23. package/es/api/biz/navigation/setTitle.js +2 -0
  24. package/es/api/biz/navigation/setTitleExpandIcon.js +2 -0
  25. package/es/api/biz/navigation/setWindowBig.js +2 -0
  26. package/es/api/biz/navigation/tencentMeeting.js +2 -0
  27. package/es/api/biz/navigation/tencentMeetingBegin.js +2 -0
  28. package/es/api/biz/navigation/updateExpandTitle.js +2 -0
  29. package/es/api/biz/telephone/call.js +2 -0
  30. package/es/api/biz/telephone/showCallMenu.js +2 -0
  31. package/es/api/biz/util/addAppToNav.js +2 -0
  32. package/es/api/biz/util/assistantCreate.js +2 -0
  33. package/es/api/biz/util/authFinish.js +2 -0
  34. package/es/api/biz/util/authStart.js +2 -0
  35. package/es/api/biz/util/chosen.js +2 -0
  36. package/es/api/biz/util/clipboardFileUpload.js +2 -0
  37. package/es/api/biz/util/closeWindow.js +2 -0
  38. package/es/api/biz/util/complain.js +2 -0
  39. package/es/api/biz/util/copy.js +2 -0
  40. package/es/api/biz/util/createModifySchedule.js +2 -0
  41. package/es/api/biz/util/datepicker.js +2 -0
  42. package/es/api/biz/util/datetimepicker.js +2 -0
  43. package/es/api/biz/util/disableScreenCapture.js +2 -0
  44. package/es/api/biz/util/downloadFile.js +2 -0
  45. package/es/api/biz/util/entergroupCheck.js +2 -0
  46. package/es/api/biz/util/externalLinkPreviewFile.js +2 -0
  47. package/es/api/biz/util/feedback.js +2 -0
  48. package/es/api/biz/util/getSingleWebviewData.js +2 -0
  49. package/es/api/biz/util/getTogetherConfig.js +2 -0
  50. package/es/api/biz/util/getToken.js +2 -0
  51. package/es/api/biz/util/injectScript.js +2 -0
  52. package/es/api/biz/util/invoice.js +2 -0
  53. package/es/api/biz/util/knowledgeBaseSelect.js +11 -1
  54. package/es/api/biz/util/knowledgeSelectParams.d.ts +14 -0
  55. package/es/api/biz/util/knowledgeSelectParams.js +21 -0
  56. package/es/api/biz/util/lorebaseRefreshNodeWebview.js +2 -0
  57. package/es/api/biz/util/lorebaseShowList.js +2 -0
  58. package/es/api/biz/util/mediaFileUpload.js +2 -0
  59. package/es/api/biz/util/onlineDocmentOpenTeamChat.js +2 -0
  60. package/es/api/biz/util/open.js +2 -0
  61. package/es/api/biz/util/openFutureGroup.js +2 -0
  62. package/es/api/biz/util/openLink.js +2 -0
  63. package/es/api/biz/util/openMediaFileDialog.js +2 -0
  64. package/es/api/biz/util/openPublish.js +2 -0
  65. package/es/api/biz/util/openSingleWebview.js +2 -0
  66. package/es/api/biz/util/openSlidePanel.js +2 -0
  67. package/es/api/biz/util/openTalYoungToTopic.js +2 -0
  68. package/es/api/biz/util/openTogetherEyeWebview.js +2 -0
  69. package/es/api/biz/util/openUserSchedule.js +2 -0
  70. package/es/api/biz/util/openVideoPlayer.js +2 -0
  71. package/es/api/biz/util/previewFile.js +2 -0
  72. package/es/api/biz/util/previewImage.js +2 -0
  73. package/es/api/biz/util/proxy.js +2 -0
  74. package/es/api/biz/util/pushWorkMsg.js +2 -0
  75. package/es/api/biz/util/remind.js +2 -0
  76. package/es/api/biz/util/resetSessionUnread.js +2 -0
  77. package/es/api/biz/util/rouseApp.js +2 -0
  78. package/es/api/biz/util/savePic.js +2 -0
  79. package/es/api/biz/util/scan.js +2 -0
  80. package/es/api/biz/util/screen.js +2 -0
  81. package/es/api/biz/util/selectDepartment.js +2 -0
  82. package/es/api/biz/util/share.js +2 -0
  83. package/es/api/biz/util/takePicture.js +2 -0
  84. package/es/api/biz/util/topicEvent.js +2 -0
  85. package/es/api/biz/util/uploadAttachment.js +2 -0
  86. package/es/api/biz/util/weeklyRead.js +2 -0
  87. package/es/api/biz/util/yachEvent.js +2 -0
  88. package/es/api/biz/util/zfbAuth.js +2 -0
  89. package/es/api/biz/webViewMessage/send.js +2 -0
  90. package/es/api/device/audio/download.js +2 -0
  91. package/es/api/device/audio/onPlayEnd.js +2 -0
  92. package/es/api/device/audio/onRecordEnd.js +2 -0
  93. package/es/api/device/audio/onRecordEnd_v2.js +2 -0
  94. package/es/api/device/audio/pause.js +2 -0
  95. package/es/api/device/audio/play.js +2 -0
  96. package/es/api/device/audio/resume.js +2 -0
  97. package/es/api/device/audio/startRecord.js +2 -0
  98. package/es/api/device/audio/startRecord_v2.js +2 -0
  99. package/es/api/device/audio/stop.js +2 -0
  100. package/es/api/device/audio/stopRecord.js +2 -0
  101. package/es/api/device/audio/stopRecord_v2.js +2 -0
  102. package/es/api/device/base/checkStepPermission.js +2 -0
  103. package/es/api/device/base/getPhoneInfo.js +2 -0
  104. package/es/api/device/base/getUUID.js +2 -0
  105. package/es/api/device/connection/getNetworkType.js +2 -0
  106. package/es/api/device/connection/isAtTal.js +4 -2
  107. package/es/api/device/geolocation/get.js +2 -0
  108. package/es/api/device/geolocation/getSwitch.js +2 -0
  109. package/es/api/device/notification/actionSheet.js +2 -0
  110. package/es/api/device/notification/alert.js +2 -0
  111. package/es/api/device/notification/confirm.js +2 -0
  112. package/es/api/device/notification/hidePreloader.js +4 -0
  113. package/es/api/device/notification/showPreloader.js +4 -0
  114. package/es/api/device/notification/toast.js +2 -0
  115. package/es/api/device/notification/vibrate.js +2 -0
  116. package/es/api/device/system/getLang.js +2 -0
  117. package/es/api/device/system/setLight.js +2 -0
  118. package/es/api/initAPI.js +5 -3
  119. package/es/api/primary/createTab.js +2 -0
  120. package/es/api/primary/exitFullScreen.js +2 -0
  121. package/es/api/primary/fullScreen.js +2 -0
  122. package/es/api/primary/updateTab.d.ts +9 -0
  123. package/es/api/primary/updateTab.js +17 -0
  124. package/es/api/primary/weeklyShare.js +2 -0
  125. package/es/api/runtime/permission/requestAuthCode.js +2 -0
  126. package/es/api/ui/pullToRefresh/disable.js +2 -0
  127. package/es/api/ui/pullToRefresh/enable.js +2 -0
  128. package/es/api/ui/pullToRefresh/stop.js +2 -0
  129. package/es/api/ui/webViewBounce/disable.js +2 -0
  130. package/es/api/util/domainStorage/getItem.js +2 -0
  131. package/es/api/util/domainStorage/removeItem.js +2 -0
  132. package/es/api/util/domainStorage/setItem.js +2 -0
  133. package/es/api/util/tool/flushLog.js +2 -0
  134. package/es/api/util/tool/log.js +2 -0
  135. package/es/index.d.ts +5 -1
  136. package/es/index.js +32 -17
  137. package/es/lib/bridge/mobile.js +28 -12
  138. package/es/lib/bridge/pc.js +19 -11
  139. package/es/lib/helper/apiHelper.js +2 -0
  140. package/es/lib/helper/codeMap.js +2 -0
  141. package/es/lib/helper/event.js +19 -7
  142. package/es/lib/helper/pcIframe.d.ts +8 -25
  143. package/es/lib/helper/pcIframe.js +85 -25
  144. package/es/lib/index.js +22 -8
  145. package/es/lib/sdk/index.js +39 -17
  146. package/es/lib/sdk/sdk.typings.d.ts +1 -0
  147. package/es/lib/sdk/sdk.typings.js +1 -0
  148. package/es/utils/bpitLog.js +13 -4
  149. package/es/utils/compareVersions.js +53 -26
  150. package/es/utils/console.js +17 -1
  151. package/es/utils/env.js +22 -13
  152. package/es/utils/index.js +6 -1
  153. package/libs/api/app/custom/talYoungFilesUpload.js +7 -2
  154. package/libs/api/biz/chat/chooseConversationByCorpId.js +7 -1
  155. package/libs/api/biz/chat/openSingleChat.js +7 -1
  156. package/libs/api/biz/chat/openSquad.js +7 -1
  157. package/libs/api/biz/chat/openTeamChat.js +7 -1
  158. package/libs/api/biz/chat/pickConversation.js +7 -1
  159. package/libs/api/biz/chat/sendP2PMsg.js +7 -1
  160. package/libs/api/biz/contact/complexPicker.js +7 -1
  161. package/libs/api/biz/contact/departmentsPicker.js +7 -1
  162. package/libs/api/biz/group/groupComplexPicker.js +7 -1
  163. package/libs/api/biz/map/multipointView.js +7 -1
  164. package/libs/api/biz/map/view.js +7 -1
  165. package/libs/api/biz/navigation/close.js +7 -1
  166. package/libs/api/biz/navigation/goBack.js +7 -1
  167. package/libs/api/biz/navigation/quit.js +7 -1
  168. package/libs/api/biz/navigation/replace.js +7 -1
  169. package/libs/api/biz/navigation/setIcon.js +8 -1
  170. package/libs/api/biz/navigation/setLeft.js +8 -1
  171. package/libs/api/biz/navigation/setMenu.js +8 -1
  172. package/libs/api/biz/navigation/setPanGestureEnable.js +8 -1
  173. package/libs/api/biz/navigation/setRight.js +8 -1
  174. package/libs/api/biz/navigation/setTitle.js +7 -1
  175. package/libs/api/biz/navigation/setTitleExpandIcon.js +8 -1
  176. package/libs/api/biz/navigation/setWindowBig.js +7 -2
  177. package/libs/api/biz/navigation/tencentMeeting.js +7 -1
  178. package/libs/api/biz/navigation/tencentMeetingBegin.js +7 -1
  179. package/libs/api/biz/navigation/updateExpandTitle.js +7 -1
  180. package/libs/api/biz/telephone/call.js +7 -1
  181. package/libs/api/biz/telephone/showCallMenu.js +7 -1
  182. package/libs/api/biz/util/addAppToNav.js +7 -1
  183. package/libs/api/biz/util/assistantCreate.js +7 -1
  184. package/libs/api/biz/util/authFinish.js +7 -1
  185. package/libs/api/biz/util/authStart.js +7 -1
  186. package/libs/api/biz/util/chosen.js +7 -1
  187. package/libs/api/biz/util/clipboardFileUpload.js +7 -1
  188. package/libs/api/biz/util/closeWindow.js +7 -1
  189. package/libs/api/biz/util/complain.js +7 -1
  190. package/libs/api/biz/util/copy.js +7 -1
  191. package/libs/api/biz/util/createModifySchedule.js +7 -1
  192. package/libs/api/biz/util/datepicker.js +7 -1
  193. package/libs/api/biz/util/datetimepicker.js +7 -1
  194. package/libs/api/biz/util/disableScreenCapture.js +7 -1
  195. package/libs/api/biz/util/downloadFile.js +7 -1
  196. package/libs/api/biz/util/entergroupCheck.js +7 -1
  197. package/libs/api/biz/util/externalLinkPreviewFile.js +7 -1
  198. package/libs/api/biz/util/feedback.js +7 -1
  199. package/libs/api/biz/util/getSingleWebviewData.js +7 -1
  200. package/libs/api/biz/util/getTogetherConfig.js +7 -1
  201. package/libs/api/biz/util/getToken.js +7 -1
  202. package/libs/api/biz/util/injectScript.js +7 -1
  203. package/libs/api/biz/util/invoice.js +7 -2
  204. package/libs/api/biz/util/knowledgeBaseSelect.js +16 -2
  205. package/libs/api/biz/util/knowledgeSelectParams.d.ts +14 -0
  206. package/libs/api/biz/util/knowledgeSelectParams.js +32 -0
  207. package/libs/api/biz/util/lorebaseRefreshNodeWebview.js +7 -1
  208. package/libs/api/biz/util/lorebaseShowList.js +7 -1
  209. package/libs/api/biz/util/mediaFileUpload.js +7 -2
  210. package/libs/api/biz/util/onlineDocmentOpenTeamChat.js +7 -1
  211. package/libs/api/biz/util/open.js +7 -1
  212. package/libs/api/biz/util/openFutureGroup.js +7 -1
  213. package/libs/api/biz/util/openLink.js +7 -1
  214. package/libs/api/biz/util/openMediaFileDialog.js +7 -2
  215. package/libs/api/biz/util/openPublish.js +7 -1
  216. package/libs/api/biz/util/openSingleWebview.js +7 -1
  217. package/libs/api/biz/util/openSlidePanel.js +7 -1
  218. package/libs/api/biz/util/openTalYoungToTopic.js +7 -2
  219. package/libs/api/biz/util/openTogetherEyeWebview.js +7 -1
  220. package/libs/api/biz/util/openUserSchedule.js +7 -1
  221. package/libs/api/biz/util/openVideoPlayer.js +7 -1
  222. package/libs/api/biz/util/previewFile.js +7 -1
  223. package/libs/api/biz/util/previewImage.js +7 -1
  224. package/libs/api/biz/util/proxy.js +7 -1
  225. package/libs/api/biz/util/pushWorkMsg.js +7 -2
  226. package/libs/api/biz/util/remind.js +7 -1
  227. package/libs/api/biz/util/resetSessionUnread.js +7 -1
  228. package/libs/api/biz/util/rouseApp.js +7 -2
  229. package/libs/api/biz/util/savePic.js +7 -1
  230. package/libs/api/biz/util/scan.js +7 -1
  231. package/libs/api/biz/util/screen.js +7 -1
  232. package/libs/api/biz/util/selectDepartment.js +7 -1
  233. package/libs/api/biz/util/share.js +7 -1
  234. package/libs/api/biz/util/takePicture.js +7 -1
  235. package/libs/api/biz/util/topicEvent.js +7 -1
  236. package/libs/api/biz/util/uploadAttachment.js +7 -1
  237. package/libs/api/biz/util/weeklyRead.js +7 -1
  238. package/libs/api/biz/util/yachEvent.js +7 -1
  239. package/libs/api/biz/util/zfbAuth.js +7 -1
  240. package/libs/api/biz/webViewMessage/send.js +7 -1
  241. package/libs/api/device/audio/download.js +7 -1
  242. package/libs/api/device/audio/onPlayEnd.js +7 -1
  243. package/libs/api/device/audio/onRecordEnd.js +7 -1
  244. package/libs/api/device/audio/onRecordEnd_v2.js +7 -1
  245. package/libs/api/device/audio/pause.js +7 -1
  246. package/libs/api/device/audio/play.js +7 -1
  247. package/libs/api/device/audio/resume.js +7 -1
  248. package/libs/api/device/audio/startRecord.js +7 -1
  249. package/libs/api/device/audio/startRecord_v2.js +7 -1
  250. package/libs/api/device/audio/stop.js +7 -1
  251. package/libs/api/device/audio/stopRecord.js +7 -1
  252. package/libs/api/device/audio/stopRecord_v2.js +7 -1
  253. package/libs/api/device/base/checkStepPermission.js +7 -1
  254. package/libs/api/device/base/getPhoneInfo.js +7 -1
  255. package/libs/api/device/base/getUUID.js +7 -1
  256. package/libs/api/device/connection/getNetworkType.js +7 -1
  257. package/libs/api/device/connection/isAtTal.js +9 -3
  258. package/libs/api/device/geolocation/get.js +7 -1
  259. package/libs/api/device/geolocation/getSwitch.js +7 -1
  260. package/libs/api/device/notification/actionSheet.js +7 -1
  261. package/libs/api/device/notification/alert.js +7 -1
  262. package/libs/api/device/notification/confirm.js +7 -1
  263. package/libs/api/device/notification/hidePreloader.js +10 -2
  264. package/libs/api/device/notification/showPreloader.js +10 -2
  265. package/libs/api/device/notification/toast.js +7 -1
  266. package/libs/api/device/notification/vibrate.js +7 -1
  267. package/libs/api/device/system/getLang.js +7 -1
  268. package/libs/api/device/system/setLight.js +7 -1
  269. package/libs/api/initAPI.js +13 -4
  270. package/libs/api/primary/createTab.js +7 -1
  271. package/libs/api/primary/exitFullScreen.js +7 -1
  272. package/libs/api/primary/fullScreen.js +7 -1
  273. package/libs/api/primary/updateTab.d.ts +9 -0
  274. package/libs/api/primary/updateTab.js +28 -0
  275. package/libs/api/primary/weeklyShare.js +7 -1
  276. package/libs/api/runtime/permission/requestAuthCode.js +7 -1
  277. package/libs/api/ui/pullToRefresh/disable.js +7 -1
  278. package/libs/api/ui/pullToRefresh/enable.js +7 -1
  279. package/libs/api/ui/pullToRefresh/stop.js +7 -1
  280. package/libs/api/ui/webViewBounce/disable.js +7 -1
  281. package/libs/api/util/domainStorage/getItem.js +7 -1
  282. package/libs/api/util/domainStorage/removeItem.js +7 -1
  283. package/libs/api/util/domainStorage/setItem.js +7 -1
  284. package/libs/api/util/tool/flushLog.js +7 -1
  285. package/libs/api/util/tool/log.js +7 -1
  286. package/libs/index.d.ts +5 -1
  287. package/libs/index.js +559 -276
  288. package/libs/lib/bridge/index.js +13 -6
  289. package/libs/lib/bridge/mobile.js +51 -16
  290. package/libs/lib/bridge/pc.js +37 -16
  291. package/libs/lib/helper/apiHelper.js +7 -1
  292. package/libs/lib/helper/codeMap.js +7 -1
  293. package/libs/lib/helper/event.js +28 -8
  294. package/libs/lib/helper/pcIframe.d.ts +8 -25
  295. package/libs/lib/helper/pcIframe.js +93 -24
  296. package/libs/lib/index.js +34 -10
  297. package/libs/lib/sdk/index.js +49 -18
  298. package/libs/lib/sdk/sdk.typings.d.ts +1 -0
  299. package/libs/lib/sdk/sdk.typings.js +4 -0
  300. package/libs/utils/bpitLog.js +16 -4
  301. package/libs/utils/compareVersions.js +77 -32
  302. package/libs/utils/console.js +18 -2
  303. package/libs/utils/env.js +24 -13
  304. package/libs/utils/index.js +21 -8
  305. package/package.json +4 -6
  306. package/dist/yach_jssdk_4.4.3-beta5.js +0 -1
package/es/index.d.ts CHANGED
@@ -51,6 +51,7 @@ import { weeklyRead } from './api/biz/util/weeklyRead';
51
51
  import { disableScreenCapture } from './api/biz/util/disableScreenCapture';
52
52
  import { openFutureGroup } from './api/biz/util/openFutureGroup';
53
53
  import { knowledgeBaseSelect } from './api/biz/util/knowledgeBaseSelect';
54
+ import { knowledgeSelectParams } from './api/biz/util/knowledgeSelectParams';
54
55
  import { lorebaseShowList } from './api/biz/util/lorebaseShowList';
55
56
  import { lorebaseRefreshNodeWebview } from './api/biz/util/lorebaseRefreshNodeWebview';
56
57
  import { copy } from './api/biz/util/copy';
@@ -84,6 +85,7 @@ import { openTeamChat } from './api/biz/chat/openTeamChat';
84
85
  import { openSquad } from './api/biz/chat/openSquad';
85
86
  import { sendP2PMsg } from './api/biz/chat/sendP2PMsg';
86
87
  import { createTab } from './api/primary/createTab';
88
+ import { updateTab } from './api/primary/updateTab';
87
89
  import { weeklyShare } from './api/primary/weeklyShare';
88
90
  import { fullScreen } from './api/primary/fullScreen';
89
91
  import { exitFullScreen } from './api/primary/exitFullScreen';
@@ -135,7 +137,7 @@ import { send as webViewMessageSend } from './api/biz/webViewMessage/send';
135
137
  import { talYoungFilesUpload } from './api/app/custom/talYoungFilesUpload';
136
138
  import { addAppToNav } from './api/biz/util/addAppToNav';
137
139
  declare const version: string, sdkVersion: string, env: import("./lib/sdk/sdk.typings").IENV, platform: import("./lib/sdk/sdk.typings").ENV_ENUM, platformV2: import("./lib/sdk/sdk.typings").PlatformV2Props, config: (configParams: import("./lib/sdk/sdk.typings").IConfigParams) => void, ready: (readyCallback: () => void) => void, error: (callback: (err: any) => void) => void, on: (methodName: string, listener: (e: any) => void) => void, off: (methodName: string, listener: (e: any) => void) => void;
138
- export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, lorebaseShowList, lorebaseRefreshNodeWebview, openPublish, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, copy, capturePage, };
140
+ export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, updateTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, knowledgeSelectParams, lorebaseShowList, lorebaseRefreshNodeWebview, openPublish, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, copy, capturePage, };
139
141
  declare const _default: {
140
142
  version: string;
141
143
  sdkVersion: string;
@@ -200,6 +202,7 @@ declare const _default: {
200
202
  disableScreenCapture: typeof disableScreenCapture;
201
203
  addAppToNav: typeof addAppToNav;
202
204
  knowledgeBaseSelect: typeof knowledgeBaseSelect;
205
+ knowledgeSelectParams: typeof knowledgeSelectParams;
203
206
  lorebaseShowList: typeof lorebaseShowList;
204
207
  lorebaseRefreshNodeWebview: typeof lorebaseRefreshNodeWebview;
205
208
  copy: typeof copy;
@@ -257,6 +260,7 @@ declare const _default: {
257
260
  };
258
261
  primary: {
259
262
  createTab: typeof createTab;
263
+ updateTab: typeof updateTab;
260
264
  weeklyShare: typeof weeklyShare;
261
265
  fullScreen: typeof fullScreen;
262
266
  exitFullScreen: typeof exitFullScreen;
package/es/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import { yachSdk } from './lib';
2
2
  /*biz*****************************/
3
+
3
4
  /**util*/
5
+
4
6
  import { openLink } from './api/biz/util/openLink';
5
7
  import { feedback } from './api/biz/util/feedback';
6
8
  import { open } from './api/biz/util/open';
@@ -53,11 +55,13 @@ import { weeklyRead } from './api/biz/util/weeklyRead';
53
55
  import { disableScreenCapture } from './api/biz/util/disableScreenCapture';
54
56
  import { openFutureGroup } from './api/biz/util/openFutureGroup';
55
57
  import { knowledgeBaseSelect } from './api/biz/util/knowledgeBaseSelect';
58
+ import { knowledgeSelectParams } from './api/biz/util/knowledgeSelectParams';
56
59
  import { lorebaseShowList } from './api/biz/util/lorebaseShowList';
57
60
  import { lorebaseRefreshNodeWebview } from './api/biz/util/lorebaseRefreshNodeWebview';
58
61
  import { copy } from './api/biz/util/copy';
59
62
  import { openPublish } from './api/biz/util/openPublish';
60
63
  /**navigation*/
64
+
61
65
  import { setIcon } from './api/biz/navigation/setIcon';
62
66
  import { setTitle } from './api/biz/navigation/setTitle';
63
67
  import { setMenu } from './api/biz/navigation/setMenu';
@@ -74,11 +78,14 @@ import { tencentMeeting } from './api/biz/navigation/tencentMeeting';
74
78
  import { tencentMeetingBegin } from './api/biz/navigation/tencentMeetingBegin';
75
79
  import { setPanGestureEnable } from './api/biz/navigation/setPanGestureEnable';
76
80
  /**contact*/
81
+
77
82
  import { complexPicker } from './api/biz/contact/complexPicker';
78
83
  import { departmentsPicker } from './api/biz/contact/departmentsPicker';
79
84
  /** group*/
85
+
80
86
  import { groupComplexPicker } from './api/biz/group/groupComplexPicker';
81
87
  /** chat*/
88
+
82
89
  import { chooseConversationByCorpId } from './api/biz/chat/chooseConversationByCorpId';
83
90
  import { pickConversation } from './api/biz/chat/pickConversation';
84
91
  import { openSingleChat } from './api/biz/chat/openSingleChat';
@@ -86,13 +93,17 @@ import { openTeamChat } from './api/biz/chat/openTeamChat';
86
93
  import { openSquad } from './api/biz/chat/openSquad';
87
94
  import { sendP2PMsg } from './api/biz/chat/sendP2PMsg';
88
95
  /* primary*****************************/
96
+
89
97
  import { createTab } from './api/primary/createTab';
98
+ import { updateTab } from './api/primary/updateTab';
90
99
  import { weeklyShare } from './api/primary/weeklyShare';
91
100
  import { fullScreen } from './api/primary/fullScreen';
92
101
  import { exitFullScreen } from './api/primary/exitFullScreen';
93
102
  /* runtime*****************************/
103
+
94
104
  import { requestAuthCode } from './api/runtime/permission/requestAuthCode';
95
105
  /** device */
106
+
96
107
  import { showPreloader, showCustomOverlayContent } from './api/device/notification/showPreloader';
97
108
  import { hidePreloader, hideCustomOverlayContent } from './api/device/notification/hidePreloader';
98
109
  import { vibrate } from './api/device/notification/vibrate';
@@ -122,38 +133,40 @@ import { startRecord_v2 } from './api/device/audio/startRecord_v2';
122
133
  import { stopRecord_v2 } from './api/device/audio/stopRecord_v2';
123
134
  import { setLight } from './api/device/system/setLight';
124
135
  /** telephone */
136
+
125
137
  import { showCallMenu } from './api/biz/telephone/showCallMenu';
126
138
  import { call } from './api/biz/telephone/call';
127
139
  /** ui */
140
+
128
141
  import { disable as webViewBounceDisable } from './api/ui/webViewBounce/disable';
129
142
  import { enable as pullToRefreshEnable } from './api/ui/pullToRefresh/enable';
130
143
  import { stop as pullToRefreshStop } from './api/ui/pullToRefresh/stop';
131
- import { disable as pullToRefreshDisable } from './api/ui/pullToRefresh/disable';
132
- // demainStorage
144
+ import { disable as pullToRefreshDisable } from './api/ui/pullToRefresh/disable'; // demainStorage
145
+
133
146
  import { getItem } from './api/util/domainStorage/getItem';
134
147
  import { setItem } from './api/util/domainStorage/setItem';
135
- import { removeItem } from './api/util/domainStorage/removeItem';
136
- // log
148
+ import { removeItem } from './api/util/domainStorage/removeItem'; // log
149
+
137
150
  import { writeLog } from './api/util/tool/log';
138
- import { flushLog } from './api/util/tool/flushLog';
139
- // screen
151
+ import { flushLog } from './api/util/tool/flushLog'; // screen
152
+
140
153
  import { capturePage } from './api/biz/util/screen';
141
154
  import { send as webViewMessageSend } from './api/biz/webViewMessage/send';
142
155
  import { talYoungFilesUpload } from './api/app/custom/talYoungFilesUpload';
143
156
  import { addAppToNav } from './api/biz/util/addAppToNav';
144
157
  console.log('add rouseApp ------------>', rouseApp);
145
158
  var _yachSdk$exportSdk = yachSdk.exportSdk,
146
- version = _yachSdk$exportSdk.version,
147
- sdkVersion = _yachSdk$exportSdk.sdkVersion,
148
- env = _yachSdk$exportSdk.env,
149
- platform = _yachSdk$exportSdk.platform,
150
- platformV2 = _yachSdk$exportSdk.platformV2,
151
- config = _yachSdk$exportSdk.config,
152
- ready = _yachSdk$exportSdk.ready,
153
- error = _yachSdk$exportSdk.error,
154
- on = _yachSdk$exportSdk.on,
155
- off = _yachSdk$exportSdk.off;
156
- export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, lorebaseShowList, lorebaseRefreshNodeWebview, openPublish, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, copy, capturePage };
159
+ version = _yachSdk$exportSdk.version,
160
+ sdkVersion = _yachSdk$exportSdk.sdkVersion,
161
+ env = _yachSdk$exportSdk.env,
162
+ platform = _yachSdk$exportSdk.platform,
163
+ platformV2 = _yachSdk$exportSdk.platformV2,
164
+ config = _yachSdk$exportSdk.config,
165
+ ready = _yachSdk$exportSdk.ready,
166
+ error = _yachSdk$exportSdk.error,
167
+ on = _yachSdk$exportSdk.on,
168
+ off = _yachSdk$exportSdk.off;
169
+ export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, updateTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, knowledgeSelectParams, lorebaseShowList, lorebaseRefreshNodeWebview, openPublish, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, copy, capturePage };
157
170
  export default {
158
171
  version: version,
159
172
  sdkVersion: sdkVersion,
@@ -218,6 +231,7 @@ export default {
218
231
  disableScreenCapture: disableScreenCapture,
219
232
  addAppToNav: addAppToNav,
220
233
  knowledgeBaseSelect: knowledgeBaseSelect,
234
+ knowledgeSelectParams: knowledgeSelectParams,
221
235
  lorebaseShowList: lorebaseShowList,
222
236
  lorebaseRefreshNodeWebview: lorebaseRefreshNodeWebview,
223
237
  copy: copy,
@@ -275,6 +289,7 @@ export default {
275
289
  },
276
290
  primary: {
277
291
  createTab: createTab,
292
+ updateTab: updateTab,
278
293
  weeklyShare: weeklyShare,
279
294
  fullScreen: fullScreen,
280
295
  exitFullScreen: exitFullScreen
@@ -1,30 +1,36 @@
1
- import _setTimeout from "@babel/runtime-corejs3/core-js/set-timeout";
2
- import _Promise from "@babel/runtime-corejs3/core-js/promise";
3
- import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
4
- import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
5
1
  import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
2
+ import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
3
+ import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
4
+ import _Promise from "@babel/runtime-corejs3/core-js/promise";
5
+ import _setTimeout from "@babel/runtime-corejs3/core-js/set-timeout";
6
6
  import Event from '../helper/event';
7
7
  import { electronResCodeMap } from '../helper/codeMap';
8
8
  import { log, bpitLog } from '../../utils';
9
+
9
10
  function setupWebViewJavascriptBridge(callback) {
10
11
  if (window.WebViewJavascriptBridge) {
11
12
  return callback(WebViewJavascriptBridge);
12
13
  }
14
+
13
15
  if (window.WKWebViewJavascriptBridge) {
14
16
  return callback(WKWebViewJavascriptBridge);
15
17
  }
18
+
16
19
  if (window.WVJBCallbacks) {
17
20
  return window.WVJBCallbacks.push(callback);
18
21
  }
22
+
19
23
  window.WVJBCallbacks = [callback];
20
24
  var WVJBIframe = document.createElement('iframe');
21
25
  WVJBIframe.style.display = 'none';
22
26
  WVJBIframe.src = 'https://__bridge_loaded__';
23
27
  document.documentElement.appendChild(WVJBIframe);
28
+
24
29
  _setTimeout(function () {
25
30
  document.documentElement.removeChild(WVJBIframe);
26
31
  }, 0);
27
32
  }
33
+
28
34
  var mobileBridgeInit = function mobileBridgeInit() {
29
35
  return new _Promise(function (resolve, reject) {
30
36
  setupWebViewJavascriptBridge(function (bridge) {
@@ -81,14 +87,17 @@ var mobileBridgeInit = function mobileBridgeInit() {
81
87
  });
82
88
  });
83
89
  };
90
+
84
91
  var mobileBridge = function mobileBridge(method, param) {
85
92
  return new _Promise(function (resolve, reject) {
86
93
  var p = _Object$assign({}, param);
94
+
87
95
  setupWebViewJavascriptBridge(function (bridge) {
88
96
  if (param.control) {
89
97
  bridge.registerHandler(method, function (data) {
90
98
  var onSuccess = param.onSuccess;
91
99
  delete p.onSuccess;
100
+
92
101
  if ('function' === typeof onSuccess) {
93
102
  onSuccess(data);
94
103
  resolve({
@@ -98,11 +107,14 @@ var mobileBridge = function mobileBridge(method, param) {
98
107
  }
99
108
  });
100
109
  }
110
+
101
111
  bridge.callHandler(method, param, function (e) {
102
112
  var code = e.code,
103
- message = e.message,
104
- data = e.data;
113
+ message = e.message,
114
+ data = e.data;
115
+
105
116
  var _code = _parseInt(code);
117
+
106
118
  var callbackStr = electronResCodeMap(_code);
107
119
  var callbackFun = p[callbackStr];
108
120
  log("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
@@ -112,37 +124,40 @@ var mobileBridge = function mobileBridge(method, param) {
112
124
  _code: _code,
113
125
  message: message,
114
126
  callbackFun: callbackFun
115
- });
116
- // 请求失败
127
+ }); // 请求失败
128
+
117
129
  if (callbackStr === 'onFail') {
118
130
  bpitLog({
119
131
  method: method,
120
132
  errorcode: _code,
121
133
  message: message || _JSON$stringify(data) || 'SDK执行失败回调,相关参数'
122
134
  });
135
+
123
136
  if ('function' === typeof callbackFun) {
124
137
  message ? callbackFun({
125
138
  code: code,
126
139
  message: message
127
140
  }) : callbackFun(data);
128
141
  }
142
+
129
143
  reject({
130
144
  _code: _code,
131
145
  message: message,
132
146
  data: data
133
147
  });
134
148
  return;
135
- }
136
- // 请求成功
149
+ } // 请求成功
150
+
151
+
137
152
  if ('function' === typeof callbackFun) {
138
153
  callbackFun(data || message);
139
154
  }
155
+
140
156
  resolve({
141
157
  _code: _code,
142
158
  message: message,
143
159
  data: data
144
- });
145
- // if (_code === -2 || _code === 7) {
160
+ }); // if (_code === -2 || _code === 7) {
146
161
  // bpitLog({
147
162
  // method,
148
163
  // errorcode: _code,
@@ -175,4 +190,5 @@ var mobileBridge = function mobileBridge(method, param) {
175
190
  });
176
191
  });
177
192
  };
193
+
178
194
  export { mobileBridge, mobileBridgeInit };
@@ -1,20 +1,24 @@
1
- import _Promise from "@babel/runtime-corejs3/core-js/promise";
2
- import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
3
- import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
4
1
  import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
2
+ import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
3
+ import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
4
+ import _Promise from "@babel/runtime-corejs3/core-js/promise";
5
5
  import PcIframe from '../helper/pcIframe';
6
6
  import { electronResCodeMap } from '../helper/codeMap';
7
7
  import { log, bpitLog } from '../../utils';
8
+
8
9
  var PcBridgeInit = function PcBridgeInit() {
9
10
  PcIframe.init();
10
11
  };
12
+
11
13
  var pcBridge = function pcBridge(method, param) {
12
14
  return new _Promise(function (resolve, reject) {
13
15
  return PcIframe.invokeAPI(method, param, function (_ref) {
14
16
  var data = _ref.data,
15
- code = _ref.code,
16
- message = _ref.message;
17
+ code = _ref.code,
18
+ message = _ref.message;
19
+
17
20
  var _code = _parseInt(code);
21
+
18
22
  var callbackStr = electronResCodeMap(_code);
19
23
  var callbackFun = param[callbackStr];
20
24
  log("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
@@ -24,14 +28,15 @@ var pcBridge = function pcBridge(method, param) {
24
28
  _code: _code,
25
29
  message: message,
26
30
  callbackFun: callbackFun
27
- });
28
- // 请求失败
31
+ }); // 请求失败
32
+
29
33
  if (callbackStr === 'onFail') {
30
34
  bpitLog({
31
35
  method: method,
32
36
  errorcode: _code,
33
37
  message: message || _JSON$stringify(data) || 'SDK执行失败回调,相关参数'
34
38
  });
39
+
35
40
  if ('function' === typeof callbackFun) {
36
41
  console.log('wenai-code', code, _code);
37
42
  var callbackData = Object.prototype.toString.call(data) === "[object Object]" ? _Object$assign(_Object$assign({}, data), {
@@ -44,23 +49,25 @@ var pcBridge = function pcBridge(method, param) {
44
49
  };
45
50
  message ? callbackFun(callbackData) : callbackFun(data);
46
51
  }
52
+
47
53
  reject({
48
54
  _code: _code,
49
55
  message: message,
50
56
  data: data
51
57
  });
52
58
  return;
53
- }
54
- // 请求成功
59
+ } // 请求成功
60
+
61
+
55
62
  if ('function' === typeof callbackFun) {
56
63
  callbackFun(data || message);
57
64
  }
65
+
58
66
  resolve({
59
67
  _code: _code,
60
68
  message: message,
61
69
  data: data
62
- });
63
- // if (_code === -2) {
70
+ }); // if (_code === -2) {
64
71
  // bpitLog({
65
72
  // method,
66
73
  // errorcode: _code,
@@ -83,4 +90,5 @@ var pcBridge = function pcBridge(method, param) {
83
90
  });
84
91
  });
85
92
  };
93
+
86
94
  export { pcBridge, PcBridgeInit };
@@ -1,8 +1,10 @@
1
1
  import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
2
+
2
3
  function genDefaultParamsDealFn(p) {
3
4
  return function (r) {
4
5
  return _Object$assign(_Object$assign({}, p), r);
5
6
  };
6
7
  }
8
+
7
9
  ;
8
10
  export { genDefaultParamsDealFn };
@@ -1,6 +1,8 @@
1
1
  import _Map from "@babel/runtime-corejs3/core-js/map";
2
2
  var resCodeMap = new _Map([[0, 'onSuccess'], [-1, 'onCancel'], [-2, 'onFail'], [-3, 'onProgress'], [-4, 'onSubmit']]);
3
+
3
4
  function electronResCodeMap(code) {
4
5
  return resCodeMap.get(code) || 'onFail';
5
6
  }
7
+
6
8
  export { electronResCodeMap };
@@ -1,31 +1,41 @@
1
- import _createClass from "@babel/runtime-corejs3/helpers/createClass";
2
- import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
3
- import _Array$isArray from "@babel/runtime-corejs3/core-js/array/is-array";
4
- import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
5
- import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
6
1
  import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js/instance/for-each";
7
- var Event = /*#__PURE__*/_createClass(function Event() {
2
+ import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
3
+ import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
4
+ import _Array$isArray from "@babel/runtime-corejs3/core-js/array/is-array";
5
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
6
+
7
+ var Event = function Event() {
8
8
  var _this = this;
9
+
9
10
  _classCallCheck(this, Event);
11
+
10
12
  this.on = function (event, fn) {
11
13
  if (!event || 'function' !== typeof fn) throw 'eventName is null or handle is not a function, on fail';
12
14
  if (!_Array$isArray(_this.eventsHandle[event])) _this.eventsHandle[event] = [];
15
+
13
16
  _this.eventsHandle[event].push(fn);
14
17
  };
18
+
15
19
  this.off = function (event, fn) {
16
20
  if (!event) throw 'eventName is null, invoke off fail';
21
+
17
22
  if (!fn) {
18
23
  _this.eventsHandle[event] = [];
19
24
  return;
20
25
  }
26
+
21
27
  if (_Array$isArray(_this.eventsHandle[event])) {
22
28
  var _context, _context2;
29
+
23
30
  var n = _indexOfInstanceProperty(_context = _this.eventsHandle[event]).call(_context, fn);
31
+
24
32
  -1 !== n && _spliceInstanceProperty(_context2 = _this.eventsHandle[event]).call(_context2, n, 1);
25
33
  }
26
34
  };
35
+
27
36
  this.execEvent = function (event, data) {
28
37
  var _context3;
38
+
29
39
  _Array$isArray(this.eventsHandle[event]) && _forEachInstanceProperty(_context3 = this.eventsHandle[event]).call(_context3, function (fn) {
30
40
  try {
31
41
  fn(data);
@@ -34,7 +44,9 @@ var Event = /*#__PURE__*/_createClass(function Event() {
34
44
  }
35
45
  });
36
46
  };
47
+
37
48
  this.eventsHandle = {};
38
- });
49
+ };
50
+
39
51
  var event = new Event();
40
52
  export default event;
@@ -3,41 +3,24 @@ declare global {
3
3
  sendToHost: any;
4
4
  sendTo: any;
5
5
  receiveBrowserViewData: any;
6
+ remoteSendToHost?: (payload: string) => void;
7
+ remoteReceiveFromHost?: (callback: (result: Record<string, any>) => void, moduleId?: string) => void;
6
8
  }
7
9
  }
8
- interface APIParams {
9
- invokeType?: 'browserView' | '';
10
- [propName: string]: any;
11
- }
12
- declare class GenPostMsg {
13
- private id;
14
- private PromiseObj;
15
- private methodName;
16
- private plainMsg;
17
- callback: (v: any) => void;
18
- result: Promise<any>;
19
- invokeType: 'browserView' | '';
20
- constructor(method: string, param: APIParams, callback: any);
21
- genid: () => string;
22
- receiveResponse: (data: any) => void;
23
- getPayload: () => {
24
- msgId: string;
25
- methodName: string;
26
- body: object;
27
- type: string;
28
- invokeType: "" | "browserView";
29
- };
30
- }
10
+ declare type InvokeType = 'browserView' | 'moduleFederation' | '';
31
11
  declare class Frame {
32
12
  pendingMsgs: {};
13
+ invokeType?: InvokeType;
14
+ moduleId?: string;
33
15
  constructor();
34
16
  addPending: (e: any) => void;
35
17
  deletePending: (e: any) => void;
36
18
  getPending: (t: any) => any;
37
19
  invokeAPIInBrowserView: (payload: string) => void;
38
20
  invokeAPIInWebview: (payload: string) => void;
39
- invokeAPI: (method: string, param: any, callback: any) => GenPostMsg;
40
- handleCallback: (datas: any, invokeType?: 'browserView' | '') => void;
21
+ invokeAPIInModuleFederation: (payload: string) => void;
22
+ invokeAPI: (method: string, param: any, callback: any) => any;
23
+ handleCallback: (datas: any, invokeType?: InvokeType) => void;
41
24
  init: () => void;
42
25
  }
43
26
  declare const frame: Frame;