zcw-shared 2.1.0 → 2.8.0

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 (461) hide show
  1. package/README.md +17 -180
  2. package/dist/constants/apiErrorCodes.d.ts +17 -0
  3. package/dist/constants/apiErrorCodes.js +26 -0
  4. package/dist/constants/apiErrorCodes.js.map +1 -0
  5. package/dist/constants/authStorage.d.ts +4 -0
  6. package/dist/constants/authStorage.js +5 -0
  7. package/dist/constants/authStorage.js.map +1 -0
  8. package/dist/functions/android/integrateThirdPartyModule.d.ts +5 -0
  9. package/dist/functions/android/integrateThirdPartyModule.js +70 -0
  10. package/dist/functions/android/integrateThirdPartyModule.js.map +1 -1
  11. package/dist/functions/android/integrateUniPushAndroid.d.ts +23 -0
  12. package/dist/functions/android/integrateUniPushAndroid.js +266 -0
  13. package/dist/functions/android/integrateUniPushAndroid.js.map +1 -0
  14. package/dist/functions/api/auth.d.ts +14 -0
  15. package/dist/functions/api/auth.js +109 -0
  16. package/dist/functions/api/auth.js.map +1 -0
  17. package/dist/functions/api/schemas/auth.schema.d.ts +363 -0
  18. package/dist/functions/api/schemas/auth.schema.js +39 -0
  19. package/dist/functions/api/schemas/auth.schema.js.map +1 -0
  20. package/dist/functions/api/schemas/video.schema.d.ts +391 -0
  21. package/dist/functions/api/schemas/video.schema.js +55 -0
  22. package/dist/functions/api/schemas/video.schema.js.map +1 -0
  23. package/dist/functions/api/video.d.ts +62 -0
  24. package/dist/functions/api/video.js +243 -0
  25. package/dist/functions/api/video.js.map +1 -0
  26. package/dist/functions/browser/isElectron.d.ts +5 -0
  27. package/dist/functions/browser/isElectron.js +4 -0
  28. package/dist/functions/browser/isElectron.js.map +1 -0
  29. package/dist/functions/dom/isTextTruncated.d.ts +4 -0
  30. package/dist/functions/dom/isTextTruncated.js +16 -0
  31. package/dist/functions/dom/isTextTruncated.js.map +1 -0
  32. package/dist/functions/dom/localFileInput.d.ts +14 -0
  33. package/dist/functions/dom/localFileInput.js +27 -0
  34. package/dist/functions/dom/localFileInput.js.map +1 -0
  35. package/dist/functions/file/getIconfontNameByExtension.js +53 -56
  36. package/dist/functions/file/getIconfontNameByExtension.js.map +1 -1
  37. package/dist/functions/im/formatImChatConversationListTime.d.ts +1 -0
  38. package/dist/functions/im/formatImChatConversationListTime.js +19 -0
  39. package/dist/functions/im/formatImChatConversationListTime.js.map +1 -0
  40. package/dist/functions/im/parseImMentionSegments.d.ts +15 -0
  41. package/dist/functions/im/parseImMentionSegments.js +56 -0
  42. package/dist/functions/im/parseImMentionSegments.js.map +1 -0
  43. package/dist/functions/image/getImageDimensions.js +15 -5
  44. package/dist/functions/image/getImageDimensions.js.map +1 -1
  45. package/dist/functions/ios/integrateThirdPartyModule.d.ts +9 -1
  46. package/dist/functions/ios/integrateThirdPartyModule.js +112 -2
  47. package/dist/functions/ios/integrateThirdPartyModule.js.map +1 -1
  48. package/dist/functions/ios/integrateUniPushIOS.d.ts +18 -0
  49. package/dist/functions/ios/integrateUniPushIOS.js +200 -0
  50. package/dist/functions/ios/integrateUniPushIOS.js.map +1 -0
  51. package/dist/functions/oss/uploadViaSignedPut.d.ts +35 -0
  52. package/dist/functions/oss/uploadViaSignedPut.js +86 -0
  53. package/dist/functions/oss/uploadViaSignedPut.js.map +1 -0
  54. package/dist/functions/storage/useDexieShortcuts.d.ts +28 -0
  55. package/dist/functions/storage/useDexieShortcuts.js +54 -0
  56. package/dist/functions/storage/useDexieShortcuts.js.map +1 -0
  57. package/dist/functions/storage/useLocalStorage.js +11 -12
  58. package/dist/functions/storage/useLocalStorage.js.map +1 -1
  59. package/dist/functions/storage/useSessionStorage.js +11 -12
  60. package/dist/functions/storage/useSessionStorage.js.map +1 -1
  61. package/dist/functions/storage/useStorageWithIndexedDB.js +4 -5
  62. package/dist/functions/storage/useStorageWithIndexedDB.js.map +1 -1
  63. package/dist/functions/uniapp/app-plus/buildAndroidApp.js +38 -0
  64. package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
  65. package/dist/functions/uniapp/app-plus/buildIOSApp.js +38 -0
  66. package/dist/functions/uniapp/app-plus/buildIOSApp.js.map +1 -1
  67. package/dist/schemas/auth.schema.d.ts +4 -4
  68. package/dist/vue-hooks/browser/useBridgeMessage.js +7 -8
  69. package/dist/vue-hooks/browser/useBridgeMessage.js.map +1 -1
  70. package/dist/vue-hooks/dom/useAppendToBody.d.ts +25 -0
  71. package/dist/vue-hooks/dom/useAppendToBody.js +31 -0
  72. package/dist/vue-hooks/dom/useAppendToBody.js.map +1 -0
  73. package/dist/vue-hooks/dom/useDraggable.d.ts +8 -3
  74. package/dist/vue-hooks/dom/useDraggable.js +57 -19
  75. package/dist/vue-hooks/dom/useDraggable.js.map +1 -1
  76. package/package.json +35 -1
  77. package/references/dom.d.ts +8 -3
  78. package/types/address.d.ts +38 -0
  79. package/types/im-api.d.ts +142 -0
  80. package/types/im-chat.d.ts +90 -0
  81. package/types/im-message-display.d.ts +89 -0
  82. package/types/notification.d.ts +37 -0
  83. package/types/oss.d.ts +26 -0
  84. package/types/page-config.d.ts +14 -0
  85. package/types/payment.d.ts +21 -0
  86. package/types/performance.d.ts +12 -0
  87. package/types/rbac.d.ts +24 -0
  88. package/types/report.d.ts +29 -0
  89. package/types/review.d.ts +13 -0
  90. package/types/uniapp-android-build.d.ts +31 -0
  91. package/types/uniapp-ios-build.d.ts +26 -0
  92. package/types/user.d.ts +2 -1
  93. package/dist/functions/async/sleep.d.ts +0 -5
  94. package/dist/functions/async/sleep.js +0 -6
  95. package/dist/functions/async/sleep.js.map +0 -1
  96. package/dist/functions/async/timeout.d.ts +0 -6
  97. package/dist/functions/async/timeout.js +0 -12
  98. package/dist/functions/async/timeout.js.map +0 -1
  99. package/dist/functions/browser/computePosition.d.ts +0 -6
  100. package/dist/functions/browser/computePosition.js +0 -49
  101. package/dist/functions/browser/computePosition.js.map +0 -1
  102. package/dist/functions/browser/createSharedKeyboardCenter.d.ts +0 -18
  103. package/dist/functions/browser/createSharedKeyboardCenter.js +0 -58
  104. package/dist/functions/browser/createSharedKeyboardCenter.js.map +0 -1
  105. package/dist/functions/browser/createThrottledEventListener.d.ts +0 -11
  106. package/dist/functions/browser/createThrottledEventListener.js +0 -51
  107. package/dist/functions/browser/createThrottledEventListener.js.map +0 -1
  108. package/dist/functions/browser/demonstrateResourceLoading.d.ts +0 -32
  109. package/dist/functions/browser/demonstrateResourceLoading.js +0 -169
  110. package/dist/functions/browser/demonstrateResourceLoading.js.map +0 -1
  111. package/dist/functions/browser/detectOverflow.d.ts +0 -12
  112. package/dist/functions/browser/detectOverflow.js +0 -17
  113. package/dist/functions/browser/detectOverflow.js.map +0 -1
  114. package/dist/functions/browser/getAlignment.d.ts +0 -2
  115. package/dist/functions/browser/getAlignment.js +0 -5
  116. package/dist/functions/browser/getAlignment.js.map +0 -1
  117. package/dist/functions/browser/getBasePlacement.d.ts +0 -2
  118. package/dist/functions/browser/getBasePlacement.js +0 -4
  119. package/dist/functions/browser/getBasePlacement.js.map +0 -1
  120. package/dist/functions/browser/getCrossAxisFlip.d.ts +0 -2
  121. package/dist/functions/browser/getCrossAxisFlip.js +0 -11
  122. package/dist/functions/browser/getCrossAxisFlip.js.map +0 -1
  123. package/dist/functions/browser/getElementRect.d.ts +0 -3
  124. package/dist/functions/browser/getElementRect.js +0 -14
  125. package/dist/functions/browser/getElementRect.js.map +0 -1
  126. package/dist/functions/browser/getFlipPlacements.d.ts +0 -2
  127. package/dist/functions/browser/getFlipPlacements.js +0 -13
  128. package/dist/functions/browser/getFlipPlacements.js.map +0 -1
  129. package/dist/functions/browser/getMainAxisFlip.d.ts +0 -2
  130. package/dist/functions/browser/getMainAxisFlip.js +0 -17
  131. package/dist/functions/browser/getMainAxisFlip.js.map +0 -1
  132. package/dist/functions/browser/getRelativePosition.d.ts +0 -3
  133. package/dist/functions/browser/getRelativePosition.js +0 -14
  134. package/dist/functions/browser/getRelativePosition.js.map +0 -1
  135. package/dist/functions/browser/getViewportRect.d.ts +0 -7
  136. package/dist/functions/browser/getViewportRect.js +0 -15
  137. package/dist/functions/browser/getViewportRect.js.map +0 -1
  138. package/dist/functions/browser/isValidPlacement.d.ts +0 -2
  139. package/dist/functions/browser/isValidPlacement.js +0 -16
  140. package/dist/functions/browser/isValidPlacement.js.map +0 -1
  141. package/dist/functions/browser/pickFile.d.ts +0 -15
  142. package/dist/functions/browser/pickFile.js +0 -48
  143. package/dist/functions/browser/pickFile.js.map +0 -1
  144. package/dist/functions/build/generateExports.d.ts +0 -26
  145. package/dist/functions/build/generateExports.js +0 -34
  146. package/dist/functions/build/generateExports.js.map +0 -1
  147. package/dist/functions/core/diff/diff.d.ts +0 -25
  148. package/dist/functions/core/diff/diff.js +0 -316
  149. package/dist/functions/core/diff/diff.js.map +0 -1
  150. package/dist/functions/core/diff/vueDiff.d.ts +0 -38
  151. package/dist/functions/core/diff/vueDiff.js +0 -333
  152. package/dist/functions/core/diff/vueDiff.js.map +0 -1
  153. package/dist/functions/core/generator/generatorUtils.d.ts +0 -16
  154. package/dist/functions/core/generator/generatorUtils.js +0 -139
  155. package/dist/functions/core/generator/generatorUtils.js.map +0 -1
  156. package/dist/functions/core/type/isType.d.ts +0 -11
  157. package/dist/functions/core/type/isType.js +0 -30
  158. package/dist/functions/core/type/isType.js.map +0 -1
  159. package/dist/functions/data/array-object/chunk.d.ts +0 -1
  160. package/dist/functions/data/array-object/chunk.js +0 -11
  161. package/dist/functions/data/array-object/chunk.js.map +0 -1
  162. package/dist/functions/data/array-object/deepClone.d.ts +0 -12
  163. package/dist/functions/data/array-object/deepClone.js +0 -131
  164. package/dist/functions/data/array-object/deepClone.js.map +0 -1
  165. package/dist/functions/data/array-object/evolve.d.ts +0 -3
  166. package/dist/functions/data/array-object/evolve.js +0 -15
  167. package/dist/functions/data/array-object/evolve.js.map +0 -1
  168. package/dist/functions/data/array-object/flatten.d.ts +0 -7
  169. package/dist/functions/data/array-object/flatten.js +0 -60
  170. package/dist/functions/data/array-object/flatten.js.map +0 -1
  171. package/dist/functions/data/array-object/flattenObject.d.ts +0 -5
  172. package/dist/functions/data/array-object/flattenObject.js +0 -102
  173. package/dist/functions/data/array-object/flattenObject.js.map +0 -1
  174. package/dist/functions/data/array-object/groupBy.d.ts +0 -1
  175. package/dist/functions/data/array-object/groupBy.js +0 -14
  176. package/dist/functions/data/array-object/groupBy.js.map +0 -1
  177. package/dist/functions/data/array-object/omit.d.ts +0 -1
  178. package/dist/functions/data/array-object/omit.js +0 -8
  179. package/dist/functions/data/array-object/omit.js.map +0 -1
  180. package/dist/functions/data/array-object/pick.d.ts +0 -1
  181. package/dist/functions/data/array-object/pick.js +0 -10
  182. package/dist/functions/data/array-object/pick.js.map +0 -1
  183. package/dist/functions/data/array-object/shuffle.d.ts +0 -1
  184. package/dist/functions/data/array-object/shuffle.js +0 -9
  185. package/dist/functions/data/array-object/shuffle.js.map +0 -1
  186. package/dist/functions/data/array-object/sortBy.d.ts +0 -1
  187. package/dist/functions/data/array-object/sortBy.js +0 -13
  188. package/dist/functions/data/array-object/sortBy.js.map +0 -1
  189. package/dist/functions/data/array-object/unique.d.ts +0 -10
  190. package/dist/functions/data/array-object/unique.js +0 -85
  191. package/dist/functions/data/array-object/unique.js.map +0 -1
  192. package/dist/functions/data/date/dateRange.d.ts +0 -1
  193. package/dist/functions/data/date/dateRange.js +0 -18
  194. package/dist/functions/data/date/dateRange.js.map +0 -1
  195. package/dist/functions/data/date/formatDate.d.ts +0 -1
  196. package/dist/functions/data/date/formatDate.js +0 -21
  197. package/dist/functions/data/date/formatDate.js.map +0 -1
  198. package/dist/functions/data/date/timeAgo.d.ts +0 -1
  199. package/dist/functions/data/date/timeAgo.js +0 -49
  200. package/dist/functions/data/date/timeAgo.js.map +0 -1
  201. package/dist/functions/data/number/average.d.ts +0 -1
  202. package/dist/functions/data/number/average.js +0 -8
  203. package/dist/functions/data/number/average.js.map +0 -1
  204. package/dist/functions/data/number/clamp.d.ts +0 -1
  205. package/dist/functions/data/number/clamp.js +0 -7
  206. package/dist/functions/data/number/clamp.js.map +0 -1
  207. package/dist/functions/data/number/formatNumber.d.ts +0 -8
  208. package/dist/functions/data/number/formatNumber.js +0 -16
  209. package/dist/functions/data/number/formatNumber.js.map +0 -1
  210. package/dist/functions/data/number/median.d.ts +0 -1
  211. package/dist/functions/data/number/median.js +0 -14
  212. package/dist/functions/data/number/median.js.map +0 -1
  213. package/dist/functions/data/number/percentile.d.ts +0 -1
  214. package/dist/functions/data/number/percentile.js +0 -18
  215. package/dist/functions/data/number/percentile.js.map +0 -1
  216. package/dist/functions/data/number/random.d.ts +0 -4
  217. package/dist/functions/data/number/random.js +0 -9
  218. package/dist/functions/data/number/random.js.map +0 -1
  219. package/dist/functions/data/number/range.d.ts +0 -1
  220. package/dist/functions/data/number/range.js +0 -18
  221. package/dist/functions/data/number/range.js.map +0 -1
  222. package/dist/functions/data/number/sum.d.ts +0 -1
  223. package/dist/functions/data/number/sum.js +0 -4
  224. package/dist/functions/data/number/sum.js.map +0 -1
  225. package/dist/functions/data/randomRegion.d.ts +0 -24
  226. package/dist/functions/data/randomRegion.js +0 -74
  227. package/dist/functions/data/randomRegion.js.map +0 -1
  228. package/dist/functions/data/string/base64.d.ts +0 -5
  229. package/dist/functions/data/string/base64.js +0 -6
  230. package/dist/functions/data/string/base64.js.map +0 -1
  231. package/dist/functions/data/string/capitalize.d.ts +0 -1
  232. package/dist/functions/data/string/capitalize.js +0 -6
  233. package/dist/functions/data/string/capitalize.js.map +0 -1
  234. package/dist/functions/data/string/caseConverter.d.ts +0 -19
  235. package/dist/functions/data/string/caseConverter.js +0 -94
  236. package/dist/functions/data/string/caseConverter.js.map +0 -1
  237. package/dist/functions/data/string/desensitize.d.ts +0 -13
  238. package/dist/functions/data/string/desensitize.js +0 -107
  239. package/dist/functions/data/string/desensitize.js.map +0 -1
  240. package/dist/functions/data/string/htmlEscape.d.ts +0 -20
  241. package/dist/functions/data/string/htmlEscape.js +0 -80
  242. package/dist/functions/data/string/htmlEscape.js.map +0 -1
  243. package/dist/functions/data/string/levenshtein.d.ts +0 -1
  244. package/dist/functions/data/string/levenshtein.js +0 -27
  245. package/dist/functions/data/string/levenshtein.js.map +0 -1
  246. package/dist/functions/data/string/normalize.d.ts +0 -8
  247. package/dist/functions/data/string/normalize.js +0 -37
  248. package/dist/functions/data/string/normalize.js.map +0 -1
  249. package/dist/functions/data/string/pad.d.ts +0 -13
  250. package/dist/functions/data/string/pad.js +0 -50
  251. package/dist/functions/data/string/pad.js.map +0 -1
  252. package/dist/functions/data/string/palindrome.d.ts +0 -3
  253. package/dist/functions/data/string/palindrome.js +0 -15
  254. package/dist/functions/data/string/palindrome.js.map +0 -1
  255. package/dist/functions/data/string/similarity.d.ts +0 -1
  256. package/dist/functions/data/string/similarity.js +0 -13
  257. package/dist/functions/data/string/similarity.js.map +0 -1
  258. package/dist/functions/data/string/template.d.ts +0 -4
  259. package/dist/functions/data/string/template.js +0 -21
  260. package/dist/functions/data/string/template.js.map +0 -1
  261. package/dist/functions/data/string/testRegex.d.ts +0 -20
  262. package/dist/functions/data/string/testRegex.js +0 -300
  263. package/dist/functions/data/string/testRegex.js.map +0 -1
  264. package/dist/functions/data/string/wordCount.d.ts +0 -5
  265. package/dist/functions/data/string/wordCount.js +0 -11
  266. package/dist/functions/data/string/wordCount.js.map +0 -1
  267. package/dist/functions/data/tree/buildTree.d.ts +0 -7
  268. package/dist/functions/data/tree/buildTree.js +0 -27
  269. package/dist/functions/data/tree/buildTree.js.map +0 -1
  270. package/dist/functions/data/tree/filterTree.d.ts +0 -4
  271. package/dist/functions/data/tree/filterTree.js +0 -21
  272. package/dist/functions/data/tree/filterTree.js.map +0 -1
  273. package/dist/functions/data/tree/findNode.d.ts +0 -4
  274. package/dist/functions/data/tree/findNode.js +0 -21
  275. package/dist/functions/data/tree/findNode.js.map +0 -1
  276. package/dist/functions/data/tree/flattenTree.d.ts +0 -6
  277. package/dist/functions/data/tree/flattenTree.js +0 -21
  278. package/dist/functions/data/tree/flattenTree.js.map +0 -1
  279. package/dist/functions/file/walk.d.ts +0 -18
  280. package/dist/functions/file/walk.js +0 -58
  281. package/dist/functions/file/walk.js.map +0 -1
  282. package/dist/functions/hybrid/detectBridgeEnvironment.d.ts +0 -11
  283. package/dist/functions/hybrid/detectBridgeEnvironment.js +0 -26
  284. package/dist/functions/hybrid/detectBridgeEnvironment.js.map +0 -1
  285. package/dist/functions/integrations/ag-grid/generateLicense.d.ts +0 -7
  286. package/dist/functions/integrations/ag-grid/generateLicense.js +0 -12
  287. package/dist/functions/integrations/ag-grid/generateLicense.js.map +0 -1
  288. package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.d.ts +0 -30
  289. package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js +0 -884
  290. package/dist/functions/integrations/uniapp/app-plus/buildAndroidApp.js.map +0 -1
  291. package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.d.ts +0 -31
  292. package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js +0 -900
  293. package/dist/functions/integrations/uniapp/app-plus/buildIOSApp.js.map +0 -1
  294. package/dist/functions/integrations/uniapp/build.d.ts +0 -21
  295. package/dist/functions/integrations/uniapp/build.js +0 -83
  296. package/dist/functions/integrations/uniapp/build.js.map +0 -1
  297. package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.d.ts +0 -11
  298. package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js +0 -30
  299. package/dist/functions/integrations/uniapp/detectAndroidProjectStructure.js.map +0 -1
  300. package/dist/functions/integrations/uniapp/detectProjectType.d.ts +0 -20
  301. package/dist/functions/integrations/uniapp/detectProjectType.js +0 -68
  302. package/dist/functions/integrations/uniapp/detectProjectType.js.map +0 -1
  303. package/dist/functions/integrations/uniapp/parseManifest.d.ts +0 -20
  304. package/dist/functions/integrations/uniapp/parseManifest.js +0 -51
  305. package/dist/functions/integrations/uniapp/parseManifest.js.map +0 -1
  306. package/dist/functions/integrations/uniapp/waitForPages.d.ts +0 -7
  307. package/dist/functions/integrations/uniapp/waitForPages.js +0 -20
  308. package/dist/functions/integrations/uniapp/waitForPages.js.map +0 -1
  309. package/dist/functions/integrations/vue/dynamicMount.d.ts +0 -18
  310. package/dist/functions/integrations/vue/dynamicMount.js +0 -25
  311. package/dist/functions/integrations/vue/dynamicMount.js.map +0 -1
  312. package/dist/functions/integrations/vue/extractColorsFromVueFile.d.ts +0 -3
  313. package/dist/functions/integrations/vue/extractColorsFromVueFile.js +0 -18
  314. package/dist/functions/integrations/vue/extractColorsFromVueFile.js.map +0 -1
  315. package/dist/functions/integrations/vue/extractColorsFromVueSection.d.ts +0 -3
  316. package/dist/functions/integrations/vue/extractColorsFromVueSection.js +0 -53
  317. package/dist/functions/integrations/vue/extractColorsFromVueSection.js.map +0 -1
  318. package/dist/functions/integrations/vue/filterSections.d.ts +0 -2
  319. package/dist/functions/integrations/vue/filterSections.js +0 -11
  320. package/dist/functions/integrations/vue/filterSections.js.map +0 -1
  321. package/dist/functions/integrations/vue/isVNode.d.ts +0 -2
  322. package/dist/functions/integrations/vue/isVNode.js +0 -6
  323. package/dist/functions/integrations/vue/isVNode.js.map +0 -1
  324. package/dist/functions/integrations/vue/isVueComponent.d.ts +0 -2
  325. package/dist/functions/integrations/vue/isVueComponent.js +0 -6
  326. package/dist/functions/integrations/vue/isVueComponent.js.map +0 -1
  327. package/dist/functions/integrations/vue/parseVueFile.d.ts +0 -2
  328. package/dist/functions/integrations/vue/parseVueFile.js +0 -53
  329. package/dist/functions/integrations/vue/parseVueFile.js.map +0 -1
  330. package/dist/functions/integrations/wechat/miniapp/downloadFile.d.ts +0 -6
  331. package/dist/functions/integrations/wechat/miniapp/downloadFile.js +0 -39
  332. package/dist/functions/integrations/wechat/miniapp/downloadFile.js.map +0 -1
  333. package/dist/functions/patterns/MyPromise.d.ts +0 -32
  334. package/dist/functions/patterns/MyPromise.js +0 -254
  335. package/dist/functions/patterns/MyPromise.js.map +0 -1
  336. package/dist/functions/patterns/functionBind.d.ts +0 -4
  337. package/dist/functions/patterns/functionBind.js +0 -33
  338. package/dist/functions/patterns/functionBind.js.map +0 -1
  339. package/dist/functions/patterns/myInstanceof.d.ts +0 -5
  340. package/dist/functions/patterns/myInstanceof.js +0 -56
  341. package/dist/functions/patterns/myInstanceof.js.map +0 -1
  342. package/dist/functions/patterns/myNew.d.ts +0 -3
  343. package/dist/functions/patterns/myNew.js +0 -19
  344. package/dist/functions/patterns/myNew.js.map +0 -1
  345. package/dist/functions/platform/android/buildProject.d.ts +0 -13
  346. package/dist/functions/platform/android/buildProject.js +0 -122
  347. package/dist/functions/platform/android/buildProject.js.map +0 -1
  348. package/dist/functions/platform/android/configureAppIcon.d.ts +0 -17
  349. package/dist/functions/platform/android/configureAppIcon.js +0 -106
  350. package/dist/functions/platform/android/configureAppIcon.js.map +0 -1
  351. package/dist/functions/platform/android/configureLaunchScreen.d.ts +0 -21
  352. package/dist/functions/platform/android/configureLaunchScreen.js +0 -328
  353. package/dist/functions/platform/android/configureLaunchScreen.js.map +0 -1
  354. package/dist/functions/platform/android/detectAndroidModules.d.ts +0 -8
  355. package/dist/functions/platform/android/detectAndroidModules.js +0 -21
  356. package/dist/functions/platform/android/detectAndroidModules.js.map +0 -1
  357. package/dist/functions/platform/android/integrateFacebookLogin.d.ts +0 -12
  358. package/dist/functions/platform/android/integrateFacebookLogin.js +0 -91
  359. package/dist/functions/platform/android/integrateFacebookLogin.js.map +0 -1
  360. package/dist/functions/platform/android/integrateGoogleLogin.d.ts +0 -10
  361. package/dist/functions/platform/android/integrateGoogleLogin.js +0 -199
  362. package/dist/functions/platform/android/integrateGoogleLogin.js.map +0 -1
  363. package/dist/functions/platform/android/integrateMiuiLogin.d.ts +0 -13
  364. package/dist/functions/platform/android/integrateMiuiLogin.js +0 -115
  365. package/dist/functions/platform/android/integrateMiuiLogin.js.map +0 -1
  366. package/dist/functions/platform/android/integrateQQLogin.d.ts +0 -12
  367. package/dist/functions/platform/android/integrateQQLogin.js +0 -130
  368. package/dist/functions/platform/android/integrateQQLogin.js.map +0 -1
  369. package/dist/functions/platform/android/integrateShareTrace.d.ts +0 -10
  370. package/dist/functions/platform/android/integrateShareTrace.js +0 -181
  371. package/dist/functions/platform/android/integrateShareTrace.js.map +0 -1
  372. package/dist/functions/platform/android/integrateSinaLogin.d.ts +0 -13
  373. package/dist/functions/platform/android/integrateSinaLogin.js +0 -85
  374. package/dist/functions/platform/android/integrateSinaLogin.js.map +0 -1
  375. package/dist/functions/platform/android/integrateThirdPartyModule.d.ts +0 -46
  376. package/dist/functions/platform/android/integrateThirdPartyModule.js +0 -251
  377. package/dist/functions/platform/android/integrateThirdPartyModule.js.map +0 -1
  378. package/dist/functions/platform/android/integrateUniAppNativePlugin.d.ts +0 -22
  379. package/dist/functions/platform/android/integrateUniAppNativePlugin.js +0 -631
  380. package/dist/functions/platform/android/integrateUniAppNativePlugin.js.map +0 -1
  381. package/dist/functions/platform/android/integrateUniverifyLogin.d.ts +0 -11
  382. package/dist/functions/platform/android/integrateUniverifyLogin.js +0 -314
  383. package/dist/functions/platform/android/integrateUniverifyLogin.js.map +0 -1
  384. package/dist/functions/platform/android/integrateWechatLogin.d.ts +0 -13
  385. package/dist/functions/platform/android/integrateWechatLogin.js +0 -154
  386. package/dist/functions/platform/android/integrateWechatLogin.js.map +0 -1
  387. package/dist/functions/platform/android/integrateWechatShare.d.ts +0 -13
  388. package/dist/functions/platform/android/integrateWechatShare.js +0 -154
  389. package/dist/functions/platform/android/integrateWechatShare.js.map +0 -1
  390. package/dist/functions/platform/android/modifyGradle.d.ts +0 -28
  391. package/dist/functions/platform/android/modifyGradle.js +0 -119
  392. package/dist/functions/platform/android/modifyGradle.js.map +0 -1
  393. package/dist/functions/platform/android/modifyManifest.d.ts +0 -39
  394. package/dist/functions/platform/android/modifyManifest.js +0 -225
  395. package/dist/functions/platform/android/modifyManifest.js.map +0 -1
  396. package/dist/functions/platform/android/permission.d.ts +0 -54
  397. package/dist/functions/platform/android/permission.js +0 -85
  398. package/dist/functions/platform/android/permission.js.map +0 -1
  399. package/dist/functions/platform/ios/configureAppIcon.d.ts +0 -17
  400. package/dist/functions/platform/ios/configureAppIcon.js +0 -149
  401. package/dist/functions/platform/ios/configureAppIcon.js.map +0 -1
  402. package/dist/functions/platform/ios/configureLaunchScreen.d.ts +0 -17
  403. package/dist/functions/platform/ios/configureLaunchScreen.js +0 -150
  404. package/dist/functions/platform/ios/configureLaunchScreen.js.map +0 -1
  405. package/dist/functions/platform/ios/configurePermissions.d.ts +0 -19
  406. package/dist/functions/platform/ios/configurePermissions.js +0 -120
  407. package/dist/functions/platform/ios/configurePermissions.js.map +0 -1
  408. package/dist/functions/platform/ios/integrateNativePlugin.d.ts +0 -35
  409. package/dist/functions/platform/ios/integrateNativePlugin.js +0 -994
  410. package/dist/functions/platform/ios/integrateNativePlugin.js.map +0 -1
  411. package/dist/functions/platform/ios/integrateQQShare.d.ts +0 -14
  412. package/dist/functions/platform/ios/integrateQQShare.js +0 -132
  413. package/dist/functions/platform/ios/integrateQQShare.js.map +0 -1
  414. package/dist/functions/platform/ios/integrateSinaShare.d.ts +0 -16
  415. package/dist/functions/platform/ios/integrateSinaShare.js +0 -108
  416. package/dist/functions/platform/ios/integrateSinaShare.js.map +0 -1
  417. package/dist/functions/platform/ios/integrateThirdPartyModule.d.ts +0 -62
  418. package/dist/functions/platform/ios/integrateThirdPartyModule.js +0 -883
  419. package/dist/functions/platform/ios/integrateThirdPartyModule.js.map +0 -1
  420. package/dist/functions/platform/ios/integrateWechatOauth.d.ts +0 -14
  421. package/dist/functions/platform/ios/integrateWechatOauth.js +0 -107
  422. package/dist/functions/platform/ios/integrateWechatOauth.js.map +0 -1
  423. package/dist/functions/platform/ios/integrateWechatShare.d.ts +0 -14
  424. package/dist/functions/platform/ios/integrateWechatShare.js +0 -101
  425. package/dist/functions/platform/ios/integrateWechatShare.js.map +0 -1
  426. package/dist/functions/platform/ios/modifyInfoPlistKeyValue.d.ts +0 -2
  427. package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js +0 -45
  428. package/dist/functions/platform/ios/modifyInfoPlistKeyValue.js.map +0 -1
  429. package/dist/functions/platform/ios/safelyModifyProjectPbxproj.d.ts +0 -16
  430. package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js +0 -136
  431. package/dist/functions/platform/ios/safelyModifyProjectPbxproj.js.map +0 -1
  432. package/dist/functions/platform/ios/useAltool.d.ts +0 -39
  433. package/dist/functions/platform/ios/useAltool.js +0 -350
  434. package/dist/functions/platform/ios/useAltool.js.map +0 -1
  435. package/dist/functions/style/buildTokens.d.ts +0 -76
  436. package/dist/functions/style/buildTokens.js +0 -183
  437. package/dist/functions/style/buildTokens.js.map +0 -1
  438. package/dist/functions/style/extractCssVariables.d.ts +0 -16
  439. package/dist/functions/style/extractCssVariables.js +0 -256
  440. package/dist/functions/style/extractCssVariables.js.map +0 -1
  441. package/dist/functions/style/generateVariables.d.ts +0 -7
  442. package/dist/functions/style/generateVariables.js +0 -135
  443. package/dist/functions/style/generateVariables.js.map +0 -1
  444. package/dist/functions/style/mixColors.d.ts +0 -1
  445. package/dist/functions/style/mixColors.js +0 -38
  446. package/dist/functions/style/mixColors.js.map +0 -1
  447. package/dist/functions/style/parseDesignTokens.d.ts +0 -10
  448. package/dist/functions/style/parseDesignTokens.js +0 -216
  449. package/dist/functions/style/parseDesignTokens.js.map +0 -1
  450. package/dist/functions/uniapp/app-plus/buildAndroidPlugin.d.ts +0 -3
  451. package/dist/functions/uniapp/app-plus/buildAndroidPlugin.js +0 -509
  452. package/dist/functions/uniapp/app-plus/buildAndroidPlugin.js.map +0 -1
  453. package/dist/functions/uniapp/app-plus/buildIOSPlugin.d.ts +0 -3
  454. package/dist/functions/uniapp/app-plus/buildIOSPlugin.js +0 -406
  455. package/dist/functions/uniapp/app-plus/buildIOSPlugin.js.map +0 -1
  456. package/dist/functions/validation/parseJwtPayload.d.ts +0 -7
  457. package/dist/functions/validation/parseJwtPayload.js +0 -33
  458. package/dist/functions/validation/parseJwtPayload.js.map +0 -1
  459. package/dist/functions/validation/validate.d.ts +0 -11
  460. package/dist/functions/validation/validate.js +0 -44
  461. package/dist/functions/validation/validate.js.map +0 -1
