@unicom-cloud/utils 0.1.16 → 0.1.18
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.
- package/class-name/index.js +5 -5
- package/constant/index.js +24 -2
- package/constant/platform.js +13 -12
- package/constant.js +24 -2
- package/content-disposition/index.js +3 -3
- package/date/convertTime.js +4 -4
- package/diff/index.js +7 -0
- package/diff/src/diff.d.ts +21 -0
- package/diff/src/diff.js +381 -0
- package/diff.js +7 -0
- package/filesize/types/constants.d.ts +81 -0
- package/filesize/types/filesize.d.ts +97 -0
- package/index.js +68 -58
- package/js-cookie/index.d.ts +116 -0
- package/js-cookie/index.js +4 -0
- package/js-cookie/src/api.js +56 -0
- package/js-cookie/src/assign.js +11 -0
- package/js-cookie/src/converter.js +14 -0
- package/jsCookie.js +4 -0
- package/lunar/lib/HolidayUtil.js +48 -49
- package/mitt/index.js +4 -0
- package/mitt/src/index.js +37 -0
- package/mitt.js +4 -0
- package/nzh/nzh.d.ts +74 -0
- package/package.json +1 -1
- package/pinyin/index.js +4 -0
- package/pinyin/simplified.js +4 -0
- package/pinyin/src/core.js +143 -0
- package/pinyin/src/simplified.js +8 -0
- package/pinyin/src/simplified_dict.js +410 -0
- package/pinyin/src/traditional.js +8 -0
- package/pinyin/src/traditional_dict.js +403 -0
- package/pinyin/traditional.js +4 -0
- package/pinyin.js +4 -0
- package/query-string/base.d.ts +717 -0
- package/query-string/base.js +268 -0
- package/query-string/index.d.ts +16 -0
- package/query-string/index.js +4 -0
- package/query-string/splitOnFirst.js +14 -0
- package/queryString.js +4 -0
- package/random/index.js +56 -35
- package/snapdom/src/api/preCache.js +51 -28
- package/snapdom/src/core/cache.js +1 -4
- package/snapdom/src/core/capture.js +45 -44
- package/snapdom/src/core/clone.js +82 -66
- package/snapdom/src/core/prepare.js +167 -45
- package/snapdom/src/modules/background.js +29 -19
- package/snapdom/src/modules/fonts.js +158 -111
- package/snapdom/src/modules/images.js +14 -9
- package/snapdom/src/modules/pseudo.js +52 -47
- package/snapdom/src/modules/styles.js +22 -22
- package/snapdom/src/modules/svgDefs.js +39 -20
- package/snapdom/src/utils/cssTools.js +58 -51
- package/snapdom/src/utils/helpers.js +197 -140
- package/snapdom/types/snapdom.d.ts +101 -0
- package/types/constant/index.d.ts +11 -0
- package/types/constant/platform.d.ts +1 -0
- package/types/diff/index.d.ts +2 -0
- package/types/diff/src/diff.d.ts +40 -0
- package/types/index.d.ts +6 -1
- package/types/js-cookie/index.d.ts +1 -0
- package/types/js-cookie/src/api.d.mts +2 -0
- package/types/js-cookie/src/assign.d.mts +1 -0
- package/types/js-cookie/src/converter.d.mts +5 -0
- package/types/mitt/index.d.ts +2 -0
- package/types/mitt/src/index.d.ts +29 -0
- package/types/pinyin/index.d.ts +1 -0
- package/types/pinyin/simplified.d.ts +1 -0
- package/types/pinyin/src/core.d.ts +3 -0
- package/types/pinyin/src/simplified.d.ts +4 -0
- package/types/pinyin/src/simplified_dict.d.ts +408 -0
- package/types/pinyin/src/traditional.d.ts +4 -0
- package/types/pinyin/src/traditional_dict.d.ts +401 -0
- package/types/pinyin/traditional.d.ts +1 -0
- package/types/query-string/base.d.ts +11 -0
- package/types/query-string/index.d.ts +2 -0
- package/types/query-string/splitOnFirst.d.ts +1 -0
- package/types/random/index.d.ts +14 -23
- package/types/snapdom/src/api/preCache.d.ts +2 -5
- package/types/snapdom/src/core/cache.d.ts +0 -3
- package/types/snapdom/src/core/clone.d.ts +1 -1
- package/types/snapdom/src/modules/background.d.ts +16 -6
- package/types/snapdom/src/modules/fonts.d.ts +5 -1
- package/types/snapdom/src/modules/pseudo.d.ts +1 -1
- package/types/snapdom/src/modules/styles.d.ts +1 -1
- package/types/snapdom/src/modules/svgDefs.d.ts +13 -13
- package/types/snapdom/src/utils/cssTools.d.ts +2 -10
- package/types/snapdom/src/utils/helpers.d.ts +13 -7
- package/types/turbo-stream/src/shared.d.ts +3 -3
- package/url-toolkit/src/url-toolkit.d.ts +22 -0
- package/event-emitter/index.js +0 -48
- package/eventEmitter.js +0 -4
- package/types/event-emitter/index.d.ts +0 -17
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
export namespace dict {
|
|
2
|
+
let yi: string;
|
|
3
|
+
let ding: string;
|
|
4
|
+
let zheng: string;
|
|
5
|
+
let kao: string;
|
|
6
|
+
let yu: string;
|
|
7
|
+
let qi: string;
|
|
8
|
+
let shang: string;
|
|
9
|
+
let xia: string;
|
|
10
|
+
let mo: string;
|
|
11
|
+
let wan: string;
|
|
12
|
+
let zhang: string;
|
|
13
|
+
let san: string;
|
|
14
|
+
let ji: string;
|
|
15
|
+
let bu: string;
|
|
16
|
+
let dun: string;
|
|
17
|
+
let fou: string;
|
|
18
|
+
let fu: string;
|
|
19
|
+
let mian: string;
|
|
20
|
+
let gai: string;
|
|
21
|
+
let chou: string;
|
|
22
|
+
let zhuan: string;
|
|
23
|
+
let cu: string;
|
|
24
|
+
let ju: string;
|
|
25
|
+
let qie: string;
|
|
26
|
+
let pi: string;
|
|
27
|
+
let shi: string;
|
|
28
|
+
let qiu: string;
|
|
29
|
+
let bing: string;
|
|
30
|
+
let ye: string;
|
|
31
|
+
let cong: string;
|
|
32
|
+
let dong: string;
|
|
33
|
+
let si: string;
|
|
34
|
+
let cheng: string;
|
|
35
|
+
let sheng: string;
|
|
36
|
+
let diu: string;
|
|
37
|
+
let liang: string;
|
|
38
|
+
let you: string;
|
|
39
|
+
let yan: string;
|
|
40
|
+
let ban: string;
|
|
41
|
+
let bang: string;
|
|
42
|
+
let sang: string;
|
|
43
|
+
let gun: string;
|
|
44
|
+
let shu: string;
|
|
45
|
+
let jiu: string;
|
|
46
|
+
let gan: string;
|
|
47
|
+
let ge: string;
|
|
48
|
+
let ya: string;
|
|
49
|
+
let zhuang: string;
|
|
50
|
+
let zhong: string;
|
|
51
|
+
let jie: string;
|
|
52
|
+
let feng: string;
|
|
53
|
+
let guan: string;
|
|
54
|
+
let kuang: string;
|
|
55
|
+
let chuan: string;
|
|
56
|
+
let chan: string;
|
|
57
|
+
let lin: string;
|
|
58
|
+
let zhuo: string;
|
|
59
|
+
let dian: string;
|
|
60
|
+
let zhu: string;
|
|
61
|
+
let ha: string;
|
|
62
|
+
let dan: string;
|
|
63
|
+
let wei: string;
|
|
64
|
+
let jing: string;
|
|
65
|
+
let li: string;
|
|
66
|
+
let pie: string;
|
|
67
|
+
let ai: string;
|
|
68
|
+
let nai: string;
|
|
69
|
+
let wu: string;
|
|
70
|
+
let tuo: string;
|
|
71
|
+
let zhe: string;
|
|
72
|
+
let ma: string;
|
|
73
|
+
let me: string;
|
|
74
|
+
let yao: string;
|
|
75
|
+
let xi: string;
|
|
76
|
+
let zhi: string;
|
|
77
|
+
let zha: string;
|
|
78
|
+
let zuo: string;
|
|
79
|
+
let hu: string;
|
|
80
|
+
let fa: string;
|
|
81
|
+
let le: string;
|
|
82
|
+
let luo: string;
|
|
83
|
+
let yue: string;
|
|
84
|
+
let pan: string;
|
|
85
|
+
let yin: string;
|
|
86
|
+
let ping: string;
|
|
87
|
+
let pang: string;
|
|
88
|
+
let jiao: string;
|
|
89
|
+
let qiao: string;
|
|
90
|
+
let guai: string;
|
|
91
|
+
let jue: string;
|
|
92
|
+
let mie: string;
|
|
93
|
+
let nie: string;
|
|
94
|
+
let xiang: string;
|
|
95
|
+
let dou: string;
|
|
96
|
+
let nang: string;
|
|
97
|
+
let mai: string;
|
|
98
|
+
let luan: string;
|
|
99
|
+
let ru: string;
|
|
100
|
+
let xue: string;
|
|
101
|
+
let sha: string;
|
|
102
|
+
let na: string;
|
|
103
|
+
let qian: string;
|
|
104
|
+
let cui: string;
|
|
105
|
+
let gui: string;
|
|
106
|
+
let liao: string;
|
|
107
|
+
let zi: string;
|
|
108
|
+
let er: string;
|
|
109
|
+
let chu: string;
|
|
110
|
+
let xu: string;
|
|
111
|
+
let kui: string;
|
|
112
|
+
let yun: string;
|
|
113
|
+
let sui: string;
|
|
114
|
+
let gen: string;
|
|
115
|
+
let xuan: string;
|
|
116
|
+
let geng: string;
|
|
117
|
+
let e: string;
|
|
118
|
+
let suo: string;
|
|
119
|
+
let xie: string;
|
|
120
|
+
let zhai: string;
|
|
121
|
+
let tou: string;
|
|
122
|
+
let wen: string;
|
|
123
|
+
let wang: string;
|
|
124
|
+
let gang: string;
|
|
125
|
+
let kang: string;
|
|
126
|
+
let da: string;
|
|
127
|
+
let hai: string;
|
|
128
|
+
let heng: string;
|
|
129
|
+
let peng: string;
|
|
130
|
+
let mu: string;
|
|
131
|
+
let ting: string;
|
|
132
|
+
let qin: string;
|
|
133
|
+
let qing: string;
|
|
134
|
+
let bo: string;
|
|
135
|
+
let zhan: string;
|
|
136
|
+
let lian: string;
|
|
137
|
+
let duo: string;
|
|
138
|
+
let men: string;
|
|
139
|
+
let ren: string;
|
|
140
|
+
let shen: string;
|
|
141
|
+
let ze: string;
|
|
142
|
+
let jin: string;
|
|
143
|
+
let nu: string;
|
|
144
|
+
let pu: string;
|
|
145
|
+
let ba: string;
|
|
146
|
+
let fo: string;
|
|
147
|
+
let tao: string;
|
|
148
|
+
let lun: string;
|
|
149
|
+
let cang: string;
|
|
150
|
+
let chuang: string;
|
|
151
|
+
let zai: string;
|
|
152
|
+
let ta: string;
|
|
153
|
+
let xian: string;
|
|
154
|
+
let cha: string;
|
|
155
|
+
let hong: string;
|
|
156
|
+
let tong: string;
|
|
157
|
+
let han: string;
|
|
158
|
+
let dai: string;
|
|
159
|
+
let ling: string;
|
|
160
|
+
let chao: string;
|
|
161
|
+
let chang: string;
|
|
162
|
+
let sa: string;
|
|
163
|
+
let fan: string;
|
|
164
|
+
let miao: string;
|
|
165
|
+
let ang: string;
|
|
166
|
+
let yang: string;
|
|
167
|
+
let bi: string;
|
|
168
|
+
let wo: string;
|
|
169
|
+
let jian: string;
|
|
170
|
+
let mou: string;
|
|
171
|
+
let jia: string;
|
|
172
|
+
let bin: string;
|
|
173
|
+
let fen: string;
|
|
174
|
+
let di: string;
|
|
175
|
+
let fang: string;
|
|
176
|
+
let pei: string;
|
|
177
|
+
let diao: string;
|
|
178
|
+
let xin: string;
|
|
179
|
+
let xiu: string;
|
|
180
|
+
let tang: string;
|
|
181
|
+
let huo: string;
|
|
182
|
+
let hui: string;
|
|
183
|
+
let kuai: string;
|
|
184
|
+
let kuo: string;
|
|
185
|
+
let zu: string;
|
|
186
|
+
let che: string;
|
|
187
|
+
let chen: string;
|
|
188
|
+
let xun: string;
|
|
189
|
+
let bai: string;
|
|
190
|
+
let gu: string;
|
|
191
|
+
let ni: string;
|
|
192
|
+
let zhou: string;
|
|
193
|
+
let qu: string;
|
|
194
|
+
let ci: string;
|
|
195
|
+
let beng: string;
|
|
196
|
+
let ga: string;
|
|
197
|
+
let chi: string;
|
|
198
|
+
let tian: string;
|
|
199
|
+
let tan: string;
|
|
200
|
+
let qia: string;
|
|
201
|
+
let shao: string;
|
|
202
|
+
let zhao: string;
|
|
203
|
+
let ben: string;
|
|
204
|
+
let ti: string;
|
|
205
|
+
let he: string;
|
|
206
|
+
let she: string;
|
|
207
|
+
let tu: string;
|
|
208
|
+
let die: string;
|
|
209
|
+
let gou: string;
|
|
210
|
+
let kou: string;
|
|
211
|
+
let ning: string;
|
|
212
|
+
let yong: string;
|
|
213
|
+
let wa: string;
|
|
214
|
+
let ka: string;
|
|
215
|
+
let bao: string;
|
|
216
|
+
let huai: string;
|
|
217
|
+
let lao: string;
|
|
218
|
+
let ming: string;
|
|
219
|
+
let hen: string;
|
|
220
|
+
let quan: string;
|
|
221
|
+
let tiao: string;
|
|
222
|
+
let xiao: string;
|
|
223
|
+
let xing: string;
|
|
224
|
+
let kan: string;
|
|
225
|
+
let lai: string;
|
|
226
|
+
let hua: string;
|
|
227
|
+
let kua: string;
|
|
228
|
+
let guang: string;
|
|
229
|
+
let lie: string;
|
|
230
|
+
let mi: string;
|
|
231
|
+
let an: string;
|
|
232
|
+
let lu: string;
|
|
233
|
+
let mao: string;
|
|
234
|
+
let gong: string;
|
|
235
|
+
let cun: string;
|
|
236
|
+
let lv: string;
|
|
237
|
+
let zhen: string;
|
|
238
|
+
let ce: string;
|
|
239
|
+
let chai: string;
|
|
240
|
+
let nong: string;
|
|
241
|
+
let hou: string;
|
|
242
|
+
let jiong: string;
|
|
243
|
+
let tui: string;
|
|
244
|
+
let nan: string;
|
|
245
|
+
let bian: string;
|
|
246
|
+
let pian: string;
|
|
247
|
+
let chuo: string;
|
|
248
|
+
let ku: string;
|
|
249
|
+
let jun: string;
|
|
250
|
+
let shun: string;
|
|
251
|
+
let lang: string;
|
|
252
|
+
let hun: string;
|
|
253
|
+
let ying: string;
|
|
254
|
+
let su: string;
|
|
255
|
+
let dao: string;
|
|
256
|
+
let lia: string;
|
|
257
|
+
let pai: string;
|
|
258
|
+
let biao: string;
|
|
259
|
+
let fei: string;
|
|
260
|
+
let bei: string;
|
|
261
|
+
let zong: string;
|
|
262
|
+
let chui: string;
|
|
263
|
+
let zhui: string;
|
|
264
|
+
let kong: string;
|
|
265
|
+
let juan: string;
|
|
266
|
+
let song: string;
|
|
267
|
+
let cai: string;
|
|
268
|
+
let ruan: string;
|
|
269
|
+
let chong: string;
|
|
270
|
+
let chun: string;
|
|
271
|
+
let re: string;
|
|
272
|
+
let ruo: string;
|
|
273
|
+
let dang: string;
|
|
274
|
+
let huang: string;
|
|
275
|
+
let zou: string;
|
|
276
|
+
let duan: string;
|
|
277
|
+
let ou: string;
|
|
278
|
+
let zan: string;
|
|
279
|
+
let liu: string;
|
|
280
|
+
let lou: string;
|
|
281
|
+
let sou: string;
|
|
282
|
+
let yuan: string;
|
|
283
|
+
let rong: string;
|
|
284
|
+
let jiang: string;
|
|
285
|
+
let hao: string;
|
|
286
|
+
let shan: string;
|
|
287
|
+
let que: string;
|
|
288
|
+
let nuo: string;
|
|
289
|
+
let ca: string;
|
|
290
|
+
let can: string;
|
|
291
|
+
let lei: string;
|
|
292
|
+
let cao: string;
|
|
293
|
+
let zao: string;
|
|
294
|
+
let shuang: string;
|
|
295
|
+
let ao: string;
|
|
296
|
+
let piao: string;
|
|
297
|
+
let man: string;
|
|
298
|
+
let lan: string;
|
|
299
|
+
let zun: string;
|
|
300
|
+
let cuan: string;
|
|
301
|
+
let deng: string;
|
|
302
|
+
let teng: string;
|
|
303
|
+
let tie: string;
|
|
304
|
+
let ceng: string;
|
|
305
|
+
let seng: string;
|
|
306
|
+
let zen: string;
|
|
307
|
+
let min: string;
|
|
308
|
+
let sai: string;
|
|
309
|
+
let tai: string;
|
|
310
|
+
let meng: string;
|
|
311
|
+
let qiong: string;
|
|
312
|
+
let la: string;
|
|
313
|
+
let du: string;
|
|
314
|
+
let long: string;
|
|
315
|
+
let rang: string;
|
|
316
|
+
let xiong: string;
|
|
317
|
+
let dui: string;
|
|
318
|
+
let rui: string;
|
|
319
|
+
let ke: string;
|
|
320
|
+
let nei: string;
|
|
321
|
+
let shou: string;
|
|
322
|
+
let ran: string;
|
|
323
|
+
let gua: string;
|
|
324
|
+
let mei: string;
|
|
325
|
+
let zhun: string;
|
|
326
|
+
let cou: string;
|
|
327
|
+
let kai: string;
|
|
328
|
+
let guo: string;
|
|
329
|
+
let bie: string;
|
|
330
|
+
let pao: string;
|
|
331
|
+
let shua: string;
|
|
332
|
+
let cuo: string;
|
|
333
|
+
let pou: string;
|
|
334
|
+
let tuan: string;
|
|
335
|
+
let qiang: string;
|
|
336
|
+
let zuan: string;
|
|
337
|
+
let keng: string;
|
|
338
|
+
let gao: string;
|
|
339
|
+
let weng: string;
|
|
340
|
+
let pin: string;
|
|
341
|
+
let nao: string;
|
|
342
|
+
let za: string;
|
|
343
|
+
let zang: string;
|
|
344
|
+
let suan: string;
|
|
345
|
+
let nian: string;
|
|
346
|
+
let shuai: string;
|
|
347
|
+
let kun: string;
|
|
348
|
+
let mang: string;
|
|
349
|
+
let zui: string;
|
|
350
|
+
let rou: string;
|
|
351
|
+
let cen: string;
|
|
352
|
+
let pa: string;
|
|
353
|
+
let po: string;
|
|
354
|
+
let a: string;
|
|
355
|
+
let tun: string;
|
|
356
|
+
let pen: string;
|
|
357
|
+
let hang: string;
|
|
358
|
+
let ne: string;
|
|
359
|
+
let wai: string;
|
|
360
|
+
let n: string;
|
|
361
|
+
let dei: string;
|
|
362
|
+
let yo: string;
|
|
363
|
+
let o: string;
|
|
364
|
+
let sao: string;
|
|
365
|
+
let shuo: string;
|
|
366
|
+
let en: string;
|
|
367
|
+
let huan: string;
|
|
368
|
+
let nou: string;
|
|
369
|
+
let ken: string;
|
|
370
|
+
let chuai: string;
|
|
371
|
+
let se: string;
|
|
372
|
+
let sun: string;
|
|
373
|
+
let hei: string;
|
|
374
|
+
let dia: string;
|
|
375
|
+
let de: string;
|
|
376
|
+
let zhuai: string;
|
|
377
|
+
let nin: string;
|
|
378
|
+
let qun: string;
|
|
379
|
+
let ri: string;
|
|
380
|
+
let zeng: string;
|
|
381
|
+
let nv: string;
|
|
382
|
+
let nuan: string;
|
|
383
|
+
let niu: string;
|
|
384
|
+
let rao: string;
|
|
385
|
+
let shui: string;
|
|
386
|
+
let nve: string;
|
|
387
|
+
let nen: string;
|
|
388
|
+
let niao: string;
|
|
389
|
+
let kuan: string;
|
|
390
|
+
let shuan: string;
|
|
391
|
+
let zhua: string;
|
|
392
|
+
let sen: string;
|
|
393
|
+
let shai: string;
|
|
394
|
+
let run: string;
|
|
395
|
+
let neng: string;
|
|
396
|
+
let miu: string;
|
|
397
|
+
let gei: string;
|
|
398
|
+
let zei: string;
|
|
399
|
+
}
|
|
400
|
+
export default traditional;
|
|
401
|
+
declare namespace traditional { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./src/traditional";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function extract(input: any): any;
|
|
2
|
+
export function parse(query: any, options: any): any;
|
|
3
|
+
export function stringify(object: any, options: any): string;
|
|
4
|
+
export function parseUrl(url: any, options: any): {
|
|
5
|
+
fragmentIdentifier?: any;
|
|
6
|
+
url: string;
|
|
7
|
+
query: any;
|
|
8
|
+
};
|
|
9
|
+
export function stringifyUrl(object: any, options: any): string;
|
|
10
|
+
export function pick(input: any, filter: any, options: any): string;
|
|
11
|
+
export function exclude(input: any, filter: any, options: any): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function splitOnFirst(string: any, separator: any): string[];
|
package/types/random/index.d.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
export { number };
|
|
3
|
-
export let natural: (min?: number, max?: number) => number;
|
|
4
|
-
export let integer: (min?: number, max?: number) => number;
|
|
5
|
-
export let float: (min: any, max: any) => number;
|
|
6
|
-
export function boolean(): boolean;
|
|
7
|
-
export function sex(): string;
|
|
8
|
-
export { sample as pick };
|
|
9
|
-
export { text };
|
|
10
|
-
export let ctitle: (min: any, max: any) => string;
|
|
11
|
-
export let cparagraph: (min: any, max: any) => string;
|
|
12
|
-
export let csentence: (min: any, max: any) => string;
|
|
13
|
-
export let cword: (pool: any, min: any, max: any, ...args: any[]) => string;
|
|
14
|
-
export { name };
|
|
15
|
-
export let cname: () => string;
|
|
16
|
-
export { web };
|
|
17
|
-
export let phone: () => string;
|
|
18
|
-
export { address };
|
|
19
2
|
export function county(p: any): string;
|
|
20
3
|
export function company(): string;
|
|
21
4
|
export function project(): string;
|
|
@@ -26,15 +9,23 @@ declare namespace _default {
|
|
|
26
9
|
export function id(): number;
|
|
27
10
|
export function increment(step: any): number;
|
|
28
11
|
export { image };
|
|
12
|
+
export { address };
|
|
13
|
+
export { web };
|
|
14
|
+
export { name };
|
|
15
|
+
export { text };
|
|
16
|
+
export function boolean(): boolean;
|
|
17
|
+
export function sex(): string;
|
|
18
|
+
export { sample as pick };
|
|
19
|
+
export { number };
|
|
29
20
|
}
|
|
30
21
|
export default _default;
|
|
31
|
-
import number from './number';
|
|
32
|
-
import sample from 'lodash/sample';
|
|
33
|
-
import text from './text';
|
|
34
|
-
import name from './name';
|
|
35
|
-
import web from './web';
|
|
36
|
-
import address from './address';
|
|
37
22
|
import time from './time';
|
|
38
23
|
import constellation from './constellation';
|
|
39
24
|
import licensePlate from './licensePlate';
|
|
40
25
|
import image from './image';
|
|
26
|
+
import address from './address';
|
|
27
|
+
import web from './web';
|
|
28
|
+
import name from './name';
|
|
29
|
+
import text from './text';
|
|
30
|
+
import sample from 'lodash/sample';
|
|
31
|
+
import number from './number';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Preloads images, background images, and optionally fonts into cache before DOM capture.
|
|
3
|
-
*
|
|
4
|
-
* @param {Document|Element} [root=document] - The root node to search for resources
|
|
5
|
-
* @param {Object} [options={}] - Pre-caching options
|
|
6
|
-
* @returns {Promise<void>} Resolves when all resources are pre-cached
|
|
3
|
+
* Nunca deja promesas rechazadas sin manejar (evita unhandled rejections).
|
|
7
4
|
*/
|
|
8
|
-
export function preCache(root?: Document
|
|
5
|
+
export function preCache(root?: Document, options?: {}): Promise<void>;
|
|
@@ -8,9 +8,6 @@ export namespace cache {
|
|
|
8
8
|
export let font: Set<any>;
|
|
9
9
|
export let snapshot: WeakMap<WeakKey, any>;
|
|
10
10
|
export let snapshotKey: Map<any, any>;
|
|
11
|
-
export let preStyleMap: Map<any, any>;
|
|
12
|
-
export let preStyle: WeakMap<WeakKey, any>;
|
|
13
|
-
export let preNodeMap: Map<any, any>;
|
|
14
11
|
export { resetCache as reset };
|
|
15
12
|
}
|
|
16
13
|
declare function resetCache(): void;
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* @param {Node} [originalRoot] - Original root element being captured
|
|
8
8
|
* @returns {Node|null} Cloned node with styles and shadow DOM content, or null for empty text nodes or filtered elements
|
|
9
9
|
*/
|
|
10
|
-
export function deepClone(node: Node, compress: boolean, options?: Object, originalRoot?: Node): Node | null;
|
|
10
|
+
export function deepClone(node: Node, styleMap: any, styleCache: any, nodeMap: any, compress: boolean, options?: Object, originalRoot?: Node): Node | null;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Recursively inlines background-related images and masks from the source element to its clone.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* This function walks through the source DOM tree and its clone, copying inline styles for
|
|
5
|
+
* background images, masks, and border images to ensure the clone retains all visual image
|
|
6
|
+
* resources inline (e.g., data URLs), avoiding external dependencies.
|
|
7
|
+
*
|
|
8
|
+
* It also preserves the `background-color` property if it is not transparent.
|
|
9
|
+
*
|
|
10
|
+
* Special handling is done for `border-image` related properties: the
|
|
11
|
+
* `border-image-slice`, `border-image-width`, `border-image-outset`, and `border-image-repeat`
|
|
12
|
+
* are only copied if `border-image` or `border-image-source` are present and active.
|
|
13
|
+
*
|
|
14
|
+
* @param {HTMLElement} source The original source element from which styles are read.
|
|
15
|
+
* @param {HTMLElement} clone The cloned element to which inline styles are applied.
|
|
16
|
+
* @param {Object} [options={}] Optional parameters passed to image inlining functions.
|
|
17
|
+
* @returns {Promise<void>} Resolves when all inlining operations (including async image fetches) complete.
|
|
8
18
|
*/
|
|
9
|
-
export function inlineBackgroundImages(source:
|
|
19
|
+
export function inlineBackgroundImages(source: HTMLElement, clone: HTMLElement, styleCache: any, options?: Object): Promise<void>;
|
|
@@ -16,8 +16,12 @@ export function iconToImage(unicodeChar: string, fontFamily: string, fontWeight:
|
|
|
16
16
|
* @export
|
|
17
17
|
* @param {Object} options
|
|
18
18
|
* @param {boolean} [options.preCached=false] - Whether to use pre-cached resources
|
|
19
|
+
* @param {Object} [options.localFonts=[]] - Additional local fonts to embed
|
|
20
|
+
* @param {string} [options.useProxy=''] - Optional proxy for font fetching
|
|
19
21
|
* @returns {Promise<string>} The inlined CSS for custom fonts
|
|
20
22
|
*/
|
|
21
|
-
export function embedCustomFonts({ preCached }?: {
|
|
23
|
+
export function embedCustomFonts({ preCached, localFonts, useProxy, }?: {
|
|
22
24
|
preCached?: boolean | undefined;
|
|
25
|
+
localFonts?: Object | undefined;
|
|
26
|
+
useProxy?: string | undefined;
|
|
23
27
|
}): Promise<string>;
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* @param {boolean} embedFonts - Whether to embed icon fonts as images
|
|
8
8
|
* @returns {Promise} Promise that resolves when all pseudo-elements are processed
|
|
9
9
|
*/
|
|
10
|
-
export function inlinePseudoElements(source: Element, clone: Element, options: any): Promise<any>;
|
|
10
|
+
export function inlinePseudoElements(source: Element, clone: Element, styleMap: any, styleCache: any, options: any): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function inlineAllStyles(source: any, clone: any, compress: any): void;
|
|
1
|
+
export function inlineAllStyles(source: any, clone: any, styleMap: any, cache: any, compress: any): void;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Ensures that all external <symbol> or <defs> elements referenced by <use>
|
|
3
|
+
* inside the given root element are inlined into it.
|
|
4
4
|
*
|
|
5
|
-
* This is
|
|
6
|
-
*
|
|
5
|
+
* This is necessary when capturing or exporting an SVG fragment that relies on
|
|
6
|
+
* definitions existing elsewhere in the document, ensuring it remains
|
|
7
|
+
* self-contained and renders correctly.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* Process:
|
|
10
|
+
* 1. Collect all IDs referenced by <use> elements in the root.
|
|
11
|
+
* 2. Look up those IDs in the global document (outside the root).
|
|
12
|
+
* 3. Create or reuse a hidden <svg> container inside the root to hold inlined defs.
|
|
13
|
+
* 4. Only insert missing <symbol>/<defs> elements that are not already present.
|
|
10
14
|
*
|
|
11
|
-
*
|
|
12
|
-
* @param {ParentNode} root - The root node containing cloned SVGs (usually the result of a DOM snapshot).
|
|
13
|
-
* @returns {void}
|
|
15
|
+
* Existing definitions in the root are never modified or removed.
|
|
14
16
|
*
|
|
15
|
-
* @
|
|
16
|
-
* const { clone } = await prepareClone(element);
|
|
17
|
-
* inlineExternalDef(clone);
|
|
17
|
+
* @param {HTMLElement} rootElement - The root element being processed (typically the cloned DOM fragment).
|
|
18
18
|
*/
|
|
19
|
-
export function
|
|
19
|
+
export function inlineExternalDefsAndSymbols(rootElement: HTMLElement): void;
|
|
@@ -6,15 +6,7 @@ export function precacheCommonTags(): void;
|
|
|
6
6
|
* @returns {Object} Object containing default values for all CSS properties
|
|
7
7
|
*/
|
|
8
8
|
export function getDefaultStyleForTag(tagName: string): Object;
|
|
9
|
-
|
|
10
|
-
* Creates a unique key from an element's computed style that differs from defaults.
|
|
11
|
-
*
|
|
12
|
-
* @param {Object} snapshot - Computed style snapshot
|
|
13
|
-
* @param {string} tagName - The tag name of the element
|
|
14
|
-
* @param {boolean} [compress=false] - Whether to compress style keys
|
|
15
|
-
* @returns {string} Semi-colon separated list of non-default properties
|
|
16
|
-
*/
|
|
17
|
-
export function getStyleKey(snapshot: Object, tagName: string, compress?: boolean): string;
|
|
9
|
+
export function getStyleKey(snapshot: any, tagName: any, compress?: boolean): string;
|
|
18
10
|
/**
|
|
19
11
|
* Collects all unique tag names used in the DOM tree rooted at the given node.
|
|
20
12
|
*
|
|
@@ -34,4 +26,4 @@ export function generateDedupedBaseCSS(usedTagNames: string[]): string;
|
|
|
34
26
|
*
|
|
35
27
|
* @returns {Map} Map of style keys to class names
|
|
36
28
|
*/
|
|
37
|
-
export function generateCSSClasses(): Map<any, any>;
|
|
29
|
+
export function generateCSSClasses(styleMap: any): Map<any, any>;
|
|
@@ -49,14 +49,20 @@ export function extractURL(value: string): string | null;
|
|
|
49
49
|
*/
|
|
50
50
|
export function isIconFont(familyOrUrl: string): boolean;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @
|
|
55
|
-
* @param {
|
|
56
|
-
* @
|
|
57
|
-
* @return {*}
|
|
52
|
+
* Fetch a resource with optional proxy fallback.
|
|
53
|
+
* @param {string} url - Resource URL
|
|
54
|
+
* @param {Object} [options]
|
|
55
|
+
* @param {string} [options.useProxy=''] - Proxy prefix
|
|
56
|
+
* @returns {Promise<Response>} The fetched response
|
|
58
57
|
*/
|
|
59
|
-
export function
|
|
58
|
+
export function fetchResource(url: string, { useProxy }?: {
|
|
59
|
+
useProxy?: string | undefined;
|
|
60
|
+
}): Promise<Response>;
|
|
61
|
+
export function fetchImage(src: any, { timeout, useProxy, errorTTL }?: {
|
|
62
|
+
timeout?: number | undefined;
|
|
63
|
+
useProxy?: string | undefined;
|
|
64
|
+
errorTTL?: number | undefined;
|
|
65
|
+
}): any;
|
|
60
66
|
/**
|
|
61
67
|
*
|
|
62
68
|
*
|
|
@@ -80,11 +80,11 @@ export declare class TurboBlob extends Blob {
|
|
|
80
80
|
text(): Promise<string>;
|
|
81
81
|
}
|
|
82
82
|
declare const FileBaseClass: {
|
|
83
|
-
new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
|
|
84
|
-
prototype: File;
|
|
85
|
-
} | {
|
|
86
83
|
new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
|
|
87
84
|
prototype: Blob;
|
|
85
|
+
} | {
|
|
86
|
+
new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
|
|
87
|
+
prototype: File;
|
|
88
88
|
};
|
|
89
89
|
export declare class TurboFile extends FileBaseClass {
|
|
90
90
|
#private;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export as namespace URLToolkit;
|
|
2
|
+
|
|
3
|
+
export type URLParts = {
|
|
4
|
+
scheme: string;
|
|
5
|
+
netLoc: string;
|
|
6
|
+
path: string;
|
|
7
|
+
params: string;
|
|
8
|
+
query: string;
|
|
9
|
+
fragment: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function buildAbsoluteURL(
|
|
13
|
+
baseURL: string,
|
|
14
|
+
relativeURL: string,
|
|
15
|
+
opts?: { alwaysNormalize?: boolean },
|
|
16
|
+
): string;
|
|
17
|
+
|
|
18
|
+
export function parseURL(url: string): URLParts | null;
|
|
19
|
+
|
|
20
|
+
export function normalizePath(path: string): string;
|
|
21
|
+
|
|
22
|
+
export function buildURLFromParts(parts: URLParts): string;
|