ddan-js 2.4.0 → 2.4.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.esm.js +1 -1
- package/bin/ddan-js.js +1 -1
- package/bin/lib/index.js +2 -3
- package/bin/lib/modules/time/dtime.js +2 -2
- package/bin/types/index.d.ts +22 -25
- package/bin/types/modules/hook/debounce.d.ts +1 -2
- package/bin/types/modules/hook/throttle.d.ts +1 -2
- package/bin/types/modules/obj/index.d.ts +5 -5
- package/bin/types/modules/string/index.d.ts +2 -2
- package/bin/types/modules/time/dtime.d.ts +3 -19
- package/bin/types/modules/time/frame.d.ts +2 -1
- package/bin/types/modules/time/index.d.ts +1 -1
- package/bin/types/typings/index.d.ts +63 -17
- package/bin/types/util/index.d.ts +4 -4
- package/package.json +1 -2
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ddan } from '../../typings';
|
|
2
2
|
declare function cloneClass<T>(source: T): T;
|
|
3
3
|
declare const _default: {
|
|
4
4
|
copy: (source: any, options?: {
|
|
5
5
|
fields?: string[] | undefined;
|
|
6
6
|
camel?: boolean | undefined;
|
|
7
7
|
pure?: boolean | undefined;
|
|
8
|
-
} &
|
|
8
|
+
} & Ddan.IIgnoreParams) => any;
|
|
9
9
|
clone: (source: any) => any;
|
|
10
|
-
merge: (target: any, source: any, options?:
|
|
10
|
+
merge: (target: any, source: any, options?: Ddan.IIgnoreParams) => {};
|
|
11
11
|
isEmpty: (source: any) => boolean;
|
|
12
12
|
parseValue: (source: any, { number, boolean }?: {
|
|
13
13
|
number?: boolean | undefined;
|
|
14
14
|
boolean?: boolean | undefined;
|
|
15
15
|
}) => any;
|
|
16
16
|
cloneClass: typeof cloneClass;
|
|
17
|
-
combine: (target: any, source: any, options?:
|
|
18
|
-
combines: (objs: any[], options?:
|
|
17
|
+
combine: (target: any, source: any, options?: Ddan.IIgnoreParams) => any;
|
|
18
|
+
combines: (objs: any[], options?: Ddan.IIgnoreParams) => {};
|
|
19
19
|
observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
|
|
20
20
|
};
|
|
21
21
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ddan } from "../../typings";
|
|
2
2
|
declare function toString(value: any): any;
|
|
3
3
|
declare const _default: {
|
|
4
4
|
toString: typeof toString;
|
|
@@ -15,6 +15,6 @@ declare const _default: {
|
|
|
15
15
|
number?: boolean | undefined;
|
|
16
16
|
boolean?: boolean | undefined;
|
|
17
17
|
}) => any;
|
|
18
|
-
replace: (source: string, rules:
|
|
18
|
+
replace: (source: string, rules: Ddan.IRegexRule | Ddan.IRegexRule[]) => string;
|
|
19
19
|
};
|
|
20
20
|
export default _default;
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
timestamp: number;
|
|
4
|
-
seconds: number;
|
|
5
|
-
d: number;
|
|
6
|
-
dd: string;
|
|
7
|
-
h: number;
|
|
8
|
-
hh: string;
|
|
9
|
-
m: number;
|
|
10
|
-
mm: string;
|
|
11
|
-
s: number;
|
|
12
|
-
ss: string;
|
|
13
|
-
S: number;
|
|
14
|
-
SS: string;
|
|
15
|
-
SSS: string;
|
|
16
|
-
desc: string;
|
|
17
|
-
}
|
|
18
|
-
export default class DTime {
|
|
1
|
+
import { Ddan } from "../../typings";
|
|
2
|
+
export default class DTime implements Ddan.ITime {
|
|
19
3
|
date?: Date;
|
|
20
4
|
timestamp: number;
|
|
21
5
|
yyyy?: number;
|
|
@@ -35,7 +19,7 @@ export default class DTime {
|
|
|
35
19
|
SSS: string;
|
|
36
20
|
constructor(time: string | number | Date);
|
|
37
21
|
toDate(): this;
|
|
38
|
-
toCountdown(
|
|
22
|
+
toCountdown(regFormat?: string): Ddan.ICountdown;
|
|
39
23
|
add(ms?: number): this;
|
|
40
24
|
format(reg?: string): string;
|
|
41
25
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import DEvent from "../../class/event";
|
|
3
|
-
|
|
3
|
+
import { Ddan } from "../../typings";
|
|
4
|
+
export default class DLoopFrame implements Ddan.ILoopFrame {
|
|
4
5
|
_loopTimer: string | number | NodeJS.Timeout | undefined;
|
|
5
6
|
_event: DEvent;
|
|
6
7
|
started: boolean;
|
|
@@ -24,7 +24,7 @@ declare const _default: {
|
|
|
24
24
|
parseTimestamp: typeof parseTimestamp;
|
|
25
25
|
todayZero: () => number;
|
|
26
26
|
format: (time: string | number | Date, reg?: string) => string;
|
|
27
|
-
countdown: (endTime: string | number | Date, reg?: string) => "" | import("
|
|
27
|
+
countdown: (endTime: string | number | Date, reg?: string) => "" | import("../..").Ddan.ICountdown;
|
|
28
28
|
dtime: (time: string | number | Date) => DTime;
|
|
29
29
|
loopFrame: (interval?: number) => LoopFrame;
|
|
30
30
|
oneDay: number;
|
|
@@ -17,7 +17,7 @@ export declare namespace Ddan {
|
|
|
17
17
|
type Result<T = any> = T | Promise<T>;
|
|
18
18
|
interface IEvent {
|
|
19
19
|
clear: () => void;
|
|
20
|
-
on: (name: string, handler: Function, tag
|
|
20
|
+
on: (name: string, handler: Function, tag?: string) => void;
|
|
21
21
|
emit: (name: string, ...args: any[]) => void;
|
|
22
22
|
off: (name: string, handler: Function) => void;
|
|
23
23
|
remove: (name: string) => void;
|
|
@@ -60,9 +60,66 @@ export declare namespace Ddan {
|
|
|
60
60
|
type TStoreActionFunction = (arg: IDStore & {
|
|
61
61
|
commit: TStoreCommitFunction;
|
|
62
62
|
}, payload: any) => any;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
interface ILoopFrame {
|
|
64
|
+
start: () => ILoopFrame;
|
|
65
|
+
stop: () => ILoopFrame;
|
|
66
|
+
restart: () => ILoopFrame;
|
|
67
|
+
on: (cb: Function) => ILoopFrame;
|
|
68
|
+
off: (cb: Function) => ILoopFrame;
|
|
69
|
+
}
|
|
70
|
+
interface ICountdown {
|
|
71
|
+
countdown: number;
|
|
72
|
+
timestamp: number;
|
|
73
|
+
seconds: number;
|
|
74
|
+
d: number;
|
|
75
|
+
dd: string;
|
|
76
|
+
h: number;
|
|
77
|
+
hh: string;
|
|
78
|
+
m: number;
|
|
79
|
+
mm: string;
|
|
80
|
+
s: number;
|
|
81
|
+
ss: string;
|
|
82
|
+
S: number;
|
|
83
|
+
SS: string;
|
|
84
|
+
SSS: string;
|
|
85
|
+
desc: string;
|
|
86
|
+
}
|
|
87
|
+
interface ITime {
|
|
88
|
+
date?: Date;
|
|
89
|
+
timestamp: number;
|
|
90
|
+
yyyy?: number;
|
|
91
|
+
yy?: string;
|
|
92
|
+
M?: number;
|
|
93
|
+
MM?: string;
|
|
94
|
+
d: number;
|
|
95
|
+
dd: string;
|
|
96
|
+
h: number;
|
|
97
|
+
hh: string;
|
|
98
|
+
m: number;
|
|
99
|
+
mm: string;
|
|
100
|
+
s: number;
|
|
101
|
+
ss: string;
|
|
102
|
+
S: number;
|
|
103
|
+
SS: string;
|
|
104
|
+
SSS: string;
|
|
105
|
+
toDate: () => ITime;
|
|
106
|
+
toCountdown: (regFormat?: string) => Ddan.ICountdown;
|
|
107
|
+
add: (ms: number) => ITime;
|
|
108
|
+
format: (regFormat?: string) => string;
|
|
109
|
+
}
|
|
110
|
+
interface IRegexRule {
|
|
111
|
+
key: string;
|
|
112
|
+
flag?: "i" | "g" | "m" | "gi" | "mi";
|
|
113
|
+
value: string;
|
|
114
|
+
}
|
|
115
|
+
interface IIgnoreParams {
|
|
116
|
+
ignoreUndefined?: boolean;
|
|
117
|
+
ignoreNull?: boolean;
|
|
118
|
+
ignoreZero?: boolean;
|
|
119
|
+
ignoreEmptyArray?: boolean;
|
|
120
|
+
ignoreEmptyString?: boolean;
|
|
121
|
+
cover?: boolean;
|
|
122
|
+
}
|
|
66
123
|
/**
|
|
67
124
|
* leading 开始执行
|
|
68
125
|
* trailing 结束执行
|
|
@@ -72,6 +129,8 @@ export declare namespace dd {
|
|
|
72
129
|
maxWait?: number;
|
|
73
130
|
trailing?: boolean;
|
|
74
131
|
}
|
|
132
|
+
}
|
|
133
|
+
export declare namespace dd {
|
|
75
134
|
interface IHttpRequest {
|
|
76
135
|
url: string;
|
|
77
136
|
host: string;
|
|
@@ -138,17 +197,4 @@ export declare namespace dd {
|
|
|
138
197
|
padx?: number;
|
|
139
198
|
pady?: number;
|
|
140
199
|
}
|
|
141
|
-
interface IRegexRule {
|
|
142
|
-
key: string;
|
|
143
|
-
flag?: "i" | "g" | "m" | "gi" | "mi";
|
|
144
|
-
value: string;
|
|
145
|
-
}
|
|
146
|
-
interface IIgnoreParams {
|
|
147
|
-
ignoreUndefined?: boolean;
|
|
148
|
-
ignoreNull?: boolean;
|
|
149
|
-
ignoreZero?: boolean;
|
|
150
|
-
ignoreEmptyArray?: boolean;
|
|
151
|
-
ignoreEmptyString?: boolean;
|
|
152
|
-
cover?: boolean;
|
|
153
|
-
}
|
|
154
200
|
}
|
|
@@ -6,17 +6,17 @@ declare const _default: {
|
|
|
6
6
|
fields?: string[] | undefined;
|
|
7
7
|
camel?: boolean | undefined;
|
|
8
8
|
pure?: boolean | undefined;
|
|
9
|
-
} & import("
|
|
9
|
+
} & import("..").Ddan.IIgnoreParams) => any;
|
|
10
10
|
clone: (source: any) => any;
|
|
11
|
-
merge: (target: any, source: any, options?: import("
|
|
11
|
+
merge: (target: any, source: any, options?: import("..").Ddan.IIgnoreParams) => {};
|
|
12
12
|
isEmpty: (source: any) => boolean;
|
|
13
13
|
parseValue: (source: any, { number, boolean }?: {
|
|
14
14
|
number?: boolean | undefined;
|
|
15
15
|
boolean?: boolean | undefined;
|
|
16
16
|
}) => any;
|
|
17
17
|
cloneClass: <T>(source: T) => T;
|
|
18
|
-
combine: (target: any, source: any, options?: import("
|
|
19
|
-
combines: (objs: any[], options?: import("
|
|
18
|
+
combine: (target: any, source: any, options?: import("..").Ddan.IIgnoreParams) => any;
|
|
19
|
+
combines: (objs: any[], options?: import("..").Ddan.IIgnoreParams) => {};
|
|
20
20
|
observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
|
|
21
21
|
getTag: (value: any) => string;
|
|
22
22
|
getType: (value: any) => string;
|
package/package.json
CHANGED