ddan-js 3.3.1 → 3.3.3
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 +11 -7
- package/bin/modules/hook/modules/promise.d.ts +4 -0
- package/bin/modules/node/file.d.ts +3 -0
- package/bin/modules/node/index.d.ts +3 -0
- package/bin/tiny/hook.d.ts +11 -7
- package/bin/tiny/node.d.ts +3 -0
- 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,11 @@ 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>;
|
|
33
|
+
anySuccess: (promises: Promise<any>[]) => Promise<boolean>;
|
|
29
34
|
bezier1: (p0: Ddan.IPoint, p1: Ddan.IPoint, t: number) => Ddan.IPoint;
|
|
30
35
|
bezier2: (p0: Ddan.IPoint, p1: Ddan.IPoint, p2: Ddan.IPoint, t: number) => Ddan.IPoint;
|
|
31
36
|
bezier3: (p0: Ddan.IPoint, p1: Ddan.IPoint, p2: Ddan.IPoint, p3: Ddan.IPoint, t: number) => Ddan.IPoint;
|
|
@@ -38,14 +43,13 @@ declare const _default: {
|
|
|
38
43
|
logParse: (logStr: string) => string;
|
|
39
44
|
logRString: (data: any) => Promise<string>;
|
|
40
45
|
logRParse: (logStr: string) => Promise<string>;
|
|
41
|
-
to: <
|
|
42
|
-
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]>;
|
|
43
48
|
delay: (ms?: number) => Promise<unknown>;
|
|
44
|
-
safeRun: <
|
|
49
|
+
safeRun: <T_3 = any>(func: any, fn?: Ddan.noop | undefined) => Promise<[null, T_3] | [any, undefined]>;
|
|
45
50
|
toError: (value: any) => any;
|
|
46
|
-
timeout: <
|
|
47
|
-
getValueIf: <
|
|
48
|
-
resolveValue: <
|
|
49
|
-
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;
|
|
50
54
|
};
|
|
51
55
|
export default _default;
|
|
@@ -2,5 +2,8 @@ import { Ddan } from '../../typings';
|
|
|
2
2
|
declare const _default: {
|
|
3
3
|
readDirectory: (dir: string, callback?: Ddan.Func1<string, any> | undefined) => Promise<unknown>;
|
|
4
4
|
readFiles: (dir: string, files: string[], callback?: Ddan.Func1<string, any> | undefined) => Promise<void>;
|
|
5
|
+
access: (filePath: string, mode?: number) => Promise<boolean>;
|
|
6
|
+
chmodFile: (path: string, mode?: string | number) => void;
|
|
7
|
+
chmod755: (path: string) => Promise<[any, undefined] | [null, boolean]>;
|
|
5
8
|
};
|
|
6
9
|
export default _default;
|
|
@@ -45,5 +45,8 @@ declare const _default: {
|
|
|
45
45
|
brotliDecompress: typeof import("./brotli").brotliDecompress;
|
|
46
46
|
readDirectory: (dir: string, callback?: import("../..").Ddan.Func1<string, any> | undefined) => Promise<unknown>;
|
|
47
47
|
readFiles: (dir: string, files: string[], callback?: import("../..").Ddan.Func1<string, any> | undefined) => Promise<void>;
|
|
48
|
+
access: (filePath: string, mode?: number) => Promise<boolean>;
|
|
49
|
+
chmodFile: (path: string, mode?: string | number) => void;
|
|
50
|
+
chmod755: (path: string) => Promise<[any, undefined] | [null, boolean]>;
|
|
48
51
|
};
|
|
49
52
|
export default _default;
|
package/bin/tiny/hook.d.ts
CHANGED
|
@@ -113,6 +113,11 @@ 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>;
|
|
120
|
+
anySuccess: (promises: Promise<any>[]) => Promise<boolean>;
|
|
116
121
|
bezier1: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
117
122
|
bezier2: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, p2: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
118
123
|
bezier3: (p0: import("..").Ddan.IPoint, p1: import("..").Ddan.IPoint, p2: import("..").Ddan.IPoint, p3: import("..").Ddan.IPoint, t: number) => import("..").Ddan.IPoint;
|
|
@@ -124,15 +129,14 @@ declare const dHook: {
|
|
|
124
129
|
logParse: (logStr: string) => string;
|
|
125
130
|
logRString: (data: any) => Promise<string>;
|
|
126
131
|
logRParse: (logStr: string) => Promise<string>;
|
|
127
|
-
to: <
|
|
128
|
-
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]>;
|
|
129
134
|
delay: (ms?: number) => Promise<unknown>;
|
|
130
|
-
safeRun: <
|
|
135
|
+
safeRun: <T_6 = any>(func: any, fn?: import("..").Ddan.noop | undefined) => Promise<[any, undefined] | [null, T_6]>;
|
|
131
136
|
toError: (value: any) => any;
|
|
132
|
-
timeout: <
|
|
133
|
-
getValueIf: <
|
|
134
|
-
resolveValue: <
|
|
135
|
-
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;
|
|
136
140
|
base64: {
|
|
137
141
|
encode: (input: string) => string;
|
|
138
142
|
decode: (base64Str: string) => string;
|
package/bin/tiny/node.d.ts
CHANGED
|
@@ -42,5 +42,8 @@ declare const dNode: {
|
|
|
42
42
|
brotliDecompress: typeof import("../modules/node/brotli").brotliDecompress;
|
|
43
43
|
readDirectory: (dir: string, callback?: import("..").Ddan.Func1<string, any> | undefined) => Promise<unknown>;
|
|
44
44
|
readFiles: (dir: string, files: string[], callback?: import("..").Ddan.Func1<string, any> | undefined) => Promise<void>;
|
|
45
|
+
access: (filePath: string, mode?: number) => Promise<boolean>;
|
|
46
|
+
chmodFile: (path: string, mode?: string | number) => void;
|
|
47
|
+
chmod755: (path: string) => Promise<[any, undefined] | [null, boolean]>;
|
|
45
48
|
};
|
|
46
49
|
export default dNode;
|