@camstack/types 1.2.362 → 1.2.364

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.
@@ -619,6 +619,20 @@ export declare const backupCapability: {
619
619
  lastError: z.ZodOptional<z.ZodString>;
620
620
  nextRunAt: z.ZodOptional<z.ZodNumber>;
621
621
  }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
622
+ /**
623
+ * The database files that exist on this hub right now (the owner's open
624
+ * files), so the selection UI can offer all of them and mark a file that
625
+ * is not created yet. `answered: false` = the owner did not answer, which
626
+ * is not the same as "none exist".
627
+ */
628
+ readonly listAvailableDatabases: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
629
+ answered: z.ZodBoolean;
630
+ databases: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
631
+ events: "events";
632
+ history: "history";
633
+ settings: "settings";
634
+ }>>>;
635
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
622
636
  /**
623
637
  * Create or replace a schedule. An empty / absent `id` mints a new
624
638
  * one; a present `id` replaces in place. `cron` is validated
@@ -24,6 +24,18 @@ export declare const CalendarInfoSchema: z.ZodObject<{
24
24
  enabled: z.ZodBoolean;
25
25
  }, z.core.$strip>;
26
26
  export type CalendarInfo = z.infer<typeof CalendarInfoSchema>;
27
+ /**
28
+ * Time contract of {@link CalendarEvent}.
29
+ *
30
+ * - Timed event: `startMs` / `endMs` are real instants; `endMs` is exclusive.
31
+ * - All-day event (`allDay: true`): the event is a run of calendar DATES, not
32
+ * instants. `startMs` is UTC midnight of the first date and `endMs` is UTC
33
+ * midnight of the day AFTER the last date (RFC 5545 exclusive DTEND), so a
34
+ * one-day event spans exactly 24 h. Every provider produces that and no
35
+ * consumer may read the instants in a local timezone: use
36
+ * {@link calendarEventLocalSpan}. Reading UTC midnight as local time put an
37
+ * all-day event on the following day for any viewer ahead of UTC.
38
+ */
27
39
  export declare const CalendarEventSchema: z.ZodObject<{
28
40
  id: z.ZodString;
29
41
  calendarId: z.ZodString;
@@ -74,3 +86,17 @@ export declare const calendarSourceCapability: {
74
86
  };
75
87
  };
76
88
  export type ICalendarSourceProvider = InferProvider<typeof calendarSourceCapability>;
89
+ /** A half-open `[startMs, endMs)` interval of local instants. */
90
+ export interface CalendarLocalSpan {
91
+ readonly startMs: number;
92
+ readonly endMs: number;
93
+ }
94
+ /**
95
+ * The interval an event occupies on the viewer's local clock, end exclusive.
96
+ * A timed event is returned as is; an all-day event's UTC dates are re-read as
97
+ * local calendar dates (local midnight to local midnight, DST-safe). A
98
+ * degenerate all-day end (`<=` start) is widened to one day.
99
+ */
100
+ export declare function calendarEventLocalSpan(ev: Pick<CalendarEvent, 'startMs' | 'endMs' | 'allDay'>): CalendarLocalSpan;
101
+ /** Does the event touch the local calendar day starting at `dayStartMs`? */
102
+ export declare function calendarEventOnLocalDay(ev: Pick<CalendarEvent, 'startMs' | 'endMs' | 'allDay'>, dayStartMs: number): boolean;