ddan-js 3.0.1 → 3.0.2
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/ddan-js.browser.js +1 -1
- package/bin/ddan-js.js +1 -1
- package/bin/ddan-js.mjs +1 -1
- package/bin/modules/hook/base.d.ts +2 -0
- package/bin/modules/hook/index.d.ts +2 -0
- package/bin/modules/node/socks5.d.ts +2 -0
- package/bin/modules/rule/async-validator/index.d.ts +0 -6
- package/bin/tiny/hook.d.ts +7 -5
- package/package.json +1 -1
|
@@ -7,5 +7,7 @@ declare const _default: {
|
|
|
7
7
|
safeRun: <T_1 = any>(func: any, fn?: Ddan.noop | undefined) => Promise<[null, T_1] | [any, undefined]>;
|
|
8
8
|
toError: (value: any) => any;
|
|
9
9
|
timeout: <T_2 = any>(task?: Ddan.PFunction<T_2> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_2]>;
|
|
10
|
+
getValueIf: <T_3 = any, F = any>(condition: boolean | (() => boolean), trueValue: T_3 | (() => T_3), falseValue?: F | (() => F) | undefined) => T_3 | F | undefined;
|
|
11
|
+
resolveValue: <T_4 = any>(value: T_4 | (() => T_4)) => T_4;
|
|
10
12
|
};
|
|
11
13
|
export default _default;
|
|
@@ -43,5 +43,7 @@ declare const _default: {
|
|
|
43
43
|
safeRun: <T_2 = any>(func: any, fn?: Ddan.noop | undefined) => Promise<[null, T_2] | [any, undefined]>;
|
|
44
44
|
toError: (value: any) => any;
|
|
45
45
|
timeout: <T_3 = any>(task?: Ddan.PFunction<T_3> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_3]>;
|
|
46
|
+
getValueIf: <T_4 = any, F = any>(condition: boolean | (() => boolean), trueValue: T_4 | (() => T_4), falseValue?: F | (() => F) | undefined) => T_4 | F | undefined;
|
|
47
|
+
resolveValue: <T_5 = any>(value: T_5 | (() => T_5)) => T_5;
|
|
46
48
|
};
|
|
47
49
|
export default _default;
|
|
@@ -45,6 +45,8 @@ export declare class Socks5 {
|
|
|
45
45
|
validateProxyConfig(proxyConfig: IProxy): "" | "无效的上游代理 IP 地址" | "无效的上游代理端口" | "无效的上游代理用户名" | "无效的上游代理密码";
|
|
46
46
|
private filterProxyConfigs;
|
|
47
47
|
start(startPort?: number): Promise<number>;
|
|
48
|
+
private setupServer;
|
|
49
|
+
restart(): boolean;
|
|
48
50
|
setUpstreamProxy(upstreamProxy: IRuleProxy | IRuleProxy[]): boolean;
|
|
49
51
|
setSystemProxy(use: boolean, config?: IProxy): void;
|
|
50
52
|
/**
|
|
@@ -14,12 +14,6 @@ declare class Schema {
|
|
|
14
14
|
string: import("./interface").ExecuteValidator;
|
|
15
15
|
method: import("./interface").ExecuteValidator;
|
|
16
16
|
number: import("./interface").ExecuteValidator;
|
|
17
|
-
/**
|
|
18
|
-
* Encapsulates a validation schema.
|
|
19
|
-
*
|
|
20
|
-
* @param descriptor An object declaring validation rules
|
|
21
|
-
* for this schema.
|
|
22
|
-
*/
|
|
23
17
|
boolean: import("./interface").ExecuteValidator;
|
|
24
18
|
regexp: import("./interface").ExecuteValidator;
|
|
25
19
|
integer: import("./interface").ExecuteValidator;
|
package/bin/tiny/hook.d.ts
CHANGED
|
@@ -127,6 +127,8 @@ declare const dHook: {
|
|
|
127
127
|
safeRun: <T_5 = any>(func: any, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_5]>;
|
|
128
128
|
toError: (value: any) => any;
|
|
129
129
|
timeout: <T_6 = any>(task?: import("..").Ddan.PFunction<T_6> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_6]>;
|
|
130
|
+
getValueIf: <T_7 = any, F = any>(condition: boolean | (() => boolean), trueValue: T_7 | (() => T_7), falseValue?: F | (() => F) | undefined) => T_7 | F | undefined;
|
|
131
|
+
resolveValue: <T_8 = any>(value: T_8 | (() => T_8)) => T_8;
|
|
130
132
|
base64: {
|
|
131
133
|
encode: (input: string) => string;
|
|
132
134
|
decode: (base64Str: string) => string;
|
|
@@ -180,7 +182,7 @@ declare const dHook: {
|
|
|
180
182
|
bytes2hex: (bytes: Uint8Array) => string;
|
|
181
183
|
toUint32: (str: string) => Uint32Array;
|
|
182
184
|
fromUint32: (uint32: Uint32Array) => string;
|
|
183
|
-
flatten: <
|
|
185
|
+
flatten: <T_9>(data: T_9[], recursive?: boolean, list?: T_9[]) => T_9[];
|
|
184
186
|
flattenPath: (data: Record<string, any>) => Record<string, any>;
|
|
185
187
|
normalizeStructure: (data: any, prevData: any) => void;
|
|
186
188
|
diffPath: (data: Record<string, any>, prevData: Record<string, any>) => Record<string, any>;
|
|
@@ -196,12 +198,12 @@ declare const dHook: {
|
|
|
196
198
|
ignoreEmptyString?: boolean | undefined;
|
|
197
199
|
}) => any;
|
|
198
200
|
clone: (source: any, weakMap?: WeakMap<object, any>) => any;
|
|
199
|
-
cloneClass: <
|
|
200
|
-
isEqual: <
|
|
201
|
+
cloneClass: <T_10>(source: T_10) => T_10;
|
|
202
|
+
isEqual: <T_11 = any>(value: T_11, other: T_11, depth?: number) => boolean;
|
|
201
203
|
isEqualArray: (value: any[], other: any[], depth?: number) => boolean;
|
|
202
204
|
isEqualObject: (value: Record<string, any>, other: Record<string, any>, depth?: number) => boolean;
|
|
203
|
-
isEqualValue: <
|
|
205
|
+
isEqualValue: <T_12>(value: T_12, other: T_12, type: string) => boolean;
|
|
204
206
|
isEqualAB: (value: ArrayBuffer, other: ArrayBuffer) => boolean;
|
|
205
|
-
isEqualDeep: <
|
|
207
|
+
isEqualDeep: <T_13>(value: T_13, other: T_13) => boolean;
|
|
206
208
|
};
|
|
207
209
|
export default dHook;
|