@croffledev/croffle-types 1.5.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;
package/api/window.d.ts CHANGED
@@ -4,5 +4,10 @@ export interface WindowApi {
4
4
  close(): Promise<void>;
5
5
  exitApp(): Promise<void>;
6
6
  checkForUpdates(): Promise<void>;
7
+ /**
8
+ * @deprecated Since 1.2.2 the close behavior is a user setting. This call now writes
9
+ * `general.closeBehavior` (`true` → `tray`, `false` → `quit`). Use `settings.update` instead.
10
+ * Will be removed in 1.3.
11
+ */
7
12
  setCloseToTrayMode(enabled: boolean): Promise<void>;
8
13
  }
package/enums.d.ts CHANGED
@@ -23,6 +23,8 @@ export declare enum AppEventType {
23
23
  WINDOW_SHOW = 'window:show',
24
24
  WINDOW_HIDE = 'window:hide',
25
25
  WINDOW_EXIT = 'window:exit',
26
+ /** Close was requested while `closeBehavior` is `ask`; the host UI asks the user. */
27
+ WINDOW_CLOSE_REQUESTED = 'window:closeRequested',
26
28
 
27
29
  // Electron updater (host UI)
28
30
  UPDATE_AVAILABLE = 'update:available',
@@ -26,6 +26,13 @@ export declare enum CalendarTimeFormat {
26
26
  H24 = '24h',
27
27
  }
28
28
 
29
+ /** What the window close button does. `ASK` shows a one-time prompt and stores the answer. */
30
+ export declare enum AppCloseBehavior {
31
+ ASK = 'ask',
32
+ TRAY = 'tray',
33
+ QUIT = 'quit',
34
+ }
35
+
29
36
  export type AppSettings = {
30
37
  general: {
31
38
  language: AppSettingLanguage;
@@ -33,6 +40,8 @@ export type AppSettings = {
33
40
  autoUpdate: boolean;
34
41
  startOnSystemBoot: boolean;
35
42
  startMinimized: boolean;
43
+ /** Close button behavior. Defaults to `ask` until the user answers the first-close prompt. */
44
+ closeBehavior: AppCloseBehavior;
36
45
  };
37
46
  appearance: {
38
47
  /** Accent color hue in degrees (0–360). Drives --croffle-accent-hue. */
@@ -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.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "Croffle project type definitions.",
5
5
  "license": "MIT",
6
6
  "type": "module",