@alibarbar/common 1.0.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 (210) hide show
  1. package/README.md +338 -0
  2. package/dist/algorithm.d.mts +66 -0
  3. package/dist/algorithm.d.ts +66 -0
  4. package/dist/algorithm.js +44 -0
  5. package/dist/algorithm.js.map +1 -0
  6. package/dist/algorithm.mjs +3 -0
  7. package/dist/algorithm.mjs.map +1 -0
  8. package/dist/array.d.mts +139 -0
  9. package/dist/array.d.ts +139 -0
  10. package/dist/array.js +84 -0
  11. package/dist/array.js.map +1 -0
  12. package/dist/array.mjs +3 -0
  13. package/dist/array.mjs.map +1 -0
  14. package/dist/chunk-27UDDVLZ.js +259 -0
  15. package/dist/chunk-27UDDVLZ.js.map +1 -0
  16. package/dist/chunk-2FFSQ573.mjs +138 -0
  17. package/dist/chunk-2FFSQ573.mjs.map +1 -0
  18. package/dist/chunk-4RGXV4SJ.js +106 -0
  19. package/dist/chunk-4RGXV4SJ.js.map +1 -0
  20. package/dist/chunk-56W6YECK.js +374 -0
  21. package/dist/chunk-56W6YECK.js.map +1 -0
  22. package/dist/chunk-5BGSUGTI.mjs +128 -0
  23. package/dist/chunk-5BGSUGTI.mjs.map +1 -0
  24. package/dist/chunk-7E6GELHJ.mjs +302 -0
  25. package/dist/chunk-7E6GELHJ.mjs.map +1 -0
  26. package/dist/chunk-7V5UQXIO.js +89 -0
  27. package/dist/chunk-7V5UQXIO.js.map +1 -0
  28. package/dist/chunk-A4SWQXX7.mjs +484 -0
  29. package/dist/chunk-A4SWQXX7.mjs.map +1 -0
  30. package/dist/chunk-ALDC6LRJ.mjs +85 -0
  31. package/dist/chunk-ALDC6LRJ.mjs.map +1 -0
  32. package/dist/chunk-BHCRFURU.js +491 -0
  33. package/dist/chunk-BHCRFURU.js.map +1 -0
  34. package/dist/chunk-D7CS5EKF.js +110 -0
  35. package/dist/chunk-D7CS5EKF.js.map +1 -0
  36. package/dist/chunk-DYBSRI7V.js +189 -0
  37. package/dist/chunk-DYBSRI7V.js.map +1 -0
  38. package/dist/chunk-F3LAGHPG.js +332 -0
  39. package/dist/chunk-F3LAGHPG.js.map +1 -0
  40. package/dist/chunk-HLDFI7R2.mjs +175 -0
  41. package/dist/chunk-HLDFI7R2.mjs.map +1 -0
  42. package/dist/chunk-HME2N3VY.mjs +354 -0
  43. package/dist/chunk-HME2N3VY.mjs.map +1 -0
  44. package/dist/chunk-I3L42475.js +145 -0
  45. package/dist/chunk-I3L42475.js.map +1 -0
  46. package/dist/chunk-JBLX27WD.mjs +240 -0
  47. package/dist/chunk-JBLX27WD.mjs.map +1 -0
  48. package/dist/chunk-JHZ7M2MR.mjs +133 -0
  49. package/dist/chunk-JHZ7M2MR.mjs.map +1 -0
  50. package/dist/chunk-JK2SE3I2.js +100 -0
  51. package/dist/chunk-JK2SE3I2.js.map +1 -0
  52. package/dist/chunk-JQZBPAPO.js +157 -0
  53. package/dist/chunk-JQZBPAPO.js.map +1 -0
  54. package/dist/chunk-JXYGC2C5.mjs +100 -0
  55. package/dist/chunk-JXYGC2C5.mjs.map +1 -0
  56. package/dist/chunk-KGFTD255.js +104 -0
  57. package/dist/chunk-KGFTD255.js.map +1 -0
  58. package/dist/chunk-LBHBNPNJ.mjs +148 -0
  59. package/dist/chunk-LBHBNPNJ.mjs.map +1 -0
  60. package/dist/chunk-LCXGZISK.js +158 -0
  61. package/dist/chunk-LCXGZISK.js.map +1 -0
  62. package/dist/chunk-LF4CILQS.mjs +87 -0
  63. package/dist/chunk-LF4CILQS.mjs.map +1 -0
  64. package/dist/chunk-MMR6XQNX.js +98 -0
  65. package/dist/chunk-MMR6XQNX.js.map +1 -0
  66. package/dist/chunk-NSSDYX2U.mjs +80 -0
  67. package/dist/chunk-NSSDYX2U.mjs.map +1 -0
  68. package/dist/chunk-O3O67R4I.js +143 -0
  69. package/dist/chunk-O3O67R4I.js.map +1 -0
  70. package/dist/chunk-OX5PLOWB.js +90 -0
  71. package/dist/chunk-OX5PLOWB.js.map +1 -0
  72. package/dist/chunk-PJ7UCTX4.mjs +362 -0
  73. package/dist/chunk-PJ7UCTX4.mjs.map +1 -0
  74. package/dist/chunk-QIBE7GVN.mjs +81 -0
  75. package/dist/chunk-QIBE7GVN.mjs.map +1 -0
  76. package/dist/chunk-QIOC54LQ.mjs +130 -0
  77. package/dist/chunk-QIOC54LQ.mjs.map +1 -0
  78. package/dist/chunk-QV6MIQ7H.mjs +328 -0
  79. package/dist/chunk-QV6MIQ7H.mjs.map +1 -0
  80. package/dist/chunk-TQN37HIN.js +94 -0
  81. package/dist/chunk-TQN37HIN.js.map +1 -0
  82. package/dist/chunk-XJTZDXSR.mjs +94 -0
  83. package/dist/chunk-XJTZDXSR.mjs.map +1 -0
  84. package/dist/chunk-XVUE53T3.js +361 -0
  85. package/dist/chunk-XVUE53T3.js.map +1 -0
  86. package/dist/chunk-Y364QIQH.js +139 -0
  87. package/dist/chunk-Y364QIQH.js.map +1 -0
  88. package/dist/chunk-YXM6Q4JS.mjs +94 -0
  89. package/dist/chunk-YXM6Q4JS.mjs.map +1 -0
  90. package/dist/chunk-ZDMFMUDR.js +309 -0
  91. package/dist/chunk-ZDMFMUDR.js.map +1 -0
  92. package/dist/chunk-ZVJ6NQUM.mjs +82 -0
  93. package/dist/chunk-ZVJ6NQUM.mjs.map +1 -0
  94. package/dist/color.d.mts +74 -0
  95. package/dist/color.d.ts +74 -0
  96. package/dist/color.js +40 -0
  97. package/dist/color.js.map +1 -0
  98. package/dist/color.mjs +3 -0
  99. package/dist/color.mjs.map +1 -0
  100. package/dist/crypto.d.mts +92 -0
  101. package/dist/crypto.d.ts +92 -0
  102. package/dist/crypto.js +60 -0
  103. package/dist/crypto.js.map +1 -0
  104. package/dist/crypto.mjs +3 -0
  105. package/dist/crypto.mjs.map +1 -0
  106. package/dist/data-structure.d.mts +213 -0
  107. package/dist/data-structure.d.ts +213 -0
  108. package/dist/data-structure.js +32 -0
  109. package/dist/data-structure.js.map +1 -0
  110. package/dist/data-structure.mjs +3 -0
  111. package/dist/data-structure.mjs.map +1 -0
  112. package/dist/date.d.mts +108 -0
  113. package/dist/date.d.ts +108 -0
  114. package/dist/date.js +72 -0
  115. package/dist/date.js.map +1 -0
  116. package/dist/date.mjs +3 -0
  117. package/dist/date.mjs.map +1 -0
  118. package/dist/dom.d.mts +92 -0
  119. package/dist/dom.d.ts +92 -0
  120. package/dist/dom.js +56 -0
  121. package/dist/dom.js.map +1 -0
  122. package/dist/dom.mjs +3 -0
  123. package/dist/dom.mjs.map +1 -0
  124. package/dist/file.d.mts +44 -0
  125. package/dist/file.d.ts +44 -0
  126. package/dist/file.js +32 -0
  127. package/dist/file.js.map +1 -0
  128. package/dist/file.mjs +3 -0
  129. package/dist/file.mjs.map +1 -0
  130. package/dist/i18n.d.mts +77 -0
  131. package/dist/i18n.d.ts +77 -0
  132. package/dist/i18n.js +40 -0
  133. package/dist/i18n.js.map +1 -0
  134. package/dist/i18n.mjs +3 -0
  135. package/dist/i18n.mjs.map +1 -0
  136. package/dist/index.d.mts +155 -0
  137. package/dist/index.d.ts +155 -0
  138. package/dist/index.js +839 -0
  139. package/dist/index.js.map +1 -0
  140. package/dist/index.mjs +22 -0
  141. package/dist/index.mjs.map +1 -0
  142. package/dist/network.d.mts +47 -0
  143. package/dist/network.d.ts +47 -0
  144. package/dist/network.js +28 -0
  145. package/dist/network.js.map +1 -0
  146. package/dist/network.mjs +3 -0
  147. package/dist/network.mjs.map +1 -0
  148. package/dist/number.d.mts +100 -0
  149. package/dist/number.d.ts +100 -0
  150. package/dist/number.js +56 -0
  151. package/dist/number.js.map +1 -0
  152. package/dist/number.mjs +3 -0
  153. package/dist/number.mjs.map +1 -0
  154. package/dist/object.d.mts +132 -0
  155. package/dist/object.d.ts +132 -0
  156. package/dist/object.js +80 -0
  157. package/dist/object.js.map +1 -0
  158. package/dist/object.mjs +3 -0
  159. package/dist/object.mjs.map +1 -0
  160. package/dist/performance.d.mts +85 -0
  161. package/dist/performance.d.ts +85 -0
  162. package/dist/performance.js +40 -0
  163. package/dist/performance.js.map +1 -0
  164. package/dist/performance.mjs +3 -0
  165. package/dist/performance.mjs.map +1 -0
  166. package/dist/storage.d.mts +176 -0
  167. package/dist/storage.d.ts +176 -0
  168. package/dist/storage.js +33 -0
  169. package/dist/storage.js.map +1 -0
  170. package/dist/storage.mjs +4 -0
  171. package/dist/storage.mjs.map +1 -0
  172. package/dist/string.d.mts +105 -0
  173. package/dist/string.d.ts +105 -0
  174. package/dist/string.js +68 -0
  175. package/dist/string.js.map +1 -0
  176. package/dist/string.mjs +3 -0
  177. package/dist/string.mjs.map +1 -0
  178. package/dist/tracking.d.mts +182 -0
  179. package/dist/tracking.d.ts +182 -0
  180. package/dist/tracking.js +52 -0
  181. package/dist/tracking.js.map +1 -0
  182. package/dist/tracking.mjs +3 -0
  183. package/dist/tracking.mjs.map +1 -0
  184. package/dist/transform.d.mts +53 -0
  185. package/dist/transform.d.ts +53 -0
  186. package/dist/transform.js +32 -0
  187. package/dist/transform.js.map +1 -0
  188. package/dist/transform.mjs +3 -0
  189. package/dist/transform.mjs.map +1 -0
  190. package/dist/upload-DzlQtUBc.d.mts +202 -0
  191. package/dist/upload-DzlQtUBc.d.ts +202 -0
  192. package/dist/upload.d.mts +1 -0
  193. package/dist/upload.d.ts +1 -0
  194. package/dist/upload.js +17 -0
  195. package/dist/upload.js.map +1 -0
  196. package/dist/upload.mjs +4 -0
  197. package/dist/upload.mjs.map +1 -0
  198. package/dist/url.d.mts +82 -0
  199. package/dist/url.d.ts +82 -0
  200. package/dist/url.js +44 -0
  201. package/dist/url.js.map +1 -0
  202. package/dist/url.mjs +3 -0
  203. package/dist/url.mjs.map +1 -0
  204. package/dist/validation.d.mts +83 -0
  205. package/dist/validation.d.ts +83 -0
  206. package/dist/validation.js +60 -0
  207. package/dist/validation.js.map +1 -0
  208. package/dist/validation.mjs +3 -0
  209. package/dist/validation.mjs.map +1 -0
  210. package/package.json +170 -0
