ddan-js 2.9.19 → 2.10.1
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 +2 -2
- package/bin/ddan-js.js +1 -1
- package/bin/ddan-js.mjs +1 -1
- package/bin/index.d.ts +17 -440
- package/bin/modules/common/clone.d.ts +20 -0
- package/bin/modules/common/equal.d.ts +49 -0
- package/bin/modules/common/index.d.ts +20 -0
- package/package.json +1 -16
- package/bin/tiny/hook.d.ts +0 -185
- package/bin/tiny/hook.esm.js +0 -1
- package/bin/tiny/hook.js +0 -1
- package/bin/tiny/store.d.ts +0 -9
- package/bin/tiny/utils.d.ts +0 -239
- package/bin/tiny/utils.esm.js +0 -1
- package/bin/tiny/utils.js +0 -1
- package/bin/tiny/web.d.ts +0 -114
- package/bin/tiny/web.esm.js +0 -1
- package/bin/tiny/web.js +0 -1
package/bin/index.d.ts
CHANGED
|
@@ -418,6 +418,23 @@ declare const dHook: {
|
|
|
418
418
|
toUint32: (str: string) => Uint32Array;
|
|
419
419
|
fromUint32: (uint32: Uint32Array) => string;
|
|
420
420
|
flatten: <T_6>(data: T_6[], recursive?: boolean, list?: T_6[]) => T_6[];
|
|
421
|
+
copy: (source: any, options?: {
|
|
422
|
+
fields?: string[] | undefined;
|
|
423
|
+
camel?: boolean | undefined;
|
|
424
|
+
pure?: boolean | undefined;
|
|
425
|
+
ignoreNull?: boolean | undefined;
|
|
426
|
+
ignoreZero?: boolean | undefined;
|
|
427
|
+
ignoreEmptyArray?: boolean | undefined;
|
|
428
|
+
ignoreEmptyString?: boolean | undefined;
|
|
429
|
+
}) => any;
|
|
430
|
+
clone: (source: any, weakMap?: WeakMap<object, any>) => any;
|
|
431
|
+
cloneClass: <T_7>(source: T_7) => T_7;
|
|
432
|
+
isEqual: <T_8>(value: T_8, other: T_8, depth?: number) => boolean;
|
|
433
|
+
isEqualArray: (value: any[], other: any[], depth?: number) => boolean;
|
|
434
|
+
isEqualObject: (value: Record<string, any>, other: Record<string, any>, depth?: number) => boolean;
|
|
435
|
+
isEqualValue: <T_9>(value: T_9, other: T_9, type: string) => boolean;
|
|
436
|
+
isEqualAB: (value: ArrayBuffer, other: ArrayBuffer) => boolean;
|
|
437
|
+
isEqualDeep: <T_10>(value: T_10, other: T_10) => boolean;
|
|
421
438
|
};
|
|
422
439
|
declare const dMini: {
|
|
423
440
|
mini: {
|
|
@@ -728,443 +745,3 @@ declare const dNode: {
|
|
|
728
745
|
readFiles: (dir: string, files: string[], callback?: import("./typings").Ddan.Func1<string, any> | undefined) => Promise<void>;
|
|
729
746
|
};
|
|
730
747
|
export { dUtil, dHook, dWeb, dMini, dCdn, dStore, dJoker, dTracker, dLogger, dNode, Event, KValue, Mapping, };
|
|
731
|
-
declare const _default: {
|
|
732
|
-
gbk: {
|
|
733
|
-
gbkLength: (str: string) => number;
|
|
734
|
-
gbkCut: (source: string, len: number) => string;
|
|
735
|
-
};
|
|
736
|
-
time: {
|
|
737
|
-
now: () => import("./modules/time/dtime").default;
|
|
738
|
-
isToday: (date: any) => any;
|
|
739
|
-
parseTimestamp: ({ year, month, date, hour, minute, second }: {
|
|
740
|
-
year?: number | undefined;
|
|
741
|
-
month?: number | undefined;
|
|
742
|
-
date?: number | undefined;
|
|
743
|
-
hour?: number | undefined;
|
|
744
|
-
minute?: number | undefined;
|
|
745
|
-
second?: number | undefined;
|
|
746
|
-
}) => number;
|
|
747
|
-
todayZero: () => number;
|
|
748
|
-
format: (time: string | number | Date, reg?: string) => string;
|
|
749
|
-
countdown: (endTime: string | number | Date, reg?: string) => "" | import("./typings").Ddan.ICountdown;
|
|
750
|
-
dtime: (time: string | number | Date) => import("./modules/time/dtime").default;
|
|
751
|
-
loopFrame: (interval?: number) => import("./modules/time/frame").default;
|
|
752
|
-
getTimezoneOffset: () => number;
|
|
753
|
-
getLocalTime: typeof import("./modules/time/dtime").default.getLocalTime;
|
|
754
|
-
oneDay: number;
|
|
755
|
-
oneHour: number;
|
|
756
|
-
oneMinute: number;
|
|
757
|
-
oneSecond: number;
|
|
758
|
-
};
|
|
759
|
-
hook: {
|
|
760
|
-
sleep: (ms?: number) => Promise<unknown>;
|
|
761
|
-
run: <T = any>(task?: import("./typings").Ddan.PFunction<T> | undefined, wait?: number) => Promise<[any, undefined] | [null, T]>;
|
|
762
|
-
exec: (func: import("./typings").Ddan.Function, taskId?: string) => import("./typings").Ddan.PSafeResult<any>;
|
|
763
|
-
debounce: typeof import("./modules/hook/modules/debounce").default;
|
|
764
|
-
throttle: typeof import("./modules/hook/modules/throttle").default;
|
|
765
|
-
task: (param?: import("./typings").Ddan.Func1<any, any> | undefined) => import("./class/pipeTask").default;
|
|
766
|
-
mutex: typeof import("./modules/hook/modules/mutex").default;
|
|
767
|
-
polling: typeof import("./modules/hook/modules/polling").default;
|
|
768
|
-
pipe: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/pipeline").default;
|
|
769
|
-
pipeline: (max?: number) => import("./modules/hook/modules/pipeline").default;
|
|
770
|
-
safeTask: (func: import("./typings").Ddan.Function, callback?: ((result: import("./typings").Ddan.SafeResult<any>) => void) | undefined) => import("./modules/hook/modules/safeTask").default;
|
|
771
|
-
bezier1: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
|
|
772
|
-
bezier2: (p0: import("./typings").Ddan.IPoint, p1: import("./typings").Ddan.IPoint, p2: import("./typings").Ddan.IPoint, t: number) => import("./typings").Ddan.IPoint;
|
|
773
|
-
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;
|
|
774
|
-
bezier: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
|
|
775
|
-
bezierCurve: (points: import("./typings").Ddan.IPoint[], t: number) => import("./typings").Ddan.IPoint;
|
|
776
|
-
lerp: (start: number, end: number, t: number) => number;
|
|
777
|
-
lerpAverage: (points: import("./typings").Ddan.IPoint[], step: number, type?: "" | "lerp") => number;
|
|
778
|
-
proportion: (start: number, end: number, current: number) => number;
|
|
779
|
-
logString: (data: any) => string;
|
|
780
|
-
logParse: (logStr: string) => string;
|
|
781
|
-
logRString: (data: any) => Promise<string>;
|
|
782
|
-
logRParse: (logStr: string) => Promise<string>;
|
|
783
|
-
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]>;
|
|
784
|
-
go: <T_2 = any>(task?: import("./typings").Ddan.PFunction<T_2> | undefined, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_2]>;
|
|
785
|
-
delay: (ms?: number) => Promise<unknown>;
|
|
786
|
-
safeRun: <T_3 = any>(func: any, fn?: import("./typings").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_3]>;
|
|
787
|
-
toError: (value: any) => any;
|
|
788
|
-
timeout: <T_4 = any>(task?: import("./typings").Ddan.PFunction<T_4> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_4]>;
|
|
789
|
-
};
|
|
790
|
-
math: {
|
|
791
|
-
random: (max: number) => number;
|
|
792
|
-
randomRange: (min: number, max: number) => number;
|
|
793
|
-
lerp: (start: number, end: number, t: number) => number;
|
|
794
|
-
randoms: (max: number, count?: number, repeat?: boolean) => number[];
|
|
795
|
-
strip: (num: string | number, digits?: number) => number;
|
|
796
|
-
float: (num: string | number, { digits, fixed }?: {
|
|
797
|
-
digits?: number | undefined;
|
|
798
|
-
fixed?: boolean | undefined;
|
|
799
|
-
}) => number;
|
|
800
|
-
radian2degree: (radians: number) => number;
|
|
801
|
-
degree2radian: (degrees: number) => number;
|
|
802
|
-
calcDataSize: (data: number) => {
|
|
803
|
-
gb: number;
|
|
804
|
-
mb: number;
|
|
805
|
-
kb: number;
|
|
806
|
-
b: number;
|
|
807
|
-
total: number;
|
|
808
|
-
desc: string;
|
|
809
|
-
};
|
|
810
|
-
};
|
|
811
|
-
util: {
|
|
812
|
-
includes: typeof import("./util/includes").default;
|
|
813
|
-
forof: (source: any, cb: (key: any, val: any) => void) => void;
|
|
814
|
-
singleton: <T_5>() => {
|
|
815
|
-
new (): {};
|
|
816
|
-
__instance__: any;
|
|
817
|
-
readonly Instance: T_5;
|
|
818
|
-
readonly I: T_5;
|
|
819
|
-
};
|
|
820
|
-
getset: <T_6 = any>(t?: T_6 | undefined) => import("./typings").Ddan.IGetset<T_6>;
|
|
821
|
-
copy: (source: any, options?: {
|
|
822
|
-
fields?: string[] | undefined;
|
|
823
|
-
camel?: boolean | undefined;
|
|
824
|
-
pure?: boolean | undefined;
|
|
825
|
-
} & import("./typings").Ddan.IIgnoreParams) => any;
|
|
826
|
-
clone: (source: any) => any;
|
|
827
|
-
merge: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => {};
|
|
828
|
-
isEmpty: (source: any) => boolean;
|
|
829
|
-
parseValue: (source: any, { number, boolean }?: {
|
|
830
|
-
number?: boolean | undefined;
|
|
831
|
-
boolean?: boolean | undefined;
|
|
832
|
-
}) => any;
|
|
833
|
-
cloneClass: <T_7>(source: T_7) => T_7;
|
|
834
|
-
combine: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => any;
|
|
835
|
-
combines: (objs: any[], options?: import("./typings").Ddan.IIgnoreParams) => {};
|
|
836
|
-
observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
|
|
837
|
-
find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
|
|
838
|
-
getTag: (value: any) => string;
|
|
839
|
-
getType: (value: any) => string;
|
|
840
|
-
toString: () => string;
|
|
841
|
-
hasOwnProperty: (v: PropertyKey) => boolean;
|
|
842
|
-
propertyIsEnumerable: (v: PropertyKey) => boolean;
|
|
843
|
-
is: (val: any, type: string) => boolean;
|
|
844
|
-
isNumber: (value: any) => boolean;
|
|
845
|
-
isString: (value: any) => boolean;
|
|
846
|
-
isObject: (value: any) => boolean;
|
|
847
|
-
isObjectLike: (value: any) => boolean;
|
|
848
|
-
isPlainObject: (value: any) => boolean;
|
|
849
|
-
isSymbol: (value: any) => boolean;
|
|
850
|
-
isFunction: (value: any) => boolean;
|
|
851
|
-
isArray: (arg: any) => arg is any[];
|
|
852
|
-
isArrayLikeObject: (value: any) => boolean;
|
|
853
|
-
isIndex: (value: any, length: number) => boolean;
|
|
854
|
-
isArrayLike: (value: any) => boolean;
|
|
855
|
-
isPrototype: (value: any) => boolean;
|
|
856
|
-
isArguments: (value: any) => boolean;
|
|
857
|
-
isPromise: (value: any) => boolean;
|
|
858
|
-
isBrowser: boolean;
|
|
859
|
-
isNode: boolean;
|
|
860
|
-
isBlobOrBuffer: (data: any) => boolean;
|
|
861
|
-
isUint8Array: (data: any) => boolean;
|
|
862
|
-
isArrayBuffer: (data: any) => boolean;
|
|
863
|
-
};
|
|
864
|
-
list: {
|
|
865
|
-
stepAction: <T_8>(list: T_8[], func: import("./typings").Ddan.Task<T_8, void>, stepCount?: number) => void;
|
|
866
|
-
skip: <T_9>(list: T_9[], count: number) => T_9[];
|
|
867
|
-
take: <T_10>(list: T_10[], count: number, skip?: number) => T_10[];
|
|
868
|
-
distinct: <T_11>(list: T_11[]) => T_11[];
|
|
869
|
-
randoms: <T_12>(list: T_12[], count?: number, repeat?: boolean) => T_12[];
|
|
870
|
-
toKV: (list: import("./typings").Ddan.KV<any>[], key: string, value: string) => import("./typings").Ddan.KV<any>;
|
|
871
|
-
groupBy: <T_13>(list: T_13[], key: string) => Record<string, T_13[]>;
|
|
872
|
-
first: <T_14>(list: T_14[]) => T_14 | undefined;
|
|
873
|
-
last: <T_15>(list: T_15[]) => T_15 | undefined;
|
|
874
|
-
toList: <T_16>(val: T_16 | T_16[]) => T_16[];
|
|
875
|
-
};
|
|
876
|
-
string: {
|
|
877
|
-
toString: (value: any) => any;
|
|
878
|
-
startCase: (string: any) => any;
|
|
879
|
-
snakeCase: (string: any) => any;
|
|
880
|
-
kebabCase: (string: any) => any;
|
|
881
|
-
camelCase: (string: any) => any;
|
|
882
|
-
upperCase: (string: any) => any;
|
|
883
|
-
upperFirst: (string: any) => any;
|
|
884
|
-
lowerCase: (string: any) => any;
|
|
885
|
-
lowerFirst: (string: any) => any;
|
|
886
|
-
splitOnFirst: (string: any, separator: any) => string[];
|
|
887
|
-
parseValue: (value?: any, { number, boolean }?: {
|
|
888
|
-
number?: boolean | undefined;
|
|
889
|
-
boolean?: boolean | undefined;
|
|
890
|
-
}) => any;
|
|
891
|
-
replace: (source: string, rules: import("./typings").Ddan.IRegexRule | import("./typings").Ddan.IRegexRule[]) => string;
|
|
892
|
-
jsonFormat: (jsonString: string) => string;
|
|
893
|
-
toLines: (content: string, separator?: string | RegExp) => string[];
|
|
894
|
-
};
|
|
895
|
-
obj: {
|
|
896
|
-
copy: (source: any, options?: {
|
|
897
|
-
fields?: string[] | undefined;
|
|
898
|
-
camel?: boolean | undefined;
|
|
899
|
-
pure?: boolean | undefined;
|
|
900
|
-
} & import("./typings").Ddan.IIgnoreParams) => any;
|
|
901
|
-
clone: (source: any) => any;
|
|
902
|
-
merge: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => {};
|
|
903
|
-
isEmpty: (source: any) => boolean;
|
|
904
|
-
parseValue: (source: any, { number, boolean }?: {
|
|
905
|
-
number?: boolean | undefined;
|
|
906
|
-
boolean?: boolean | undefined;
|
|
907
|
-
}) => any;
|
|
908
|
-
cloneClass: <T_7>(source: T_7) => T_7;
|
|
909
|
-
combine: (target: any, source: any, options?: import("./typings").Ddan.IIgnoreParams) => any;
|
|
910
|
-
combines: (objs: any[], options?: import("./typings").Ddan.IIgnoreParams) => {};
|
|
911
|
-
observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
|
|
912
|
-
find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
|
|
913
|
-
};
|
|
914
|
-
crypto: {
|
|
915
|
-
base64: {
|
|
916
|
-
encode: (input: string) => string;
|
|
917
|
-
decode: (base64Str: string) => string;
|
|
918
|
-
encodeByOss: (input: string) => string;
|
|
919
|
-
};
|
|
920
|
-
tea: {
|
|
921
|
-
TEAKey: string;
|
|
922
|
-
encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
|
|
923
|
-
decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
|
|
924
|
-
toTeaKey: (str: string) => Uint32Array;
|
|
925
|
-
encode: (plaintext: string, key: string) => string;
|
|
926
|
-
decode: (ciphertext: string, key: string) => string;
|
|
927
|
-
encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
|
|
928
|
-
decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
|
|
929
|
-
};
|
|
930
|
-
uuid: (len?: number, radix?: number) => string;
|
|
931
|
-
guid: (len: number, prefix?: boolean, sep?: string) => string;
|
|
932
|
-
getHexString: (len: number) => string;
|
|
933
|
-
keyNumber: string;
|
|
934
|
-
keyLower: string;
|
|
935
|
-
keyUpper: string;
|
|
936
|
-
keyChars: string;
|
|
937
|
-
};
|
|
938
|
-
mini: {
|
|
939
|
-
diff: typeof import("./modules/mini/diff").default;
|
|
940
|
-
promixify: (miniapi: any) => any;
|
|
941
|
-
run: (func: any, args?: {}) => Promise<[any, undefined] | [null, any]>;
|
|
942
|
-
formatList: (lists: any[], start: any, name: any) => any;
|
|
943
|
-
ruleValidator: (_: any, value: any) => boolean;
|
|
944
|
-
Http: typeof import("./modules/mini/http").default;
|
|
945
|
-
setWatcher: (page: any) => void;
|
|
946
|
-
};
|
|
947
|
-
qs: {
|
|
948
|
-
parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
|
|
949
|
-
sep?: string | undefined;
|
|
950
|
-
eq?: string | undefined;
|
|
951
|
-
max?: number | undefined;
|
|
952
|
-
multiple?: boolean | undefined;
|
|
953
|
-
uri?: boolean | undefined;
|
|
954
|
-
parseNumber?: boolean | undefined;
|
|
955
|
-
parseBoolean?: boolean | undefined;
|
|
956
|
-
}) => {};
|
|
957
|
-
stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
|
|
958
|
-
sep?: string | undefined;
|
|
959
|
-
eq?: string | undefined;
|
|
960
|
-
name?: null | undefined;
|
|
961
|
-
uri?: boolean | undefined;
|
|
962
|
-
cleanZero?: boolean | undefined;
|
|
963
|
-
cleanNull?: boolean | undefined;
|
|
964
|
-
cleanWhitespace?: boolean | undefined;
|
|
965
|
-
}) => string;
|
|
966
|
-
https: (url: string) => string;
|
|
967
|
-
parseUrl: (url: string) => {
|
|
968
|
-
pathname: string;
|
|
969
|
-
params: {};
|
|
970
|
-
route: string;
|
|
971
|
-
page: string;
|
|
972
|
-
name: string;
|
|
973
|
-
withoutExtension: string;
|
|
974
|
-
extname: string;
|
|
975
|
-
href: string;
|
|
976
|
-
url: string;
|
|
977
|
-
origin: string;
|
|
978
|
-
host: string;
|
|
979
|
-
protocol: string;
|
|
980
|
-
port: string;
|
|
981
|
-
query: string;
|
|
982
|
-
};
|
|
983
|
-
parsePath: (url: string) => {
|
|
984
|
-
route: string;
|
|
985
|
-
page: string;
|
|
986
|
-
name: string;
|
|
987
|
-
withoutExtension: string;
|
|
988
|
-
extname: string;
|
|
989
|
-
};
|
|
990
|
-
parseHost: (url: string) => import("./typings").Ddan.IHttpHost;
|
|
991
|
-
join: (...args: string[]) => string;
|
|
992
|
-
shExpMatch: (text: string, pattern: string) => boolean;
|
|
993
|
-
isLocalIpAddress: (addr: string) => boolean;
|
|
994
|
-
parseFileUrl: (url: string) => {
|
|
995
|
-
href: string;
|
|
996
|
-
file: string;
|
|
997
|
-
url: string;
|
|
998
|
-
protocol: string;
|
|
999
|
-
host: string;
|
|
1000
|
-
query: string;
|
|
1001
|
-
params: {};
|
|
1002
|
-
};
|
|
1003
|
-
};
|
|
1004
|
-
css: {
|
|
1005
|
-
stringify: (styleObj: Record<string, string | number>) => string;
|
|
1006
|
-
parse: (styleStr: string, { camel, pure }?: {
|
|
1007
|
-
camel?: boolean | undefined;
|
|
1008
|
-
pure?: boolean | undefined;
|
|
1009
|
-
}) => {} | undefined;
|
|
1010
|
-
fixValue: (value: string | number, unit?: string) => string | number;
|
|
1011
|
-
style: (cssKV: Record<string, any>, unit?: string) => string;
|
|
1012
|
-
commonFields: string[];
|
|
1013
|
-
};
|
|
1014
|
-
cdn: {
|
|
1015
|
-
ossImage: (url: string, options?: {
|
|
1016
|
-
webp?: boolean | undefined;
|
|
1017
|
-
resize?: number | undefined;
|
|
1018
|
-
interlace?: boolean | undefined;
|
|
1019
|
-
domain?: string | string[] | undefined;
|
|
1020
|
-
}) => string;
|
|
1021
|
-
ossSnapshot: (url: string, options?: {
|
|
1022
|
-
t?: number | undefined;
|
|
1023
|
-
w?: number | undefined;
|
|
1024
|
-
h?: number | undefined;
|
|
1025
|
-
m?: "" | "fast" | undefined;
|
|
1026
|
-
f?: "jpg" | "png" | undefined;
|
|
1027
|
-
ar?: "auto" | "h" | "w" | undefined;
|
|
1028
|
-
}) => string;
|
|
1029
|
-
ossBase64: (input: string) => string;
|
|
1030
|
-
};
|
|
1031
|
-
html: {
|
|
1032
|
-
dataURLtoFile: (dataurl: any, filename: any) => File;
|
|
1033
|
-
dataURLtoBlob: (dataurl: any) => Blob;
|
|
1034
|
-
blobToFile: (blob: any, fileName: string) => any;
|
|
1035
|
-
readAsDataURL: (file: any, cb: any) => void;
|
|
1036
|
-
downloadUrl: (url: string, filename?: string, checkSomeOrigin?: boolean) => void;
|
|
1037
|
-
download: (urlOrFile: string | Blob | MediaSource, filename?: string) => void;
|
|
1038
|
-
downloadFile: (data: Blob | MediaSource, filename?: string) => void;
|
|
1039
|
-
downloadImage: (url: string) => Promise<void> | undefined;
|
|
1040
|
-
watermark: (text: string, { width, height, angle, fillStyle, font, textAlign, textBaseline, }?: {
|
|
1041
|
-
width?: number | undefined;
|
|
1042
|
-
height?: number | undefined;
|
|
1043
|
-
angle?: number | undefined;
|
|
1044
|
-
fillStyle?: string | undefined;
|
|
1045
|
-
font?: string | undefined;
|
|
1046
|
-
textAlign?: "center" | "end" | "left" | "right" | "start" | undefined;
|
|
1047
|
-
textBaseline?: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" | undefined;
|
|
1048
|
-
}) => string;
|
|
1049
|
-
copyText: (text: string, legacy?: boolean) => Promise<boolean>;
|
|
1050
|
-
queryPermission: (name: string, def?: PermissionState) => Promise<PermissionState>;
|
|
1051
|
-
isAllowed: (status: PermissionState | undefined, prompt?: boolean) => boolean;
|
|
1052
|
-
legacyCopy: (text: string) => boolean;
|
|
1053
|
-
takeHtmlLinks: (htmlContent: string) => never[];
|
|
1054
|
-
takeHtml: (htmlContent: string, regex: RegExp) => string[];
|
|
1055
|
-
toBlobUrl: (part: BlobPart, mime: "application/javascript") => string;
|
|
1056
|
-
};
|
|
1057
|
-
icon: import("./class/icon").DIcon;
|
|
1058
|
-
rule: {
|
|
1059
|
-
validateId: (content: any) => boolean;
|
|
1060
|
-
validatePhone: (content: any) => boolean;
|
|
1061
|
-
validator: (rules: import("./modules/rule/async-validator").Rules) => import("./modules/rule/async-validator").default;
|
|
1062
|
-
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>;
|
|
1063
|
-
isChinese: (content: string) => boolean;
|
|
1064
|
-
isNumber: (content: string) => boolean;
|
|
1065
|
-
isFloat: (content: string) => boolean;
|
|
1066
|
-
isPhoneNumber: (content: any) => boolean;
|
|
1067
|
-
};
|
|
1068
|
-
regex: {
|
|
1069
|
-
pattern: {
|
|
1070
|
-
num: string;
|
|
1071
|
-
zh: string;
|
|
1072
|
-
en: string;
|
|
1073
|
-
};
|
|
1074
|
-
regex: (patt: string, modifiers?: "i" | "g" | "m" | undefined) => RegExp;
|
|
1075
|
-
entire: {
|
|
1076
|
-
chinese: RegExp;
|
|
1077
|
-
real: RegExp;
|
|
1078
|
-
cssReal: RegExp;
|
|
1079
|
-
id: RegExp;
|
|
1080
|
-
yyyyMMdd: RegExp;
|
|
1081
|
-
};
|
|
1082
|
-
};
|
|
1083
|
-
convert: {
|
|
1084
|
-
str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
|
|
1085
|
-
ab2str: (data: ArrayBuffer, base64?: boolean) => string;
|
|
1086
|
-
utf8ToBase64: (str: string) => string;
|
|
1087
|
-
base64ToUtf8: (base64Str: string) => string;
|
|
1088
|
-
getRandomBytes: (length: number) => Uint8Array;
|
|
1089
|
-
textEncode: (text: string) => Uint8Array;
|
|
1090
|
-
textDecode: (buf: ArrayBufferLike) => string;
|
|
1091
|
-
toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
|
|
1092
|
-
md5: (input: string | Uint8Array) => string;
|
|
1093
|
-
md5Base64: (input: string | Uint8Array) => string;
|
|
1094
|
-
toBase64: (input?: string) => string;
|
|
1095
|
-
fromBase64: (input?: string) => string;
|
|
1096
|
-
bytesToBase64: (bytes: Uint8Array) => string;
|
|
1097
|
-
base64ToBytes: (input?: string) => Uint8Array;
|
|
1098
|
-
toUtf8: (content: string) => string;
|
|
1099
|
-
fromUtf8: (utftext: string) => string;
|
|
1100
|
-
toUtf8Bytes: (content: string) => Uint8Array;
|
|
1101
|
-
fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
|
|
1102
|
-
pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
|
|
1103
|
-
pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
|
|
1104
|
-
bytes2str: (bytes: Uint8Array) => string;
|
|
1105
|
-
str2bytes: (str?: string) => Uint8Array;
|
|
1106
|
-
str2hex: (str: string) => string;
|
|
1107
|
-
hex2str: (hexstr: string) => string;
|
|
1108
|
-
concatBytes: (...args: Uint8Array[]) => Uint8Array;
|
|
1109
|
-
uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
|
|
1110
|
-
bytesToUint32: (bytes: Uint8Array) => Uint32Array;
|
|
1111
|
-
hex2bytes: (hex: string) => Uint8Array;
|
|
1112
|
-
bytes2hex: (bytes: Uint8Array) => string;
|
|
1113
|
-
toUint32: (str: string) => Uint32Array;
|
|
1114
|
-
fromUint32: (uint32: Uint32Array) => string;
|
|
1115
|
-
flatten: <T_17>(data: T_17[], recursive?: boolean, list?: T_17[]) => T_17[];
|
|
1116
|
-
};
|
|
1117
|
-
KValue: typeof KValue;
|
|
1118
|
-
Mapping: typeof Mapping;
|
|
1119
|
-
Event: typeof Event;
|
|
1120
|
-
Http: typeof Http;
|
|
1121
|
-
Store: typeof Store;
|
|
1122
|
-
storeRef: (source: import("./typings").Ddan.IDStore, persistConfig?: import("./typings").Ddan.IDPersistConfig | undefined) => any;
|
|
1123
|
-
Persist: typeof Persist;
|
|
1124
|
-
persistConfig: (key: string, fields: string[], storage: import("./typings").Ddan.IStorage) => import("./typings").Ddan.IDPersistConfig;
|
|
1125
|
-
watermark: (bg: string, size?: {
|
|
1126
|
-
width?: number | undefined;
|
|
1127
|
-
height?: number | undefined;
|
|
1128
|
-
} | undefined) => import("./class/watermark").DWatermark;
|
|
1129
|
-
joker: import("./class/joker").Joker;
|
|
1130
|
-
tracker: import("./class/tracker").DTracker;
|
|
1131
|
-
logger: {
|
|
1132
|
-
override: () => void;
|
|
1133
|
-
log: (...args: any[]) => void;
|
|
1134
|
-
info: (...args: any[]) => void;
|
|
1135
|
-
warn: (...args: any[]) => void;
|
|
1136
|
-
error: (...args: any[]) => void;
|
|
1137
|
-
config: ({ tag, format }?: {
|
|
1138
|
-
tag?: boolean | undefined;
|
|
1139
|
-
format?: string | undefined;
|
|
1140
|
-
}) => void;
|
|
1141
|
-
};
|
|
1142
|
-
fetch: {
|
|
1143
|
-
getDataURL: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, {
|
|
1144
|
-
contentType: string;
|
|
1145
|
-
dataUrl: string;
|
|
1146
|
-
}]>;
|
|
1147
|
-
getArrayBuffer: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, ArrayBuffer]>;
|
|
1148
|
-
getJson: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, any]>;
|
|
1149
|
-
download: (url: string, opts?: {
|
|
1150
|
-
success?: ((buffer: Uint8Array) => void) | undefined;
|
|
1151
|
-
progress?: ((percentage: number, current: number, total: number) => void) | undefined;
|
|
1152
|
-
fail?: ((error: Error) => void) | undefined;
|
|
1153
|
-
}) => Promise<Uint8Array | undefined>;
|
|
1154
|
-
getText: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, string]>;
|
|
1155
|
-
cache: (url: string, cache?: RequestCache) => Promise<[any, undefined] | [null, boolean]>;
|
|
1156
|
-
};
|
|
1157
|
-
rsa: {
|
|
1158
|
-
generateKeys: () => Promise<{
|
|
1159
|
-
publicKey: string;
|
|
1160
|
-
publicKeyPem: string;
|
|
1161
|
-
privateKey: string;
|
|
1162
|
-
privateKeyPem: string;
|
|
1163
|
-
}>;
|
|
1164
|
-
encrypt: (data: string, publicKey: string) => Promise<string>;
|
|
1165
|
-
decrypt: (encryptedBase64: string, privateKey: string) => Promise<string>;
|
|
1166
|
-
encode: (data: string) => Promise<string>;
|
|
1167
|
-
decode: (encryptedBase64: string) => Promise<string>;
|
|
1168
|
-
};
|
|
1169
|
-
};
|
|
1170
|
-
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 克隆一个类实例,保留其原型链和属性描述符
|
|
3
|
+
* @param source 要克隆的对象
|
|
4
|
+
* @returns 克隆后的对象
|
|
5
|
+
*/
|
|
6
|
+
declare function cloneClass<T>(source: T): T;
|
|
7
|
+
declare const _default: {
|
|
8
|
+
copy: (source: any, options?: {
|
|
9
|
+
fields?: string[] | undefined;
|
|
10
|
+
camel?: boolean | undefined;
|
|
11
|
+
pure?: boolean | undefined;
|
|
12
|
+
ignoreNull?: boolean | undefined;
|
|
13
|
+
ignoreZero?: boolean | undefined;
|
|
14
|
+
ignoreEmptyArray?: boolean | undefined;
|
|
15
|
+
ignoreEmptyString?: boolean | undefined;
|
|
16
|
+
}) => any;
|
|
17
|
+
clone: (source: any, weakMap?: WeakMap<object, any>) => any;
|
|
18
|
+
cloneClass: typeof cloneClass;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 对比值相等
|
|
3
|
+
* @param value
|
|
4
|
+
* @param other
|
|
5
|
+
* @param depth 比较深度
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare function isEqual<T>(value: T, other: T, depth?: number): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 比较数组
|
|
11
|
+
* @param value
|
|
12
|
+
* @param other
|
|
13
|
+
* @param depth
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
declare function isEqualArray(value: any[], other: any[], depth?: number): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 比较对象
|
|
19
|
+
* @param value
|
|
20
|
+
* @param other
|
|
21
|
+
* @param depth
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
declare function isEqualObject(value: Record<string, any>, other: Record<string, any>, depth?: number): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 按值类型直接比较
|
|
27
|
+
* @param value
|
|
28
|
+
* @param other
|
|
29
|
+
* @param type
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
declare function isEqualValue<T>(value: T, other: T, type: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 比较 ArrayBuffer
|
|
35
|
+
* @param value
|
|
36
|
+
* @param other
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
declare function isEqualAB(value: ArrayBuffer, other: ArrayBuffer): boolean;
|
|
40
|
+
declare function isEqualDeep<T>(value: T, other: T): boolean;
|
|
41
|
+
declare const _default: {
|
|
42
|
+
isEqual: typeof isEqual;
|
|
43
|
+
isEqualArray: typeof isEqualArray;
|
|
44
|
+
isEqualObject: typeof isEqualObject;
|
|
45
|
+
isEqualValue: typeof isEqualValue;
|
|
46
|
+
isEqualAB: typeof isEqualAB;
|
|
47
|
+
isEqualDeep: typeof isEqualDeep;
|
|
48
|
+
};
|
|
49
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
copy: (source: any, options?: {
|
|
3
|
+
fields?: string[] | undefined;
|
|
4
|
+
camel?: boolean | undefined;
|
|
5
|
+
pure?: boolean | undefined;
|
|
6
|
+
ignoreNull?: boolean | undefined;
|
|
7
|
+
ignoreZero?: boolean | undefined;
|
|
8
|
+
ignoreEmptyArray?: boolean | undefined;
|
|
9
|
+
ignoreEmptyString?: boolean | undefined;
|
|
10
|
+
}) => any;
|
|
11
|
+
clone: (source: any, weakMap?: WeakMap<object, any>) => any;
|
|
12
|
+
cloneClass: <T>(source: T) => T;
|
|
13
|
+
isEqual: <T_1>(value: T_1, other: T_1, depth?: number) => boolean;
|
|
14
|
+
isEqualArray: (value: any[], other: any[], depth?: number) => boolean;
|
|
15
|
+
isEqualObject: (value: Record<string, any>, other: Record<string, any>, depth?: number) => boolean;
|
|
16
|
+
isEqualValue: <T_2>(value: T_2, other: T_2, type: string) => boolean;
|
|
17
|
+
isEqualAB: (value: ArrayBuffer, other: ArrayBuffer) => boolean;
|
|
18
|
+
isEqualDeep: <T_3>(value: T_3, other: T_3) => boolean;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddan-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddan-js",
|
|
@@ -33,21 +33,6 @@
|
|
|
33
33
|
"import": "./bin/ddan-upload.mjs",
|
|
34
34
|
"require": "./bin/ddan-upload.js"
|
|
35
35
|
},
|
|
36
|
-
"./tiny/hook": {
|
|
37
|
-
"types": "./bin/tiny/hook.d.ts",
|
|
38
|
-
"import": "./bin/tiny/hook.esm.js",
|
|
39
|
-
"require": "./bin/tiny/hook.js"
|
|
40
|
-
},
|
|
41
|
-
"./tiny/utils": {
|
|
42
|
-
"types": "./bin/tiny/utils.d.ts",
|
|
43
|
-
"import": "./bin/tiny/utils.esm.js",
|
|
44
|
-
"require": "./bin/tiny/utils.js"
|
|
45
|
-
},
|
|
46
|
-
"./tiny/web": {
|
|
47
|
-
"types": "./bin/tiny/web.d.ts",
|
|
48
|
-
"import": "./bin/tiny/web.esm.js",
|
|
49
|
-
"require": "./bin/tiny/web.js"
|
|
50
|
-
},
|
|
51
36
|
"./*": "./*"
|
|
52
37
|
},
|
|
53
38
|
"files": [
|