ddan-js 2.9.17 → 2.9.19
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/package.json +10 -10
- package/bin/hook.d.ts +0 -185
- package/bin/store.d.ts +0 -9
- package/bin/utils.d.ts +0 -239
- package/bin/web.d.ts +0 -114
- /package/bin/tiny/{hook.mjs → hook.esm.js} +0 -0
- /package/bin/tiny/{utils.mjs → utils.esm.js} +0 -0
- /package/bin/tiny/{web.mjs → web.esm.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddan-js",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddan-js",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
"import": "./bin/ddan-upload.mjs",
|
|
34
34
|
"require": "./bin/ddan-upload.js"
|
|
35
35
|
},
|
|
36
|
-
"./hook": {
|
|
37
|
-
"types": "./bin/hook.d.ts",
|
|
38
|
-
"import": "./bin/tiny/hook.
|
|
36
|
+
"./tiny/hook": {
|
|
37
|
+
"types": "./bin/tiny/hook.d.ts",
|
|
38
|
+
"import": "./bin/tiny/hook.esm.js",
|
|
39
39
|
"require": "./bin/tiny/hook.js"
|
|
40
40
|
},
|
|
41
|
-
"./utils": {
|
|
42
|
-
"types": "./bin/utils.d.ts",
|
|
43
|
-
"import": "./bin/tiny/utils.
|
|
41
|
+
"./tiny/utils": {
|
|
42
|
+
"types": "./bin/tiny/utils.d.ts",
|
|
43
|
+
"import": "./bin/tiny/utils.esm.js",
|
|
44
44
|
"require": "./bin/tiny/utils.js"
|
|
45
45
|
},
|
|
46
|
-
"./web": {
|
|
47
|
-
"types": "./bin/web.d.ts",
|
|
48
|
-
"import": "./bin/tiny/web.
|
|
46
|
+
"./tiny/web": {
|
|
47
|
+
"types": "./bin/tiny/web.d.ts",
|
|
48
|
+
"import": "./bin/tiny/web.esm.js",
|
|
49
49
|
"require": "./bin/tiny/web.js"
|
|
50
50
|
},
|
|
51
51
|
"./*": "./*"
|
package/bin/hook.d.ts
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
declare const dHook: {
|
|
2
|
-
qs: {
|
|
3
|
-
parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
|
|
4
|
-
sep?: string | undefined;
|
|
5
|
-
eq?: string | undefined;
|
|
6
|
-
max?: number | undefined;
|
|
7
|
-
multiple?: boolean | undefined;
|
|
8
|
-
uri?: boolean | undefined;
|
|
9
|
-
parseNumber?: boolean | undefined;
|
|
10
|
-
parseBoolean?: boolean | undefined;
|
|
11
|
-
}) => {};
|
|
12
|
-
stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
|
|
13
|
-
sep?: string | undefined;
|
|
14
|
-
eq?: string | undefined;
|
|
15
|
-
name?: null | undefined;
|
|
16
|
-
uri?: boolean | undefined;
|
|
17
|
-
cleanZero?: boolean | undefined;
|
|
18
|
-
cleanNull?: boolean | undefined;
|
|
19
|
-
cleanWhitespace?: boolean | undefined;
|
|
20
|
-
}) => string;
|
|
21
|
-
https: (url: string) => string;
|
|
22
|
-
parseUrl: (url: string) => {
|
|
23
|
-
pathname: string;
|
|
24
|
-
params: {};
|
|
25
|
-
route: string;
|
|
26
|
-
page: string;
|
|
27
|
-
name: string;
|
|
28
|
-
withoutExtension: string;
|
|
29
|
-
extname: string;
|
|
30
|
-
href: string;
|
|
31
|
-
url: string;
|
|
32
|
-
origin: string;
|
|
33
|
-
host: string;
|
|
34
|
-
protocol: string;
|
|
35
|
-
port: string;
|
|
36
|
-
query: string;
|
|
37
|
-
};
|
|
38
|
-
parsePath: (url: string) => {
|
|
39
|
-
route: string;
|
|
40
|
-
page: string;
|
|
41
|
-
name: string;
|
|
42
|
-
withoutExtension: string;
|
|
43
|
-
extname: string;
|
|
44
|
-
};
|
|
45
|
-
parseHost: (url: string) => import("..").Ddan.IHttpHost;
|
|
46
|
-
join: (...args: string[]) => string;
|
|
47
|
-
shExpMatch: (text: string, pattern: string) => boolean;
|
|
48
|
-
isLocalIpAddress: (addr: string) => boolean;
|
|
49
|
-
parseFileUrl: (url: string) => {
|
|
50
|
-
href: string;
|
|
51
|
-
file: string;
|
|
52
|
-
url: string;
|
|
53
|
-
protocol: string;
|
|
54
|
-
host: string;
|
|
55
|
-
query: string;
|
|
56
|
-
params: {};
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
singleton: <T>() => {
|
|
60
|
-
new (): {};
|
|
61
|
-
__instance__: any;
|
|
62
|
-
readonly Instance: T;
|
|
63
|
-
readonly I: T;
|
|
64
|
-
};
|
|
65
|
-
getset: <T_1 = any>(t?: T_1 | undefined) => import("..").Ddan.IGetset<T_1>;
|
|
66
|
-
random: (max: number) => number;
|
|
67
|
-
randomRange: (min: number, max: number) => number;
|
|
68
|
-
lerp: (start: number, end: number, t: number) => number;
|
|
69
|
-
randoms: (max: number, count?: number, repeat?: boolean) => number[];
|
|
70
|
-
strip: (num: string | number, digits?: number) => number;
|
|
71
|
-
float: (num: string | number, { digits, fixed }?: {
|
|
72
|
-
digits?: number | undefined;
|
|
73
|
-
fixed?: boolean | undefined;
|
|
74
|
-
}) => number;
|
|
75
|
-
radian2degree: (radians: number) => number;
|
|
76
|
-
degree2radian: (degrees: number) => number;
|
|
77
|
-
calcDataSize: (data: number) => {
|
|
78
|
-
gb: number;
|
|
79
|
-
mb: number;
|
|
80
|
-
kb: number;
|
|
81
|
-
b: number;
|
|
82
|
-
total: number;
|
|
83
|
-
desc: string;
|
|
84
|
-
};
|
|
85
|
-
toString: (value: any) => any;
|
|
86
|
-
startCase: (string: any) => any;
|
|
87
|
-
snakeCase: (string: any) => any;
|
|
88
|
-
kebabCase: (string: any) => any;
|
|
89
|
-
camelCase: (string: any) => any;
|
|
90
|
-
upperCase: (string: any) => any;
|
|
91
|
-
upperFirst: (string: any) => any;
|
|
92
|
-
lowerCase: (string: any) => any;
|
|
93
|
-
lowerFirst: (string: any) => any;
|
|
94
|
-
splitOnFirst: (string: any, separator: any) => string[];
|
|
95
|
-
parseValue: (value?: any, { number, boolean }?: {
|
|
96
|
-
number?: boolean | undefined;
|
|
97
|
-
boolean?: boolean | undefined;
|
|
98
|
-
}) => any;
|
|
99
|
-
replace: (source: string, rules: import("..").Ddan.IRegexRule | import("..").Ddan.IRegexRule[]) => string;
|
|
100
|
-
jsonFormat: (jsonString: string) => string;
|
|
101
|
-
toLines: (content: string, separator?: string | RegExp) => string[];
|
|
102
|
-
sleep: (ms?: number) => Promise<unknown>;
|
|
103
|
-
run: <T_2 = any>(task?: import("..").Ddan.PFunction<T_2> | undefined, wait?: number) => Promise<[any, undefined] | [null, T_2]>;
|
|
104
|
-
exec: (func: import("..").Ddan.Function, taskId?: string) => import("..").Ddan.PSafeResult<any>;
|
|
105
|
-
debounce: typeof import("../modules/hook/modules/debounce").default;
|
|
106
|
-
throttle: typeof import("../modules/hook/modules/throttle").default;
|
|
107
|
-
task: (param?: import("..").Ddan.Func1<any, any> | undefined) => import("../class/pipeTask").default;
|
|
108
|
-
mutex: typeof import("../modules/hook/modules/mutex").default;
|
|
109
|
-
polling: typeof import("../modules/hook/modules/polling").default;
|
|
110
|
-
pipe: (func: import("..").Ddan.Function, callback?: ((result: import("..").Ddan.SafeResult<any>) => void) | undefined) => import("../modules/hook/modules/pipeline").default;
|
|
111
|
-
pipeline: (max?: number) => import("../modules/hook/modules/pipeline").default;
|
|
112
|
-
safeTask: (func: import("..").Ddan.Function, callback?: ((result: import("..").Ddan.SafeResult<any>) => void) | undefined) => import("../modules/hook/modules/safeTask").default;
|
|
113
|
-
bezier1: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
114
|
-
bezier2: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, p2: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
115
|
-
bezier3: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, p2: import("..").Ddan.IPoint, p3: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
116
|
-
bezier: (points: import("..").Ddan.IPoint[], t: number) => import("..").Ddan.IPoint;
|
|
117
|
-
bezierCurve: (points: import("..").Ddan.IPoint[], t: number) => import("..").Ddan.IPoint;
|
|
118
|
-
lerpAverage: (points: import("..").Ddan.IPoint[], step: number, type?: "" | "lerp") => number;
|
|
119
|
-
proportion: (start: number, end: number, current: number) => number;
|
|
120
|
-
logString: (data: any) => string;
|
|
121
|
-
logParse: (logStr: string) => string;
|
|
122
|
-
logRString: (data: any) => Promise<string>;
|
|
123
|
-
logRParse: (logStr: string) => Promise<string>;
|
|
124
|
-
to: <T_3 = any, U extends object = any>(promise: Promise<T_3>, errorExt?: object | undefined, fn?: import("..").Ddan.noop | undefined) => Promise<[null, T_3] | [U, undefined]>;
|
|
125
|
-
go: <T_4 = any>(task?: import("..").Ddan.PFunction<T_4> | undefined, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_4]>;
|
|
126
|
-
delay: (ms?: number) => Promise<unknown>;
|
|
127
|
-
safeRun: <T_5 = any>(func: any, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_5]>;
|
|
128
|
-
toError: (value: any) => any;
|
|
129
|
-
timeout: <T_6 = any>(task?: import("..").Ddan.PFunction<T_6> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_6]>;
|
|
130
|
-
base64: {
|
|
131
|
-
encode: (input: string) => string;
|
|
132
|
-
decode: (base64Str: string) => string;
|
|
133
|
-
encodeByOss: (input: string) => string;
|
|
134
|
-
};
|
|
135
|
-
tea: {
|
|
136
|
-
TEAKey: string;
|
|
137
|
-
encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
|
|
138
|
-
decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
|
|
139
|
-
toTeaKey: (str: string) => Uint32Array;
|
|
140
|
-
encode: (plaintext: string, key: string) => string;
|
|
141
|
-
decode: (ciphertext: string, key: string) => string;
|
|
142
|
-
encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
|
|
143
|
-
decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
|
|
144
|
-
};
|
|
145
|
-
uuid: (len?: number, radix?: number) => string;
|
|
146
|
-
guid: (len: number, prefix?: boolean, sep?: string) => string;
|
|
147
|
-
getHexString: (len: number) => string;
|
|
148
|
-
keyNumber: string;
|
|
149
|
-
keyLower: string;
|
|
150
|
-
keyUpper: string;
|
|
151
|
-
keyChars: string;
|
|
152
|
-
str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
|
|
153
|
-
ab2str: (data: ArrayBuffer, base64?: boolean) => string;
|
|
154
|
-
utf8ToBase64: (str: string) => string;
|
|
155
|
-
base64ToUtf8: (base64Str: string) => string;
|
|
156
|
-
getRandomBytes: (length: number) => Uint8Array;
|
|
157
|
-
textEncode: (text: string) => Uint8Array;
|
|
158
|
-
textDecode: (buf: ArrayBufferLike) => string;
|
|
159
|
-
toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
|
|
160
|
-
md5: (input: string | Uint8Array) => string;
|
|
161
|
-
md5Base64: (input: string | Uint8Array) => string;
|
|
162
|
-
toBase64: (input?: string) => string;
|
|
163
|
-
fromBase64: (input?: string) => string;
|
|
164
|
-
bytesToBase64: (bytes: Uint8Array) => string;
|
|
165
|
-
base64ToBytes: (input?: string) => Uint8Array;
|
|
166
|
-
toUtf8: (content: string) => string;
|
|
167
|
-
fromUtf8: (utftext: string) => string;
|
|
168
|
-
toUtf8Bytes: (content: string) => Uint8Array;
|
|
169
|
-
fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
|
|
170
|
-
pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
|
|
171
|
-
pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
|
|
172
|
-
bytes2str: (bytes: Uint8Array) => string;
|
|
173
|
-
str2bytes: (str?: string) => Uint8Array;
|
|
174
|
-
str2hex: (str: string) => string;
|
|
175
|
-
hex2str: (hexstr: string) => string;
|
|
176
|
-
concatBytes: (...args: Uint8Array[]) => Uint8Array;
|
|
177
|
-
uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
|
|
178
|
-
bytesToUint32: (bytes: Uint8Array) => Uint32Array;
|
|
179
|
-
hex2bytes: (hex: string) => Uint8Array;
|
|
180
|
-
bytes2hex: (bytes: Uint8Array) => string;
|
|
181
|
-
toUint32: (str: string) => Uint32Array;
|
|
182
|
-
fromUint32: (uint32: Uint32Array) => string;
|
|
183
|
-
flatten: <T_7>(data: T_7[], recursive?: boolean, list?: T_7[]) => T_7[];
|
|
184
|
-
};
|
|
185
|
-
export { dHook };
|
package/bin/store.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import Store from '../class/store';
|
|
2
|
-
import Persist from '../class/persist';
|
|
3
|
-
declare const dStore: {
|
|
4
|
-
Store: typeof Store;
|
|
5
|
-
storeRef: (source: import("..").Ddan.IDStore, persistConfig?: import("..").Ddan.IDPersistConfig | undefined) => any;
|
|
6
|
-
Persist: typeof Persist;
|
|
7
|
-
persistConfig: (key: string, fields: string[], storage: import("..").Ddan.IStorage) => import("..").Ddan.IDPersistConfig;
|
|
8
|
-
};
|
|
9
|
-
export { dStore };
|
package/bin/utils.d.ts
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
declare const dUtils: {
|
|
2
|
-
Event: {
|
|
3
|
-
new (type: string, eventInitDict?: EventInit | undefined): Event;
|
|
4
|
-
prototype: Event;
|
|
5
|
-
readonly NONE: 0;
|
|
6
|
-
readonly CAPTURING_PHASE: 1;
|
|
7
|
-
readonly AT_TARGET: 2;
|
|
8
|
-
readonly BUBBLING_PHASE: 3;
|
|
9
|
-
};
|
|
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("..").Ddan.IGetset<T_1>;
|
|
19
|
-
copy: (source: any, options?: {
|
|
20
|
-
fields?: string[] | undefined;
|
|
21
|
-
camel?: boolean | undefined;
|
|
22
|
-
pure?: boolean | undefined;
|
|
23
|
-
} & import("..").Ddan.IIgnoreParams) => any;
|
|
24
|
-
clone: (source: any) => any;
|
|
25
|
-
merge: (target: any, source: any, options?: import("..").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("..").Ddan.IIgnoreParams) => any;
|
|
33
|
-
combines: (objs: any[], options?: import("..").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
|
-
md5: (input: string | Uint8Array) => string;
|
|
92
|
-
md5Base64: (input: string | Uint8Array) => string;
|
|
93
|
-
toBase64: (input?: string) => string;
|
|
94
|
-
fromBase64: (input?: string) => string;
|
|
95
|
-
bytesToBase64: (bytes: Uint8Array) => string;
|
|
96
|
-
base64ToBytes: (input?: string) => Uint8Array;
|
|
97
|
-
toUtf8: (content: string) => string;
|
|
98
|
-
fromUtf8: (utftext: string) => string;
|
|
99
|
-
toUtf8Bytes: (content: string) => Uint8Array;
|
|
100
|
-
fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
|
|
101
|
-
pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
|
|
102
|
-
pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
|
|
103
|
-
bytes2str: (bytes: Uint8Array) => string;
|
|
104
|
-
str2bytes: (str?: string) => Uint8Array;
|
|
105
|
-
str2hex: (str: string) => string;
|
|
106
|
-
hex2str: (hexstr: string) => string;
|
|
107
|
-
concatBytes: (...args: Uint8Array[]) => Uint8Array;
|
|
108
|
-
uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
|
|
109
|
-
bytesToUint32: (bytes: Uint8Array) => Uint32Array;
|
|
110
|
-
hex2bytes: (hex: string) => Uint8Array;
|
|
111
|
-
bytes2hex: (bytes: Uint8Array) => string;
|
|
112
|
-
toUint32: (str: string) => Uint32Array;
|
|
113
|
-
fromUint32: (uint32: Uint32Array) => string;
|
|
114
|
-
flatten: <T_3>(data: T_3[], recursive?: boolean, list?: T_3[]) => T_3[];
|
|
115
|
-
gbk: {
|
|
116
|
-
gbkLength: (str: string) => number;
|
|
117
|
-
gbkCut: (source: string, len: number) => string;
|
|
118
|
-
};
|
|
119
|
-
math: {
|
|
120
|
-
random: (max: number) => number;
|
|
121
|
-
randomRange: (min: number, max: number) => number;
|
|
122
|
-
lerp: (start: number, end: number, t: number) => number;
|
|
123
|
-
randoms: (max: number, count?: number, repeat?: boolean) => number[];
|
|
124
|
-
strip: (num: string | number, digits?: number) => number;
|
|
125
|
-
float: (num: string | number, { digits, fixed }?: {
|
|
126
|
-
digits?: number | undefined;
|
|
127
|
-
fixed?: boolean | undefined;
|
|
128
|
-
}) => number;
|
|
129
|
-
radian2degree: (radians: number) => number;
|
|
130
|
-
degree2radian: (degrees: number) => number;
|
|
131
|
-
calcDataSize: (data: number) => {
|
|
132
|
-
gb: number;
|
|
133
|
-
mb: number;
|
|
134
|
-
kb: number;
|
|
135
|
-
b: number;
|
|
136
|
-
total: number;
|
|
137
|
-
desc: string;
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
list: {
|
|
141
|
-
stepAction: <T_4>(list: T_4[], func: import("..").Ddan.Task<T_4, void>, stepCount?: number) => void;
|
|
142
|
-
skip: <T_5>(list: T_5[], count: number) => T_5[];
|
|
143
|
-
take: <T_6>(list: T_6[], count: number, skip?: number) => T_6[];
|
|
144
|
-
distinct: <T_7>(list: T_7[]) => T_7[];
|
|
145
|
-
randoms: <T_8>(list: T_8[], count?: number, repeat?: boolean) => T_8[];
|
|
146
|
-
toKV: (list: import("..").Ddan.KV<any>[], key: string, value: string) => import("..").Ddan.KV<any>;
|
|
147
|
-
groupBy: <T_9>(list: T_9[], key: string) => Record<string, T_9[]>;
|
|
148
|
-
first: <T_10>(list: T_10[]) => T_10 | undefined;
|
|
149
|
-
last: <T_11>(list: T_11[]) => T_11 | undefined;
|
|
150
|
-
toList: <T_12>(val: T_12 | T_12[]) => T_12[];
|
|
151
|
-
};
|
|
152
|
-
string: {
|
|
153
|
-
toString: (value: any) => any;
|
|
154
|
-
startCase: (string: any) => any;
|
|
155
|
-
snakeCase: (string: any) => any;
|
|
156
|
-
kebabCase: (string: any) => any;
|
|
157
|
-
camelCase: (string: any) => any;
|
|
158
|
-
upperCase: (string: any) => any;
|
|
159
|
-
upperFirst: (string: any) => any;
|
|
160
|
-
lowerCase: (string: any) => any;
|
|
161
|
-
lowerFirst: (string: any) => any;
|
|
162
|
-
splitOnFirst: (string: any, separator: any) => string[];
|
|
163
|
-
parseValue: (value?: any, { number, boolean }?: {
|
|
164
|
-
number?: boolean | undefined;
|
|
165
|
-
boolean?: boolean | undefined;
|
|
166
|
-
}) => any;
|
|
167
|
-
replace: (source: string, rules: import("..").Ddan.IRegexRule | import("..").Ddan.IRegexRule[]) => string;
|
|
168
|
-
jsonFormat: (jsonString: string) => string;
|
|
169
|
-
toLines: (content: string, separator?: string | RegExp) => string[];
|
|
170
|
-
};
|
|
171
|
-
time: {
|
|
172
|
-
now: () => import("../modules/time/dtime").default;
|
|
173
|
-
isToday: (date: any) => any;
|
|
174
|
-
parseTimestamp: ({ year, month, date, hour, minute, second }: {
|
|
175
|
-
year?: number | undefined;
|
|
176
|
-
month?: number | undefined;
|
|
177
|
-
date?: number | undefined;
|
|
178
|
-
hour?: number | undefined;
|
|
179
|
-
minute?: number | undefined;
|
|
180
|
-
second?: number | undefined;
|
|
181
|
-
}) => number;
|
|
182
|
-
todayZero: () => number;
|
|
183
|
-
format: (time: string | number | Date, reg?: string) => string;
|
|
184
|
-
countdown: (endTime: string | number | Date, reg?: string) => "" | import("..").Ddan.ICountdown;
|
|
185
|
-
dtime: (time: string | number | Date) => import("../modules/time/dtime").default;
|
|
186
|
-
loopFrame: (interval?: number) => import("../modules/time/frame").default;
|
|
187
|
-
getTimezoneOffset: () => number;
|
|
188
|
-
getLocalTime: typeof import("../modules/time/dtime").default.getLocalTime;
|
|
189
|
-
oneDay: number;
|
|
190
|
-
oneHour: number;
|
|
191
|
-
oneMinute: number;
|
|
192
|
-
oneSecond: number;
|
|
193
|
-
};
|
|
194
|
-
obj: {
|
|
195
|
-
copy: (source: any, options?: {
|
|
196
|
-
fields?: string[] | undefined;
|
|
197
|
-
camel?: boolean | undefined;
|
|
198
|
-
pure?: boolean | undefined;
|
|
199
|
-
} & import("..").Ddan.IIgnoreParams) => any;
|
|
200
|
-
clone: (source: any) => any;
|
|
201
|
-
merge: (target: any, source: any, options?: import("..").Ddan.IIgnoreParams) => {};
|
|
202
|
-
isEmpty: (source: any) => boolean;
|
|
203
|
-
parseValue: (source: any, { number, boolean }?: {
|
|
204
|
-
number?: boolean | undefined;
|
|
205
|
-
boolean?: boolean | undefined;
|
|
206
|
-
}) => any;
|
|
207
|
-
cloneClass: <T_2>(source: T_2) => T_2;
|
|
208
|
-
combine: (target: any, source: any, options?: import("..").Ddan.IIgnoreParams) => any;
|
|
209
|
-
combines: (objs: any[], options?: import("..").Ddan.IIgnoreParams) => {};
|
|
210
|
-
observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
|
|
211
|
-
find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
|
|
212
|
-
};
|
|
213
|
-
rule: {
|
|
214
|
-
validateId: (content: any) => boolean;
|
|
215
|
-
validatePhone: (content: any) => boolean;
|
|
216
|
-
validator: (rules: import("../modules/rule/async-validator").Rules) => import("../modules/rule/async-validator").default;
|
|
217
|
-
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>;
|
|
218
|
-
isChinese: (content: string) => boolean;
|
|
219
|
-
isNumber: (content: string) => boolean;
|
|
220
|
-
isFloat: (content: string) => boolean;
|
|
221
|
-
isPhoneNumber: (content: any) => boolean;
|
|
222
|
-
};
|
|
223
|
-
regex: {
|
|
224
|
-
pattern: {
|
|
225
|
-
num: string;
|
|
226
|
-
zh: string;
|
|
227
|
-
en: string;
|
|
228
|
-
};
|
|
229
|
-
regex: (patt: string, modifiers?: "i" | "g" | "m" | undefined) => RegExp;
|
|
230
|
-
entire: {
|
|
231
|
-
chinese: RegExp;
|
|
232
|
-
real: RegExp;
|
|
233
|
-
cssReal: RegExp;
|
|
234
|
-
id: RegExp;
|
|
235
|
-
yyyyMMdd: RegExp;
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
export { dUtils };
|
package/bin/web.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import Http from '../modules/http';
|
|
2
|
-
declare const dWeb: {
|
|
3
|
-
fetch: {
|
|
4
|
-
getDataURL: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, {
|
|
5
|
-
contentType: string;
|
|
6
|
-
dataUrl: string;
|
|
7
|
-
}]>;
|
|
8
|
-
getArrayBuffer: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, ArrayBuffer]>;
|
|
9
|
-
getJson: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, any]>;
|
|
10
|
-
download: (url: string, opts?: {
|
|
11
|
-
success?: ((buffer: Uint8Array) => void) | undefined;
|
|
12
|
-
progress?: ((percentage: number, current: number, total: number) => void) | undefined;
|
|
13
|
-
fail?: ((error: Error) => void) | undefined;
|
|
14
|
-
}) => Promise<Uint8Array | undefined>;
|
|
15
|
-
getText: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, string]>;
|
|
16
|
-
cache: (url: string, cache?: RequestCache) => Promise<[any, undefined] | [null, boolean]>;
|
|
17
|
-
};
|
|
18
|
-
Http: typeof Http;
|
|
19
|
-
css: {
|
|
20
|
-
stringify: (styleObj: Record<string, string | number>) => string;
|
|
21
|
-
parse: (styleStr: string, { camel, pure }?: {
|
|
22
|
-
camel?: boolean | undefined;
|
|
23
|
-
pure?: boolean | undefined;
|
|
24
|
-
}) => {} | undefined;
|
|
25
|
-
fixValue: (value: string | number, unit?: string) => string | number;
|
|
26
|
-
style: (cssKV: Record<string, any>, unit?: string) => string;
|
|
27
|
-
commonFields: string[];
|
|
28
|
-
};
|
|
29
|
-
qs: {
|
|
30
|
-
parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
|
|
31
|
-
sep?: string | undefined;
|
|
32
|
-
eq?: string | undefined;
|
|
33
|
-
max?: number | undefined;
|
|
34
|
-
multiple?: boolean | undefined;
|
|
35
|
-
uri?: boolean | undefined;
|
|
36
|
-
parseNumber?: boolean | undefined;
|
|
37
|
-
parseBoolean?: boolean | undefined;
|
|
38
|
-
}) => {};
|
|
39
|
-
stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
|
|
40
|
-
sep?: string | undefined;
|
|
41
|
-
eq?: string | undefined;
|
|
42
|
-
name?: null | undefined;
|
|
43
|
-
uri?: boolean | undefined;
|
|
44
|
-
cleanZero?: boolean | undefined;
|
|
45
|
-
cleanNull?: boolean | undefined;
|
|
46
|
-
cleanWhitespace?: boolean | undefined;
|
|
47
|
-
}) => string;
|
|
48
|
-
https: (url: string) => string;
|
|
49
|
-
parseUrl: (url: string) => {
|
|
50
|
-
pathname: string;
|
|
51
|
-
params: {};
|
|
52
|
-
route: string;
|
|
53
|
-
page: string;
|
|
54
|
-
name: string;
|
|
55
|
-
withoutExtension: string;
|
|
56
|
-
extname: string;
|
|
57
|
-
href: string;
|
|
58
|
-
url: string;
|
|
59
|
-
origin: string;
|
|
60
|
-
host: string;
|
|
61
|
-
protocol: string;
|
|
62
|
-
port: string;
|
|
63
|
-
query: string;
|
|
64
|
-
};
|
|
65
|
-
parsePath: (url: string) => {
|
|
66
|
-
route: string;
|
|
67
|
-
page: string;
|
|
68
|
-
name: string;
|
|
69
|
-
withoutExtension: string;
|
|
70
|
-
extname: string;
|
|
71
|
-
};
|
|
72
|
-
parseHost: (url: string) => import("..").Ddan.IHttpHost;
|
|
73
|
-
join: (...args: string[]) => string;
|
|
74
|
-
shExpMatch: (text: string, pattern: string) => boolean;
|
|
75
|
-
isLocalIpAddress: (addr: string) => boolean;
|
|
76
|
-
parseFileUrl: (url: string) => {
|
|
77
|
-
href: string;
|
|
78
|
-
file: string;
|
|
79
|
-
url: string;
|
|
80
|
-
protocol: string;
|
|
81
|
-
host: string;
|
|
82
|
-
query: string;
|
|
83
|
-
params: {};
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
icon: import("../class/icon").DIcon;
|
|
87
|
-
html: {
|
|
88
|
-
dataURLtoFile: (dataurl: any, filename: any) => File;
|
|
89
|
-
dataURLtoBlob: (dataurl: any) => Blob;
|
|
90
|
-
blobToFile: (blob: any, fileName: string) => any;
|
|
91
|
-
readAsDataURL: (file: any, cb: any) => void;
|
|
92
|
-
downloadUrl: (url: string, filename?: string, checkSomeOrigin?: boolean) => void;
|
|
93
|
-
download: (urlOrFile: string | Blob | MediaSource, filename?: string) => void;
|
|
94
|
-
downloadFile: (data: Blob | MediaSource, filename?: string) => void;
|
|
95
|
-
downloadImage: (url: string) => Promise<void> | undefined;
|
|
96
|
-
watermark: (text: string, { width, height, angle, fillStyle, font, textAlign, textBaseline, }?: {
|
|
97
|
-
width?: number | undefined;
|
|
98
|
-
height?: number | undefined;
|
|
99
|
-
angle?: number | undefined;
|
|
100
|
-
fillStyle?: string | undefined;
|
|
101
|
-
font?: string | undefined;
|
|
102
|
-
textAlign?: "center" | "end" | "left" | "right" | "start" | undefined;
|
|
103
|
-
textBaseline?: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" | undefined;
|
|
104
|
-
}) => string;
|
|
105
|
-
copyText: (text: string, legacy?: boolean) => Promise<boolean>;
|
|
106
|
-
queryPermission: (name: string, def?: PermissionState) => Promise<PermissionState>;
|
|
107
|
-
isAllowed: (status: PermissionState | undefined, prompt?: boolean) => boolean;
|
|
108
|
-
legacyCopy: (text: string) => boolean;
|
|
109
|
-
takeHtmlLinks: (htmlContent: string) => never[];
|
|
110
|
-
takeHtml: (htmlContent: string, regex: RegExp) => string[];
|
|
111
|
-
toBlobUrl: (part: BlobPart, mime: "application/javascript") => string;
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
export { dWeb };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|