ddan-js 3.3.2 → 3.4.0
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 +0 -1
- package/bin/modules/hook/index.d.ts +10 -7
- package/bin/modules/hook/modules/debounce.d.ts +1 -1
- package/bin/modules/hook/modules/throttle.d.ts +1 -1
- package/bin/tiny/hook.d.ts +10 -7
- package/package.json +1 -1
|
@@ -9,6 +9,5 @@ declare const _default: {
|
|
|
9
9
|
timeout: <T_2 = any>(task?: Ddan.PFunction<T_2> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_2]>;
|
|
10
10
|
getValueIf: <T_3 = any, F = any>(condition: boolean | (() => boolean), trueValue: T_3 | (() => T_3), falseValue?: F | (() => F) | undefined) => T_3 | F | undefined;
|
|
11
11
|
resolveValue: <T_4 = any>(value: T_4 | (() => T_4)) => T_4;
|
|
12
|
-
runAsync: <T_5 = any>(func: any) => Promise<T_5 | undefined>;
|
|
13
12
|
};
|
|
14
13
|
export default _default;
|
|
@@ -26,6 +26,10 @@ declare const _default: {
|
|
|
26
26
|
pipeline: (max?: number) => DPipeline;
|
|
27
27
|
safeTask: (func: Ddan.Function, callback?: ((result: Ddan.SafeResult<any>) => void) | undefined) => DSafeTask;
|
|
28
28
|
pipeAsync: (func: Ddan.Function) => Ddan.PSafeResult<any>;
|
|
29
|
+
runAsync: <T = any>(func: any, opts?: {
|
|
30
|
+
pipe?: boolean | undefined;
|
|
31
|
+
mutex?: string | undefined;
|
|
32
|
+
}) => Promise<T | undefined>;
|
|
29
33
|
anySuccess: (promises: Promise<any>[]) => Promise<boolean>;
|
|
30
34
|
bezier1: (p0: Ddan.IPoint, p1: Ddan.IPoint, t: number) => Ddan.IPoint;
|
|
31
35
|
bezier2: (p0: Ddan.IPoint, p1: Ddan.IPoint, p2: Ddan.IPoint, t: number) => Ddan.IPoint;
|
|
@@ -39,14 +43,13 @@ declare const _default: {
|
|
|
39
43
|
logParse: (logStr: string) => string;
|
|
40
44
|
logRString: (data: any) => Promise<string>;
|
|
41
45
|
logRParse: (logStr: string) => Promise<string>;
|
|
42
|
-
to: <
|
|
43
|
-
go: <
|
|
46
|
+
to: <T_1 = any, U extends object = any>(promise: Promise<T_1>, errorExt?: object | undefined, fn?: Ddan.noop | undefined) => Promise<[null, T_1] | [U, undefined]>;
|
|
47
|
+
go: <T_2 = any>(task?: Ddan.PFunction<T_2> | undefined, fn?: Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_2]>;
|
|
44
48
|
delay: (ms?: number) => Promise<unknown>;
|
|
45
|
-
safeRun: <
|
|
49
|
+
safeRun: <T_3 = any>(func: any, fn?: Ddan.noop | undefined) => Promise<[null, T_3] | [any, undefined]>;
|
|
46
50
|
toError: (value: any) => any;
|
|
47
|
-
timeout: <
|
|
48
|
-
getValueIf: <
|
|
49
|
-
resolveValue: <
|
|
50
|
-
runAsync: <T_6 = any>(func: any) => Promise<T_6 | undefined>;
|
|
51
|
+
timeout: <T_4 = any>(task?: Ddan.PFunction<T_4> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_4]>;
|
|
52
|
+
getValueIf: <T_5 = any, F = any>(condition: boolean | (() => boolean), trueValue: T_5 | (() => T_5), falseValue?: F | (() => F) | undefined) => T_5 | F | undefined;
|
|
53
|
+
resolveValue: <T_6 = any>(value: T_6 | (() => T_6)) => T_6;
|
|
51
54
|
};
|
|
52
55
|
export default _default;
|
|
@@ -6,7 +6,7 @@ import { Ddan } from '../../../typings';
|
|
|
6
6
|
* @param options 参数:leading 开始执行, trailing结束执行
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
declare function debounce(func:
|
|
9
|
+
declare function debounce(func: Function, wait?: number, options?: Ddan.IDebounceOption): {
|
|
10
10
|
(...args: any[]): any;
|
|
11
11
|
cancel: () => void;
|
|
12
12
|
flush: () => any;
|
|
@@ -6,7 +6,7 @@ import { Ddan } from "../../../typings";
|
|
|
6
6
|
* @param options 参数:leading 开始执行, trailing结束执行
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
declare function throttle(func:
|
|
9
|
+
declare function throttle(func: Function, wait?: number, options?: Omit<Ddan.IDebounceOption, 'maxWait'>): {
|
|
10
10
|
(...args: any[]): any;
|
|
11
11
|
cancel: () => void;
|
|
12
12
|
flush: () => any;
|
package/bin/tiny/hook.d.ts
CHANGED
|
@@ -113,6 +113,10 @@ declare const dHook: {
|
|
|
113
113
|
pipeline: (max?: number) => import("../modules/hook/modules/pipeline").default;
|
|
114
114
|
safeTask: (func: import("..").Ddan.Function, callback?: ((result: import("..").Ddan.SafeResult<any>) => void) | undefined) => import("../modules/hook/modules/safeTask").default;
|
|
115
115
|
pipeAsync: (func: import("..").Ddan.Function) => import("..").Ddan.PSafeResult<any>;
|
|
116
|
+
runAsync: <T_3 = any>(func: any, opts?: {
|
|
117
|
+
pipe?: boolean | undefined;
|
|
118
|
+
mutex?: string | undefined;
|
|
119
|
+
}) => Promise<T_3 | undefined>;
|
|
116
120
|
anySuccess: (promises: Promise<any>[]) => Promise<boolean>;
|
|
117
121
|
bezier1: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
118
122
|
bezier2: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, p2: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
@@ -125,15 +129,14 @@ declare const dHook: {
|
|
|
125
129
|
logParse: (logStr: string) => string;
|
|
126
130
|
logRString: (data: any) => Promise<string>;
|
|
127
131
|
logRParse: (logStr: string) => Promise<string>;
|
|
128
|
-
to: <
|
|
129
|
-
go: <
|
|
132
|
+
to: <T_4 = any, U extends object = any>(promise: Promise<T_4>, errorExt?: object | undefined, fn?: import("..").Ddan.noop | undefined) => Promise<[null, T_4] | [U, undefined]>;
|
|
133
|
+
go: <T_5 = any>(task?: import("..").Ddan.PFunction<T_5> | undefined, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_5]>;
|
|
130
134
|
delay: (ms?: number) => Promise<unknown>;
|
|
131
|
-
safeRun: <
|
|
135
|
+
safeRun: <T_6 = any>(func: any, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_6]>;
|
|
132
136
|
toError: (value: any) => any;
|
|
133
|
-
timeout: <
|
|
134
|
-
getValueIf: <
|
|
135
|
-
resolveValue: <
|
|
136
|
-
runAsync: <T_9 = any>(func: any) => Promise<T_9 | undefined>;
|
|
137
|
+
timeout: <T_7 = any>(task?: import("..").Ddan.PFunction<T_7> | undefined, ms?: number, desc?: string) => Promise<[any, undefined] | [null, T_7]>;
|
|
138
|
+
getValueIf: <T_8 = any, F = any>(condition: boolean | (() => boolean), trueValue: T_8 | (() => T_8), falseValue?: F | (() => F) | undefined) => T_8 | F | undefined;
|
|
139
|
+
resolveValue: <T_9 = any>(value: T_9 | (() => T_9)) => T_9;
|
|
137
140
|
base64: {
|
|
138
141
|
encode: (input: string) => string;
|
|
139
142
|
decode: (base64Str: string) => string;
|