@@ -0,0 +1,89 @@
1
+ /**
2
+ * IM 消息「多段展示」:落库在 `ImApiMessage.extra_data.im_display`。
3
+ *
4
+ * - **v1**:结构化块 kind + 固定字段
5
+ * - **v2**:配置驱动,按路径从 JSON 取值填入各渲染器 props
6
+ */
7
+
8
+ /** ---------- v1 ---------- */
9
+
10
+ /** 已解析的展示块 */
11
+ export type ImDisplayBlock =
12
+ | { kind: 'text'; text: string }
13
+ | { kind: 'image'; url: string; width?: number; height?: number }
14
+ | { kind: 'video'; url: string; posterUrl?: string; width?: number; height?: number }
15
+ | { kind: 'file'; url: string; name?: string; sizeBytes?: number }
16
+
17
+ export interface ImMessageDisplaySpecV1 {
18
+ version: 1
19
+ blocks: ImDisplayBlock[]
20
+ }
21
+
22
+ /** v1 模板(version 省略或 1) */
23
+ export type ImDisplayBlockTemplate =
24
+ | { kind: 'text'; text: string }
25
+ | {
26
+ kind: 'image'
27
+ urlPath: string[]
28
+ widthPath?: string[]
29
+ heightPath?: string[]
30
+ }
31
+ | {
32
+ kind: 'video'
33
+ urlPath: string[]
34
+ posterPath?: string[]
35
+ widthPath?: string[]
36
+ heightPath?: string[]
37
+ }
38
+ | { kind: 'file'; urlPath: string[]; namePath?: string[]; sizePath?: string[] }
39
+
40
+ export interface ImToolMessageFormatConfigV1 {
41
+ version: 1
42
+ blocks: ImDisplayBlockTemplate[]
43
+ }
44
+
45
+ /** ---------- v2(配置驱动) ---------- */
46
+
47
+ /** 单 prop 绑定:路径 + 可选强制类型 */
48
+ export type ImPropBinding =
49
+ | string[]
50
+ | {
51
+ path: string[]
52
+ /** 默认 string;url 会校验 http(s);positiveInt 为 1~65536 像素或非负整数(文件大小用 number) */
53
+ coerce?: 'string' | 'url' | 'positiveInt' | 'number'
54
+ }
55
+
56
+ /**
57
+ * 渲染器 type 白名单(与 vue-ui 注册表一致):
58
+ * - im.text → content
59
+ * - im.markdown → content(Markdown 源文本,由 CwMarkdown 渲染)
60
+ * - im.image → thumbnailUrl, width?, height?
61
+ * - im.video → videoUrl, thumbnailUrl?, width?, height?
62
+ * - im.file → downloadUrl, originalFileName?, fileSizeBytes?
63
+ */
64
+ export interface ImToolMessageFormatBlockV2 {
65
+ type: string
66
+ propsFromResult: Record<string, ImPropBinding>
67
+ }
68
+
69
+ export interface ImToolMessageFormatConfigV2 {
70
+ version: 2
71
+ blocks: ImToolMessageFormatBlockV2[]
72
+ }
73
+
74
+ /** 写入 im_display 的块(props 已展开) */
75
+ export interface ImFormattedDisplayBlock {
76
+ type: string
77
+ props: Record<string, unknown>
78
+ }
79
+
80
+ export interface ImMessageDisplaySpecV2 {
81
+ version: 2
82
+ blocks: ImFormattedDisplayBlock[]
83
+ }
84
+
85
+ export type ImMessageDisplaySpec = ImMessageDisplaySpecV1 | ImMessageDisplaySpecV2
86
+
87
+ export type ImToolMessageFormatConfig =
88
+ | ImToolMessageFormatConfigV1
89
+ | ImToolMessageFormatConfigV2
@@ -0,0 +1,37 @@
1
+ export type NotificationType =
2
+ | 'system'
3
+ | 'comment'
4
+ | 'reply'
5
+ | 'like'
6
+ | 'follow'
7
+ | 'post'
8
+ | 'order'
9
+ | 'payment'
10
+
11
+ export interface Notification {
12
+ id: number
13
+ user_id?: string
14
+ type?: NotificationType
15
+ title?: string
16
+ content?: string
17
+ status?: string
18
+ related_id?: string
19
+ related_type?: string
20
+ extra_data?: Record<string, unknown>
21
+ created_at?: string
22
+ updated_at?: string
23
+ }
24
+
25
+ export interface NotificationListResponse {
26
+ data: Notification[]
27
+ }
28
+
29
+ export interface CreateNotificationPayload {
30
+ user_id: string
31
+ type: NotificationType
32
+ title: string
33
+ content?: string
34
+ related_id?: string
35
+ related_type?: string
36
+ extra_data?: Record<string, unknown>
37
+ }
package/types/oss.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ /** 与 api.zengchaowu.com OSS listFiles 返回结构一致 */
2
+ export interface OssFile {
3
+ id?: string
4
+ name: string
5
+ updated_at?: string
6
+ created_at?: string
7
+ last_accessed_at?: string
8
+ metadata?: Record<string, unknown>
9
+ }
10
+
11
+ export interface OssListParams {
12
+ bucket: string
13
+ path?: string
14
+ limit?: number
15
+ offset?: number
16
+ }
17
+
18
+ export interface OssListResponse {
19
+ data: OssFile[]
20
+ count: number
21
+ }
22
+
23
+ export interface OssDeleteFilesPayload {
24
+ bucket: string
25
+ paths: string[]
26
+ }
@@ -0,0 +1,14 @@
1
+ /** 与 api.zengchaowu.com GET /page-config 返回的 data 结构一致 */
2
+ export interface PageConfig {
3
+ appKey?: string
4
+ version?: string
5
+ tabBar?: unknown
6
+ permissions?: unknown
7
+ displays?: unknown
8
+ [key: string]: unknown
9
+ }
10
+
11
+ export interface PageConfigResponse {
12
+ code?: number
13
+ data?: PageConfig
14
+ }
@@ -0,0 +1,21 @@
1
+ export interface Payment {
2
+ id: number
3
+ user_id?: string
4
+ order_id?: number
5
+ amount?: number
6
+ status?: string
7
+ payment_method?: string
8
+ transaction_id?: string
9
+ created_at?: string
10
+ updated_at?: string
11
+ }
12
+
13
+ export interface PaymentListResponse {
14
+ data: Payment[]
15
+ pagination: {
16
+ total: number
17
+ page: number
18
+ page_size: number
19
+ total_pages: number
20
+ }
21
+ }
@@ -0,0 +1,12 @@
1
+ export interface PerformanceMetric {
2
+ type?: string
3
+ value?: number
4
+ timestamp?: number
5
+ [key: string]: unknown
6
+ }
7
+
8
+ export interface PerformanceMetricsResponse {
9
+ data?: PerformanceMetric[]
10
+ /** 或直接返回数组 */
11
+ [key: string]: unknown
12
+ }
@@ -0,0 +1,24 @@
1
+ export interface Role {
2
+ id: string
3
+ name: string
4
+ code: string
5
+ permissionCount: number
6
+ createdAt: string
7
+ }
8
+
9
+ export interface Permission {
10
+ id: string
11
+ code: string
12
+ name: string
13
+ module: string
14
+ description?: string
15
+ }
16
+
17
+ export interface AssignUserRolesPayload {
18
+ roleIds: string[]
19
+ }
20
+
21
+ export interface AssignRolePermissionsPayload {
22
+ permissionIds: string[]
23
+ }
24
+
@@ -0,0 +1,29 @@
1
+ /** 举报状态(与 api.zengchaowu.com 一致) */
2
+ export type ReportStatus = 'pending' | 'processing' | 'resolved' | 'rejected'
3
+
4
+ /** 举报目标类型 */
5
+ export type ReportTargetType = 'post' | 'comment' | 'product' | 'user'
6
+
7
+ export interface Report {
8
+ id: number
9
+ reporter_id?: string
10
+ target_type?: ReportTargetType
11
+ target_id?: string | number
12
+ reason?: string
13
+ description?: string
14
+ status?: ReportStatus
15
+ created_at?: string
16
+ updated_at?: string
17
+ }
18
+
19
+ export interface ReportListResponse {
20
+ data: Report[]
21
+ total: number
22
+ limit?: number
23
+ offset?: number
24
+ }
25
+
26
+ export interface ProcessReportPayload {
27
+ status: ReportStatus
28
+ remark?: string
29
+ }
@@ -0,0 +1,13 @@
1
+ export interface Review {
2
+ id: number
3
+ product_id?: number
4
+ user_id?: string
5
+ rating?: number
6
+ content?: string
7
+ created_at?: string
8
+ updated_at?: string
9
+ }
10
+
11
+ export interface ReviewListResponse {
12
+ data: Review[]
13
+ }
@@ -108,6 +108,34 @@ export interface FacebookLoginOptions {
108
108
  oauthAarPath: string
109
109
  }
110
110
 
111
+ /**
112
+ * uniPush 配置(Android 离线打包,HBuilderX 3.99+ 默认 maven 方式)
113
+ *
114
+ * @see https://nativesupport.dcloud.net.cn/AppDocs/usemodule/androidModuleConfig/push.html
115
+ */
116
+ export interface UniPushAndroidOptions {
117
+ /** uniPush AppId */
118
+ appId: string
119
+ /** uniPush AppKey */
120
+ appKey: string
121
+ /** uniPush AppSecret */
122
+ appSecret: string
123
+ /** maven(默认):根工程加个推仓 + gtsdk/gtc-dcloud;aar:仅拷贝本地 aar */
124
+ integrationMode?: 'maven' | 'aar'
125
+ /** aar 模式:SDK/libs 等待拷贝的 aar/jar 列表 */
126
+ aarLibFiles?: Array<{ source: string; targetName?: string }>
127
+ /** maven 模式额外 implementation 整行 */
128
+ extraMavenDependencies?: string[]
129
+ /** maven 是否写入文档中的空厂商 manifestPlaceholders 键,默认 true */
130
+ includeDefaultOemPlaceholderKeys?: boolean
131
+ /** 是否同步 dcloud_properties(Push/unipush/push service),默认 true */
132
+ syncDcloudProperties?: boolean
133
+ /** 是否添加 unipush deep link 的 intent-filter,默认 true */
134
+ addUniPushDeepLinkIntentFilter?: boolean
135
+ /** 是否添加 OPPO 推送 intent-filter,默认 false */
136
+ addOppoPushIntentFilter?: boolean
137
+ }
138
+
111
139
  /**
112
140
  * ShareTrace配置
113
141
  */
