ddan-js 2.8.9 → 2.8.11

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.
@@ -0,0 +1,1073 @@
1
+ export { Ddan } from './typings';
2
+ import Http from './modules/http';
3
+ import Event from './class/event';
4
+ import Store from './class/store';
5
+ import Persist from './class/persist';
6
+ import KValue from './class/kvalue';
7
+ import Mapping from './class/mapping';
8
+ declare const dUtil: {
9
+ Event: typeof Event;
10
+ includes: typeof import("./util/includes").default;
11
+ forof: (source: any, cb: (key: any, val: any) => void) => void;
12
+ singleton: <T>() => {
13
+ new (): {};
14
+ __instance__: any;
15
+ readonly Instance: T;
16
+ readonly I: T;
17
+ };
18
+ getset: <T_1 = any>(t?: T_1 | undefined) => import("./typings").Ddan.IGetset<T_1>;
19
+ copy: (source: any, options?: {
20
+ fields?: string[] | undefined;
21
+ camel?: boolean | undefined;
22
+ pure?: boolean | undefined;
23
+ } & import("./typings").Ddan.IIgnoreParams) => any;
24
+ clone: (source: any) => any;
25
+ merge: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => {};
26
+ isEmpty: (source: any) => boolean;
27
+ parseValue: (source: any, { number, boolean }?: {
28
+ number?: boolean | undefined;
29
+ boolean?: boolean | undefined;
30
+ }) => any;
31
+ cloneClass: <T_2>(source: T_2) => T_2;
32
+ combine: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => any;
33
+ combines: (objs: any[], options?: import("./typings").Ddan.IIgnoreParams) => {};
34
+ observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
35
+ find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
36
+ getTag: (value: any) => string;
37
+ getType: (value: any) => string;
38
+ toString: () => string;
39
+ hasOwnProperty: (v: PropertyKey) => boolean;
40
+ propertyIsEnumerable: (v: PropertyKey) => boolean;
41
+ is: (val: any, type: string) => boolean;
42
+ isNumber: (value: any) => boolean;
43
+ isString: (value: any) => boolean;
44
+ isObject: (value: any) => boolean;
45
+ isObjectLike: (value: any) => boolean;
46
+ isPlainObject: (value: any) => boolean;
47
+ isSymbol: (value: any) => boolean;
48
+ isFunction: (value: any) => boolean;
49
+ isArray: (arg: any) => arg is any[];
50
+ isArrayLikeObject: (value: any) => boolean;
51
+ isIndex: (value: any, length: number) => boolean;
52
+ isArrayLike: (value: any) => boolean;
53
+ isPrototype: (value: any) => boolean;
54
+ isArguments: (value: any) => boolean;
55
+ isPromise: (value: any) => boolean;
56
+ isBrowser: boolean;
57
+ isNode: boolean;
58
+ isBlobOrBuffer: (data: any) => boolean;
59
+ isUint8Array: (data: any) => boolean;
60
+ isArrayBuffer: (data: any) => boolean;
61
+ base64: {
62
+ encode: (input: string) => string;
63
+ decode: (base64Str: string) => string;
64
+ encodeByOss: (input: string) => string;
65
+ };
66
+ tea: {
67
+ TEAKey: string;
68
+ encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
69
+ decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
70
+ toTeaKey: (str: string) => Uint32Array;
71
+ encode: (plaintext: string, key: string) => string;
72
+ decode: (ciphertext: string, key: string) => string;
73
+ encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
74
+ decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
75
+ };
76
+ uuid: (len?: number, radix?: number) => string;
77
+ guid: (len: number, prefix?: boolean, sep?: string) => string;
78
+ getHexString: (len: number) => string;
79
+ keyNumber: string;
80
+ keyLower: string;
81
+ keyUpper: string;
82
+ keyChars: string;
83
+ str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
84
+ ab2str: (data: ArrayBuffer, base64?: boolean) => string;
85
+ utf8ToBase64: (str: string) => string;
86
+ base64ToUtf8: (base64Str: string) => string;
87
+ getRandomBytes: (length: number) => Uint8Array;
88
+ textEncode: (text: string) => Uint8Array;
89
+ textDecode: (buf: ArrayBufferLike) => string;
90
+ toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
91
+ toBase64: (input?: string) => string;
92
+ fromBase64: (input?: string) => string;
93
+ bytesToBase64: (bytes: Uint8Array) => string;
94
+ base64ToBytes: (input?: string) => Uint8Array;
95
+ toUtf8: (content: string) => string;
96
+ fromUtf8: (utftext: string) => string;
97
+ toUtf8Bytes: (content: string) => Uint8Array;
98
+ fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
99
+ pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
100
+ pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
101
+ bytes2str: (bytes: Uint8Array) => string;
102
+ str2bytes: (str?: string) => Uint8Array;
103
+ str2hex: (str: string) => string;
104
+ hex2str: (hexstr: string) => string;
105
+ concatBytes: (...args: Uint8Array[]) => Uint8Array;
106
+ uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
107
+ bytesToUint32: (bytes: Uint8Array) => Uint32Array;
108
+ hex2bytes: (hex: string) => Uint8Array;
109
+ bytes2hex: (bytes: Uint8Array) => string;
110
+ toUint32: (str: string) => Uint32Array;
111
+ fromUint32: (uint32: Uint32Array) => string;
112
+ flatten: <T_3>(data: T_3[], recursive?: boolean, list?: T_3[]) => T_3[];
113
+ gbk: {
114
+ gbkLength: (str: string) => number;
115
+ gbkCut: (source: string, len: number) => string;
116
+ };
117
+ math: {
118
+ random: (max: number) => number;
119
+ randomRange: (min: number, max: number) => number;
120
+ lerp: (start: number, end: number, t: number) => number;
121
+ randoms: (max: number, count?: number, repeat?: boolean) => number[];
122
+ strip: (num: string | number, digits?: number) => number;
123
+ float: (num: string | number, { digits, fixed }?: {
124
+ digits?: number | undefined;
125
+ fixed?: boolean | undefined;
126
+ }) => number;
127
+ radian2degree: (radians: number) => number;
128
+ degree2radian: (degrees: number) => number;
129
+ calcDataSize: (data: number) => {
130
+ gb: number;
131
+ mb: number;
132
+ kb: number;
133
+ b: number;
134
+ total: number;
135
+ desc: string;
136
+ };
137
+ };
138
+ list: {
139
+ stepAction: <T_4>(list: T_4[], func: import("./typings").Ddan.Task<T_4, void>, stepCount?: number) => void;
140
+ skip: <T_5>(list: T_5[], count: number) => T_5[];
141
+ take: <T_6>(list: T_6[], count: number, skip?: number) => T_6[];
142
+ distinct: <T_7>(list: T_7[]) => T_7[];
143
+ randoms: <T_8>(list: T_8[], count?: number, repeat?: boolean) => T_8[];
144
+ toKV: (list: import("./typings").Ddan.KV<any>[], key: string, value: string) => import("./typings").Ddan.KV<any>;
145
+ groupBy: <T_9>(list: T_9[], key: string) => Record<string, T_9[]>;
146
+ first: <T_10>(list: T_10[]) => T_10 | undefined;
147
+ last: <T_11>(list: T_11[]) => T_11 | undefined;
148
+ toList: <T_12>(val: T_12 | T_12[]) => T_12[];
149
+ };
150
+ string: {
151
+ toString: (value: any) => any;
152
+ startCase: (string: any) => any;
153
+ snakeCase: (string: any) => any;
154
+ kebabCase: (string: any) => any;
155
+ camelCase: (string: any) => any;
156
+ upperCase: (string: any) => any;
157
+ upperFirst: (string: any) => any;
158
+ lowerCase: (string: any) => any;
159
+ lowerFirst: (string: any) => any;
160
+ splitOnFirst: (string: any, separator: any) => string[];
161
+ parseValue: (value?: any, { number, boolean }?: {
162
+ number?: boolean | undefined;
163
+ boolean?: boolean | undefined;
164
+ }) => any;
165
+ replace: (source: string, rules: import("./typings").Ddan.IRegexRule | import("./typings").Ddan.IRegexRule[]) => string;
166
+ jsonFormat: (jsonString: string) => string;
167
+ };
168
+ time: {
169
+ now: () => import("./modules/time/dtime").default;
170
+ isToday: (date: any) => any;
171
+ parseTimestamp: ({ year, month, date, hour, minute, second }: {
172
+ year?: number | undefined;
173
+ month?: number | undefined;
174
+ date?: number | undefined;
175
+ hour?: number | undefined;
176
+ minute?: number | undefined;
177
+ second?: number | undefined;
178
+ }) => number;
179
+ todayZero: () => number;
180
+ format: (time: string | number | Date, reg?: string) => string;
181
+ countdown: (endTime: string | number | Date, reg?: string) => "" | import("./typings").Ddan.ICountdown;
182
+ dtime: (time: string | number | Date) => import("./modules/time/dtime").default;
183
+ loopFrame: (interval?: number) => import("./modules/time/frame").default;
184
+ getTimezoneOffset: () => number;
185
+ getLocalTime: typeof import("./modules/time/dtime").default.getLocalTime;
186
+ oneDay: number;
187
+ oneHour: number;
188
+ oneMinute: number;
189
+ oneSecond: number;
190
+ };
191
+ obj: {
192
+ copy: (source: any, options?: {
193
+ fields?: string[] | undefined;
194
+ camel?: boolean | undefined;
195
+ pure?: boolean | undefined;
196
+ } & import("./typings").Ddan.IIgnoreParams) => any;
197
+ clone: (source: any) => any;
198
+ merge: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => {};
199
+ isEmpty: (source: any) => boolean;
200
+ parseValue: (source: any, { number, boolean }?: {
201
+ number?: boolean | undefined;
202
+ boolean?: boolean | undefined;
203
+ }) => any;
204
+ cloneClass: <T_2>(source: T_2) => T_2;
205
+ combine: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => any;
206
+ combines: (objs: any[], options?: import("./typings").Ddan.IIgnoreParams) => {};
207
+ observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
208
+ find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
209
+ };
210
+ rule: {
211
+ validateId: (content: any) => boolean;
212
+ validatePhone: (content: any) => boolean;
213
+ validator: (rules: import("./modules/rule/async-validator").Rules) => import("./modules/rule/async-validator").default;
214
+ validate: (rules: import("./modules/rule/async-validator").Rules, source_: import("./modules/rule/async-validator").Values, o?: any, oc?: any) => Promise<import("./modules/rule/async-validator").Values>;
215
+ isChinese: (content: string) => boolean;
216
+ isNumber: (content: string) => boolean;
217
+ isFloat: (content: string) => boolean;
218
+ isPhoneNumber: (content: any) => boolean;
219
+ };
220
+ regex: {
221
+ pattern: {
222
+ num: string;
223
+ zh: string;
224
+ en: string;
225
+ };
226
+ regex: (patt: string, modifiers?: "i" | "g" | "m" | undefined) => RegExp;
227
+ entire: {
228
+ chinese: RegExp;
229
+ real: RegExp;
230
+ cssReal: RegExp;
231
+ id: RegExp;
232
+ yyyyMMdd: RegExp;
233
+ };
234
+ };
235
+ };
236
+ declare const dHook: {
237
+ qs: {
238
+ parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
239
+ sep?: string | undefined;
240
+ eq?: string | undefined;
241
+ max?: number | undefined;
242
+ multiple?: boolean | undefined;
243
+ uri?: boolean | undefined;
244
+ parseNumber?: boolean | undefined;
245
+ parseBoolean?: boolean | undefined;
246
+ }) => {};
247
+ stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
248
+ sep?: string | undefined;
249
+ eq?: string | undefined;
250
+ name?: null | undefined;
251
+ uri?: boolean | undefined;
252
+ cleanZero?: boolean | undefined;
253
+ cleanNull?: boolean | undefined;
254
+ cleanWhitespace?: boolean | undefined;
255
+ }) => string;
256
+ https: (url: string) => string;
257
+ parseUrl: (url: string) => {
258
+ pathname: string;
259
+ params: {};
260
+ route: string;
261
+ page: string;
262
+ name: string;
263
+ withoutExtension: string;
264
+ extname: string;
265
+ href: string;
266
+ url: string;
267
+ origin: string;
268
+ host: string;
269
+ protocol: string;
270
+ port: string;
271
+ query: string;
272
+ };
273
+ parsePath: (url: string) => {
274
+ route: string;
275
+ page: string;
276
+ name: string;
277
+ withoutExtension: string;
278
+ extname: string;
279
+ };
280
+ parseHost: (url: string) => import("./typings").Ddan.IHttpHost;
281
+ join: (...args: string[]) => string;
282
+ shExpMatch: (text: string, pattern: string) => boolean;
283
+ isLocalIpAddress: (addr: string) => boolean;
284
+ };
285
+ singleton: <T>() => {
286
+ new (): {};
287
+ __instance__: any;
288
+ readonly Instance: T;
289
+ readonly I: T;
290
+ };
291
+ random: (max: number) => number;
292
+ randomRange: (min: number, max: number) => number;
293
+ lerp: (start: number, end: number, t: number) => number;
294
+ randoms: (max: number, count?: number, repeat?: boolean) => number[];
295
+ strip: (num: string | number, digits?: number) => number;
296
+ float: (num: string | number, { digits, fixed }?: {
297
+ digits?: number | undefined;
298
+ fixed?: boolean | undefined;
299
+ }) => number;
300
+ radian2degree: (radians: number) => number;
301
+ degree2radian: (degrees: number) => number;
302
+ calcDataSize: (data: number) => {
303
+ gb: number;
304
+ mb: number;
305
+ kb: number;
306
+ b: number;
307
+ total: number;
308
+ desc: string;
309
+ };
310
+ toString: (value: any) => any;
311
+ startCase: (string: any) => any;
312
+ snakeCase: (string: any) => any;
313
+ kebabCase: (string: any) => any;
314
+ camelCase: (string: any) => any;
315
+ upperCase: (string: any) => any;
316
+ upperFirst: (string: any) => any;
317
+ lowerCase: (string: any) => any;
318
+ lowerFirst: (string: any) => any;
319
+ splitOnFirst: (string: any, separator: any) => string[];
320
+ parseValue: (value?: any, { number, boolean }?: {
321
+ number?: boolean | undefined;
322
+ boolean?: boolean | undefined;
323
+ }) => any;
324
+ replace: (source: string, rules: import("./typings").Ddan.IRegexRule | import("./typings").Ddan.IRegexRule[]) => string;
325
+ jsonFormat: (jsonString: string) => string;
326
+ sleep: (ms?: number) => Promise<unknown>;
327
+ run: <T_1 = any>(task?: import("./typings").Ddan.PFunction<T_1> | undefined, wait?: number) => Promise<[any, undefined] | [null, T_1]>;
328
+ exec: (func: import("./typings").Ddan.Function, taskId?: string) => import("./typings").Ddan.PSafeResult<any>;
329
+ debounce: typeof import("./modules/hook/modules/debounce").default;
330
+ throttle: typeof import("./modules/hook/modules/throttle").default;
331
+ task: (param?: import("./typings").Ddan.Func1<any, any> | undefined) => import("./class/pipeTask").default;
332
+ mutex: typeof import("./modules/hook/modules/mutex").default;
333
+ polling: typeof import("./modules/hook/modules/polling").default;
334
+ pipe: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/pipeline").default;
335
+ pipeline: (max?: number) => import("./modules/hook/modules/pipeline").default;
336
+ safeTask: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/safeTask").default;
337
+ bezier1: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
338
+ bezier2: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, p2: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
339
+ bezier3: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, p2: import("./typings").Ddan.IPoint, p3: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
340
+ bezier: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
341
+ bezierCurve: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
342
+ logString: (data: any) => string;
343
+ logParse: (logStr: string) => string;
344
+ logRString: (data: any) => Promise<string>;
345
+ logRParse: (logStr: string) => Promise<string>;
346
+ to: <T_2 = any, U extends object = any>(promise: Promise<T_2>, errorExt?: object | undefined, fn?: import("./typings").Ddan.noop | undefined) => Promise<[null, T_2] | [U, undefined]>;
347
+ go: <T_3 = any>(task?: import("./typings").Ddan.PFunction<T_3> | undefined, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_3]>;
348
+ delay: (ms?: number) => Promise<unknown>;
349
+ safeRun: <T_4 = any>(func: any, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_4]>;
350
+ toError: (value: any) => any;
351
+ timeout: <T_5 = any>(task?: import("./typings").Ddan.PFunction<T_5> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_5]>;
352
+ base64: {
353
+ encode: (input: string) => string;
354
+ decode: (base64Str: string) => string;
355
+ encodeByOss: (input: string) => string;
356
+ };
357
+ tea: {
358
+ TEAKey: string;
359
+ encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
360
+ decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
361
+ toTeaKey: (str: string) => Uint32Array;
362
+ encode: (plaintext: string, key: string) => string;
363
+ decode: (ciphertext: string, key: string) => string;
364
+ encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
365
+ decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
366
+ };
367
+ uuid: (len?: number, radix?: number) => string;
368
+ guid: (len: number, prefix?: boolean, sep?: string) => string;
369
+ getHexString: (len: number) => string;
370
+ keyNumber: string;
371
+ keyLower: string;
372
+ keyUpper: string;
373
+ keyChars: string;
374
+ str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
375
+ ab2str: (data: ArrayBuffer, base64?: boolean) => string;
376
+ utf8ToBase64: (str: string) => string;
377
+ base64ToUtf8: (base64Str: string) => string;
378
+ getRandomBytes: (length: number) => Uint8Array;
379
+ textEncode: (text: string) => Uint8Array;
380
+ textDecode: (buf: ArrayBufferLike) => string;
381
+ toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
382
+ toBase64: (input?: string) => string;
383
+ fromBase64: (input?: string) => string;
384
+ bytesToBase64: (bytes: Uint8Array) => string;
385
+ base64ToBytes: (input?: string) => Uint8Array;
386
+ toUtf8: (content: string) => string;
387
+ fromUtf8: (utftext: string) => string;
388
+ toUtf8Bytes: (content: string) => Uint8Array;
389
+ fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
390
+ pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
391
+ pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
392
+ bytes2str: (bytes: Uint8Array) => string;
393
+ str2bytes: (str?: string) => Uint8Array;
394
+ str2hex: (str: string) => string;
395
+ hex2str: (hexstr: string) => string;
396
+ concatBytes: (...args: Uint8Array[]) => Uint8Array;
397
+ uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
398
+ bytesToUint32: (bytes: Uint8Array) => Uint32Array;
399
+ hex2bytes: (hex: string) => Uint8Array;
400
+ bytes2hex: (bytes: Uint8Array) => string;
401
+ toUint32: (str: string) => Uint32Array;
402
+ fromUint32: (uint32: Uint32Array) => string;
403
+ flatten: <T_6>(data: T_6[], recursive?: boolean, list?: T_6[]) => T_6[];
404
+ };
405
+ declare const dMini: {
406
+ mini: {
407
+ diff: typeof import("./modules/mini/diff").default;
408
+ promixify: (miniapi: any) => any;
409
+ run: (func: any, args?: {}) => Promise<[any, undefined] | [null, any]>;
410
+ formatList: (lists: any[], start: any, name: any) => any;
411
+ ruleValidator: (_: any, value: any) => boolean;
412
+ Http: typeof import("./modules/mini/http").default;
413
+ setWatcher: (page: any) => void;
414
+ };
415
+ css: {
416
+ stringify: (styleObj: Record<string, string | number>) => string;
417
+ parse: (styleStr: string, { camel, pure }?: {
418
+ camel?: boolean | undefined;
419
+ pure?: boolean | undefined;
420
+ }) => {} | undefined;
421
+ fixValue: (value: string | number, unit?: string) => string | number;
422
+ style: (cssKV: Record<string, any>, unit?: string) => string;
423
+ commonFields: string[];
424
+ };
425
+ qs: {
426
+ parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
427
+ sep?: string | undefined;
428
+ eq?: string | undefined;
429
+ max?: number | undefined;
430
+ multiple?: boolean | undefined;
431
+ uri?: boolean | undefined;
432
+ parseNumber?: boolean | undefined;
433
+ parseBoolean?: boolean | undefined;
434
+ }) => {};
435
+ stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
436
+ sep?: string | undefined;
437
+ eq?: string | undefined;
438
+ name?: null | undefined;
439
+ uri?: boolean | undefined;
440
+ cleanZero?: boolean | undefined;
441
+ cleanNull?: boolean | undefined;
442
+ cleanWhitespace?: boolean | undefined;
443
+ }) => string;
444
+ https: (url: string) => string;
445
+ parseUrl: (url: string) => {
446
+ pathname: string;
447
+ params: {};
448
+ route: string;
449
+ page: string;
450
+ name: string;
451
+ withoutExtension: string;
452
+ extname: string;
453
+ href: string;
454
+ url: string;
455
+ origin: string;
456
+ host: string;
457
+ protocol: string;
458
+ port: string;
459
+ query: string;
460
+ };
461
+ parsePath: (url: string) => {
462
+ route: string;
463
+ page: string;
464
+ name: string;
465
+ withoutExtension: string;
466
+ extname: string;
467
+ };
468
+ parseHost: (url: string) => import("./typings").Ddan.IHttpHost;
469
+ join: (...args: string[]) => string;
470
+ shExpMatch: (text: string, pattern: string) => boolean;
471
+ isLocalIpAddress: (addr: string) => boolean;
472
+ };
473
+ icon: import("./class/icon").DIcon;
474
+ html: {
475
+ dataURLtoFile: (dataurl: any, filename: any) => File;
476
+ dataURLtoBlob: (dataurl: any) => Blob;
477
+ blobToFile: (blob: any, fileName: string) => any;
478
+ readAsDataURL: (file: any, cb: any) => void;
479
+ downloadUrl: (url: string, filename?: string, checkSomeOrigin?: boolean) => void;
480
+ download: (urlOrFile: string | Blob | MediaSource, filename?: string) => void;
481
+ downloadFile: (data: Blob | MediaSource, filename?: string) => void;
482
+ downloadImage: (url: string) => Promise<void> | undefined;
483
+ watermark: (text: string, { width, height, angle, fillStyle, font, textAlign, textBaseline, }?: {
484
+ width?: number | undefined;
485
+ height?: number | undefined;
486
+ angle?: number | undefined;
487
+ fillStyle?: string | undefined;
488
+ font?: string | undefined;
489
+ textAlign?: "center" | "end" | "left" | "right" | "start" | undefined;
490
+ textBaseline?: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" | undefined;
491
+ }) => string;
492
+ copyText: (text: string, legacy?: boolean) => Promise<boolean>;
493
+ queryPermission: (name: string, def?: PermissionState) => Promise<PermissionState>;
494
+ isAllowed: (status: PermissionState | undefined, prompt?: boolean) => boolean;
495
+ legacyCopy: (text: string) => boolean;
496
+ };
497
+ };
498
+ declare const dCdn: {
499
+ cdn: {
500
+ ossImage: (url: string, options?: {
501
+ webp?: boolean | undefined;
502
+ resize?: number | undefined;
503
+ interlace?: boolean | undefined;
504
+ domain?: string | string[] | undefined;
505
+ }) => string;
506
+ ossSnapshot: (url: string, options?: {
507
+ t?: number | undefined;
508
+ w?: number | undefined;
509
+ h?: number | undefined;
510
+ m?: "" | "fast" | undefined;
511
+ f?: "jpg" | "png" | undefined;
512
+ ar?: "auto" | "h" | "w" | undefined;
513
+ }) => string;
514
+ ossBase64: (input: string) => string;
515
+ };
516
+ watermark: (bg: string, size?: {
517
+ width?: number | undefined;
518
+ height?: number | undefined;
519
+ } | undefined) => import("./class/watermark").DWatermark;
520
+ };
521
+ declare const dStore: {
522
+ Store: typeof Store;
523
+ storeRef: (source: import("./typings").Ddan.IDStore, persistConfig?: import("./typings").Ddan.IDPersistConfig | undefined) => any;
524
+ Persist: typeof Persist;
525
+ persistConfig: (key: string, fields: string[], storage: import("./typings").Ddan.IStorage) => import("./typings").Ddan.IDPersistConfig;
526
+ };
527
+ declare const dJoker: import("./class/joker").Joker;
528
+ declare const dTracker: import("./class/tracker").DTracker;
529
+ declare const dLogger: {
530
+ override: () => void;
531
+ log: (...args: any[]) => void;
532
+ info: (...args: any[]) => void;
533
+ warn: (...args: any[]) => void;
534
+ error: (...args: any[]) => void;
535
+ config: ({ tag, format }?: {
536
+ tag?: boolean | undefined;
537
+ format?: string | undefined;
538
+ }) => void;
539
+ };
540
+ declare const dWeb: {
541
+ Ecdh: typeof import("./modules/browser/ecdh").default;
542
+ fetch: {
543
+ getDataURL: (url: string) => Promise<[any, undefined] | [null, {
544
+ contentType: string;
545
+ dataUrl: string;
546
+ }]>;
547
+ getArrayBuffer: (url: string) => Promise<[any, undefined] | [null, ArrayBuffer]>;
548
+ getJson: (url: string) => Promise<[any, undefined] | [null, any]>;
549
+ download: (url: string, opts?: {
550
+ success?: ((buffer: Uint8Array) => void) | undefined;
551
+ progress?: ((percentage: number, current: number, total: number) => void) | undefined;
552
+ fail?: ((error: Error) => void) | undefined;
553
+ }) => Promise<Uint8Array | undefined>;
554
+ getText: (url: string) => Promise<[any, undefined] | [null, string]>;
555
+ };
556
+ Http: typeof Http;
557
+ css: {
558
+ stringify: (styleObj: Record<string, string | number>) => string;
559
+ parse: (styleStr: string, { camel, pure }?: {
560
+ camel?: boolean | undefined;
561
+ pure?: boolean | undefined;
562
+ }) => {} | undefined;
563
+ fixValue: (value: string | number, unit?: string) => string | number;
564
+ style: (cssKV: Record<string, any>, unit?: string) => string;
565
+ commonFields: string[];
566
+ };
567
+ qs: {
568
+ parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
569
+ sep?: string | undefined;
570
+ eq?: string | undefined;
571
+ max?: number | undefined;
572
+ multiple?: boolean | undefined;
573
+ uri?: boolean | undefined;
574
+ parseNumber?: boolean | undefined;
575
+ parseBoolean?: boolean | undefined;
576
+ }) => {};
577
+ stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
578
+ sep?: string | undefined;
579
+ eq?: string | undefined;
580
+ name?: null | undefined;
581
+ uri?: boolean | undefined;
582
+ cleanZero?: boolean | undefined;
583
+ cleanNull?: boolean | undefined;
584
+ cleanWhitespace?: boolean | undefined;
585
+ }) => string;
586
+ https: (url: string) => string;
587
+ parseUrl: (url: string) => {
588
+ pathname: string;
589
+ params: {};
590
+ route: string;
591
+ page: string;
592
+ name: string;
593
+ withoutExtension: string;
594
+ extname: string;
595
+ href: string;
596
+ url: string;
597
+ origin: string;
598
+ host: string;
599
+ protocol: string;
600
+ port: string;
601
+ query: string;
602
+ };
603
+ parsePath: (url: string) => {
604
+ route: string;
605
+ page: string;
606
+ name: string;
607
+ withoutExtension: string;
608
+ extname: string;
609
+ };
610
+ parseHost: (url: string) => import("./typings").Ddan.IHttpHost;
611
+ join: (...args: string[]) => string;
612
+ shExpMatch: (text: string, pattern: string) => boolean;
613
+ isLocalIpAddress: (addr: string) => boolean;
614
+ };
615
+ icon: import("./class/icon").DIcon;
616
+ html: {
617
+ dataURLtoFile: (dataurl: any, filename: any) => File;
618
+ dataURLtoBlob: (dataurl: any) => Blob;
619
+ blobToFile: (blob: any, fileName: string) => any;
620
+ readAsDataURL: (file: any, cb: any) => void;
621
+ downloadUrl: (url: string, filename?: string, checkSomeOrigin?: boolean) => void;
622
+ download: (urlOrFile: string | Blob | MediaSource, filename?: string) => void;
623
+ downloadFile: (data: Blob | MediaSource, filename?: string) => void;
624
+ downloadImage: (url: string) => Promise<void> | undefined;
625
+ watermark: (text: string, { width, height, angle, fillStyle, font, textAlign, textBaseline, }?: {
626
+ width?: number | undefined;
627
+ height?: number | undefined;
628
+ angle?: number | undefined;
629
+ fillStyle?: string | undefined;
630
+ font?: string | undefined;
631
+ textAlign?: "center" | "end" | "left" | "right" | "start" | undefined;
632
+ textBaseline?: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" | undefined;
633
+ }) => string;
634
+ copyText: (text: string, legacy?: boolean) => Promise<boolean>;
635
+ queryPermission: (name: string, def?: PermissionState) => Promise<PermissionState>;
636
+ isAllowed: (status: PermissionState | undefined, prompt?: boolean) => boolean;
637
+ legacyCopy: (text: string) => boolean;
638
+ };
639
+ rsa: {
640
+ generateKeys: () => Promise<{
641
+ publicKey: string;
642
+ publicKeyPem: string;
643
+ privateKey: string;
644
+ privateKeyPem: string;
645
+ }>;
646
+ encrypt: (data: string, publicKey: string) => Promise<string>;
647
+ decrypt: (encryptedBase64: string, privateKey: string) => Promise<string>;
648
+ encode: (data: string) => Promise<string>;
649
+ decode: (encryptedBase64: string) => Promise<string>;
650
+ };
651
+ };
652
+ export { dUtil, dHook, dWeb, dMini, dCdn, dStore, dJoker, dTracker, dLogger, Event, KValue, Mapping, };
653
+ declare const _default: {
654
+ gbk: {
655
+ gbkLength: (str: string) => number;
656
+ gbkCut: (source: string, len: number) => string;
657
+ };
658
+ time: {
659
+ now: () => import("./modules/time/dtime").default;
660
+ isToday: (date: any) => any;
661
+ parseTimestamp: ({ year, month, date, hour, minute, second }: {
662
+ year?: number | undefined;
663
+ month?: number | undefined;
664
+ date?: number | undefined;
665
+ hour?: number | undefined;
666
+ minute?: number | undefined;
667
+ second?: number | undefined;
668
+ }) => number;
669
+ todayZero: () => number;
670
+ format: (time: string | number | Date, reg?: string) => string;
671
+ countdown: (endTime: string | number | Date, reg?: string) => "" | import("./typings").Ddan.ICountdown;
672
+ dtime: (time: string | number | Date) => import("./modules/time/dtime").default;
673
+ loopFrame: (interval?: number) => import("./modules/time/frame").default;
674
+ getTimezoneOffset: () => number;
675
+ getLocalTime: typeof import("./modules/time/dtime").default.getLocalTime;
676
+ oneDay: number;
677
+ oneHour: number;
678
+ oneMinute: number;
679
+ oneSecond: number;
680
+ };
681
+ hook: {
682
+ sleep: (ms?: number) => Promise<unknown>;
683
+ run: <T = any>(task?: import("./typings").Ddan.PFunction<T> | undefined, wait?: number) => Promise<[any, undefined] | [null, T]>;
684
+ exec: (func: import("./typings").Ddan.Function, taskId?: string) => import("./typings").Ddan.PSafeResult<any>;
685
+ debounce: typeof import("./modules/hook/modules/debounce").default;
686
+ throttle: typeof import("./modules/hook/modules/throttle").default;
687
+ task: (param?: import("./typings").Ddan.Func1<any, any> | undefined) => import("./class/pipeTask").default;
688
+ mutex: typeof import("./modules/hook/modules/mutex").default;
689
+ polling: typeof import("./modules/hook/modules/polling").default;
690
+ pipe: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/pipeline").default;
691
+ pipeline: (max?: number) => import("./modules/hook/modules/pipeline").default;
692
+ safeTask: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/safeTask").default;
693
+ bezier1: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
694
+ bezier2: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, p2: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
695
+ bezier3: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, p2: import("./typings").Ddan.IPoint, p3: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
696
+ bezier: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
697
+ bezierCurve: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
698
+ logString: (data: any) => string;
699
+ logParse: (logStr: string) => string;
700
+ logRString: (data: any) => Promise<string>;
701
+ logRParse: (logStr: string) => Promise<string>;
702
+ to: <T_1 = any, U extends object = any>(promise: Promise<T_1>, errorExt?: object | undefined, fn?: import("./typings").Ddan.noop | undefined) => Promise<[null, T_1] | [U, undefined]>;
703
+ go: <T_2 = any>(task?: import("./typings").Ddan.PFunction<T_2> | undefined, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_2]>;
704
+ delay: (ms?: number) => Promise<unknown>;
705
+ safeRun: <T_3 = any>(func: any, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_3]>;
706
+ toError: (value: any) => any;
707
+ timeout: <T_4 = any>(task?: import("./typings").Ddan.PFunction<T_4> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_4]>;
708
+ };
709
+ math: {
710
+ random: (max: number) => number;
711
+ randomRange: (min: number, max: number) => number;
712
+ lerp: (start: number, end: number, t: number) => number;
713
+ randoms: (max: number, count?: number, repeat?: boolean) => number[];
714
+ strip: (num: string | number, digits?: number) => number;
715
+ float: (num: string | number, { digits, fixed }?: {
716
+ digits?: number | undefined;
717
+ fixed?: boolean | undefined;
718
+ }) => number;
719
+ radian2degree: (radians: number) => number;
720
+ degree2radian: (degrees: number) => number;
721
+ calcDataSize: (data: number) => {
722
+ gb: number;
723
+ mb: number;
724
+ kb: number;
725
+ b: number;
726
+ total: number;
727
+ desc: string;
728
+ };
729
+ };
730
+ util: {
731
+ includes: typeof import("./util/includes").default;
732
+ forof: (source: any, cb: (key: any, val: any) => void) => void;
733
+ singleton: <T_5>() => {
734
+ new (): {};
735
+ __instance__: any;
736
+ readonly Instance: T_5;
737
+ readonly I: T_5;
738
+ };
739
+ getset: <T_6 = any>(t?: T_6 | undefined) => import("./typings").Ddan.IGetset<T_6>;
740
+ copy: (source: any, options?: {
741
+ fields?: string[] | undefined;
742
+ camel?: boolean | undefined;
743
+ pure?: boolean | undefined;
744
+ } & import("./typings").Ddan.IIgnoreParams) => any;
745
+ clone: (source: any) => any;
746
+ merge: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => {};
747
+ isEmpty: (source: any) => boolean;
748
+ parseValue: (source: any, { number, boolean }?: {
749
+ number?: boolean | undefined;
750
+ boolean?: boolean | undefined;
751
+ }) => any;
752
+ cloneClass: <T_7>(source: T_7) => T_7;
753
+ combine: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => any;
754
+ combines: (objs: any[], options?: import("./typings").Ddan.IIgnoreParams) => {};
755
+ observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
756
+ find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
757
+ getTag: (value: any) => string;
758
+ getType: (value: any) => string;
759
+ toString: () => string;
760
+ hasOwnProperty: (v: PropertyKey) => boolean;
761
+ propertyIsEnumerable: (v: PropertyKey) => boolean;
762
+ is: (val: any, type: string) => boolean;
763
+ isNumber: (value: any) => boolean;
764
+ isString: (value: any) => boolean;
765
+ isObject: (value: any) => boolean;
766
+ isObjectLike: (value: any) => boolean;
767
+ isPlainObject: (value: any) => boolean;
768
+ isSymbol: (value: any) => boolean;
769
+ isFunction: (value: any) => boolean;
770
+ isArray: (arg: any) => arg is any[];
771
+ isArrayLikeObject: (value: any) => boolean;
772
+ isIndex: (value: any, length: number) => boolean;
773
+ isArrayLike: (value: any) => boolean;
774
+ isPrototype: (value: any) => boolean;
775
+ isArguments: (value: any) => boolean;
776
+ isPromise: (value: any) => boolean;
777
+ isBrowser: boolean;
778
+ isNode: boolean;
779
+ isBlobOrBuffer: (data: any) => boolean;
780
+ isUint8Array: (data: any) => boolean;
781
+ isArrayBuffer: (data: any) => boolean;
782
+ };
783
+ list: {
784
+ stepAction: <T_8>(list: T_8[], func: import("./typings").Ddan.Task<T_8, void>, stepCount?: number) => void;
785
+ skip: <T_9>(list: T_9[], count: number) => T_9[];
786
+ take: <T_10>(list: T_10[], count: number, skip?: number) => T_10[];
787
+ distinct: <T_11>(list: T_11[]) => T_11[];
788
+ randoms: <T_12>(list: T_12[], count?: number, repeat?: boolean) => T_12[];
789
+ toKV: (list: import("./typings").Ddan.KV<any>[], key: string, value: string) => import("./typings").Ddan.KV<any>;
790
+ groupBy: <T_13>(list: T_13[], key: string) => Record<string, T_13[]>;
791
+ first: <T_14>(list: T_14[]) => T_14 | undefined;
792
+ last: <T_15>(list: T_15[]) => T_15 | undefined;
793
+ toList: <T_16>(val: T_16 | T_16[]) => T_16[];
794
+ };
795
+ string: {
796
+ toString: (value: any) => any;
797
+ startCase: (string: any) => any;
798
+ snakeCase: (string: any) => any;
799
+ kebabCase: (string: any) => any;
800
+ camelCase: (string: any) => any;
801
+ upperCase: (string: any) => any;
802
+ upperFirst: (string: any) => any;
803
+ lowerCase: (string: any) => any;
804
+ lowerFirst: (string: any) => any;
805
+ splitOnFirst: (string: any, separator: any) => string[];
806
+ parseValue: (value?: any, { number, boolean }?: {
807
+ number?: boolean | undefined;
808
+ boolean?: boolean | undefined;
809
+ }) => any;
810
+ replace: (source: string, rules: import("./typings").Ddan.IRegexRule | import("./typings").Ddan.IRegexRule[]) => string;
811
+ jsonFormat: (jsonString: string) => string;
812
+ };
813
+ obj: {
814
+ copy: (source: any, options?: {
815
+ fields?: string[] | undefined;
816
+ camel?: boolean | undefined;
817
+ pure?: boolean | undefined;
818
+ } & import("./typings").Ddan.IIgnoreParams) => any;
819
+ clone: (source: any) => any;
820
+ merge: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => {};
821
+ isEmpty: (source: any) => boolean;
822
+ parseValue: (source: any, { number, boolean }?: {
823
+ number?: boolean | undefined;
824
+ boolean?: boolean | undefined;
825
+ }) => any;
826
+ cloneClass: <T_7>(source: T_7) => T_7;
827
+ combine: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => any;
828
+ combines: (objs: any[], options?: import("./typings").Ddan.IIgnoreParams) => {};
829
+ observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
830
+ find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
831
+ };
832
+ crypto: {
833
+ base64: {
834
+ encode: (input: string) => string;
835
+ decode: (base64Str: string) => string;
836
+ encodeByOss: (input: string) => string;
837
+ };
838
+ tea: {
839
+ TEAKey: string;
840
+ encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
841
+ decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
842
+ toTeaKey: (str: string) => Uint32Array;
843
+ encode: (plaintext: string, key: string) => string;
844
+ decode: (ciphertext: string, key: string) => string;
845
+ encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
846
+ decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
847
+ };
848
+ uuid: (len?: number, radix?: number) => string;
849
+ guid: (len: number, prefix?: boolean, sep?: string) => string;
850
+ getHexString: (len: number) => string;
851
+ keyNumber: string;
852
+ keyLower: string;
853
+ keyUpper: string;
854
+ keyChars: string;
855
+ };
856
+ mini: {
857
+ diff: typeof import("./modules/mini/diff").default;
858
+ promixify: (miniapi: any) => any;
859
+ run: (func: any, args?: {}) => Promise<[any, undefined] | [null, any]>;
860
+ formatList: (lists: any[], start: any, name: any) => any;
861
+ ruleValidator: (_: any, value: any) => boolean;
862
+ Http: typeof import("./modules/mini/http").default;
863
+ setWatcher: (page: any) => void;
864
+ };
865
+ qs: {
866
+ parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
867
+ sep?: string | undefined;
868
+ eq?: string | undefined;
869
+ max?: number | undefined;
870
+ multiple?: boolean | undefined;
871
+ uri?: boolean | undefined;
872
+ parseNumber?: boolean | undefined;
873
+ parseBoolean?: boolean | undefined;
874
+ }) => {};
875
+ stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
876
+ sep?: string | undefined;
877
+ eq?: string | undefined;
878
+ name?: null | undefined;
879
+ uri?: boolean | undefined;
880
+ cleanZero?: boolean | undefined;
881
+ cleanNull?: boolean | undefined;
882
+ cleanWhitespace?: boolean | undefined;
883
+ }) => string;
884
+ https: (url: string) => string;
885
+ parseUrl: (url: string) => {
886
+ pathname: string;
887
+ params: {};
888
+ route: string;
889
+ page: string;
890
+ name: string;
891
+ withoutExtension: string;
892
+ extname: string;
893
+ href: string;
894
+ url: string;
895
+ origin: string;
896
+ host: string;
897
+ protocol: string;
898
+ port: string;
899
+ query: string;
900
+ };
901
+ parsePath: (url: string) => {
902
+ route: string;
903
+ page: string;
904
+ name: string;
905
+ withoutExtension: string;
906
+ extname: string;
907
+ };
908
+ parseHost: (url: string) => import("./typings").Ddan.IHttpHost;
909
+ join: (...args: string[]) => string;
910
+ shExpMatch: (text: string, pattern: string) => boolean;
911
+ isLocalIpAddress: (addr: string) => boolean;
912
+ };
913
+ css: {
914
+ stringify: (styleObj: Record<string, string | number>) => string;
915
+ parse: (styleStr: string, { camel, pure }?: {
916
+ camel?: boolean | undefined;
917
+ pure?: boolean | undefined;
918
+ }) => {} | undefined;
919
+ fixValue: (value: string | number, unit?: string) => string | number;
920
+ style: (cssKV: Record<string, any>, unit?: string) => string;
921
+ commonFields: string[];
922
+ };
923
+ cdn: {
924
+ ossImage: (url: string, options?: {
925
+ webp?: boolean | undefined;
926
+ resize?: number | undefined;
927
+ interlace?: boolean | undefined;
928
+ domain?: string | string[] | undefined;
929
+ }) => string;
930
+ ossSnapshot: (url: string, options?: {
931
+ t?: number | undefined;
932
+ w?: number | undefined;
933
+ h?: number | undefined;
934
+ m?: "" | "fast" | undefined;
935
+ f?: "jpg" | "png" | undefined;
936
+ ar?: "auto" | "h" | "w" | undefined;
937
+ }) => string;
938
+ ossBase64: (input: string) => string;
939
+ };
940
+ html: {
941
+ dataURLtoFile: (dataurl: any, filename: any) => File;
942
+ dataURLtoBlob: (dataurl: any) => Blob;
943
+ blobToFile: (blob: any, fileName: string) => any;
944
+ readAsDataURL: (file: any, cb: any) => void;
945
+ downloadUrl: (url: string, filename?: string, checkSomeOrigin?: boolean) => void;
946
+ download: (urlOrFile: string | Blob | MediaSource, filename?: string) => void;
947
+ downloadFile: (data: Blob | MediaSource, filename?: string) => void;
948
+ downloadImage: (url: string) => Promise<void> | undefined;
949
+ watermark: (text: string, { width, height, angle, fillStyle, font, textAlign, textBaseline, }?: {
950
+ width?: number | undefined;
951
+ height?: number | undefined;
952
+ angle?: number | undefined;
953
+ fillStyle?: string | undefined;
954
+ font?: string | undefined;
955
+ textAlign?: "center" | "end" | "left" | "right" | "start" | undefined;
956
+ textBaseline?: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" | undefined;
957
+ }) => string;
958
+ copyText: (text: string, legacy?: boolean) => Promise<boolean>;
959
+ queryPermission: (name: string, def?: PermissionState) => Promise<PermissionState>;
960
+ isAllowed: (status: PermissionState | undefined, prompt?: boolean) => boolean;
961
+ legacyCopy: (text: string) => boolean;
962
+ };
963
+ icon: import("./class/icon").DIcon;
964
+ rule: {
965
+ validateId: (content: any) => boolean;
966
+ validatePhone: (content: any) => boolean;
967
+ validator: (rules: import("./modules/rule/async-validator").Rules) => import("./modules/rule/async-validator").default;
968
+ validate: (rules: import("./modules/rule/async-validator").Rules, source_: import("./modules/rule/async-validator").Values, o?: any, oc?: any) => Promise<import("./modules/rule/async-validator").Values>;
969
+ isChinese: (content: string) => boolean;
970
+ isNumber: (content: string) => boolean;
971
+ isFloat: (content: string) => boolean;
972
+ isPhoneNumber: (content: any) => boolean;
973
+ };
974
+ regex: {
975
+ pattern: {
976
+ num: string;
977
+ zh: string;
978
+ en: string;
979
+ };
980
+ regex: (patt: string, modifiers?: "i" | "g" | "m" | undefined) => RegExp;
981
+ entire: {
982
+ chinese: RegExp;
983
+ real: RegExp;
984
+ cssReal: RegExp;
985
+ id: RegExp;
986
+ yyyyMMdd: RegExp;
987
+ };
988
+ };
989
+ convert: {
990
+ str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
991
+ ab2str: (data: ArrayBuffer, base64?: boolean) => string;
992
+ utf8ToBase64: (str: string) => string;
993
+ base64ToUtf8: (base64Str: string) => string;
994
+ getRandomBytes: (length: number) => Uint8Array;
995
+ textEncode: (text: string) => Uint8Array;
996
+ textDecode: (buf: ArrayBufferLike) => string;
997
+ toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
998
+ toBase64: (input?: string) => string;
999
+ fromBase64: (input?: string) => string;
1000
+ bytesToBase64: (bytes: Uint8Array) => string;
1001
+ base64ToBytes: (input?: string) => Uint8Array;
1002
+ toUtf8: (content: string) => string;
1003
+ fromUtf8: (utftext: string) => string;
1004
+ toUtf8Bytes: (content: string) => Uint8Array;
1005
+ fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
1006
+ pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
1007
+ pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
1008
+ bytes2str: (bytes: Uint8Array) => string;
1009
+ str2bytes: (str?: string) => Uint8Array;
1010
+ str2hex: (str: string) => string;
1011
+ hex2str: (hexstr: string) => string;
1012
+ concatBytes: (...args: Uint8Array[]) => Uint8Array;
1013
+ uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
1014
+ bytesToUint32: (bytes: Uint8Array) => Uint32Array;
1015
+ hex2bytes: (hex: string) => Uint8Array;
1016
+ bytes2hex: (bytes: Uint8Array) => string;
1017
+ toUint32: (str: string) => Uint32Array;
1018
+ fromUint32: (uint32: Uint32Array) => string;
1019
+ flatten: <T_17>(data: T_17[], recursive?: boolean, list?: T_17[]) => T_17[];
1020
+ };
1021
+ KValue: typeof KValue;
1022
+ Mapping: typeof Mapping;
1023
+ Event: typeof Event;
1024
+ Http: typeof Http;
1025
+ Store: typeof Store;
1026
+ storeRef: (source: import("./typings").Ddan.IDStore, persistConfig?: import("./typings").Ddan.IDPersistConfig | undefined) => any;
1027
+ Persist: typeof Persist;
1028
+ persistConfig: (key: string, fields: string[], storage: import("./typings").Ddan.IStorage) => import("./typings").Ddan.IDPersistConfig;
1029
+ watermark: (bg: string, size?: {
1030
+ width?: number | undefined;
1031
+ height?: number | undefined;
1032
+ } | undefined) => import("./class/watermark").DWatermark;
1033
+ joker: import("./class/joker").Joker;
1034
+ tracker: import("./class/tracker").DTracker;
1035
+ logger: {
1036
+ override: () => void;
1037
+ log: (...args: any[]) => void;
1038
+ info: (...args: any[]) => void;
1039
+ warn: (...args: any[]) => void;
1040
+ error: (...args: any[]) => void;
1041
+ config: ({ tag, format }?: {
1042
+ tag?: boolean | undefined;
1043
+ format?: string | undefined;
1044
+ }) => void;
1045
+ };
1046
+ fetch: {
1047
+ getDataURL: (url: string) => Promise<[any, undefined] | [null, {
1048
+ contentType: string;
1049
+ dataUrl: string;
1050
+ }]>;
1051
+ getArrayBuffer: (url: string) => Promise<[any, undefined] | [null, ArrayBuffer]>;
1052
+ getJson: (url: string) => Promise<[any, undefined] | [null, any]>;
1053
+ download: (url: string, opts?: {
1054
+ success?: ((buffer: Uint8Array) => void) | undefined;
1055
+ progress?: ((percentage: number, current: number, total: number) => void) | undefined;
1056
+ fail?: ((error: Error) => void) | undefined;
1057
+ }) => Promise<Uint8Array | undefined>;
1058
+ getText: (url: string) => Promise<[any, undefined] | [null, string]>;
1059
+ };
1060
+ rsa: {
1061
+ generateKeys: () => Promise<{
1062
+ publicKey: string;
1063
+ publicKeyPem: string;
1064
+ privateKey: string;
1065
+ privateKeyPem: string;
1066
+ }>;
1067
+ encrypt: (data: string, publicKey: string) => Promise<string>;
1068
+ decrypt: (encryptedBase64: string, privateKey: string) => Promise<string>;
1069
+ encode: (data: string) => Promise<string>;
1070
+ decode: (encryptedBase64: string) => Promise<string>;
1071
+ };
1072
+ };
1073
+ export default _default;