@croffledev/croffle-types 1.6.0 → 1.7.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/api/calendar.d.ts CHANGED
@@ -7,6 +7,16 @@ export interface SchedulesApi {
7
7
  create(data: Partial<Schedule>): Promise<Schedule>;
8
8
  update(id: string, data: Partial<Schedule>): Promise<Schedule>;
9
9
  remove(id: string): Promise<boolean>;
10
+ /**
11
+ * Move one occurrence of a recurring schedule, keeping its duration.
12
+ * `occurrenceStart` is the occurrence's original start; the series is unchanged.
13
+ * Rejects for non-recurring schedules. Returns the schedule with its updated `exceptions`.
14
+ */
15
+ moveOccurrence(
16
+ id: string,
17
+ occurrenceStart: Date | string,
18
+ newStart: Date | string,
19
+ ): Promise<Schedule>;
10
20
  exportSchedulesToFile(period?: {
11
21
  start: string;
12
22
  end: string;
@@ -1,5 +1,20 @@
1
1
  import type { Tag } from './tag';
2
2
 
3
+ /**
4
+ * Override of one occurrence of a recurring schedule, keyed by the occurrence's
5
+ * original start. `startDate`/`endDate` null means "not moved"; `cancelled` hides it.
6
+ */
7
+ export type ScheduleException = {
8
+ /** Original start of the occurrence this entry overrides (all-day: local midnight). */
9
+ occurrenceStart: Date;
10
+ /** New start of the occurrence, or null when only `cancelled` applies. */
11
+ startDate: Date | null;
12
+ /** New end of the occurrence, or null when only `cancelled` applies. */
13
+ endDate: Date | null;
14
+ /** true = this occurrence does not happen. */
15
+ cancelled: boolean;
16
+ };
17
+
3
18
  export type Schedule = {
4
19
  id: string;
5
20
  title: string;
@@ -23,6 +38,12 @@ export type Schedule = {
23
38
  * written against 1.2.0. Removed in 1.3 — read `reminders` instead.
24
39
  */
25
40
  reminderMinutes?: number | null;
41
+ /**
42
+ * Per-occurrence overrides of a recurring schedule (empty or missing for one-off schedules).
43
+ * Extensions that expand `recurrenceRule` themselves must apply these: skip each
44
+ * `occurrenceStart`, and add `startDate`..`endDate` unless `cancelled`.
45
+ */
46
+ exceptions?: ScheduleException[];
26
47
  createdAt: Date;
27
48
  updatedAt: Date;
28
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@croffledev/croffle-types",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Croffle project type definitions.",
5
5
  "license": "MIT",
6
6
  "type": "module",