@unicom-cloud/utils 0.1.10 → 0.1.12

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 (206) hide show
  1. package/caseName.js +11 -0
  2. package/className.js +5 -0
  3. package/clipboardCopy.js +6 -0
  4. package/constant.js +4 -0
  5. package/contentDisposition.js +7 -0
  6. package/cookie.js +7 -0
  7. package/date/convertTime.js +61 -0
  8. package/date/index.js +22 -0
  9. package/date.js +9 -0
  10. package/decimal.js +5 -0
  11. package/eventEmitter.js +4 -0
  12. package/file.js +6 -0
  13. package/filesize.js +8 -0
  14. package/index.js +56 -46
  15. package/invariant.js +4 -0
  16. package/is.js +92 -0
  17. package/lunar/index.js +36 -0
  18. package/lunar/lib/Holiday.js +42 -0
  19. package/lunar/lib/HolidayUtil.js +128 -0
  20. package/lunar/lib/I18n.js +1005 -0
  21. package/lunar/lib/JieQi.js +40 -0
  22. package/lunar/lib/Lunar.js +1035 -0
  23. package/lunar/lib/LunarMonth.js +150 -0
  24. package/lunar/lib/LunarTime.js +138 -0
  25. package/lunar/lib/LunarUtil.js +1752 -0
  26. package/lunar/lib/LunarYear.js +616 -0
  27. package/lunar/lib/ShouXingUtil.js +6915 -0
  28. package/lunar/lib/Solar.js +311 -0
  29. package/lunar/lib/SolarHalfYear.js +45 -0
  30. package/lunar/lib/SolarMonth.js +55 -0
  31. package/lunar/lib/SolarSeason.js +42 -0
  32. package/lunar/lib/SolarUtil.js +256 -0
  33. package/lunar/lib/SolarWeek.js +153 -0
  34. package/lunar/lib/SolarYear.js +35 -0
  35. package/lunar/lib/index.js +35 -0
  36. package/lunar.js +36 -0
  37. package/math.js +9 -0
  38. package/md5.js +4 -0
  39. package/mock.js +8 -0
  40. package/normalizeWheel.js +6 -0
  41. package/number-to-chinese/index.js +72 -0
  42. package/numberToChinese.js +4 -0
  43. package/nzh.js +4 -0
  44. package/object-keys-sort/index.js +7 -0
  45. package/objectKeysSort.js +2 -5
  46. package/package.json +1 -1
  47. package/random.js +15 -0
  48. package/screenfull.js +4 -0
  49. package/snapdom/src/api/preCache.js +26 -36
  50. package/snapdom/src/api/snapdom.js +78 -61
  51. package/snapdom/src/core/capture.js +54 -54
  52. package/snapdom/src/core/prepare.js +46 -37
  53. package/snapdom/src/modules/fonts.js +90 -92
  54. package/snapdom/src/modules/iconFonts.js +28 -0
  55. package/snapdom/src/modules/images.js +6 -6
  56. package/snapdom/src/modules/pseudo.js +51 -49
  57. package/snapdom/src/modules/styles.js +27 -7
  58. package/snapdom/src/modules/svgDefs.js +26 -0
  59. package/snapdom/src/utils/helpers.js +150 -103
  60. package/snapdom.js +6 -0
  61. package/tinycolor/index.js +46 -0
  62. package/tinycolor/src/conversion.js +143 -0
  63. package/tinycolor/src/css-color-names.js +153 -0
  64. package/tinycolor/src/format-input.js +77 -0
  65. package/tinycolor/src/from-ratio.js +21 -0
  66. package/tinycolor/src/index.js +404 -0
  67. package/tinycolor/src/random.js +221 -0
  68. package/tinycolor/src/readability.js +37 -0
  69. package/tinycolor/src/to-ms-filter.js +15 -0
  70. package/tinycolor/src/util.js +32 -0
  71. package/tinycolor.js +46 -0
  72. package/tree/index.js +10 -8
  73. package/tree/searchTree.js +54 -0
  74. package/tree.js +13 -0
  75. package/turboStream.js +6 -0
  76. package/types/case-name/index.d.ts +11 -0
  77. package/types/class-name/index.d.ts +2 -0
  78. package/types/clipboard-copy/index.d.ts +2 -0
  79. package/types/constant/address.d.ts +14 -0
  80. package/types/constant/chineseCharacters.d.ts +2 -0
  81. package/types/constant/constellations.d.ts +2 -0
  82. package/types/constant/domain.d.ts +2 -0
  83. package/types/constant/identity.d.ts +2 -0
  84. package/types/constant/index.d.ts +1 -0
  85. package/types/constant/keyboardCode.d.ts +158 -0
  86. package/types/constant/licensePlate.d.ts +2 -0
  87. package/types/constant/name.d.ts +4 -0
  88. package/types/constant/platform.d.ts +11 -0
  89. package/types/constant/protocol.d.ts +2 -0
  90. package/types/constant/ui.d.ts +14 -0
  91. package/types/content-disposition/index.d.ts +10 -0
  92. package/types/cookie/index.d.ts +4 -0
  93. package/types/cookie/src/index.d.ts +114 -0
  94. package/types/date/convertTime.d.ts +32 -0
  95. package/types/date/index.d.ts +4 -0
  96. package/types/decimal/decimal.d.ts +4 -0
  97. package/types/decimal/index.d.ts +1 -0
  98. package/types/event-emitter/index.d.ts +17 -0
  99. package/types/file/fileToURL.d.ts +2 -0
  100. package/types/file/index.d.ts +3 -0
  101. package/types/file/saveAs.d.ts +2 -0
  102. package/types/filesize/index.d.ts +2 -0
  103. package/types/filesize/src/constants.d.ts +42 -0
  104. package/types/filesize/src/filesize.d.ts +47 -0
  105. package/types/index.d.ts +25 -0
  106. package/types/invariant/index.d.ts +2 -0
  107. package/types/is/index.d.ts +53 -0
  108. package/types/lunar/index.d.ts +3 -0
  109. package/types/lunar/lib/Holiday.d.ts +17 -0
  110. package/types/lunar/lib/HolidayUtil.d.ts +23 -0
  111. package/types/lunar/lib/I18n.d.ts +23 -0
  112. package/types/lunar/lib/JieQi.d.ts +15 -0
  113. package/types/lunar/lib/Lunar.d.ts +245 -0
  114. package/types/lunar/lib/LunarMonth.d.ts +35 -0
  115. package/types/lunar/lib/LunarTime.d.ts +40 -0
  116. package/types/lunar/lib/LunarUtil.d.ts +128 -0
  117. package/types/lunar/lib/LunarYear.d.ts +61 -0
  118. package/types/lunar/lib/ShouXingUtil.d.ts +38 -0
  119. package/types/lunar/lib/Solar.d.ts +51 -0
  120. package/types/lunar/lib/SolarHalfYear.d.ts +15 -0
  121. package/types/lunar/lib/SolarMonth.d.ts +16 -0
  122. package/types/lunar/lib/SolarSeason.d.ts +15 -0
  123. package/types/lunar/lib/SolarUtil.d.ts +20 -0
  124. package/types/lunar/lib/SolarWeek.d.ts +23 -0
  125. package/types/lunar/lib/SolarYear.d.ts +12 -0
  126. package/types/lunar/lib/index.d.ts +17 -0
  127. package/types/math/index.d.ts +11 -0
  128. package/types/md5/index.d.ts +2 -0
  129. package/types/mock/MockWebSocket.d.ts +17 -0
  130. package/types/mock/MockXMLHttpRequest.d.ts +17 -0
  131. package/types/mock/index.d.ts +2 -0
  132. package/types/normalize-wheel/ExecutionEnvironment.d.ts +9 -0
  133. package/types/normalize-wheel/UserAgent_DEPRECATED.d.ts +86 -0
  134. package/types/normalize-wheel/index.d.ts +115 -0
  135. package/types/normalize-wheel/isEventSupported.d.ts +16 -0
  136. package/types/number-to-chinese/index.d.ts +11 -0
  137. package/types/nzh/cn.d.ts +8 -0
  138. package/types/nzh/hk.d.ts +8 -0
  139. package/types/nzh/index.d.ts +1 -0
  140. package/types/nzh/nzh.d.ts +36 -0
  141. package/types/nzh/src/autoGet.d.ts +8 -0
  142. package/types/nzh/src/index.d.ts +34 -0
  143. package/types/nzh/src/langs/cn_b.d.ts +10 -0
  144. package/types/nzh/src/langs/cn_s.d.ts +7 -0
  145. package/types/nzh/src/langs/hk_b.d.ts +10 -0
  146. package/types/nzh/src/langs/hk_s.d.ts +7 -0
  147. package/types/nzh/src/utils.d.ts +65 -0
  148. package/types/object-keys-sort/index.d.ts +4 -0
  149. package/types/random/address.d.ts +8 -0
  150. package/types/random/constellation.d.ts +2 -0
  151. package/types/random/image.d.ts +5 -0
  152. package/types/random/index.d.ts +40 -0
  153. package/types/random/licensePlate.d.ts +2 -0
  154. package/types/random/name.d.ts +9 -0
  155. package/types/random/number.d.ts +6 -0
  156. package/types/random/text.d.ts +13 -0
  157. package/types/random/time.d.ts +2 -0
  158. package/types/random/web.d.ts +11 -0
  159. package/types/screenfull/index.d.ts +10 -0
  160. package/types/snapdom/index.d.ts +1 -0
  161. package/types/snapdom/src/api/preCache.d.ts +8 -0
  162. package/types/snapdom/src/api/snapdom.d.ts +26 -0
  163. package/types/snapdom/src/core/cache.d.ts +11 -0
  164. package/types/snapdom/src/core/capture.d.ts +17 -0
  165. package/types/snapdom/src/core/clone.d.ts +11 -0
  166. package/types/snapdom/src/core/prepare.d.ts +8 -0
  167. package/types/snapdom/src/index.browser.d.ts +1 -0
  168. package/types/snapdom/src/index.d.ts +2 -0
  169. package/types/snapdom/src/modules/background.d.ts +10 -0
  170. package/types/snapdom/src/modules/fonts.d.ts +23 -0
  171. package/types/snapdom/src/modules/iconFonts.d.ts +2 -0
  172. package/types/snapdom/src/modules/images.d.ts +8 -0
  173. package/types/snapdom/src/modules/pseudo.d.ts +12 -0
  174. package/types/snapdom/src/modules/styles.d.ts +1 -0
  175. package/types/snapdom/src/modules/svgDefs.d.ts +19 -0
  176. package/types/snapdom/src/utils/cssTools.d.ts +38 -0
  177. package/types/snapdom/src/utils/helpers.d.ts +71 -0
  178. package/types/tinycolor/index.d.ts +2 -0
  179. package/types/tinycolor/src/conversion.d.ts +79 -0
  180. package/types/tinycolor/src/css-color-names.d.ts +4 -0
  181. package/types/tinycolor/src/format-input.d.ts +38 -0
  182. package/types/tinycolor/src/from-ratio.d.ts +14 -0
  183. package/types/tinycolor/src/index.d.ts +214 -0
  184. package/types/tinycolor/src/interfaces.d.ts +57 -0
  185. package/types/tinycolor/src/public_api.d.ts +10 -0
  186. package/types/tinycolor/src/random.d.ts +24 -0
  187. package/types/tinycolor/src/readability.d.ts +46 -0
  188. package/types/tinycolor/src/to-ms-filter.d.ts +5 -0
  189. package/types/tinycolor/src/umd_api.d.ts +22 -0
  190. package/types/tinycolor/src/util.d.ts +36 -0
  191. package/types/tree/index.d.ts +9 -0
  192. package/types/tree/searchTree.d.ts +20 -0
  193. package/types/turbo-stream/index.d.ts +1 -0
  194. package/types/turbo-stream/src/decode.d.ts +7 -0
  195. package/types/turbo-stream/src/encode.d.ts +27 -0
  196. package/types/turbo-stream/src/shared.d.ts +107 -0
  197. package/types/turbo-stream/src/turbo-stream.d.ts +4 -0
  198. package/types/ui-color/compareColorByRange.d.ts +2 -0
  199. package/types/ui-color/index.d.ts +183 -0
  200. package/types/url-toolkit/index.d.ts +2 -0
  201. package/types/url-toolkit/src/url-toolkit.d.ts +18 -0
  202. package/ui-color/compareColorByRange.js +9 -0
  203. package/ui-color/index.js +155 -0
  204. package/uiColor.js +28 -0
  205. package/urlToolkit.js +8 -0
  206. package/dayjs/index.js +0 -15
