ddan-js 2.9.14 → 2.9.15

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/hook.d.ts ADDED
@@ -0,0 +1,185 @@
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 default dHook;
package/bin/store.d.ts ADDED
@@ -0,0 +1,9 @@
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 default dStore;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddan-js",
3
- "version": "2.9.14",
3
+ "version": "2.9.15",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "ddan-js",
@@ -35,18 +35,18 @@
35
35
  },
36
36
  "./hook": {
37
37
  "types": "./bin/hook.d.ts",
38
- "import": "./bin/tiny/t-hook.mjs",
39
- "require": "./bin/tiny/t-hook.js"
38
+ "import": "./bin/tiny/hook.mjs",
39
+ "require": "./bin/tiny/hook.js"
40
40
  },
41
41
  "./utils": {
42
42
  "types": "./bin/utils.d.ts",
43
- "import": "./bin/tiny/t-utils.mjs",
44
- "require": "./bin/tiny/t-utils.js"
43
+ "import": "./bin/tiny/utils.mjs",
44
+ "require": "./bin/tiny/utils.js"
45
45
  },
46
46
  "./web": {
47
47
  "types": "./bin/web.d.ts",
48
- "import": "./bin/tiny/t-web.mjs",
49
- "require": "./bin/tiny/t-web.js"
48
+ "import": "./bin/tiny/web.mjs",
49
+ "require": "./bin/tiny/web.js"
50
50
  },
51
51
  "./*": "./*"
52
52
  },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes