ddan-js 2.10.3 → 2.10.4

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/bin/browser.d.ts CHANGED
@@ -5,6 +5,7 @@ import Store from './class/store';
5
5
  import Persist from './class/persist';
6
6
  import KValue from './class/kvalue';
7
7
  import Mapping from './class/mapping';
8
+ import dHook from './tiny/hook';
8
9
  declare const dUtil: {
9
10
  Event: typeof Event;
10
11
  includes: typeof import("./util/includes").default;
@@ -236,189 +237,6 @@ declare const dUtil: {
236
237
  };
237
238
  };
238
239
  };
239
- declare const dHook: {
240
- qs: {
241
- parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
242
- sep?: string | undefined;
243
- eq?: string | undefined;
244
- max?: number | undefined;
245
- multiple?: boolean | undefined;
246
- uri?: boolean | undefined;
247
- parseNumber?: boolean | undefined;
248
- parseBoolean?: boolean | undefined;
249
- }) => {};
250
- stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
251
- sep?: string | undefined;
252
- eq?: string | undefined;
253
- name?: null | undefined;
254
- uri?: boolean | undefined;
255
- cleanZero?: boolean | undefined;
256
- cleanNull?: boolean | undefined;
257
- cleanWhitespace?: boolean | undefined;
258
- }) => string;
259
- https: (url: string) => string;
260
- parseUrl: (url: string) => {
261
- pathname: string;
262
- params: {};
263
- route: string;
264
- page: string;
265
- name: string;
266
- withoutExtension: string;
267
- extname: string;
268
- href: string;
269
- url: string;
270
- origin: string;
271
- host: string;
272
- protocol: string;
273
- port: string;
274
- query: string;
275
- };
276
- parsePath: (url: string) => {
277
- route: string;
278
- page: string;
279
- name: string;
280
- withoutExtension: string;
281
- extname: string;
282
- };
283
- parseHost: (url: string) => import("./typings").Ddan.IHttpHost;
284
- join: (...args: string[]) => string;
285
- shExpMatch: (text: string, pattern: string) => boolean;
286
- isLocalIpAddress: (addr: string) => boolean;
287
- parseFileUrl: (url: string) => {
288
- href: string;
289
- file: string;
290
- url: string;
291
- protocol: string;
292
- host: string;
293
- query: string;
294
- params: {};
295
- };
296
- };
297
- singleton: <T>() => {
298
- new (): {};
299
- __instance__: any;
300
- readonly Instance: T;
301
- readonly I: T;
302
- };
303
- random: (max: number) => number;
304
- randomRange: (min: number, max: number) => number;
305
- lerp: (start: number, end: number, t: number) => number;
306
- randoms: (max: number, count?: number, repeat?: boolean) => number[];
307
- strip: (num: string | number, digits?: number) => number;
308
- float: (num: string | number, { digits, fixed }?: {
309
- digits?: number | undefined;
310
- fixed?: boolean | undefined;
311
- }) => number;
312
- radian2degree: (radians: number) => number;
313
- degree2radian: (degrees: number) => number;
314
- calcDataSize: (data: number) => {
315
- gb: number;
316
- mb: number;
317
- kb: number;
318
- b: number;
319
- total: number;
320
- desc: string;
321
- };
322
- toString: (value: any) => any;
323
- startCase: (string: any) => any;
324
- snakeCase: (string: any) => any;
325
- kebabCase: (string: any) => any;
326
- camelCase: (string: any) => any;
327
- upperCase: (string: any) => any;
328
- upperFirst: (string: any) => any;
329
- lowerCase: (string: any) => any;
330
- lowerFirst: (string: any) => any;
331
- splitOnFirst: (string: any, separator: any) => string[];
332
- parseValue: (value?: any, { number, boolean }?: {
333
- number?: boolean | undefined;
334
- boolean?: boolean | undefined;
335
- }) => any;
336
- replace: (source: string, rules: import("./typings").Ddan.IRegexRule | import("./typings").Ddan.IRegexRule[]) => string;
337
- jsonFormat: (jsonString: string) => string;
338
- toLines: (content: string, separator?: string | RegExp) => string[];
339
- sleep: (ms?: number) => Promise<unknown>;
340
- run: <T_1 = any>(task?: import("./typings").Ddan.PFunction<T_1> | undefined, wait?: number) => Promise<[any, undefined] | [null, T_1]>;
341
- exec: (func: import("./typings").Ddan.Function, taskId?: string) => import("./typings").Ddan.PSafeResult<any>;
342
- debounce: typeof import("./modules/hook/modules/debounce").default;
343
- throttle: typeof import("./modules/hook/modules/throttle").default;
344
- task: (param?: import("./typings").Ddan.Func1<any, any> | undefined) => import("./class/pipeTask").default;
345
- mutex: typeof import("./modules/hook/modules/mutex").default;
346
- polling: typeof import("./modules/hook/modules/polling").default;
347
- pipe: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/pipeline").default;
348
- pipeline: (max?: number) => import("./modules/hook/modules/pipeline").default;
349
- safeTask: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/safeTask").default;
350
- bezier1: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
351
- bezier2: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, p2: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
352
- 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;
353
- bezier: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
354
- bezierCurve: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
355
- lerpAverage: (points: import("./typings").Ddan.IPoint[], step: number, type?: "" | "lerp") => number;
356
- proportion: (start: number, end: number, current: number) => number;
357
- logString: (data: any) => string;
358
- logParse: (logStr: string) => string;
359
- logRString: (data: any) => Promise<string>;
360
- logRParse: (logStr: string) => Promise<string>;
361
- 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]>;
362
- go: <T_3 = any>(task?: import("./typings").Ddan.PFunction<T_3> | undefined, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_3]>;
363
- delay: (ms?: number) => Promise<unknown>;
364
- safeRun: <T_4 = any>(func: any, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_4]>;
365
- toError: (value: any) => any;
366
- timeout: <T_5 = any>(task?: import("./typings").Ddan.PFunction<T_5> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_5]>;
367
- base64: {
368
- encode: (input: string) => string;
369
- decode: (base64Str: string) => string;
370
- encodeByOss: (input: string) => string;
371
- };
372
- tea: {
373
- TEAKey: string;
374
- encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
375
- decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
376
- toTeaKey: (str: string) => Uint32Array;
377
- encode: (plaintext: string, key: string) => string;
378
- decode: (ciphertext: string, key: string) => string;
379
- encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
380
- decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
381
- };
382
- uuid: (len?: number, radix?: number) => string;
383
- guid: (len: number, prefix?: boolean, sep?: string) => string;
384
- getHexString: (len: number) => string;
385
- keyNumber: string;
386
- keyLower: string;
387
- keyUpper: string;
388
- keyChars: string;
389
- str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
390
- ab2str: (data: ArrayBuffer, base64?: boolean) => string;
391
- utf8ToBase64: (str: string) => string;
392
- base64ToUtf8: (base64Str: string) => string;
393
- getRandomBytes: (length: number) => Uint8Array;
394
- textEncode: (text: string) => Uint8Array;
395
- textDecode: (buf: ArrayBufferLike) => string;
396
- toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
397
- md5: (input: string | Uint8Array) => string;
398
- md5Base64: (input: string | Uint8Array) => string;
399
- toBase64: (input?: string) => string;
400
- fromBase64: (input?: string) => string;
401
- bytesToBase64: (bytes: Uint8Array) => string;
402
- base64ToBytes: (input?: string) => Uint8Array;
403
- toUtf8: (content: string) => string;
404
- fromUtf8: (utftext: string) => string;
405
- toUtf8Bytes: (content: string) => Uint8Array;
406
- fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
407
- pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
408
- pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
409
- bytes2str: (bytes: Uint8Array) => string;
410
- str2bytes: (str?: string) => Uint8Array;
411
- str2hex: (str: string) => string;
412
- hex2str: (hexstr: string) => string;
413
- concatBytes: (...args: Uint8Array[]) => Uint8Array;
414
- uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
415
- bytesToUint32: (bytes: Uint8Array) => Uint32Array;
416
- hex2bytes: (hex: string) => Uint8Array;
417
- bytes2hex: (bytes: Uint8Array) => string;
418
- toUint32: (str: string) => Uint32Array;
419
- fromUint32: (uint32: Uint32Array) => string;
420
- flatten: <T_6>(data: T_6[], recursive?: boolean, list?: T_6[]) => T_6[];
421
- };
422
240
  declare const dMini: {
423
241
  mini: {
424
242
  diff: typeof import("./modules/mini/diff").default;
@@ -692,443 +510,3 @@ declare const dWeb: {
692
510
  };
693
511
  };
694
512
  export { dUtil, dHook, dWeb, dMini, dCdn, dStore, dJoker, dTracker, dLogger, Event, KValue, Mapping, };
695
- declare const _default: {
696
- gbk: {
697
- gbkLength: (str: string) => number;
698
- gbkCut: (source: string, len: number) => string;
699
- };
700
- time: {
701
- now: () => import("./modules/time/dtime").default;
702
- isToday: (date: any) => any;
703
- parseTimestamp: ({ year, month, date, hour, minute, second }: {
704
- year?: number | undefined;
705
- month?: number | undefined;
706
- date?: number | undefined;
707
- hour?: number | undefined;
708
- minute?: number | undefined;
709
- second?: number | undefined;
710
- }) => number;
711
- todayZero: () => number;
712
- format: (time: string | number | Date, reg?: string) => string;
713
- countdown: (endTime: string | number | Date, reg?: string) => "" | import("./typings").Ddan.ICountdown;
714
- dtime: (time: string | number | Date) => import("./modules/time/dtime").default;
715
- loopFrame: (interval?: number) => import("./modules/time/frame").default;
716
- getTimezoneOffset: () => number;
717
- getLocalTime: typeof import("./modules/time/dtime").default.getLocalTime;
718
- oneDay: number;
719
- oneHour: number;
720
- oneMinute: number;
721
- oneSecond: number;
722
- };
723
- hook: {
724
- sleep: (ms?: number) => Promise<unknown>;
725
- run: <T = any>(task?: import("./typings").Ddan.PFunction<T> | undefined, wait?: number) => Promise<[any, undefined] | [null, T]>;
726
- exec: (func: import("./typings").Ddan.Function, taskId?: string) => import("./typings").Ddan.PSafeResult<any>;
727
- debounce: typeof import("./modules/hook/modules/debounce").default;
728
- throttle: typeof import("./modules/hook/modules/throttle").default;
729
- task: (param?: import("./typings").Ddan.Func1<any, any> | undefined) => import("./class/pipeTask").default;
730
- mutex: typeof import("./modules/hook/modules/mutex").default;
731
- polling: typeof import("./modules/hook/modules/polling").default;
732
- pipe: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/pipeline").default;
733
- pipeline: (max?: number) => import("./modules/hook/modules/pipeline").default;
734
- safeTask: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/safeTask").default;
735
- bezier1: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
736
- bezier2: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, p2: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
737
- 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;
738
- bezier: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
739
- bezierCurve: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
740
- lerp: (start: number, end: number, t: number) => number;
741
- lerpAverage: (points: import("./typings").Ddan.IPoint[], step: number, type?: "" | "lerp") => number;
742
- proportion: (start: number, end: number, current: number) => number;
743
- logString: (data: any) => string;
744
- logParse: (logStr: string) => string;
745
- logRString: (data: any) => Promise<string>;
746
- logRParse: (logStr: string) => Promise<string>;
747
- 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]>;
748
- go: <T_2 = any>(task?: import("./typings").Ddan.PFunction<T_2> | undefined, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_2]>;
749
- delay: (ms?: number) => Promise<unknown>;
750
- safeRun: <T_3 = any>(func: any, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_3]>;
751
- toError: (value: any) => any;
752
- timeout: <T_4 = any>(task?: import("./typings").Ddan.PFunction<T_4> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_4]>;
753
- };
754
- math: {
755
- random: (max: number) => number;
756
- randomRange: (min: number, max: number) => number;
757
- lerp: (start: number, end: number, t: number) => number;
758
- randoms: (max: number, count?: number, repeat?: boolean) => number[];
759
- strip: (num: string | number, digits?: number) => number;
760
- float: (num: string | number, { digits, fixed }?: {
761
- digits?: number | undefined;
762
- fixed?: boolean | undefined;
763
- }) => number;
764
- radian2degree: (radians: number) => number;
765
- degree2radian: (degrees: number) => number;
766
- calcDataSize: (data: number) => {
767
- gb: number;
768
- mb: number;
769
- kb: number;
770
- b: number;
771
- total: number;
772
- desc: string;
773
- };
774
- };
775
- util: {
776
- includes: typeof import("./util/includes").default;
777
- forof: (source: any, cb: (key: any, val: any) => void) => void;
778
- singleton: <T_5>() => {
779
- new (): {};
780
- __instance__: any;
781
- readonly Instance: T_5;
782
- readonly I: T_5;
783
- };
784
- getset: <T_6 = any>(t?: T_6 | undefined) => import("./typings").Ddan.IGetset<T_6>;
785
- copy: (source: any, options?: {
786
- fields?: string[] | undefined;
787
- camel?: boolean | undefined;
788
- pure?: boolean | undefined;
789
- } & import("./typings").Ddan.IIgnoreParams) => any;
790
- clone: (source: any) => any;
791
- merge: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => {};
792
- isEmpty: (source: any) => boolean;
793
- parseValue: (source: any, { number, boolean }?: {
794
- number?: boolean | undefined;
795
- boolean?: boolean | undefined;
796
- }) => any;
797
- cloneClass: <T_7>(source: T_7) => T_7;
798
- combine: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => any;
799
- combines: (objs: any[], options?: import("./typings").Ddan.IIgnoreParams) => {};
800
- observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
801
- find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
802
- getTag: (value: any) => string;
803
- getType: (value: any) => string;
804
- toString: () => string;
805
- hasOwnProperty: (v: PropertyKey) => boolean;
806
- propertyIsEnumerable: (v: PropertyKey) => boolean;
807
- is: (val: any, type: string) => boolean;
808
- isNumber: (value: any) => boolean;
809
- isString: (value: any) => boolean;
810
- isObject: (value: any) => boolean;
811
- isObjectLike: (value: any) => boolean;
812
- isPlainObject: (value: any) => boolean;
813
- isSymbol: (value: any) => boolean;
814
- isFunction: (value: any) => boolean;
815
- isArray: (arg: any) => arg is any[];
816
- isArrayLikeObject: (value: any) => boolean;
817
- isIndex: (value: any, length: number) => boolean;
818
- isArrayLike: (value: any) => boolean;
819
- isPrototype: (value: any) => boolean;
820
- isArguments: (value: any) => boolean;
821
- isPromise: (value: any) => boolean;
822
- isBrowser: boolean;
823
- isNode: boolean;
824
- isBlobOrBuffer: (data: any) => boolean;
825
- isUint8Array: (data: any) => boolean;
826
- isArrayBuffer: (data: any) => boolean;
827
- };
828
- list: {
829
- stepAction: <T_8>(list: T_8[], func: import("./typings").Ddan.Task<T_8, void>, stepCount?: number) => void;
830
- skip: <T_9>(list: T_9[], count: number) => T_9[];
831
- take: <T_10>(list: T_10[], count: number, skip?: number) => T_10[];
832
- distinct: <T_11>(list: T_11[]) => T_11[];
833
- randoms: <T_12>(list: T_12[], count?: number, repeat?: boolean) => T_12[];
834
- toKV: (list: import("./typings").Ddan.KV<any>[], key: string, value: string) => import("./typings").Ddan.KV<any>;
835
- groupBy: <T_13>(list: T_13[], key: string) => Record<string, T_13[]>;
836
- first: <T_14>(list: T_14[]) => T_14 | undefined;
837
- last: <T_15>(list: T_15[]) => T_15 | undefined;
838
- toList: <T_16>(val: T_16 | T_16[]) => T_16[];
839
- };
840
- string: {
841
- toString: (value: any) => any;
842
- startCase: (string: any) => any;
843
- snakeCase: (string: any) => any;
844
- kebabCase: (string: any) => any;
845
- camelCase: (string: any) => any;
846
- upperCase: (string: any) => any;
847
- upperFirst: (string: any) => any;
848
- lowerCase: (string: any) => any;
849
- lowerFirst: (string: any) => any;
850
- splitOnFirst: (string: any, separator: any) => string[];
851
- parseValue: (value?: any, { number, boolean }?: {
852
- number?: boolean | undefined;
853
- boolean?: boolean | undefined;
854
- }) => any;
855
- replace: (source: string, rules: import("./typings").Ddan.IRegexRule | import("./typings").Ddan.IRegexRule[]) => string;
856
- jsonFormat: (jsonString: string) => string;
857
- toLines: (content: string, separator?: string | RegExp) => string[];
858
- };
859
- obj: {
860
- copy: (source: any, options?: {
861
- fields?: string[] | undefined;
862
- camel?: boolean | undefined;
863
- pure?: boolean | undefined;
864
- } & import("./typings").Ddan.IIgnoreParams) => any;
865
- clone: (source: any) => any;
866
- merge: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => {};
867
- isEmpty: (source: any) => boolean;
868
- parseValue: (source: any, { number, boolean }?: {
869
- number?: boolean | undefined;
870
- boolean?: boolean | undefined;
871
- }) => any;
872
- cloneClass: <T_7>(source: T_7) => T_7;
873
- combine: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => any;
874
- combines: (objs: any[], options?: import("./typings").Ddan.IIgnoreParams) => {};
875
- observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
876
- find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
877
- };
878
- crypto: {
879
- base64: {
880
- encode: (input: string) => string;
881
- decode: (base64Str: string) => string;
882
- encodeByOss: (input: string) => string;
883
- };
884
- tea: {
885
- TEAKey: string;
886
- encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
887
- decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
888
- toTeaKey: (str: string) => Uint32Array;
889
- encode: (plaintext: string, key: string) => string;
890
- decode: (ciphertext: string, key: string) => string;
891
- encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
892
- decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
893
- };
894
- uuid: (len?: number, radix?: number) => string;
895
- guid: (len: number, prefix?: boolean, sep?: string) => string;
896
- getHexString: (len: number) => string;
897
- keyNumber: string;
898
- keyLower: string;
899
- keyUpper: string;
900
- keyChars: string;
901
- };
902
- mini: {
903
- diff: typeof import("./modules/mini/diff").default;
904
- promixify: (miniapi: any) => any;
905
- run: (func: any, args?: {}) => Promise<[any, undefined] | [null, any]>;
906
- formatList: (lists: any[], start: any, name: any) => any;
907
- ruleValidator: (_: any, value: any) => boolean;
908
- Http: typeof import("./modules/mini/http").default;
909
- setWatcher: (page: any) => void;
910
- };
911
- qs: {
912
- parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
913
- sep?: string | undefined;
914
- eq?: string | undefined;
915
- max?: number | undefined;
916
- multiple?: boolean | undefined;
917
- uri?: boolean | undefined;
918
- parseNumber?: boolean | undefined;
919
- parseBoolean?: boolean | undefined;
920
- }) => {};
921
- stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
922
- sep?: string | undefined;
923
- eq?: string | undefined;
924
- name?: null | undefined;
925
- uri?: boolean | undefined;
926
- cleanZero?: boolean | undefined;
927
- cleanNull?: boolean | undefined;
928
- cleanWhitespace?: boolean | undefined;
929
- }) => string;
930
- https: (url: string) => string;
931
- parseUrl: (url: string) => {
932
- pathname: string;
933
- params: {};
934
- route: string;
935
- page: string;
936
- name: string;
937
- withoutExtension: string;
938
- extname: string;
939
- href: string;
940
- url: string;
941
- origin: string;
942
- host: string;
943
- protocol: string;
944
- port: string;
945
- query: string;
946
- };
947
- parsePath: (url: string) => {
948
- route: string;
949
- page: string;
950
- name: string;
951
- withoutExtension: string;
952
- extname: string;
953
- };
954
- parseHost: (url: string) => import("./typings").Ddan.IHttpHost;
955
- join: (...args: string[]) => string;
956
- shExpMatch: (text: string, pattern: string) => boolean;
957
- isLocalIpAddress: (addr: string) => boolean;
958
- parseFileUrl: (url: string) => {
959
- href: string;
960
- file: string;
961
- url: string;
962
- protocol: string;
963
- host: string;
964
- query: string;
965
- params: {};
966
- };
967
- };
968
- css: {
969
- stringify: (styleObj: Record<string, string | number>) => string;
970
- parse: (styleStr: string, { camel, pure }?: {
971
- camel?: boolean | undefined;
972
- pure?: boolean | undefined;
973
- }) => {} | undefined;
974
- fixValue: (value: string | number, unit?: string) => string | number;
975
- style: (cssKV: Record<string, any>, unit?: string) => string;
976
- commonFields: string[];
977
- };
978
- cdn: {
979
- ossImage: (url: string, options?: {
980
- webp?: boolean | undefined;
981
- resize?: number | undefined;
982
- interlace?: boolean | undefined;
983
- domain?: string | string[] | undefined;
984
- }) => string;
985
- ossSnapshot: (url: string, options?: {
986
- t?: number | undefined;
987
- w?: number | undefined;
988
- h?: number | undefined;
989
- m?: "" | "fast" | undefined;
990
- f?: "jpg" | "png" | undefined;
991
- ar?: "auto" | "h" | "w" | undefined;
992
- }) => string;
993
- ossBase64: (input: string) => string;
994
- };
995
- html: {
996
- dataURLtoFile: (dataurl: any, filename: any) => File;
997
- dataURLtoBlob: (dataurl: any) => Blob;
998
- blobToFile: (blob: any, fileName: string) => any;
999
- readAsDataURL: (file: any, cb: any) => void;
1000
- downloadUrl: (url: string, filename?: string, checkSomeOrigin?: boolean) => void;
1001
- download: (urlOrFile: string | Blob | MediaSource, filename?: string) => void;
1002
- downloadFile: (data: Blob | MediaSource, filename?: string) => void;
1003
- downloadImage: (url: string) => Promise<void> | undefined;
1004
- watermark: (text: string, { width, height, angle, fillStyle, font, textAlign, textBaseline, }?: {
1005
- width?: number | undefined;
1006
- height?: number | undefined;
1007
- angle?: number | undefined;
1008
- fillStyle?: string | undefined;
1009
- font?: string | undefined;
1010
- textAlign?: "center" | "end" | "left" | "right" | "start" | undefined;
1011
- textBaseline?: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" | undefined;
1012
- }) => string;
1013
- copyText: (text: string, legacy?: boolean) => Promise<boolean>;
1014
- queryPermission: (name: string, def?: PermissionState) => Promise<PermissionState>;
1015
- isAllowed: (status: PermissionState | undefined, prompt?: boolean) => boolean;
1016
- legacyCopy: (text: string) => boolean;
1017
- takeHtmlLinks: (htmlContent: string) => never[];
1018
- takeHtml: (htmlContent: string, regex: RegExp) => string[];
1019
- toBlobUrl: (part: BlobPart, mime: "application/javascript") => string;
1020
- };
1021
- icon: import("./class/icon").DIcon;
1022
- rule: {
1023
- validateId: (content: any) => boolean;
1024
- validatePhone: (content: any) => boolean;
1025
- validator: (rules: import("./modules/rule/async-validator").Rules) => import("./modules/rule/async-validator").default;
1026
- 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>;
1027
- isChinese: (content: string) => boolean;
1028
- isNumber: (content: string) => boolean;
1029
- isFloat: (content: string) => boolean;
1030
- isPhoneNumber: (content: any) => boolean;
1031
- };
1032
- regex: {
1033
- pattern: {
1034
- num: string;
1035
- zh: string;
1036
- en: string;
1037
- };
1038
- regex: (patt: string, modifiers?: "g" | "i" | "m" | undefined) => RegExp;
1039
- entire: {
1040
- chinese: RegExp;
1041
- real: RegExp;
1042
- cssReal: RegExp;
1043
- id: RegExp;
1044
- yyyyMMdd: RegExp;
1045
- };
1046
- };
1047
- convert: {
1048
- str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
1049
- ab2str: (data: ArrayBuffer, base64?: boolean) => string;
1050
- utf8ToBase64: (str: string) => string;
1051
- base64ToUtf8: (base64Str: string) => string;
1052
- getRandomBytes: (length: number) => Uint8Array;
1053
- textEncode: (text: string) => Uint8Array;
1054
- textDecode: (buf: ArrayBufferLike) => string;
1055
- toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
1056
- md5: (input: string | Uint8Array) => string;
1057
- md5Base64: (input: string | Uint8Array) => string;
1058
- toBase64: (input?: string) => string;
1059
- fromBase64: (input?: string) => string;
1060
- bytesToBase64: (bytes: Uint8Array) => string;
1061
- base64ToBytes: (input?: string) => Uint8Array;
1062
- toUtf8: (content: string) => string;
1063
- fromUtf8: (utftext: string) => string;
1064
- toUtf8Bytes: (content: string) => Uint8Array;
1065
- fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
1066
- pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
1067
- pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
1068
- bytes2str: (bytes: Uint8Array) => string;
1069
- str2bytes: (str?: string) => Uint8Array;
1070
- str2hex: (str: string) => string;
1071
- hex2str: (hexstr: string) => string;
1072
- concatBytes: (...args: Uint8Array[]) => Uint8Array;
1073
- uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
1074
- bytesToUint32: (bytes: Uint8Array) => Uint32Array;
1075
- hex2bytes: (hex: string) => Uint8Array;
1076
- bytes2hex: (bytes: Uint8Array) => string;
1077
- toUint32: (str: string) => Uint32Array;
1078
- fromUint32: (uint32: Uint32Array) => string;
1079
- flatten: <T_17>(data: T_17[], recursive?: boolean, list?: T_17[]) => T_17[];
1080
- };
1081
- KValue: typeof KValue;
1082
- Mapping: typeof Mapping;
1083
- Event: typeof Event;
1084
- Http: typeof Http;
1085
- Store: typeof Store;
1086
- storeRef: (source: import("./typings").Ddan.IDStore, persistConfig?: import("./typings").Ddan.IDPersistConfig | undefined) => any;
1087
- Persist: typeof Persist;
1088
- persistConfig: (key: string, fields: string[], storage: import("./typings").Ddan.IStorage) => import("./typings").Ddan.IDPersistConfig;
1089
- watermark: (bg: string, size?: {
1090
- width?: number | undefined;
1091
- height?: number | undefined;
1092
- } | undefined) => import("./class/watermark").DWatermark;
1093
- joker: import("./class/joker").Joker;
1094
- tracker: import("./class/tracker").DTracker;
1095
- logger: {
1096
- override: () => void;
1097
- log: (...args: any[]) => void;
1098
- info: (...args: any[]) => void;
1099
- warn: (...args: any[]) => void;
1100
- error: (...args: any[]) => void;
1101
- config: ({ tag, format }?: {
1102
- tag?: boolean | undefined;
1103
- format?: string | undefined;
1104
- }) => void;
1105
- };
1106
- fetch: {
1107
- getDataURL: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, {
1108
- contentType: string;
1109
- dataUrl: string;
1110
- }]>;
1111
- getArrayBuffer: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, ArrayBuffer]>;
1112
- getJson: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, any]>;
1113
- download: (url: string, opts?: {
1114
- success?: ((buffer: Uint8Array) => void) | undefined;
1115
- progress?: ((percentage: number, current: number, total: number) => void) | undefined;
1116
- fail?: ((error: Error) => void) | undefined;
1117
- }) => Promise<Uint8Array | undefined>;
1118
- getText: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, string]>;
1119
- cache: (url: string, cache?: RequestCache) => Promise<[any, undefined] | [null, boolean]>;
1120
- };
1121
- rsa: {
1122
- generateKeys: () => Promise<{
1123
- publicKey: string;
1124
- publicKeyPem: string;
1125
- privateKey: string;
1126
- privateKeyPem: string;
1127
- }>;
1128
- encrypt: (data: string, publicKey: string) => Promise<string>;
1129
- decrypt: (encryptedBase64: string, privateKey: string) => Promise<string>;
1130
- encode: (data: string) => Promise<string>;
1131
- decode: (encryptedBase64: string) => Promise<string>;
1132
- };
1133
- };
1134
- export default _default;