@@ -195,6 +223,8 @@ export interface UniAppAndroidBuildOptions extends AndroidBuildOptions {
195
223
  facebookLogin?: FacebookLoginOptions
196
224
  /** ShareTrace配置(可选) */
197
225
  shareTrace?: ShareTraceOptions
226
+ /** uniPush 配置(可选) */
227
+ uniPush?: UniPushAndroidOptions
198
228
  /** UniApp 原生插件配置列表(可选) */
199
229
  nativePlugins?: UniAppNativePluginOptions[]
200
230
  }
@@ -229,4 +259,5 @@ export interface UniAppAndroidPluginBuildOptions extends Omit<UniAppAndroidBuild
229
259
  googleLogin?: never
230
260
  facebookLogin?: never
231
261
  shareTrace?: never
262
+ uniPush?: never
232
263
  }
@@ -78,6 +78,30 @@ export interface SinaShareIOSOptions {
78
78
  weiboSDKBundlePath?: string
79
79
  }
80
80
 
81
+ /**
82
+ * uniPush 配置(iOS 离线打包)
83
+ *
84
+ * @see https://nativesupport.dcloud.net.cn/AppDocs/usemodule/iOSModuleConfig/push.html#unipush
85
+ */
86
+ export interface UniPushIOSOptions {
87
+ /** Info.plist 根节点 `getui` 字典(与开发者后台字段一致,如 appid、appkey、appsecret) */
88
+ getui: Record<string, string>
89
+ /** liblibPush.a 路径 */
90
+ liblibPushPath?: string
91
+ /** libUniPush.a 路径 */
92
+ libUniPushPath?: string
93
+ /** GTSDK.xcframework 路径 */
94
+ gtSdkXcframeworkPath?: string
95
+ /** 是否同步 PandoraApi.bundle/feature.plist 中的 Push 节点为文档标准结构,默认 true */
96
+ syncFeaturePlistPush?: boolean
97
+ /** PandoraApi.bundle 目录;默认 `{projectPath}/{projectName}/PandoraApi.bundle` */
98
+ pandoraApiBundlePath?: string
99
+ /** 是否自动添加文档中的系统 tbd 与框架(含弱链接 UserNotifications),默认 true */
100
+ includeDefaultSystemDependencies?: boolean
101
+ extraSystemFrameworks?: string[]
102
+ extraSystemTbdLibraries?: string[]
103
+ }
104
+
81
105
  /**
82
106
  * Camera/Gallery 配置(iOS)
83
107
  */
