rrule-rust 3.0.0-alpha.8 → 3.0.0-alpha.9
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/dist/browser/dtstart.d.ts +2 -2
- package/dist/browser/dtstart.js +5 -5
- package/dist/browser/rrule-set.d.ts +9 -9
- package/dist/browser/rrule-set.js +10 -10
- package/dist/node/dtstart.d.ts +2 -2
- package/dist/node/dtstart.js +5 -5
- package/dist/node/rrule-set.d.ts +9 -9
- package/dist/node/rrule-set.js +10 -10
- package/package.json +15 -15
|
@@ -8,13 +8,13 @@ export interface DtStartLike<DT extends DateTimeLike | DateLike> {
|
|
|
8
8
|
tzid?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare class DtStart<DT extends DateTime<Time> | DateTime<undefined> = DateTime<Time>> {
|
|
11
|
-
readonly
|
|
11
|
+
readonly value: DT;
|
|
12
12
|
readonly tzid?: string;
|
|
13
13
|
constructor(datetime: DT, tzid?: string);
|
|
14
14
|
constructor(options: DtStartOptions<DT>);
|
|
15
15
|
static fromPlain(plain: DtStartLike<DateTimeLike>): DtStart<DateTime<Time>>;
|
|
16
16
|
static fromPlain(plain: DtStartLike<DateLike>): DtStart<DateTime<undefined>>;
|
|
17
17
|
setTzid(tzid: string | undefined): DtStart<DT>;
|
|
18
|
-
|
|
18
|
+
setValue<NDT extends DateTime<Time> | DateTime<undefined>>(datetime: NDT): DtStart<NDT>;
|
|
19
19
|
toPlain<DTL extends DateTimeLike | DateLike = DT extends DateTime<Time> ? DateTimeLike : DateLike>(): DtStartLike<DTL>;
|
|
20
20
|
}
|
package/dist/browser/dtstart.js
CHANGED
|
@@ -2,11 +2,11 @@ import { DateTime, } from './datetime';
|
|
|
2
2
|
export class DtStart {
|
|
3
3
|
constructor(datetimeOrOptions, tzid) {
|
|
4
4
|
if ('datetime' in datetimeOrOptions) {
|
|
5
|
-
this.
|
|
5
|
+
this.value = datetimeOrOptions.datetime;
|
|
6
6
|
this.tzid = datetimeOrOptions.tzid;
|
|
7
7
|
}
|
|
8
8
|
else {
|
|
9
|
-
this.
|
|
9
|
+
this.value = datetimeOrOptions;
|
|
10
10
|
this.tzid = tzid;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -17,14 +17,14 @@ export class DtStart {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
setTzid(tzid) {
|
|
20
|
-
return new DtStart(this.
|
|
20
|
+
return new DtStart(this.value, tzid);
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
setValue(datetime) {
|
|
23
23
|
return new DtStart(datetime, this.tzid);
|
|
24
24
|
}
|
|
25
25
|
toPlain() {
|
|
26
26
|
return {
|
|
27
|
-
datetime: this.
|
|
27
|
+
datetime: this.value.toPlain(),
|
|
28
28
|
tzid: this.tzid,
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -31,15 +31,15 @@ export declare class RRuleSet<DT extends DateTime<Time> | DateTime<undefined>> i
|
|
|
31
31
|
static parse<DT extends DateTime<Time> | DateTime<undefined>>(str: string): RRuleSet<DT>;
|
|
32
32
|
static fromPlain(plain: RRuleSetLike<DateTimeLike>): RRuleSet<DateTime<Time>>;
|
|
33
33
|
static fromPlain(plain: RRuleSetLike<DateLike>): RRuleSet<DateTime<undefined>>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
setDtStart(dtstart: DtStart<DT>): RRuleSet<DT>;
|
|
35
|
+
addRRule<RRDT extends DT>(rrule: RRule<RRDT>): RRuleSet<DT>;
|
|
36
|
+
setRRules(rrules: readonly RRule<DT>[]): RRuleSet<DT>;
|
|
37
|
+
addExRule(rrule: RRule<DT>): RRuleSet<DT>;
|
|
38
|
+
setExRules(rrules: readonly RRule<DT>[]): RRuleSet<DT>;
|
|
39
|
+
addExDate(exdate: ExDate<DT>): RRuleSet<DT>;
|
|
40
|
+
setExDates(exdates: readonly ExDate<DT>[]): RRuleSet<DT>;
|
|
41
|
+
addRDate(datetime: RDate<DT>): RRuleSet<DT>;
|
|
42
|
+
setRDates(datetimes: readonly RDate<DT>[]): RRuleSet<DT>;
|
|
43
43
|
/**
|
|
44
44
|
* Returns all the occurrences of the rrule.
|
|
45
45
|
*
|
|
@@ -53,55 +53,55 @@ export class RRuleSet {
|
|
|
53
53
|
set.rust = rust;
|
|
54
54
|
return set;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
setDtStart(dtstart) {
|
|
57
57
|
return new RRuleSet({
|
|
58
58
|
...this.toOptions(),
|
|
59
59
|
dtstart: dtstart,
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
addRRule(rrule) {
|
|
63
63
|
return new RRuleSet({
|
|
64
64
|
...this.toOptions(),
|
|
65
65
|
rrules: [...this.rrules, rrule],
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
setRRules(rrules) {
|
|
69
69
|
return new RRuleSet({
|
|
70
70
|
...this.toOptions(),
|
|
71
71
|
rrules: rrules,
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
addExRule(rrule) {
|
|
75
75
|
return new RRuleSet({
|
|
76
76
|
...this.toOptions(),
|
|
77
77
|
exrules: [...this.exrules, rrule],
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
setExRules(rrules) {
|
|
81
81
|
return new RRuleSet({
|
|
82
82
|
...this.toOptions(),
|
|
83
83
|
exrules: rrules,
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
addExDate(exdate) {
|
|
87
87
|
return new RRuleSet({
|
|
88
88
|
...this.toOptions(),
|
|
89
89
|
exdates: [...this.exdates, exdate],
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
setExDates(exdates) {
|
|
93
93
|
return new RRuleSet({
|
|
94
94
|
...this.toOptions(),
|
|
95
95
|
exdates: exdates,
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
addRDate(datetime) {
|
|
99
99
|
return new RRuleSet({
|
|
100
100
|
...this.toOptions(),
|
|
101
101
|
rdates: [...this.rdates, datetime],
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
setRDates(datetimes) {
|
|
105
105
|
return new RRuleSet({
|
|
106
106
|
...this.toOptions(),
|
|
107
107
|
rdates: datetimes,
|
|
@@ -141,7 +141,7 @@ export class RRuleSet {
|
|
|
141
141
|
* @internal
|
|
142
142
|
*/
|
|
143
143
|
toRust() {
|
|
144
|
-
this.rust ??= new Rust(this.dtstart.
|
|
144
|
+
this.rust ??= new Rust(this.dtstart.value.toNumeric(), this.dtstart.tzid, undefined, this.rrules.map((rrule) => rrule.toRust()), this.exrules.map((rrule) => rrule.toRust()), this.exdates.map((exdate) => exdate.toRust()), this.rdates.map((rdate) => rdate.toRust()));
|
|
145
145
|
return this.rust;
|
|
146
146
|
}
|
|
147
147
|
toString() {
|
package/dist/node/dtstart.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ export interface DtStartLike<DT extends DateTimeLike | DateLike> {
|
|
|
8
8
|
tzid?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare class DtStart<DT extends DateTime<Time> | DateTime<undefined> = DateTime<Time>> {
|
|
11
|
-
readonly
|
|
11
|
+
readonly value: DT;
|
|
12
12
|
readonly tzid?: string;
|
|
13
13
|
constructor(datetime: DT, tzid?: string);
|
|
14
14
|
constructor(options: DtStartOptions<DT>);
|
|
15
15
|
static fromPlain(plain: DtStartLike<DateTimeLike>): DtStart<DateTime<Time>>;
|
|
16
16
|
static fromPlain(plain: DtStartLike<DateLike>): DtStart<DateTime<undefined>>;
|
|
17
17
|
setTzid(tzid: string | undefined): DtStart<DT>;
|
|
18
|
-
|
|
18
|
+
setValue<NDT extends DateTime<Time> | DateTime<undefined>>(datetime: NDT): DtStart<NDT>;
|
|
19
19
|
toPlain<DTL extends DateTimeLike | DateLike = DT extends DateTime<Time> ? DateTimeLike : DateLike>(): DtStartLike<DTL>;
|
|
20
20
|
}
|
package/dist/node/dtstart.js
CHANGED
|
@@ -5,11 +5,11 @@ const datetime_1 = require("./datetime");
|
|
|
5
5
|
class DtStart {
|
|
6
6
|
constructor(datetimeOrOptions, tzid) {
|
|
7
7
|
if ('datetime' in datetimeOrOptions) {
|
|
8
|
-
this.
|
|
8
|
+
this.value = datetimeOrOptions.datetime;
|
|
9
9
|
this.tzid = datetimeOrOptions.tzid;
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
|
-
this.
|
|
12
|
+
this.value = datetimeOrOptions;
|
|
13
13
|
this.tzid = tzid;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -20,14 +20,14 @@ class DtStart {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
setTzid(tzid) {
|
|
23
|
-
return new DtStart(this.
|
|
23
|
+
return new DtStart(this.value, tzid);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
setValue(datetime) {
|
|
26
26
|
return new DtStart(datetime, this.tzid);
|
|
27
27
|
}
|
|
28
28
|
toPlain() {
|
|
29
29
|
return {
|
|
30
|
-
datetime: this.
|
|
30
|
+
datetime: this.value.toPlain(),
|
|
31
31
|
tzid: this.tzid,
|
|
32
32
|
};
|
|
33
33
|
}
|
package/dist/node/rrule-set.d.ts
CHANGED
|
@@ -31,15 +31,15 @@ export declare class RRuleSet<DT extends DateTime<Time> | DateTime<undefined>> i
|
|
|
31
31
|
static parse<DT extends DateTime<Time> | DateTime<undefined>>(str: string): RRuleSet<DT>;
|
|
32
32
|
static fromPlain(plain: RRuleSetLike<DateTimeLike>): RRuleSet<DateTime<Time>>;
|
|
33
33
|
static fromPlain(plain: RRuleSetLike<DateLike>): RRuleSet<DateTime<undefined>>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
setDtStart(dtstart: DtStart<DT>): RRuleSet<DT>;
|
|
35
|
+
addRRule<RRDT extends DT>(rrule: RRule<RRDT>): RRuleSet<DT>;
|
|
36
|
+
setRRules(rrules: readonly RRule<DT>[]): RRuleSet<DT>;
|
|
37
|
+
addExRule(rrule: RRule<DT>): RRuleSet<DT>;
|
|
38
|
+
setExRules(rrules: readonly RRule<DT>[]): RRuleSet<DT>;
|
|
39
|
+
addExDate(exdate: ExDate<DT>): RRuleSet<DT>;
|
|
40
|
+
setExDates(exdates: readonly ExDate<DT>[]): RRuleSet<DT>;
|
|
41
|
+
addRDate(datetime: RDate<DT>): RRuleSet<DT>;
|
|
42
|
+
setRDates(datetimes: readonly RDate<DT>[]): RRuleSet<DT>;
|
|
43
43
|
/**
|
|
44
44
|
* Returns all the occurrences of the rrule.
|
|
45
45
|
*
|
package/dist/node/rrule-set.js
CHANGED
|
@@ -56,55 +56,55 @@ class RRuleSet {
|
|
|
56
56
|
set.rust = rust;
|
|
57
57
|
return set;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
setDtStart(dtstart) {
|
|
60
60
|
return new RRuleSet({
|
|
61
61
|
...this.toOptions(),
|
|
62
62
|
dtstart: dtstart,
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
addRRule(rrule) {
|
|
66
66
|
return new RRuleSet({
|
|
67
67
|
...this.toOptions(),
|
|
68
68
|
rrules: [...this.rrules, rrule],
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
setRRules(rrules) {
|
|
72
72
|
return new RRuleSet({
|
|
73
73
|
...this.toOptions(),
|
|
74
74
|
rrules: rrules,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
addExRule(rrule) {
|
|
78
78
|
return new RRuleSet({
|
|
79
79
|
...this.toOptions(),
|
|
80
80
|
exrules: [...this.exrules, rrule],
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
setExRules(rrules) {
|
|
84
84
|
return new RRuleSet({
|
|
85
85
|
...this.toOptions(),
|
|
86
86
|
exrules: rrules,
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
addExDate(exdate) {
|
|
90
90
|
return new RRuleSet({
|
|
91
91
|
...this.toOptions(),
|
|
92
92
|
exdates: [...this.exdates, exdate],
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
setExDates(exdates) {
|
|
96
96
|
return new RRuleSet({
|
|
97
97
|
...this.toOptions(),
|
|
98
98
|
exdates: exdates,
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
addRDate(datetime) {
|
|
102
102
|
return new RRuleSet({
|
|
103
103
|
...this.toOptions(),
|
|
104
104
|
rdates: [...this.rdates, datetime],
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
setRDates(datetimes) {
|
|
108
108
|
return new RRuleSet({
|
|
109
109
|
...this.toOptions(),
|
|
110
110
|
rdates: datetimes,
|
|
@@ -144,7 +144,7 @@ class RRuleSet {
|
|
|
144
144
|
* @internal
|
|
145
145
|
*/
|
|
146
146
|
toRust() {
|
|
147
|
-
this.rust ??= new lib_1.RRuleSet(this.dtstart.
|
|
147
|
+
this.rust ??= new lib_1.RRuleSet(this.dtstart.value.toNumeric(), this.dtstart.tzid, undefined, this.rrules.map((rrule) => rrule.toRust()), this.exrules.map((rrule) => rrule.toRust()), this.exdates.map((exdate) => exdate.toRust()), this.rdates.map((rdate) => rdate.toRust()));
|
|
148
148
|
return this.rust;
|
|
149
149
|
}
|
|
150
150
|
toString() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rrule-rust",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.9",
|
|
4
4
|
"main": "dist/node/index.js",
|
|
5
5
|
"browser": "dist/browser/index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -96,19 +96,19 @@
|
|
|
96
96
|
"prepublishOnly": "npm run build && napi prepublish -t npm"
|
|
97
97
|
},
|
|
98
98
|
"optionalDependencies": {
|
|
99
|
-
"@rrule-rust/lib-win32-x64-msvc": "3.0.0-alpha.
|
|
100
|
-
"@rrule-rust/lib-darwin-x64": "3.0.0-alpha.
|
|
101
|
-
"@rrule-rust/lib-linux-x64-gnu": "3.0.0-alpha.
|
|
102
|
-
"@rrule-rust/lib-linux-x64-musl": "3.0.0-alpha.
|
|
103
|
-
"@rrule-rust/lib-linux-arm64-gnu": "3.0.0-alpha.
|
|
104
|
-
"@rrule-rust/lib-win32-ia32-msvc": "3.0.0-alpha.
|
|
105
|
-
"@rrule-rust/lib-linux-arm-gnueabihf": "3.0.0-alpha.
|
|
106
|
-
"@rrule-rust/lib-darwin-arm64": "3.0.0-alpha.
|
|
107
|
-
"@rrule-rust/lib-android-arm64": "3.0.0-alpha.
|
|
108
|
-
"@rrule-rust/lib-freebsd-x64": "3.0.0-alpha.
|
|
109
|
-
"@rrule-rust/lib-linux-arm64-musl": "3.0.0-alpha.
|
|
110
|
-
"@rrule-rust/lib-win32-arm64-msvc": "3.0.0-alpha.
|
|
111
|
-
"@rrule-rust/lib-android-arm-eabi": "3.0.0-alpha.
|
|
112
|
-
"@rrule-rust/lib-wasm32-wasi": "3.0.0-alpha.
|
|
99
|
+
"@rrule-rust/lib-win32-x64-msvc": "3.0.0-alpha.9",
|
|
100
|
+
"@rrule-rust/lib-darwin-x64": "3.0.0-alpha.9",
|
|
101
|
+
"@rrule-rust/lib-linux-x64-gnu": "3.0.0-alpha.9",
|
|
102
|
+
"@rrule-rust/lib-linux-x64-musl": "3.0.0-alpha.9",
|
|
103
|
+
"@rrule-rust/lib-linux-arm64-gnu": "3.0.0-alpha.9",
|
|
104
|
+
"@rrule-rust/lib-win32-ia32-msvc": "3.0.0-alpha.9",
|
|
105
|
+
"@rrule-rust/lib-linux-arm-gnueabihf": "3.0.0-alpha.9",
|
|
106
|
+
"@rrule-rust/lib-darwin-arm64": "3.0.0-alpha.9",
|
|
107
|
+
"@rrule-rust/lib-android-arm64": "3.0.0-alpha.9",
|
|
108
|
+
"@rrule-rust/lib-freebsd-x64": "3.0.0-alpha.9",
|
|
109
|
+
"@rrule-rust/lib-linux-arm64-musl": "3.0.0-alpha.9",
|
|
110
|
+
"@rrule-rust/lib-win32-arm64-msvc": "3.0.0-alpha.9",
|
|
111
|
+
"@rrule-rust/lib-android-arm-eabi": "3.0.0-alpha.9",
|
|
112
|
+
"@rrule-rust/lib-wasm32-wasi": "3.0.0-alpha.9"
|
|
113
113
|
}
|
|
114
114
|
}
|