@@ -0,0 +1,2 @@
1
+ export const PROVINCE_CODE_ARRAY: string[];
2
+ export const PROVINCE_CODE_STRING: string;
@@ -0,0 +1,4 @@
1
+ export const FIRST_NAME_CHINESE: string[];
2
+ export const LAST_NAME_CHINESE: string[];
3
+ export const FIRST_NAME: string[];
4
+ export const LAST_NAME: string[];
@@ -0,0 +1,11 @@
1
+ export const isWeChatMiniProgram: boolean;
2
+ export const isWeChatBrowser: boolean;
3
+ export const isDingtalkBrowser: boolean;
4
+ export const isAlipayBrowser: boolean;
5
+ export const isIOS_OS: boolean;
6
+ export const isAndroidOS: boolean;
7
+ export const isHarmony: boolean;
8
+ export const isMacOS: boolean;
9
+ export const isWindowsOS: boolean;
10
+ export const isMobileDevice: boolean;
11
+ export const isPWA: boolean;
@@ -0,0 +1,2 @@
1
+ export default PROTOCOL;
2
+ declare const PROTOCOL: string[];
@@ -0,0 +1,14 @@
1
+ export const PC_KEY: "pc";
2
+ export const MOBILE_KEY: "mobile";
3
+ export const UI_COMMON_PREFIX: "pqbc";
4
+ export const UI_COMMON_KEY: "pqb-common";
5
+ export const UI_COMMON_THEME_LIGHT_CLASS_NAME: "pqbc-theme-light";
6
+ export const UI_COMMON_THEME_DARK_CLASS_NAME: "pqbc-theme-dark";
7
+ export const UI_PC_PREFIX: "pqb";
8
+ export const UI_PC_KEY: "pqb-pc";
9
+ export const UI_PC_THEME_LIGHT_CLASS_NAME: "pqb-theme-light";
10
+ export const UI_PC_THEME_DARK_CLASS_NAME: "pqb-theme-dark";
11
+ export const UI_MOBILE_PREFIX: "pqbm";
12
+ export const UI_MOBILE_KEY: "pqb-mobile";
13
+ export const UI_MOBILE_THEME_LIGHT_CLASS_NAME: "pqbm-theme-light";
14
+ export const UI_MOBILE_THEME_DARK_CLASS_NAME: "pqbm-theme-dark";
@@ -0,0 +1,10 @@
1
+ export default parseContentDisposition;
2
+ export function getContentDispositionFromHeader(params: any): Object | undefined;
3
+ export function getContentDispositionParametersFilenameFromHeader(params: any): any;
4
+ export function getContentDispositionParametersFromHeader(params: any): any;
5
+ /**
6
+ * 解析 Content-Disposition 头部
7
+ * @param {string} contentDisposition - Content-Disposition 头部字符串
8
+ * @returns {Object} 包含 disposition 类型和参数的对象
9
+ */
10
+ declare function parseContentDisposition(contentDisposition: string): Object;
@@ -0,0 +1,4 @@
1
+ export default cookie;
2
+ import * as cookie from './src';
3
+ export function splitCookiesString(cookiesString?: string): string[] | (string & any[]);
4
+ export { cookie };
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Parse options.
3
+ */
4
+ export interface ParseOptions {
5
+ /**
6
+ * Specifies a function that will be used to decode a [cookie-value](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1).
7
+ * Since the value of a cookie has a limited character set (and must be a simple string), this function can be used to decode
8
+ * a previously-encoded cookie value into a JavaScript string.
9
+ *
10
+ * The default function is the global `decodeURIComponent`, wrapped in a `try..catch`. If an error
11
+ * is thrown it will return the cookie's original value. If you provide your own encode/decode
12
+ * scheme you must ensure errors are appropriately handled.
13
+ *
14
+ * @default decode
15
+ */
16
+ decode?: (str: string) => string | undefined;
17
+ }
18
+ /**
19
+ * Parse a cookie header.
20
+ *
21
+ * Parse the given cookie header string into an object
22
+ * The object has the various cookies as keys(names) => values
23
+ */
24
+ export declare function parse(str: string, options?: ParseOptions): Record<string, string | undefined>;
25
+ /**
26
+ * Serialize options.
27
+ */
28
+ export interface SerializeOptions {
29
+ /**
30
+ * Specifies a function that will be used to encode a [cookie-value](https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1).
31
+ * Since value of a cookie has a limited character set (and must be a simple string), this function can be used to encode
32
+ * a value into a string suited for a cookie's value, and should mirror `decode` when parsing.
33
+ *
34
+ * @default encodeURIComponent
35
+ */
36
+ encode?: (str: string) => string;
37
+ /**
38
+ * Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.2).
39
+ *
40
+ * The [cookie storage model specification](https://tools.ietf.org/html/rfc6265#section-5.3) states that if both `expires` and
41
+ * `maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
42
+ * so if both are set, they should point to the same date and time.
43
+ */
44
+ maxAge?: number;
45
+ /**
46
+ * Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.1).
47
+ * When no expiration is set clients consider this a "non-persistent cookie" and delete it the current session is over.
48
+ *
49
+ * The [cookie storage model specification](https://tools.ietf.org/html/rfc6265#section-5.3) states that if both `expires` and
50
+ * `maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
51
+ * so if both are set, they should point to the same date and time.
52
+ */
53
+ expires?: Date;
54
+ /**
55
+ * Specifies the value for the [`Domain` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.3).
56
+ * When no domain is set clients consider the cookie to apply to the current domain only.
57
+ */
58
+ domain?: string;
59
+ /**
60
+ * Specifies the value for the [`Path` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.4).
61
+ * When no path is set, the path is considered the ["default path"](https://tools.ietf.org/html/rfc6265#section-5.1.4).
62
+ */
63
+ path?: string;
64
+ /**
65
+ * Enables the [`HttpOnly` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.6).
66
+ * When enabled, clients will not allow client-side JavaScript to see the cookie in `document.cookie`.
67
+ */
68
+ httpOnly?: boolean;
69
+ /**
70
+ * Enables the [`Secure` `Set-Cookie` attribute](https://tools.ietf.org/html/rfc6265#section-5.2.5).
71
+ * When enabled, clients will only send the cookie back if the browser has a HTTPS connection.
72
+ */
73
+ secure?: boolean;
74
+ /**
75
+ * Enables the [`Partitioned` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/).
76
+ * When enabled, clients will only send the cookie back when the current domain _and_ top-level domain matches.
77
+ *
78
+ * This is an attribute that has not yet been fully standardized, and may change in the future.
79
+ * This also means clients may ignore this attribute until they understand it. More information
80
+ * about can be found in [the proposal](https://github.com/privacycg/CHIPS).
81
+ */
82
+ partitioned?: boolean;
83
+ /**
84
+ * Specifies the value for the [`Priority` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1).
85
+ *
86
+ * - `'low'` will set the `Priority` attribute to `Low`.
87
+ * - `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set.
88
+ * - `'high'` will set the `Priority` attribute to `High`.
89
+ *
90
+ * More information about priority levels can be found in [the specification](https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1).
91
+ */
92
+ priority?: 'low' | 'medium' | 'high';
93
+ /**
94
+ * Specifies the value for the [`SameSite` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7).
95
+ *
96
+ * - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
97
+ * - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement.
98
+ * - `'none'` will set the `SameSite` attribute to `None` for an explicit cross-site cookie.
99
+ * - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
100
+ *
101
+ * More information about enforcement levels can be found in [the specification](https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7).
102
+ */
103
+ sameSite?: boolean | 'lax' | 'strict' | 'none';
104
+ }
105
+ /**
106
+ * Serialize data into a cookie header.
107
+ *
108
+ * Serialize a name value pair into a cookie string suitable for
109
+ * http headers. An optional options object specifies cookie parameters.
110
+ *
111
+ * serialize('foo', 'bar', { httpOnly: true })
112
+ * => "foo=bar; httpOnly"
113
+ */
114
+ export declare function serialize(name: string, val: string, options?: SerializeOptions): string;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * 时间单位定义
3
+ * @property name - 单位名称(如 "秒"、"分钟")
4
+ * @property seconds - 该单位对应的秒数
5
+ * @property max - 该单位的最大值(例如月份最大为12,小时最大为24),可选
6
+ */
7
+ interface TimeUnit {
8
+ name: string;
9
+ seconds: number;
10
+ max?: number;
11
+ }
12
+ /**
13
+ * 支持的输入单位类型
14
+ */
15
+ type InputTimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week';
16
+ /**
17
+ * 时间单位转换函数
18
+ * @param inputValue 输入的时间值
19
+ * @param options 配置选项
20
+ * @param options.inputUnit 输入单位(默认为 'second')
21
+ * @param options.units 自定义输出单位(默认为 DEFAULT_TIME_UNITS)
22
+ * @param options.maxUnitCount 最多显示几个单位(默认为全部)
23
+ * @param options.keepZero 是否保留0值单位(如 "0小时1分钟")
24
+ * @returns 格式化后的时间字符串(如 "2小时30分钟")
25
+ */
26
+ declare function convertTime(inputValue: number, options?: {
27
+ inputUnit?: InputTimeUnit;
28
+ units?: TimeUnit[];
29
+ maxUnitCount?: number;
30
+ keepZero?: boolean;
31
+ }): string;
32
+ export default convertTime;
@@ -0,0 +1,4 @@
1
+ export function convertToDurationBasedOnTimeUnits(duration: any, unit: any): string;
2
+ export function dateFormat(date: any, template: any): any;
3
+ export { default as convertTime } from "./convertTime";
4
+ export { dateFormat as dayjsFormat };
@@ -0,0 +1,4 @@
1
+ export default Decimal;
2
+ export class Decimal {
3
+ private constructor();
4
+ }
@@ -0,0 +1 @@
1
+ export { Decimal, default } from "./decimal";
@@ -0,0 +1,17 @@
1
+ export default EventEmitter;
2
+ declare class EventEmitter {
3
+ addListener: (k: any, cb: any) => void;
4
+ addEventListener: (k: any, cb: any) => void;
5
+ removeListener: (k: any, cb: any) => void;
6
+ removeEventListener: (k: any, cb: any) => void;
7
+ removeAllListeners: (k: any) => void;
8
+ removeAllEventListeners: (k: any) => void;
9
+ dispatch: (k: any, ...a: any[]) => void;
10
+ dispatchEvent: (k: any, ...a: any[]) => void;
11
+ once(k: any, cb: any): void;
12
+ on(k: any, cb: any): void;
13
+ off(k: any, cb: any): void;
14
+ offAll(k: any): void;
15
+ emit(k: any, ...a: any[]): void;
16
+ #private;
17
+ }
@@ -0,0 +1,2 @@
1
+ export default fileToURL;
2
+ export function fileToURL(file: any): Promise<any>;
@@ -0,0 +1,3 @@
1
+ import fileToURL from './fileToURL';
2
+ import saveAs from './saveAs';
3
+ export { fileToURL, saveAs };
@@ -0,0 +1,2 @@
1
+ export default saveAs;
2
+ export function saveAs(blob: any, name: any): void;
@@ -0,0 +1,2 @@
1
+ export * as filesizeConstants from "./src/constants";
2
+ export { filesize as default, filesize, partial } from "./src/filesize";
@@ -0,0 +1,42 @@
1
+ export const ARRAY: "array";
2
+ export const BIT: "bit";
3
+ export const BITS: "bits";
4
+ export const BYTE: "byte";
5
+ export const BYTES: "bytes";
6
+ export const EMPTY: "";
7
+ export const EXPONENT: "exponent";
8
+ export const FUNCTION: "function";
9
+ export const IEC: "iec";
10
+ export const INVALID_NUMBER: "Invalid number";
11
+ export const INVALID_ROUND: "Invalid rounding method";
12
+ export const JEDEC: "jedec";
13
+ export const OBJECT: "object";
14
+ export const PERIOD: ".";
15
+ export const ROUND: "round";
16
+ export const S: "s";
17
+ export const SI: "si";
18
+ export const SI_KBIT: "kbit";
19
+ export const SI_KBYTE: "kB";
20
+ export const SPACE: " ";
21
+ export const STRING: "string";
22
+ export const ZERO: "0";
23
+ export namespace STRINGS {
24
+ namespace symbol {
25
+ namespace iec {
26
+ let bits: string[];
27
+ let bytes: string[];
28
+ }
29
+ namespace jedec {
30
+ let bits_1: string[];
31
+ export { bits_1 as bits };
32
+ let bytes_1: string[];
33
+ export { bytes_1 as bytes };
34
+ }
35
+ }
36
+ namespace fullform {
37
+ let iec_1: string[];
38
+ export { iec_1 as iec };
39
+ let jedec_1: string[];
40
+ export { jedec_1 as jedec };
41
+ }
42
+ }
@@ -0,0 +1,47 @@
1
+ export function filesize(arg: any, { bits, pad, base, round, locale, localeOptions, separator, spacer, symbols, standard, output, fullform, fullforms, exponent, roundingMethod, precision, }?: {
2
+ bits?: boolean | undefined;
3
+ pad?: boolean | undefined;
4
+ base?: number | undefined;
5
+ round?: number | undefined;
6
+ locale?: string | undefined;
7
+ localeOptions?: {} | undefined;
8
+ separator?: string | undefined;
9
+ spacer?: string | undefined;
10
+ symbols?: {} | undefined;
11
+ standard?: string | undefined;
12
+ output?: string | undefined;
13
+ fullform?: boolean | undefined;
14
+ fullforms?: never[] | undefined;
15
+ exponent?: number | undefined;
16
+ roundingMethod?: string | undefined;
17
+ precision?: number | undefined;
18
+ }): string | number | any[] | {
19
+ value: any;
20
+ symbol: any;
21
+ exponent: number;
22
+ unit: string;
23
+ };
24
+ export function partial({ bits, pad, base, round, locale, localeOptions, separator, spacer, symbols, standard, output, fullform, fullforms, exponent, roundingMethod, precision, }?: {
25
+ bits?: boolean | undefined;
26
+ pad?: boolean | undefined;
27
+ base?: number | undefined;
28
+ round?: number | undefined;
29
+ locale?: string | undefined;
30
+ localeOptions?: {} | undefined;
31
+ separator?: string | undefined;
32
+ spacer?: string | undefined;
33
+ symbols?: {} | undefined;
34
+ standard?: string | undefined;
35
+ output?: string | undefined;
36
+ fullform?: boolean | undefined;
37
+ fullforms?: never[] | undefined;
38
+ exponent?: number | undefined;
39
+ roundingMethod?: string | undefined;
40
+ precision?: number | undefined;
41
+ }): (arg: any) => string | number | any[] | {
42
+ value: any;
43
+ symbol: any;
44
+ exponent: number;
45
+ unit: string;
46
+ };
47
+ export default filesize;
@@ -0,0 +1,25 @@
1
+ export * as date from "./date";
2
+ export * as is from "./is";
3
+ export * as math from "./math";
4
+ export * as tree from "./tree";
5
+ export * as turboStream from "./turbo-stream";
6
+ export * as uiColor from "./ui-color";
7
+ export * as urlToolkit from "./url-toolkit";
8
+ export { default as caseName } from "./case-name";
9
+ export { default as className } from "./class-name";
10
+ export { default as clipboardCopy } from "./clipboard-copy";
11
+ export { default as decimal } from "./decimal";
12
+ export { default as eventEmitter } from "./event-emitter";
13
+ export { default as invariant } from "./invariant";
14
+ export { default as Lunar } from "./lunar";
15
+ export { default as md5 } from "./md5";
16
+ export { default as normalizeWheel } from "./normalize-wheel";
17
+ export { default as numberToChinese } from "./number-to-chinese";
18
+ export { default as nzh } from "./nzh";
19
+ export { default as objectKeysSort } from "./object-keys-sort";
20
+ export { default as screenfull } from "./screenfull";
21
+ export { default as tinycolor } from "./tinycolor";
22
+ export { default as contentDisposition, getContentDispositionFromHeader, getContentDispositionParametersFilenameFromHeader, getContentDispositionParametersFromHeader } from "./content-disposition";
23
+ export { default as cookie, splitCookiesString } from "./cookie";
24
+ export { fileToURL, saveAs } from "./file";
25
+ export { default as filesize, filesizeConstants, partial } from "./filesize";
@@ -0,0 +1,2 @@
1
+ declare function invariant<T>(condition: T | null | undefined | boolean, message?: string, ...args: string[]): asserts condition is T;
2
+ export default invariant;
@@ -0,0 +1,53 @@
1
+ import isArguments from 'lodash/isArguments';
2
+ import isArray from 'lodash/isArray';
3
+ import isArrayBuffer from 'lodash/isArrayBuffer';
4
+ import isArrayLike from 'lodash/isArrayLike';
5
+ import isArrayLikeObject from 'lodash/isArrayLikeObject';
6
+ export function isBlob(o: any): boolean;
7
+ import isBoolean from 'lodash/isBoolean';
8
+ import isBuffer from 'lodash/isBuffer';
9
+ export function isColor(color: any): boolean;
10
+ export function isColor2(color: any): boolean;
11
+ import isDate from 'lodash/isDate';
12
+ import isElement from 'lodash/isElement';
13
+ import isEmpty from 'lodash/isEmpty';
14
+ export function isEmptyArray(o: any): boolean;
15
+ export function isEmptyObject(o: any): boolean;
16
+ export function isEmptyValue(o: any): boolean;
17
+ import isEqual from 'lodash/isEqual';
18
+ import isEqualWith from 'lodash/isEqualWith';
19
+ import isError from 'lodash/isError';
20
+ export function isFile(o: any): boolean;
21
+ import isFinite from 'lodash/isFinite';
22
+ import isFunction from 'lodash/isFunction';
23
+ import isInteger from 'lodash/isInteger';
24
+ export function isJSON(text: any): boolean;
25
+ import isLength from 'lodash/isLength';
26
+ import isMap from 'lodash/isMap';
27
+ import isMatch from 'lodash/isMatch';
28
+ import isMatchWith from 'lodash/isMatchWith';
29
+ import isNaN from 'lodash/isNaN';
30
+ import isNative from 'lodash/isNative';
31
+ import isNil from 'lodash/isNil';
32
+ import isNull from 'lodash/isNull';
33
+ import isNumber from 'lodash/isNumber';
34
+ import isObject from 'lodash/isObject';
35
+ import isObjectLike from 'lodash/isObjectLike';
36
+ import isPlainObject from 'lodash/isPlainObject';
37
+ export function isPromise(p: any): p is Promise<any>;
38
+ export const isReadableByteStreamControllerSupported: boolean;
39
+ export function isReadableStream(params: any): boolean;
40
+ export const isReadableStreamDefaultControllerSupported: boolean;
41
+ export const isReadableStreamSupported: boolean;
42
+ export const isReadableStreamSymbolAsyncIteratorSupported: any;
43
+ import isRegExp from 'lodash/isRegExp';
44
+ import isSafeInteger from 'lodash/isSafeInteger';
45
+ import isSet from 'lodash/isSet';
46
+ import isString from 'lodash/isString';
47
+ import isSymbol from 'lodash/isSymbol';
48
+ import isTypedArray from 'lodash/isTypedArray';
49
+ import isUndefined from 'lodash/isUndefined';
50
+ export function isValidColor(value: any): boolean;
51
+ import isWeakMap from 'lodash/isWeakMap';
52
+ import isWeakSet from 'lodash/isWeakSet';
53
+ export { isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet };
@@ -0,0 +1,3 @@
1
+ import * as lunar from './lib';
2
+ export * from './lib';
3
+ export default lunar;
@@ -0,0 +1,17 @@
1
+ export declare class Holiday {
2
+ private _day;
3
+ private _name;
4
+ private _work;
5
+ private _target;
6
+ constructor(day: string, name: string, work: boolean, target: string);
7
+ private static _ymd;
8
+ getDay(): string;
9
+ setDay(value: string): void;
10
+ getName(): string;
11
+ setName(value: string): void;
12
+ isWork(): boolean;
13
+ setWork(value: boolean): void;
14
+ getTarget(): string;
15
+ setTarget(value: string): void;
16
+ toString(): string;
17
+ }
@@ -0,0 +1,23 @@
1
+ import { Holiday } from './Holiday';
2
+ export declare class HolidayUtil {
3
+ static NAMES: string[];
4
+ static DATA: string;
5
+ private static _SIZE;
6
+ private static _ZERO;
7
+ private static _TAG_REMOVE;
8
+ private static _NAMES_IN_USE;
9
+ private static _DATA_IN_USE;
10
+ private static _padding;
11
+ private static _findForward;
12
+ private static _findBackward;
13
+ private static _buildHolidayForward;
14
+ private static _buildHolidayBackward;
15
+ private static _findHolidaysForward;
16
+ private static _findHolidaysBackward;
17
+ static getHoliday(yearOrYmd: number | string, month?: number, day?: number): Holiday | null;
18
+ static getHolidays(yearOrYmd: number | string, month?: number): Holiday[];
19
+ static getHolidaysByTarget(yearOrYmd: number | string, month?: number): Holiday[];
20
+ private static _fixNames;
21
+ private static _fixData;
22
+ static fix(a: any, b?: string): void;
23
+ }
@@ -0,0 +1,23 @@
1
+ export declare class I18n {
2
+ private static _INIT;
3
+ private static _MESSAGES;
4
+ private static _OBJS;
5
+ private static _DICT_STRING;
6
+ private static _DICT_NUMBER;
7
+ private static _DICT_ARRAY;
8
+ private static _ARRAYS;
9
+ private static updateArray;
10
+ private static updateStringDictionary;
11
+ private static updateNumberDictionary;
12
+ private static updateArrayDictionary;
13
+ private static update;
14
+ static setMessages(messages: {
15
+ [key: string]: string;
16
+ }): void;
17
+ static getMessage(key: string): string;
18
+ private static initArray;
19
+ private static initArrayDictionary;
20
+ private static initStringDictionary;
21
+ private static initNumberDictionary;
22
+ static init(): void;
23
+ }
@@ -0,0 +1,15 @@
1
+ import { Solar } from './Solar';
2
+ export declare class JieQi {
3
+ private _name;
4
+ private _solar;
5
+ private readonly _jie;
6
+ private readonly _qi;
7
+ constructor(name: string, solar: Solar);
8
+ getName(): string;
9
+ getSolar(): Solar;
10
+ setName(name: string): void;
11
+ setSolar(solar: Solar): void;
12
+ isJie(): boolean;
13
+ isQi(): boolean;
14
+ toString(): string;
15
+ }