@@ -152,6 +176,8 @@ export interface UniAppIOSBuildOptions extends IOSBuildOptions {
152
176
  sinaShare?: SinaShareIOSOptions
153
177
  /** Camera/Gallery 配置(可选) */
154
178
  cameraGallery?: CameraGalleryIOSOptions
179
+ /** uniPush 配置(可选) */
180
+ uniPush?: UniPushIOSOptions
155
181
  /** UniApp 原生插件配置列表(可选) */
156
182
  nativePlugins?: UniAppNativePluginIOSOptions[]
157
183
  /** 源码目录名称(可选,如果 .xcodeproj 文件名与实际源码目录不一致时需要指定,默认从 .xcodeproj 推断) */
package/types/user.d.ts CHANGED
@@ -6,7 +6,8 @@ export interface User {
6
6
  wechat_openid?: string
7
7
  wechat_unionid?: string
8
8
  wechat_nickname?: string
9
- wechat_avatar?: string
9
+ /** 用户头像 URL(微信登录等会写入微信头像) */
10
+ avatar?: string
10
11
  created_at?: string
11
12
  updated_at?: string
12
13
  // 兼容旧字段名
@@ -1,5 +0,0 @@
1
- import type { setTimeout } from '../../../references/timer.d';
2
- export interface SleepDeps {
3
- setTimeout: typeof setTimeout;
4
- }
5
- export declare function sleep(ms: number, deps: SleepDeps): Promise<void>;
@@ -1,6 +0,0 @@
1
- export function sleep(ms, deps) {
2
- return new Promise(resolve => {
3
- deps.setTimeout(resolve, ms);
4
- });
5
- }
6
- //# sourceMappingURL=sleep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../../src/functions/async/sleep.ts"],"names":[],"mappings":"AA+BA,MAAM,UAAU,KAAK,CAAC,EAAU,EAAE,IAAe;IAC/C,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { setTimeout, clearTimeout } from '../../../references/timer.d';
2
- export interface TimeoutDeps {
3
- setTimeout: typeof setTimeout;
4
- clearTimeout: typeof clearTimeout;
5
- }
6
- export declare function timeout<T>(promise: Promise<T>, ms: number, deps: TimeoutDeps): Promise<T>;
@@ -1,12 +0,0 @@
1
- export function timeout(promise, ms, deps) {
2
- let timeoutId;
3
- const timeoutPromise = new Promise((_, reject) => {
4
- timeoutId = deps.setTimeout(() => {
5
- reject(new Error(`Operation timed out after ${ms}ms`));
6
- }, ms);
7
- });
8
- return Promise.race([promise, timeoutPromise]).finally(() => {
9
- deps.clearTimeout(timeoutId);
10
- });
11
- }
12
- //# sourceMappingURL=timeout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeout.js","sourceRoot":"","sources":["../../../src/functions/async/timeout.ts"],"names":[],"mappings":"AAyCA,MAAM,UAAU,OAAO,CACrB,OAAmB,EACnB,EAAU,EACV,IAAiB;IAEjB,IAAI,SAAc,CAAA;IAElB,MAAM,cAAc,GAAG,IAAI,OAAO,CAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE;QACtD,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;YAC/B,MAAM,CAAC,IAAI,KAAK,CAAC,6BAA6B,EAAE,IAAI,CAAC,CAAC,CAAA;QACxD,CAAC,EAAE,EAAE,CAAC,CAAA;IACR,CAAC,CAAC,CAAA;IAEF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;QAC1D,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Placement } from '../../../types/placement';
2
- import type { Rect, Coords } from '../../../types/geometry';
3
- export declare function computePosition(placement: Placement, reference: Rect, floating: {
4
- width: number;
5
- height: number;
6
- }, scrollOffset: Coords): Coords;
@@ -1,49 +0,0 @@
1
- import { getBasePlacement } from './getBasePlacement';
2
- import { getAlignment } from './getAlignment';
3
- export function computePosition(placement, reference, floating, scrollOffset) {
4
- const basePlacement = getBasePlacement(placement);
5
- const alignment = getAlignment(placement);
6
- let x = reference.x;
7
- let y = reference.y;
8
- switch (basePlacement) {
9
- case 'top':
10
- x = x + reference.width / 2 - floating.width / 2;
11
- y = reference.y - floating.height;
12
- break;
13
- case 'bottom':
14
- x = x + reference.width / 2 - floating.width / 2;
15
- y = reference.y + reference.height;
16
- break;
17
- case 'left':
18
- x = x - floating.width;
19
- y = y + reference.height / 2 - floating.height / 2;
20
- break;
21
- case 'right':
22
- x = x + reference.width;
23
- y = y + reference.height / 2 - floating.height / 2;
24
- break;
25
- }
26
- if (alignment) {
27
- if (basePlacement === 'top' || basePlacement === 'bottom') {
28
- if (alignment === 'start') {
29
- x = reference.x;
30
- }
31
- else if (alignment === 'end') {
32
- x = reference.x + reference.width - floating.width;
33
- }
34
- }
35
- else {
36
- if (alignment === 'start') {
37
- y = reference.y;
38
- }
39
- else if (alignment === 'end') {
40
- y = reference.y + reference.height - floating.height;
41
- }
42
- }
43
- }
44
- return {
45
- x: x + scrollOffset.x,
46
- y: y + scrollOffset.y,
47
- };
48
- }
49
- //# sourceMappingURL=computePosition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"computePosition.js","sourceRoot":"","sources":["../../../src/functions/browser/computePosition.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AA0B7C,MAAM,UAAU,eAAe,CAC7B,SAAoB,EACpB,SAAe,EACf,QAA2C,EAC3C,YAAoB;IAEpB,MAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAA;IACjD,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;IAGzC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;IACnB,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;IAGnB,QAAQ,aAAa,EAAE,CAAC;QACtB,KAAK,KAAK;YACR,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAA;YAChD,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAA;YACjC,MAAK;QACP,KAAK,QAAQ;YACX,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAA;YAChD,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAA;YAClC,MAAK;QACP,KAAK,MAAM;YACT,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAA;YACtB,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAA;YAClD,MAAK;QACP,KAAK,OAAO;YACV,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAA;YACvB,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAA;YAClD,MAAK;IACT,CAAC;IAGD,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,aAAa,KAAK,KAAK,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;YAE1D,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;gBAC1B,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;YACjB,CAAC;iBAAM,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;gBAC/B,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAA;YACpD,CAAC;QACH,CAAC;aAAM,CAAC;YAEN,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;gBAC1B,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;YACjB,CAAC;iBAAM,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;gBAC/B,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAA;YACtD,CAAC;QACH,CAAC;IACH,CAAC;IAGD,OAAO;QACL,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC;QACrB,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC;KACtB,CAAA;AACH,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { Window } from '../../../references/browser.d';
2
- import type { KeyboardEvent } from '../../../references/dom.d';
3
- import type { Console } from '../../../references/console.d';
4
- export type KeyboardEventListener = (event: KeyboardEvent) => void;
5
- export interface KeyboardCenterDeps {
6
- addEventListener: Window['addEventListener'];
7
- removeEventListener: Window['removeEventListener'];
8
- log: Console['log'];
9
- error: Console['error'];
10
- warn: Console['warn'];
11
- }
12
- export interface KeyboardCenter {
13
- subscribe(listener: KeyboardEventListener): () => void;
14
- unsubscribe(listener: KeyboardEventListener): void;
15
- getListenerCount(): number;
16
- isInitialized(): boolean;
17
- }
18
- export declare function createSharedKeyboardCenter(deps: KeyboardCenterDeps): KeyboardCenter;
@@ -1,58 +0,0 @@
1
- import { createEventEmitter } from '../patterns/EventEmitter';
2
- let globalCenter = null;
3
- export function createSharedKeyboardCenter(deps) {
4
- if (globalCenter) {
5
- return globalCenter;
6
- }
7
- const emitter = createEventEmitter({ log: deps.log, error: deps.error, warn: deps.warn }, { maxListeners: 50 });
8
- let isListenerAdded = false;
9
- const listeners = new Set();
10
- const globalKeyboardHandler = (event) => {
11
- if (listeners.size === 0) {
12
- return;
13
- }
14
- listeners.forEach(listener => {
15
- try {
16
- listener(event);
17
- }
18
- catch (error) {
19
- deps.error('[KeyboardCenter] 监听器执行错误:', error);
20
- }
21
- });
22
- };
23
- const center = {
24
- subscribe(listener) {
25
- listeners.add(listener);
26
- emitter.on('keyboard', listener);
27
- if (!isListenerAdded) {
28
- deps.addEventListener('keydown', globalKeyboardHandler, {
29
- passive: true
30
- });
31
- deps.addEventListener('keyup', globalKeyboardHandler, {
32
- passive: true
33
- });
34
- isListenerAdded = true;
35
- deps.log('[KeyboardCenter] 已添加全局键盘监听');
36
- }
37
- return () => {
38
- center.unsubscribe(listener);
39
- };
40
- },
41
- unsubscribe(listener) {
42
- listeners.delete(listener);
43
- emitter.off('keyboard', listener);
44
- if (listeners.size === 0) {
45
- deps.log('[KeyboardCenter] 所有订阅者已移除,但保持全局监听');
46
- }
47
- },
48
- getListenerCount() {
49
- return listeners.size;
50
- },
51
- isInitialized() {
52
- return isListenerAdded;
53
- }
54
- };
55
- globalCenter = center;
56
- return center;
57
- }
58
- //# sourceMappingURL=createSharedKeyboardCenter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createSharedKeyboardCenter.js","sourceRoot":"","sources":["../../../src/functions/browser/createSharedKeyboardCenter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAsD3E,IAAI,YAAY,GAA0B,IAAI,CAAA;AAiC9C,MAAM,UAAU,0BAA0B,CAAC,IAAwB;IAEjE,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,YAAY,CAAA;IACrB,CAAC;IAGD,MAAM,OAAO,GAAG,kBAAkB,CAChC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EACrD,EAAE,YAAY,EAAE,EAAE,EAAE,CACrB,CAAA;IAED,IAAI,eAAe,GAAG,KAAK,CAAA;IAC3B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAyB,CAAA;IAKlD,MAAM,qBAAqB,GAAG,CAAC,KAAoB,EAAE,EAAE;QAErD,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACzB,OAAM;QACR,CAAC;QAGD,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC3B,IAAI,CAAC;gBACH,QAAQ,CAAC,KAAK,CAAC,CAAA;YACjB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAA;YAChD,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,MAAM,GAAmB;QAI7B,SAAS,CAAC,QAA+B;YACvC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YACvB,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;YAGhC,IAAI,CAAC,eAAe,EAAE,CAAC;gBACrB,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,qBAAsC,EAAE;oBACvE,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;gBACF,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,qBAAsC,EAAE;oBACrE,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;gBACF,eAAe,GAAG,IAAI,CAAA;gBACtB,IAAI,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;YACxC,CAAC;YAGD,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;YAC9B,CAAC,CAAA;QACH,CAAC;QAKD,WAAW,CAAC,QAA+B;YACzC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC1B,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;YAIjC,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;gBACzB,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAA;YAC/C,CAAC;QACH,CAAC;QAKD,gBAAgB;YACd,OAAO,SAAS,CAAC,IAAI,CAAA;QACvB,CAAC;QAKD,aAAa;YACX,OAAO,eAAe,CAAA;QACxB,CAAC;KACF,CAAA;IAGD,YAAY,GAAG,MAAM,CAAA;IAErB,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { Window } from '../../../references/browser.d';
2
- import type { setTimeout, clearTimeout } from '../../../references/timer.d';
3
- export type ThrottledEventType = 'resize' | 'scroll' | 'mousemove' | 'touchmove' | 'pointermove' | 'wheel';
4
- export interface CreateThrottledEventListenerDeps {
5
- addEventListener: Window['addEventListener'];
6
- removeEventListener: Window['removeEventListener'];
7
- setTimeout: typeof setTimeout;
8
- clearTimeout: typeof clearTimeout;
9
- now: () => number;
10
- }
11
- export declare function createThrottledEventListener(eventType: ThrottledEventType, callback: () => void, throttleMs: number, deps: CreateThrottledEventListenerDeps): () => void;
@@ -1,51 +0,0 @@
1
- export function createThrottledEventListener(eventType, callback, throttleMs, deps) {
2
- if (throttleMs === 0) {
3
- const handleEvent = () => {
4
- callback();
5
- };
6
- deps.addEventListener(eventType, handleEvent, { passive: true });
7
- return () => {
8
- deps.removeEventListener(eventType, handleEvent);
9
- };
10
- }
11
- let timeoutId = undefined;
12
- let lastExecuteTime = -1;
13
- let hasPendingCall = false;
14
- const executeCallback = () => {
15
- lastExecuteTime = deps.now();
16
- hasPendingCall = false;
17
- callback();
18
- };
19
- const handleEvent = () => {
20
- const now = deps.now();
21
- const timeSinceLastExecute = now - lastExecuteTime;
22
- if (lastExecuteTime < 0 || timeSinceLastExecute >= throttleMs) {
23
- if (timeoutId !== undefined) {
24
- deps.clearTimeout(timeoutId);
25
- timeoutId = undefined;
26
- }
27
- executeCallback();
28
- }
29
- else {
30
- hasPendingCall = true;
31
- if (timeoutId === undefined) {
32
- const remainingTime = throttleMs - timeSinceLastExecute;
33
- timeoutId = deps.setTimeout(() => {
34
- timeoutId = undefined;
35
- if (hasPendingCall) {
36
- executeCallback();
37
- }
38
- }, remainingTime);
39
- }
40
- }
41
- };
42
- deps.addEventListener(eventType, handleEvent, { passive: true });
43
- return () => {
44
- deps.removeEventListener(eventType, handleEvent);
45
- if (timeoutId !== undefined) {
46
- deps.clearTimeout(timeoutId);
47
- timeoutId = undefined;
48
- }
49
- };
50
- }
51
- //# sourceMappingURL=createThrottledEventListener.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createThrottledEventListener.js","sourceRoot":"","sources":["../../../src/functions/browser/createThrottledEventListener.ts"],"names":[],"mappings":"AA+DA,MAAM,UAAU,4BAA4B,CAC1C,SAA6B,EAC7B,QAAoB,EACpB,UAAkB,EAClB,IAAsC;IAGtC,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,WAAW,GAAkB,GAAG,EAAE;YACtC,QAAQ,EAAE,CAAA;QACZ,CAAC,CAAA;QAED,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;QAEhE,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;QAClD,CAAC,CAAA;IACH,CAAC;IAGD,IAAI,SAAS,GAAQ,SAAS,CAAA;IAC9B,IAAI,eAAe,GAAG,CAAC,CAAC,CAAA;IACxB,IAAI,cAAc,GAAG,KAAK,CAAA;IAE1B,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAC5B,cAAc,GAAG,KAAK,CAAA;QACtB,QAAQ,EAAE,CAAA;IACZ,CAAC,CAAA;IAED,MAAM,WAAW,GAAkB,GAAG,EAAE;QACtC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACtB,MAAM,oBAAoB,GAAG,GAAG,GAAG,eAAe,CAAA;QAGlD,IAAI,eAAe,GAAG,CAAC,IAAI,oBAAoB,IAAI,UAAU,EAAE,CAAC;YAE9D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC5B,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;gBAC5B,SAAS,GAAG,SAAS,CAAA;YACvB,CAAC;YACD,eAAe,EAAE,CAAA;QACnB,CAAC;aAAM,CAAC;YAEN,cAAc,GAAG,IAAI,CAAA;YAGrB,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC5B,MAAM,aAAa,GAAG,UAAU,GAAG,oBAAoB,CAAA;gBACvD,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE;oBAC/B,SAAS,GAAG,SAAS,CAAA;oBACrB,IAAI,cAAc,EAAE,CAAC;wBACnB,eAAe,EAAE,CAAA;oBACnB,CAAC;gBACH,CAAC,EAAE,aAAa,CAAC,CAAA;YACnB,CAAC;QAGH,CAAC;IACH,CAAC,CAAA;IAED,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IAGhE,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;QAChD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;YAC5B,SAAS,GAAG,SAAS,CAAA;QACvB,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}