@@ -0,0 +1,155 @@
1
+ export { camelCase, capitalize, escapeHtml, highlight, kebabCase, mask, maskEmail, maskPhone, pascalCase, removeAccents, slugify, snakeCase, template, truncate, unescapeHtml } from './string.mjs';
2
+ export { chunk, compact, difference, drop, dropWhile, findIndexBy, flatten, groupBy, intersection, partition, sample, shuffle, sortBy, take, takeWhile, union, unique, unzip, zip } from './array.mjs';
3
+ export { deepClone, deepMerge, defaults, get, invert, isEmptyObject, isEqual, keys, mapKeys, mapValues, merge, omit, omitBy, pick, pickBy, set, transform, values } from './object.mjs';
4
+ export { addDays, addMonths, addYears, diffDays, endOfDay, formatDate, getDateFormatByGMT, getQuarter, getRelativeTime, getTimeFromGMT, getWeekNumber, isToday, isWeekday, isWeekend, isYesterday, startOfDay } from './date.mjs';
5
+ export { isEmpty, isFloat, isInteger, isNumeric, isValidDomain, isValidEmail, isValidHexColor, isValidIP, isValidIdCard, isValidJSON, isValidPhone, isValidUUID, isValidUrl } from './validation.mjs';
6
+ export { ceil, clamp, floor, formatBytes, formatCurrency, formatNumber, isBetween, parseNumber, percent, random, round, toFixed } from './number.mjs';
7
+ export { ParsedUrl, buildUrl, getQueryParams, isAbsoluteUrl, joinUrl, normalizeUrl, parseUrl, removeQueryParams, setQueryParams, updateQueryParams } from './url.mjs';
8
+ export { HSL, RGB, contrast, darken, hexToRgb, hslToRgb, lighten, mix, rgbToHex, rgbToHsl } from './color.mjs';
9
+ export { CurrencyCode, Locale, TranslationDictionary, createTranslator, formatCurrencyI18n, formatDateI18n, formatNumberI18n, formatRelativeTime, getLocale, pluralize, translate } from './i18n.mjs';
10
+ export { calculateBlobMD5, calculateFileMD5, formatFileSize, getFileExtension, getFileNameWithoutExtension, splitFileIntoChunks } from './file.mjs';
11
+ export { A as ApiResponse, h as ChunkInfo, b as ChunkUploadResponse, C as ChunkUploader, d as CompleteUploadResponse, U as UploadInitRequest, a as UploadInitResponse, f as UploadOptions, e as UploadProgress, g as UploadStatus, c as createUploader } from './upload-DzlQtUBc.mjs';
12
+ export { StorageOptions, cookie, getStorageKeyPair, localStorage, sessionStorage, setStorageKeyPair, storage } from './storage.mjs';
13
+ export { checkOnline, downloadFile, fetchWithRetry, fetchWithTimeout, request } from './network.mjs';
14
+ export { $, $$, addClass, copyToClipboard, getElementOffset, getScrollPosition, getStyle, isInViewport, removeClass, scrollTo, setStyle, toggleClass } from './dom.mjs';
15
+ export { csvToJson, jsonToCsv, jsonToXml, jsonToYaml, xmlToJson, yamlToJson } from './transform.mjs';
16
+ export { BinaryTree, DataQueue, Graph, LRUCache, LinkedList, Stack } from './data-structure.mjs';
17
+ export { binarySearch, bubbleSort, factorial, fibonacci, fibonacciSequence, gcd, lcm, mergeSort, quickSort } from './algorithm.mjs';
18
+ export { Queue, batch, debounce, memoize, once, retry, throttle, timeout } from './performance.mjs';
19
+ export { RSAKeyPair, base64Decode, base64Encode, exportPrivateKey, exportPublicKey, generateRSAKeyPair, generateRandomString, generateUUID, hash, importPrivateKey, importPublicKey, rsaDecrypt, rsaEncrypt, sha256 } from './crypto.mjs';
20
+ export { ExposureOptions, Tracker, TrackerOptions, TrackingEvent, TrackingEventType, createTracker, flush, getTracker, initTracker, setCommonParams, setUserInfo, trackClick, trackEvent, trackExposure, trackPageView } from './tracking.mjs';
21
+
22
+ /**
23
+ * 类型工具函数
24
+ */
25
+ /**
26
+ * 提取函数参数类型
27
+ */
28
+ type Parameters<T extends (...args: unknown[]) => unknown> = T extends (...args: infer P) => unknown ? P : never;
29
+ /**
30
+ * 提取函数返回类型
31
+ */
32
+ type ReturnType<T extends (...args: unknown[]) => unknown> = T extends (...args: unknown[]) => infer R ? R : never;
33
+ /**
34
+ * 提取Promise的返回类型
35
+ */
36
+ type Awaited<T> = T extends Promise<infer U> ? U : T;
37
+ /**
38
+ * 使所有属性可选(深度)
39
+ */
40
+ type DeepPartial<T> = T extends object ? {
41
+ [P in keyof T]?: DeepPartial<T[P]>;
42
+ } : T;
43
+ /**
44
+ * 使所有属性必需(深度)
45
+ */
46
+ type DeepRequired<T> = T extends object ? {
47
+ [P in keyof T]-?: DeepRequired<T[P]>;
48
+ } : T;
49
+ /**
50
+ * 使所有属性只读(深度)
51
+ */
52
+ type DeepReadonly<T> = T extends object ? {
53
+ readonly [P in keyof T]: DeepReadonly<T[P]>;
54
+ } : T;
55
+ /**
56
+ * 提取对象的值类型
57
+ */
58
+ type ValueOf<T> = T[keyof T];
59
+ /**
60
+ * 提取数组元素类型
61
+ */
62
+ type ArrayElement<T> = T extends ReadonlyArray<infer U> ? U : never;
63
+ /**
64
+ * 排除null和undefined
65
+ */
66
+ type NonNullable<T> = T extends null | undefined ? never : T;
67
+ /**
68
+ * 提取函数类型
69
+ */
70
+ type FunctionType = (...args: unknown[]) => unknown;
71
+ /**
72
+ * 判断是否为函数类型
73
+ */
74
+ type IsFunction<T> = T extends FunctionType ? true : false;
75
+ /**
76
+ * 提取对象中函数类型的键
77
+ */
78
+ type FunctionKeys<T> = {
79
+ [K in keyof T]: T[K] extends FunctionType ? K : never;
80
+ }[keyof T];
81
+ /**
82
+ * 提取对象中非函数类型的键
83
+ */
84
+ type NonFunctionKeys<T> = {
85
+ [K in keyof T]: T[K] extends FunctionType ? never : K;
86
+ }[keyof T];
87
+ /**
88
+ * 合并两个类型
89
+ */
90
+ type Merge<T, U> = {
91
+ [K in keyof T | keyof U]: K extends keyof U ? U[K] : K extends keyof T ? T[K] : never;
92
+ };
93
+ /**
94
+ * 覆盖类型(U中的属性会覆盖T中的同名属性)
95
+ */
96
+ type Overwrite<T, U> = Omit<T, keyof U> & U;
97
+ /**
98
+ * 必需属性
99
+ */
100
+ type Required<T, K extends keyof T> = T & {
101
+ [P in K]-?: T[P];
102
+ };
103
+ /**
104
+ * 提取字符串字面量类型
105
+ */
106
+ type StringLiteral<T> = T extends string ? T : never;
107
+ /**
108
+ * 提取数字字面量类型
109
+ */
110
+ type NumberLiteral<T> = T extends number ? T : never;
111
+ /**
112
+ * 判断类型是否相等
113
+ */
114
+ type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
115
+ /**
116
+ * 判断类型是否为any
117
+ */
118
+ type IsAny<T> = 0 extends 1 & T ? true : false;
119
+ /**
120
+ * 判断类型是否为never
121
+ */
122
+ type IsNever<T> = [T] extends [never] ? true : false;
123
+ /**
124
+ * 判断类型是否为unknown
125
+ */
126
+ type IsUnknown<T> = IsNever<T> extends false ? T extends unknown ? unknown extends T ? IsAny<T> extends false ? true : false : false : false : false;
127
+
128
+ /**
129
+ * 类型定义
130
+ */
131
+ /**
132
+ * 通用函数类型
133
+ */
134
+ type Func<T = any, R = any> = (...args: T[]) => R;
135
+ /**
136
+ * 异步函数类型
137
+ */
138
+ type AsyncFunc<T = any, R = any> = (...args: T[]) => Promise<R>;
139
+ /**
140
+ * 可空类型
141
+ */
142
+ type Nullable<T> = T | null;
143
+ /**
144
+ * 可选类型
145
+ */
146
+ type Optional<T> = T | undefined;
147
+ /**
148
+ * 键值对类型
149
+ */
150
+ type KeyValuePair<K = string, V = any> = {
151
+ key: K;
152
+ value: V;
153
+ };
154
+
155
+ export type { ArrayElement, AsyncFunc, Awaited, DeepPartial, DeepReadonly, DeepRequired, Equals, Func, FunctionKeys, FunctionType, IsAny, IsFunction, IsNever, IsUnknown, KeyValuePair, Merge, NonFunctionKeys, NonNullable, Nullable, NumberLiteral, Optional, Overwrite, Parameters, Required, ReturnType, StringLiteral, ValueOf };
@@ -0,0 +1,155 @@
1
+ export { camelCase, capitalize, escapeHtml, highlight, kebabCase, mask, maskEmail, maskPhone, pascalCase, removeAccents, slugify, snakeCase, template, truncate, unescapeHtml } from './string.js';
2
+ export { chunk, compact, difference, drop, dropWhile, findIndexBy, flatten, groupBy, intersection, partition, sample, shuffle, sortBy, take, takeWhile, union, unique, unzip, zip } from './array.js';
3
+ export { deepClone, deepMerge, defaults, get, invert, isEmptyObject, isEqual, keys, mapKeys, mapValues, merge, omit, omitBy, pick, pickBy, set, transform, values } from './object.js';
4
+ export { addDays, addMonths, addYears, diffDays, endOfDay, formatDate, getDateFormatByGMT, getQuarter, getRelativeTime, getTimeFromGMT, getWeekNumber, isToday, isWeekday, isWeekend, isYesterday, startOfDay } from './date.js';
5
+ export { isEmpty, isFloat, isInteger, isNumeric, isValidDomain, isValidEmail, isValidHexColor, isValidIP, isValidIdCard, isValidJSON, isValidPhone, isValidUUID, isValidUrl } from './validation.js';
6
+ export { ceil, clamp, floor, formatBytes, formatCurrency, formatNumber, isBetween, parseNumber, percent, random, round, toFixed } from './number.js';
7
+ export { ParsedUrl, buildUrl, getQueryParams, isAbsoluteUrl, joinUrl, normalizeUrl, parseUrl, removeQueryParams, setQueryParams, updateQueryParams } from './url.js';
8
+ export { HSL, RGB, contrast, darken, hexToRgb, hslToRgb, lighten, mix, rgbToHex, rgbToHsl } from './color.js';
9
+ export { CurrencyCode, Locale, TranslationDictionary, createTranslator, formatCurrencyI18n, formatDateI18n, formatNumberI18n, formatRelativeTime, getLocale, pluralize, translate } from './i18n.js';
10
+ export { calculateBlobMD5, calculateFileMD5, formatFileSize, getFileExtension, getFileNameWithoutExtension, splitFileIntoChunks } from './file.js';
11
+ export { A as ApiResponse, h as ChunkInfo, b as ChunkUploadResponse, C as ChunkUploader, d as CompleteUploadResponse, U as UploadInitRequest, a as UploadInitResponse, f as UploadOptions, e as UploadProgress, g as UploadStatus, c as createUploader } from './upload-DzlQtUBc.js';
12
+ export { StorageOptions, cookie, getStorageKeyPair, localStorage, sessionStorage, setStorageKeyPair, storage } from './storage.js';
13
+ export { checkOnline, downloadFile, fetchWithRetry, fetchWithTimeout, request } from './network.js';
14
+ export { $, $$, addClass, copyToClipboard, getElementOffset, getScrollPosition, getStyle, isInViewport, removeClass, scrollTo, setStyle, toggleClass } from './dom.js';
15
+ export { csvToJson, jsonToCsv, jsonToXml, jsonToYaml, xmlToJson, yamlToJson } from './transform.js';
16
+ export { BinaryTree, DataQueue, Graph, LRUCache, LinkedList, Stack } from './data-structure.js';
17
+ export { binarySearch, bubbleSort, factorial, fibonacci, fibonacciSequence, gcd, lcm, mergeSort, quickSort } from './algorithm.js';
18
+ export { Queue, batch, debounce, memoize, once, retry, throttle, timeout } from './performance.js';
19
+ export { RSAKeyPair, base64Decode, base64Encode, exportPrivateKey, exportPublicKey, generateRSAKeyPair, generateRandomString, generateUUID, hash, importPrivateKey, importPublicKey, rsaDecrypt, rsaEncrypt, sha256 } from './crypto.js';
20
+ export { ExposureOptions, Tracker, TrackerOptions, TrackingEvent, TrackingEventType, createTracker, flush, getTracker, initTracker, setCommonParams, setUserInfo, trackClick, trackEvent, trackExposure, trackPageView } from './tracking.js';
21
+
22
+ /**
23
+ * 类型工具函数
24
+ */
25
+ /**
26
+ * 提取函数参数类型
27
+ */
28
+ type Parameters<T extends (...args: unknown[]) => unknown> = T extends (...args: infer P) => unknown ? P : never;
29
+ /**
30
+ * 提取函数返回类型
31
+ */
32
+ type ReturnType<T extends (...args: unknown[]) => unknown> = T extends (...args: unknown[]) => infer R ? R : never;
33
+ /**
34
+ * 提取Promise的返回类型
35
+ */
36
+ type Awaited<T> = T extends Promise<infer U> ? U : T;
37
+ /**
38
+ * 使所有属性可选(深度)
39
+ */
40
+ type DeepPartial<T> = T extends object ? {
41
+ [P in keyof T]?: DeepPartial<T[P]>;
42
+ } : T;
43
+ /**
44
+ * 使所有属性必需(深度)
45
+ */
46
+ type DeepRequired<T> = T extends object ? {
47
+ [P in keyof T]-?: DeepRequired<T[P]>;
48
+ } : T;
49
+ /**
50
+ * 使所有属性只读(深度)
51
+ */
52
+ type DeepReadonly<T> = T extends object ? {
53
+ readonly [P in keyof T]: DeepReadonly<T[P]>;
54
+ } : T;
55
+ /**
56
+ * 提取对象的值类型
57
+ */
58
+ type ValueOf<T> = T[keyof T];
59
+ /**
60
+ * 提取数组元素类型
61
+ */
62
+ type ArrayElement<T> = T extends ReadonlyArray<infer U> ? U : never;
63
+ /**
64
+ * 排除null和undefined
65
+ */
66
+ type NonNullable<T> = T extends null | undefined ? never : T;
67
+ /**
68
+ * 提取函数类型
69
+ */
70
+ type FunctionType = (...args: unknown[]) => unknown;
71
+ /**
72
+ * 判断是否为函数类型
73
+ */
74
+ type IsFunction<T> = T extends FunctionType ? true : false;
75
+ /**
76
+ * 提取对象中函数类型的键
77
+ */
78
+ type FunctionKeys<T> = {
79
+ [K in keyof T]: T[K] extends FunctionType ? K : never;
80
+ }[keyof T];
81
+ /**
82
+ * 提取对象中非函数类型的键
83
+ */
84
+ type NonFunctionKeys<T> = {
85
+ [K in keyof T]: T[K] extends FunctionType ? never : K;
86
+ }[keyof T];
87
+ /**
88
+ * 合并两个类型
89
+ */
90
+ type Merge<T, U> = {
91
+ [K in keyof T | keyof U]: K extends keyof U ? U[K] : K extends keyof T ? T[K] : never;
92
+ };
93
+ /**
94
+ * 覆盖类型(U中的属性会覆盖T中的同名属性)
95
+ */
96
+ type Overwrite<T, U> = Omit<T, keyof U> & U;
97
+ /**
98
+ * 必需属性
99
+ */
100
+ type Required<T, K extends keyof T> = T & {
101
+ [P in K]-?: T[P];
102
+ };
103
+ /**
104
+ * 提取字符串字面量类型
105
+ */
106
+ type StringLiteral<T> = T extends string ? T : never;
107
+ /**
108
+ * 提取数字字面量类型
109
+ */
110
+ type NumberLiteral<T> = T extends number ? T : never;
111
+ /**
112
+ * 判断类型是否相等
113
+ */
114
+ type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
115
+ /**
116
+ * 判断类型是否为any
117
+ */
118
+ type IsAny<T> = 0 extends 1 & T ? true : false;
119
+ /**
120
+ * 判断类型是否为never
121
+ */
122
+ type IsNever<T> = [T] extends [never] ? true : false;
123
+ /**
124
+ * 判断类型是否为unknown
125
+ */
126
+ type IsUnknown<T> = IsNever<T> extends false ? T extends unknown ? unknown extends T ? IsAny<T> extends false ? true : false : false : false : false;
127
+
128
+ /**
129
+ * 类型定义
130
+ */
131
+ /**
132
+ * 通用函数类型
133
+ */
134
+ type Func<T = any, R = any> = (...args: T[]) => R;
135
+ /**
136
+ * 异步函数类型
137
+ */
138
+ type AsyncFunc<T = any, R = any> = (...args: T[]) => Promise<R>;
139
+ /**
140
+ * 可空类型
141
+ */
142
+ type Nullable<T> = T | null;
143
+ /**
144
+ * 可选类型
145
+ */
146
+ type Optional<T> = T | undefined;
147
+ /**
148
+ * 键值对类型
149
+ */
150
+ type KeyValuePair<K = string, V = any> = {
151
+ key: K;
152
+ value: V;
153
+ };
154
+
155
+ export type { ArrayElement, AsyncFunc, Awaited, DeepPartial, DeepReadonly, DeepRequired, Equals, Func, FunctionKeys, FunctionType, IsAny, IsFunction, IsNever, IsUnknown, KeyValuePair, Merge, NonFunctionKeys, NonNullable, Nullable, NumberLiteral, Optional, Overwrite, Parameters, Required, ReturnType, StringLiteral, ValueOf };