@moltenship/calendar-core 1.0.0-rc.2 → 2.0.0-beta.1
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/index.d.mts +51 -141
- package/dist/index.mjs +124 -165
- package/package.json +15 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { CalendarClock, HalfOpenIntervalComparator, InstantInterval, PlainDateInterval, PlainDateTimeInterval, TemporalDisambiguation, WallTimeSnapOptions, ZonedDayRange } from "@moltenship/calendar-temporal";
|
|
2
|
-
//#region src/format.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Intl output with thin and narrow no-break spaces as plain ones. Runtimes disagree on them: Node
|
|
5
4
|
* 26 puts thin spaces around a range's dash, "Oct 12 – 18", where Chrome puts plain ones, so text
|
|
6
5
|
* rendered on the server would not match the browser's when it hydrates.
|
|
7
6
|
*/
|
|
8
7
|
export declare function withAsciiSpaces(text: string): string;
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/ids.d.ts
|
|
11
8
|
type CalendarEntityId = string | number;
|
|
12
9
|
type EventId = CalendarEntityId;
|
|
13
10
|
type ResourceId = CalendarEntityId;
|
|
@@ -15,8 +12,6 @@ type AnnotationId = CalendarEntityId;
|
|
|
15
12
|
export declare function isEventId(value: unknown): value is EventId;
|
|
16
13
|
export declare function isResourceId(value: unknown): value is ResourceId;
|
|
17
14
|
export declare function isAnnotationId(value: unknown): value is AnnotationId;
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/events.d.ts
|
|
20
15
|
interface CalendarEventBase<TData, TEventId extends EventId, TResourceId extends ResourceId> {
|
|
21
16
|
readonly data: TData;
|
|
22
17
|
readonly id: TEventId;
|
|
@@ -100,8 +95,6 @@ type CalendarEventContractValidation<TValue> = {
|
|
|
100
95
|
};
|
|
101
96
|
export declare function validateCalendarEventInterval<TInstant, TPlainDate, TPlainDateTime, TInterval extends CalendarEventIntervalOf<TInstant, TPlainDate, TPlainDateTime>>(interval: TInterval, comparators: CalendarEventIntervalComparators<TInstant, TPlainDate, TPlainDateTime>): CalendarEventContractValidation<ValidatedCalendarEventInterval<TInterval>>;
|
|
102
97
|
export declare function validateCalendarEvent<TEvent extends CalendarEvent<unknown, EventId, ResourceId>>(event: TEvent): CalendarEventContractValidation<ValidatedCalendarEvent<TEvent>>;
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/snapshots/types.d.ts
|
|
105
98
|
type InvalidCalendarEventPolicy = "report-and-skip" | "throw";
|
|
106
99
|
type EventAdapterAccessor = "getId" | "getInterval" | "getResourceIds" | "getRevision" | "getTitle" | "isBusy" | "isReadOnly";
|
|
107
100
|
interface EventSnapshotIssue<TEvent, TEventId extends EventId> {
|
|
@@ -181,12 +174,8 @@ export declare class InvalidCalendarEventSnapshotError<TEvent, TEventId extends
|
|
|
181
174
|
readonly issues: readonly EventSnapshotIssue<TEvent, TEventId>[];
|
|
182
175
|
constructor(issues: readonly EventSnapshotIssue<TEvent, TEventId>[]);
|
|
183
176
|
}
|
|
184
|
-
//#endregion
|
|
185
|
-
//#region src/snapshots/event-snapshot.d.ts
|
|
186
177
|
export declare function createEventSnapshotCache<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(adapter: EventAdapter<TEvent, TEventId, TResourceId>, options?: EventSnapshotOptions): EventSnapshotCache<TEvent, TEventId, TResourceId>;
|
|
187
178
|
export declare function createEventSnapshot<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(events: readonly TEvent[], adapter: EventAdapter<TEvent, TEventId, TResourceId>, options?: EventSnapshotOptions): EventSnapshot<TEvent, TEventId, TResourceId>;
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region src/projection/visible-events.d.ts
|
|
190
179
|
/**
|
|
191
180
|
* Returns the instants covered by a half-open date range in `timeZone`. Each boundary is the
|
|
192
181
|
* start of its local day, so a skipped midnight resolves to the first instant that exists.
|
|
@@ -198,8 +187,6 @@ export declare function visibleInstantRange(range: PlainDateInterval, timeZone:
|
|
|
198
187
|
* by the range's instants in `timeZone`, and floating events by wall time.
|
|
199
188
|
*/
|
|
200
189
|
export declare function queryVisibleEvents<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(snapshot: EventSnapshot<TEvent, TEventId, TResourceId>, range: PlainDateInterval, timeZone: string): readonly NormalizedCalendarEvent<TEvent, TEventId, TResourceId>[];
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region src/projection/day-fragments.d.ts
|
|
203
190
|
/** The part of one event that falls on one local date of the display time zone. */
|
|
204
191
|
interface EventDayFragment<TEvent, TEventId extends EventId, TResourceId extends ResourceId> {
|
|
205
192
|
readonly date: Temporal.PlainDate;
|
|
@@ -230,8 +217,6 @@ export declare function eventDateRanges(event: NormalizedCalendarEvent<unknown,
|
|
|
230
217
|
* date.
|
|
231
218
|
*/
|
|
232
219
|
export declare function splitEventsByDay<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(events: readonly NormalizedCalendarEvent<TEvent, TEventId, TResourceId>[], range: PlainDateInterval, timeZone: string): readonly EventDayFragment<TEvent, TEventId, TResourceId>[];
|
|
233
|
-
//#endregion
|
|
234
|
-
//#region src/layout/day-grid.d.ts
|
|
235
220
|
/** One event's run of consecutive days within a day-grid row, placed in a lane. */
|
|
236
221
|
interface DayGridSegment<TEvent, TEventId extends EventId, TResourceId extends ResourceId> {
|
|
237
222
|
/** Zero-based index of the segment's first day within the row. */
|
|
@@ -271,8 +256,6 @@ export declare function layoutDayGridRow<TEvent, TEventId extends EventId, TReso
|
|
|
271
256
|
* a "+N more" control; a segment stays visible only if its lane fits on every day it covers.
|
|
272
257
|
*/
|
|
273
258
|
export declare function limitDayGridLanes<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(row: DayGridRow<TEvent, TEventId, TResourceId>, maxLanes: number): DayGridOverflow<TEvent, TEventId, TResourceId>;
|
|
274
|
-
//#endregion
|
|
275
|
-
//#region src/environment.d.ts
|
|
276
259
|
type IsoDayOfWeek = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
277
260
|
type CalendarDirection = "ltr" | "rtl";
|
|
278
261
|
interface CalendarWeekRules {
|
|
@@ -307,8 +290,6 @@ type CalendarNowSource = {
|
|
|
307
290
|
readonly now?: undefined;
|
|
308
291
|
};
|
|
309
292
|
type CalendarEnvironment = CalendarEnvironmentBase & CalendarNowSource;
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region src/navigation/focus.d.ts
|
|
312
293
|
/**
|
|
313
294
|
* Where a resource view places focus: in a resource, or in the unassigned bucket (`null`). Views
|
|
314
295
|
* without resources leave it out.
|
|
@@ -347,8 +328,6 @@ type CalendarSelection<TEventId extends EventId = EventId> = CalendarCellFocus |
|
|
|
347
328
|
readonly kind: "event";
|
|
348
329
|
};
|
|
349
330
|
export declare function sameFocus(left: CalendarFocus | null, right: CalendarFocus | null): boolean;
|
|
350
|
-
//#endregion
|
|
351
|
-
//#region src/navigation/types.d.ts
|
|
352
331
|
/**
|
|
353
332
|
* A navigation key, by meaning. `"enter"` moves into the focused cell's events and `"exit"` back
|
|
354
333
|
* out to the cell an event sits in.
|
|
@@ -379,8 +358,6 @@ type CalendarSpatialNavigation = {
|
|
|
379
358
|
} | {
|
|
380
359
|
readonly page: -1 | 1;
|
|
381
360
|
};
|
|
382
|
-
//#endregion
|
|
383
|
-
//#region src/availability/types.d.ts
|
|
384
361
|
/**
|
|
385
362
|
* Open hours on a wall clock, `[start, end)`. An `end` at or before `start` runs past midnight
|
|
386
363
|
* into the next day, so `22:00`–`06:00` is a night and `00:00`–`00:00` a whole day.
|
|
@@ -465,8 +442,6 @@ interface AvailabilitySnapshot {
|
|
|
465
442
|
*/
|
|
466
443
|
forResource(resourceId: ResourceId | null): AvailabilitySchedule | null;
|
|
467
444
|
}
|
|
468
|
-
//#endregion
|
|
469
|
-
//#region src/resources.d.ts
|
|
470
445
|
interface CalendarResource<TData = unknown, TResourceId extends ResourceId = string> {
|
|
471
446
|
/** When the resource can be booked; the calendar's `availability` by default. */
|
|
472
447
|
readonly availability?: ResourceAvailability;
|
|
@@ -480,8 +455,6 @@ interface CalendarResource<TData = unknown, TResourceId extends ResourceId = str
|
|
|
480
455
|
readonly timeZone?: string;
|
|
481
456
|
readonly title: string;
|
|
482
457
|
}
|
|
483
|
-
//#endregion
|
|
484
|
-
//#region src/resources/tree.d.ts
|
|
485
458
|
/** What the hierarchy reads from a resource. */
|
|
486
459
|
type ResourceTreeInput = Pick<CalendarResource<unknown, ResourceId>, "id" | "parentId">;
|
|
487
460
|
interface ResourceTreeNode<TResource> {
|
|
@@ -506,8 +479,6 @@ interface ResourceTree<TResource = CalendarResource<unknown, ResourceId>> {
|
|
|
506
479
|
* resource, and a resource whose parent is missing, or whose parents loop back to it, is top-level.
|
|
507
480
|
*/
|
|
508
481
|
export declare function createResourceTree<TResource extends ResourceTreeInput>(resources: readonly TResource[]): ResourceTree<TResource>;
|
|
509
|
-
//#endregion
|
|
510
|
-
//#region src/views.d.ts
|
|
511
482
|
interface CalendarViewProjectionInput<TOptions, TEvent = unknown> {
|
|
512
483
|
readonly environment: CalendarEnvironmentBase;
|
|
513
484
|
/** Resources whose children show; see `visibleResources`. */
|
|
@@ -554,8 +525,6 @@ export declare function resolveViewInstantRange(range: PlainDateInterval, timeZo
|
|
|
554
525
|
* has none. A load range that leaves out visible dates throws `RangeError`.
|
|
555
526
|
*/
|
|
556
527
|
export declare function resolveViewLoadRange<TOptions>(strategy: Pick<CalendarViewStrategy<unknown, TOptions>, "getLoadRange">, anchor: Temporal.PlainDate, environment: CalendarEnvironmentBase, options: TOptions, range: PlainDateInterval): PlainDateInterval;
|
|
557
|
-
//#endregion
|
|
558
|
-
//#region src/views/month/month.d.ts
|
|
559
528
|
interface MonthDay {
|
|
560
529
|
readonly date: Temporal.PlainDate;
|
|
561
530
|
readonly inMonth: boolean;
|
|
@@ -585,8 +554,6 @@ export declare function projectMonth<TEvent>(input: CalendarViewProjectionInput<
|
|
|
585
554
|
* days of `month` are `inMonth`.
|
|
586
555
|
*/
|
|
587
556
|
export declare function projectMonthWeeks<TEvent>({ environment, snapshot, today }: Pick<CalendarViewProjectionInput<unknown, TEvent>, "environment" | "snapshot" | "today">, range: PlainDateInterval, month: Temporal.PlainDate): MonthProjection<TEvent, EventId, ResourceId>;
|
|
588
|
-
//#endregion
|
|
589
|
-
//#region src/views/month/scrolling.d.ts
|
|
590
557
|
/**
|
|
591
558
|
* The first day of the month a scrolling month shows: the month its first week ends in, since
|
|
592
559
|
* that week holds the month's first day.
|
|
@@ -605,8 +572,6 @@ export declare function scrollingMonthAnchor(firstWeek: Temporal.PlainDate): Tem
|
|
|
605
572
|
* through the visible weeks as in a month grid.
|
|
606
573
|
*/
|
|
607
574
|
export declare function scrollingMonthStrategy<TOptions = undefined, TEvent = unknown>(weeks?: number): CalendarViewStrategy<MonthProjection<TEvent, EventId, ResourceId>, TOptions, TEvent>;
|
|
608
|
-
//#endregion
|
|
609
|
-
//#region src/views/year/year.d.ts
|
|
610
575
|
interface YearDay<TEvent, TEventId extends EventId, TResourceId extends ResourceId> {
|
|
611
576
|
readonly date: Temporal.PlainDate;
|
|
612
577
|
/** The parts of events that fall on the date: all-day events first, then by start time. */
|
|
@@ -644,8 +609,6 @@ export declare function getYearTitle(range: PlainDateInterval, environment: Cale
|
|
|
644
609
|
* in event colours, or a list of the day's events. Dates outside the range are `null`.
|
|
645
610
|
*/
|
|
646
611
|
export declare function projectYear<TEvent>(input: CalendarViewProjectionInput<unknown, TEvent>): YearProjection<TEvent, EventId, ResourceId>;
|
|
647
|
-
//#endregion
|
|
648
|
-
//#region src/views/list/list.d.ts
|
|
649
612
|
interface ListViewOptions {
|
|
650
613
|
/** Number of whole weeks shown, starting with the anchor's week. Defaults to 4. */
|
|
651
614
|
readonly weeks?: number;
|
|
@@ -674,8 +637,6 @@ export declare function getListTitle(range: PlainDateInterval, environment: Cale
|
|
|
674
637
|
* listing its fragments with all-day events first, then by start time.
|
|
675
638
|
*/
|
|
676
639
|
export declare function projectList<TEvent>(input: CalendarViewProjectionInput<unknown, TEvent>): ListProjection<TEvent, EventId, ResourceId>;
|
|
677
|
-
//#endregion
|
|
678
|
-
//#region src/views/list/scrolling.d.ts
|
|
679
640
|
/**
|
|
680
641
|
* An agenda that scrolls through days instead of paging. Its range is `weeks` from the anchor
|
|
681
642
|
* date, the day a view shows on top, since a list comes to rest on any day rather than on a week;
|
|
@@ -685,8 +646,6 @@ export declare function projectList<TEvent>(input: CalendarViewProjectionInput<u
|
|
|
685
646
|
* the paged agenda; a range without events is entered at its first date.
|
|
686
647
|
*/
|
|
687
648
|
export declare function scrollingListStrategy<TOptions extends ListViewOptions | undefined = ListViewOptions, TEvent = unknown>(): CalendarViewStrategy<ListProjection<TEvent, EventId, ResourceId>, TOptions, TEvent>;
|
|
688
|
-
//#endregion
|
|
689
|
-
//#region src/annotations/types.d.ts
|
|
690
649
|
/**
|
|
691
650
|
* Time-based information shown beside events without being one: a listening session, a night's
|
|
692
651
|
* sleep, a focus block. Annotations are read-only and never take part in event layout. Like
|
|
@@ -726,15 +685,11 @@ interface AnnotationSnapshot<TData = unknown, TResourceId extends ResourceId = R
|
|
|
726
685
|
/** Annotations intersecting `[start, end)`, in input order. */
|
|
727
686
|
query(start: Temporal.Instant, end: Temporal.Instant): readonly CalendarAnnotation<TData, TResourceId>[];
|
|
728
687
|
}
|
|
729
|
-
//#endregion
|
|
730
|
-
//#region src/annotations/snapshot.d.ts
|
|
731
688
|
/**
|
|
732
689
|
* Validates and indexes annotations. Invalid ones are skipped and reported in `issues`, as are
|
|
733
690
|
* repeated IDs after their first use; the calendar never throws over annotation data.
|
|
734
691
|
*/
|
|
735
692
|
export declare function createAnnotationSnapshot<TData = unknown, TResourceId extends ResourceId = ResourceId>(input: readonly CalendarAnnotation<TData, TResourceId>[]): AnnotationSnapshot<TData, TResourceId>;
|
|
736
|
-
//#endregion
|
|
737
|
-
//#region src/views/time-grid/columns.d.ts
|
|
738
693
|
/** A vertical extent as fractions of a column's nominal 24-hour wall-clock axis. */
|
|
739
694
|
interface TimeGridBand {
|
|
740
695
|
readonly height: number;
|
|
@@ -756,8 +711,6 @@ interface TimeGridColumn {
|
|
|
756
711
|
}
|
|
757
712
|
/** Builds one column per visible date in the display timezone. */
|
|
758
713
|
export declare function timeGridColumns(range: PlainDateInterval, timeZone: string): readonly TimeGridColumn[];
|
|
759
|
-
//#endregion
|
|
760
|
-
//#region src/annotations/time-grid.d.ts
|
|
761
714
|
/** How marks draw in a time grid's rail, as fractions of a column's 24-hour axis. */
|
|
762
715
|
interface TimeGridAnnotationGeometry {
|
|
763
716
|
/**
|
|
@@ -802,8 +755,6 @@ interface TimeGridAnnotationMark<TSource extends CalendarAnnotationSource = Cale
|
|
|
802
755
|
* hides them. The event projection is not involved, so annotations never change event layout.
|
|
803
756
|
*/
|
|
804
757
|
export declare function projectTimeGridAnnotations<TSource extends CalendarAnnotationSource, TData>(columns: readonly TimeGridColumn[], snapshot: AnnotationSnapshot<TData>, sources: readonly TSource[], geometry?: TimeGridAnnotationGeometry): readonly (readonly TimeGridAnnotationMark<TSource, TData>[])[];
|
|
805
|
-
//#endregion
|
|
806
|
-
//#region src/annotations/summary.d.ts
|
|
807
758
|
/** One source's marks on a day, for a screen-reader summary or a day cell. */
|
|
808
759
|
interface AnnotationSourceSummary<TSource extends CalendarAnnotationSource = CalendarAnnotationSource> {
|
|
809
760
|
readonly source: TSource;
|
|
@@ -819,8 +770,6 @@ interface AnnotationSourceSummary<TSource extends CalendarAnnotationSource = Cal
|
|
|
819
770
|
}
|
|
820
771
|
/** Summarizes a column's marks per source, in source order. */
|
|
821
772
|
export declare function summarizeAnnotationMarks<TSource extends CalendarAnnotationSource>(marks: readonly TimeGridAnnotationMark<TSource, unknown>[]): readonly AnnotationSourceSummary<TSource>[];
|
|
822
|
-
//#endregion
|
|
823
|
-
//#region src/availability/snapshot.d.ts
|
|
824
773
|
interface AvailabilitySnapshotInput {
|
|
825
774
|
/** The calendar's hours; without them the calendar is always open. */
|
|
826
775
|
readonly availability?: CalendarAvailability;
|
|
@@ -835,8 +784,6 @@ interface AvailabilitySnapshotInput {
|
|
|
835
784
|
* resources without any share the calendar's hours, resolved once per time zone.
|
|
836
785
|
*/
|
|
837
786
|
export declare function createAvailabilitySnapshot({ availability, resources, timeZone }: AvailabilitySnapshotInput): AvailabilitySnapshot;
|
|
838
|
-
//#endregion
|
|
839
|
-
//#region src/availability/busy.d.ts
|
|
840
787
|
/**
|
|
841
788
|
* Whether events occupy an instant, and when that changes: the events in progress and when the
|
|
842
789
|
* last of a run of overlapping or back-to-back ones ends, or the next event's start. Either is
|
|
@@ -887,8 +834,6 @@ export declare function busyAt<TEvent, TEventId extends EventId, TResourceId ext
|
|
|
887
834
|
* read as `busyAt` reads events. Which events are busy is `isBusyEvent`'s call.
|
|
888
835
|
*/
|
|
889
836
|
export declare function busyResources<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(events: EventSnapshot<TEvent, TEventId, TResourceId>, range: InstantInterval | CalendarEventInterval, { exclude, resourceIds, timeZone }: BusyResourcesQuery<TEventId, TResourceId>): ReadonlyMap<TResourceId, readonly NormalizedCalendarEvent<TEvent, TEventId, TResourceId>[]>;
|
|
890
|
-
//#endregion
|
|
891
|
-
//#region src/availability/closures.d.ts
|
|
892
837
|
/**
|
|
893
838
|
* Why time is closed: `"outside-hours"` before, between, or after a date's open hours (its
|
|
894
839
|
* exception's included), `"closed-day"` on a date the weekly hours leave closed, and
|
|
@@ -905,8 +850,6 @@ interface ClosedTime {
|
|
|
905
850
|
/** Whether open time starts where it ends. */
|
|
906
851
|
readonly opensAfter: boolean;
|
|
907
852
|
}
|
|
908
|
-
//#endregion
|
|
909
|
-
//#region src/views/resource-timeline/geometry.d.ts
|
|
910
853
|
/** A stretch of a timeline, as fractions of its width from the inline start. */
|
|
911
854
|
interface TimelineExtent {
|
|
912
855
|
readonly end: number;
|
|
@@ -922,8 +865,6 @@ interface TimelineExtent {
|
|
|
922
865
|
export declare function timelineExtent(columns: readonly TimeGridColumn[], interval: CalendarEventInterval): TimelineExtent | null;
|
|
923
866
|
/** Where an instant, such as now, falls along a timeline by its wall time; `null` off it. */
|
|
924
867
|
export declare function timelinePosition(columns: readonly TimeGridColumn[], instant: Temporal.Instant): number | null;
|
|
925
|
-
//#endregion
|
|
926
|
-
//#region src/availability/projection.d.ts
|
|
927
868
|
/**
|
|
928
869
|
* Closed time on a time-grid column's 24-hour axis. Its edges open only where open time meets it
|
|
929
870
|
* inside the column, not where it runs on past midnight.
|
|
@@ -955,8 +896,6 @@ export declare function projectTimelineAvailability(columns: readonly TimeGridCo
|
|
|
955
896
|
* schedule's wall clock lends its label, and makes the reason `"exception"`.
|
|
956
897
|
*/
|
|
957
898
|
export declare function closedDates(range: PlainDateInterval, schedule: AvailabilitySchedule | null, timeZone: string): ReadonlyMap<string, ClosedDate>;
|
|
958
|
-
//#endregion
|
|
959
|
-
//#region src/availability/status.d.ts
|
|
960
899
|
/**
|
|
961
900
|
* Whether an instant is within working hours, and when that changes. `closesAt` and `opensAt`
|
|
962
901
|
* are `null` when it doesn't within a year.
|
|
@@ -988,8 +927,6 @@ interface ResourceStatus<TEvent> {
|
|
|
988
927
|
* whether that resource's events (or any) occupy it, with when either next changes.
|
|
989
928
|
*/
|
|
990
929
|
export declare function resourceStatusAt<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(availability: AvailabilitySnapshot, events: EventSnapshot<TEvent, TEventId, TResourceId>, at: Temporal.Instant, query: BusyQuery<TResourceId>): ResourceStatus<NormalizedCalendarEvent<TEvent, TEventId, TResourceId>>;
|
|
991
|
-
//#endregion
|
|
992
|
-
//#region src/resources/visible.d.ts
|
|
993
930
|
/**
|
|
994
931
|
* A resource a view shows, as a column or a row, in display order. The same resource keeps the
|
|
995
932
|
* same object while its expansion does not change, so memoized rows skip re-rendering.
|
|
@@ -1035,8 +972,6 @@ export declare function groupByResource<TItem extends {
|
|
|
1035
972
|
readonly resourceIds: readonly ResourceId[];
|
|
1036
973
|
};
|
|
1037
974
|
}>(items: readonly TItem[], resources: readonly VisibleResource<unknown>[]): readonly (readonly TItem[])[];
|
|
1038
|
-
//#endregion
|
|
1039
|
-
//#region src/views/time-grid/range.d.ts
|
|
1040
975
|
/** The anchor's week, or `count` consecutive days starting at the anchor (a day view is one). */
|
|
1041
976
|
type TimeGridSpan = {
|
|
1042
977
|
readonly kind: "week";
|
|
@@ -1050,8 +985,6 @@ export declare function timeGridRange(anchor: Temporal.PlainDate, span: TimeGrid
|
|
|
1050
985
|
export declare function navigateTimeGrid(anchor: Temporal.PlainDate, delta: number, span: TimeGridSpan): Temporal.PlainDate;
|
|
1051
986
|
/** "October 8, 2026" for one day, "Oct 6 – 12, 2026" for several, in the given locale. */
|
|
1052
987
|
export declare function timeGridTitle(range: PlainDateInterval, locale: Intl.Locale | string): string;
|
|
1053
|
-
//#endregion
|
|
1054
|
-
//#region src/views/time-grid/geometry.d.ts
|
|
1055
988
|
interface TimeGridPosition {
|
|
1056
989
|
/** Index into the columns that were searched. */
|
|
1057
990
|
readonly column: number;
|
|
@@ -1077,8 +1010,6 @@ export declare function timedFragmentBox(column: TimeGridColumn, interval: Insta
|
|
|
1077
1010
|
* repeated time keeps the requested `fold` occurrence.
|
|
1078
1011
|
*/
|
|
1079
1012
|
export declare function timeGridDateTimeAt(column: TimeGridColumn, y: number, options?: TimeGridPointOptions): Temporal.ZonedDateTime;
|
|
1080
|
-
//#endregion
|
|
1081
|
-
//#region src/views/time-grid/zones.d.ts
|
|
1082
1013
|
/** A display-zone wall time read in another zone. */
|
|
1083
1014
|
interface TimeGridZoneTime {
|
|
1084
1015
|
/** The wall time in the other zone. */
|
|
@@ -1178,8 +1109,6 @@ export declare function timeGridZoneRows(column: TimeGridColumn, timeZone: strin
|
|
|
1178
1109
|
* zone or a step that doesn't divide a day.
|
|
1179
1110
|
*/
|
|
1180
1111
|
export declare function timeGridZoneAxis(columns: readonly TimeGridColumn[], timeZone: string, options?: TimeGridZoneAxisOptions): TimeGridZoneAxis | null;
|
|
1181
|
-
//#endregion
|
|
1182
|
-
//#region src/layout/timed-overlap.d.ts
|
|
1183
1112
|
/**
|
|
1184
1113
|
* How overlapping timed events share a day column:
|
|
1185
1114
|
*
|
|
@@ -1226,8 +1155,6 @@ interface TimedOverlapOptions extends Pick<OverlapLayoutOptions, "overlapLayout"
|
|
|
1226
1155
|
/** Smallest rendered height, in the same units as `top`; shorter items reserve this much. */
|
|
1227
1156
|
readonly minHeight?: number;
|
|
1228
1157
|
}
|
|
1229
|
-
//#endregion
|
|
1230
|
-
//#region src/views/time-grid/layout.d.ts
|
|
1231
1158
|
type DayFragment = EventDayFragment<unknown, EventId, ResourceId>;
|
|
1232
1159
|
/** `layoutTimeGrid`'s options: the layout, each event's own, and the smallest height. */
|
|
1233
1160
|
interface TimeGridLayoutOptions<TEvent = unknown> extends TimedOverlapOptions, Pick<OverlapLayoutOptions<TEvent>, "getEventOverlapLayout"> {}
|
|
@@ -1245,8 +1172,6 @@ interface TimeGridEventLayout<TFragment> extends TimeGridBand {
|
|
|
1245
1172
|
* `getEventOverlapLayout` choose; see `OverlapLayoutOptions`.
|
|
1246
1173
|
*/
|
|
1247
1174
|
export declare function layoutTimeGrid<TFragment extends DayFragment>(columns: readonly TimeGridColumn[], fragments: readonly TFragment[], options?: TimeGridLayoutOptions<TFragment["event"]["event"]>): readonly (readonly TimeGridEventLayout<TFragment>[])[];
|
|
1248
|
-
//#endregion
|
|
1249
|
-
//#region src/views/time-grid/projection.d.ts
|
|
1250
1175
|
interface TimeGridDay<TEvent> {
|
|
1251
1176
|
readonly column: TimeGridColumn;
|
|
1252
1177
|
/** Timed and floating events shorter than a day, positioned within the column. */
|
|
@@ -1275,8 +1200,6 @@ export declare function projectTimeGrid<TEvent>({ environment, getEventOverlapLa
|
|
|
1275
1200
|
* view's options.
|
|
1276
1201
|
*/
|
|
1277
1202
|
export declare function timeGridStrategy<TOptions = undefined, TEvent = unknown>(span: TimeGridSpan): CalendarViewStrategy<TimeGridProjection<TEvent>, TOptions, TEvent>;
|
|
1278
|
-
//#endregion
|
|
1279
|
-
//#region src/views/time-grid/scrolling.d.ts
|
|
1280
1203
|
/**
|
|
1281
1204
|
* A time grid that scrolls through days instead of paging: the anchor's week, or `count` days
|
|
1282
1205
|
* starting at the anchor, as `timeGridStrategy` shows them. A view swipes a page at a time, so
|
|
@@ -1287,8 +1210,6 @@ export declare function timeGridStrategy<TOptions = undefined, TEvent = unknown>
|
|
|
1287
1210
|
* in `timeGridStrategy`.
|
|
1288
1211
|
*/
|
|
1289
1212
|
export declare function scrollingTimeGridStrategy<TOptions = undefined, TEvent = unknown>(span: TimeGridSpan): CalendarViewStrategy<TimeGridProjection<TEvent>, TOptions, TEvent>;
|
|
1290
|
-
//#endregion
|
|
1291
|
-
//#region src/views/resource-columns/projection.d.ts
|
|
1292
1213
|
/** One visible resource's time grid: its all-day row and its events in each day column. */
|
|
1293
1214
|
interface ResourceColumn<TEvent> extends TimeGridProjection<TEvent> {
|
|
1294
1215
|
readonly resource: VisibleResource;
|
|
@@ -1319,8 +1240,6 @@ export declare function projectResourceColumns<TEvent>({ environment, expandedRe
|
|
|
1319
1240
|
* events share a column.
|
|
1320
1241
|
*/
|
|
1321
1242
|
export declare function resourceColumnsStrategy<TOptions extends ResourceVisibilityOptions = ResourceVisibilityOptions, TEvent = unknown>(span: TimeGridSpan): CalendarViewStrategy<ResourceColumnsProjection<TEvent>, TOptions, TEvent>;
|
|
1322
|
-
//#endregion
|
|
1323
|
-
//#region src/views/resource-timeline/range.d.ts
|
|
1324
1243
|
/** A time grid's span, or the anchor's calendar month (its own dates, not padded weeks). */
|
|
1325
1244
|
type ResourceTimelineSpan = TimeGridSpan | {
|
|
1326
1245
|
readonly kind: "month";
|
|
@@ -1330,8 +1249,6 @@ export declare function resourceTimelineRange(anchor: Temporal.PlainDate, span:
|
|
|
1330
1249
|
export declare function navigateResourceTimeline(anchor: Temporal.PlainDate, delta: number, span: ResourceTimelineSpan): Temporal.PlainDate;
|
|
1331
1250
|
/** "October 2026" for a month, otherwise as a time grid titles the same dates. */
|
|
1332
1251
|
export declare function resourceTimelineTitle(range: PlainDateInterval, span: ResourceTimelineSpan, locale: Intl.Locale | string): string;
|
|
1333
|
-
//#endregion
|
|
1334
|
-
//#region src/views/resource-timeline/projection.d.ts
|
|
1335
1252
|
interface ResourceTimelineOptions extends ResourceVisibilityOptions {
|
|
1336
1253
|
/** What a slot spans: an hour, or a whole day. Hours for one day and days for longer ranges by default. */
|
|
1337
1254
|
readonly slotUnit?: "day" | "hour";
|
|
@@ -1411,11 +1328,15 @@ export declare function projectResourceTimeline<TEvent>({ environment, expandedR
|
|
|
1411
1328
|
* events share it.
|
|
1412
1329
|
*/
|
|
1413
1330
|
export declare function resourceTimelineStrategy<TOptions extends ResourceTimelineOptions = ResourceTimelineOptions, TEvent = unknown>(span: ResourceTimelineSpan): CalendarViewStrategy<ResourceTimelineProjection<TEvent>, TOptions, TEvent>;
|
|
1414
|
-
//#endregion
|
|
1415
|
-
//#region src/policies/types.d.ts
|
|
1416
1331
|
interface CalendarPolicyContext<TEvent, TEventId extends EventId, TResourceId extends ResourceId> {
|
|
1417
1332
|
/** The root's working hours, for `availabilityPolicy`. */
|
|
1418
1333
|
readonly availability?: AvailabilitySnapshot;
|
|
1334
|
+
/**
|
|
1335
|
+
* Which input proposed the change, as `detail.input === "agent"` for an AI agent's, so a policy
|
|
1336
|
+
* can reject or flag it. Event transactions always set it; it is absent only where a caller runs
|
|
1337
|
+
* policies itself without one.
|
|
1338
|
+
*/
|
|
1339
|
+
readonly detail?: CalendarProposalDetail;
|
|
1419
1340
|
/** Current events with pending changes applied, as the user sees them. */
|
|
1420
1341
|
readonly events: EventSnapshot<TEvent, TEventId, TResourceId>;
|
|
1421
1342
|
readonly timeZone: string;
|
|
@@ -1445,8 +1366,6 @@ type CalendarPolicyResult<TEvent, TEventId extends EventId, TResourceId extends
|
|
|
1445
1366
|
readonly reason: string;
|
|
1446
1367
|
readonly status: "rejected";
|
|
1447
1368
|
};
|
|
1448
|
-
//#endregion
|
|
1449
|
-
//#region src/transactions/types.d.ts
|
|
1450
1369
|
type CalendarEventPlacement<TResourceId extends ResourceId = ResourceId> = CalendarEventInterval & {
|
|
1451
1370
|
readonly resourceIds: readonly TResourceId[];
|
|
1452
1371
|
};
|
|
@@ -1518,13 +1437,27 @@ interface CalendarEventDeleteChange<TEvent, TEventId extends EventId, TResourceI
|
|
|
1518
1437
|
type CalendarEventChange<TEvent, TEventId extends EventId, TResourceId extends ResourceId> = CalendarEventCreateChange<TResourceId, TEvent> | CalendarEventUpdateChange<TEvent, TEventId, TResourceId> | CalendarEventDeleteChange<TEvent, TEventId, TResourceId>;
|
|
1519
1438
|
/**
|
|
1520
1439
|
* Persists an accepted change. Returning a promise keeps the change visible as pending until it
|
|
1521
|
-
* settles; throwing or rejecting rolls it back.
|
|
1440
|
+
* settles; throwing or rejecting rolls it back. `detail` says which input proposed it, so a
|
|
1441
|
+
* handler can refuse an agent's change by throwing.
|
|
1442
|
+
*/
|
|
1443
|
+
type CalendarEventChangeHandler<TEvent, TEventId extends EventId, TResourceId extends ResourceId> = (change: CalendarEventChange<TEvent, TEventId, TResourceId>, detail: CalendarProposalDetail) => void | Promise<void>;
|
|
1444
|
+
/**
|
|
1445
|
+
* Which input made a proposal: a pointer or keyboard gesture, the application's own code, or an
|
|
1446
|
+
* AI agent acting through the calendar's agent surface.
|
|
1447
|
+
*/
|
|
1448
|
+
type CalendarInputMethod = "pointer" | "keyboard" | "api" | "agent";
|
|
1449
|
+
/**
|
|
1450
|
+
* What a proposal says beside the change itself. Policies and `onEventChange` read it, and
|
|
1451
|
+
* `onEventChangeResult` gets it back.
|
|
1522
1452
|
*/
|
|
1523
|
-
type CalendarEventChangeHandler<TEvent, TEventId extends EventId, TResourceId extends ResourceId> = (change: CalendarEventChange<TEvent, TEventId, TResourceId>) => void | Promise<void>;
|
|
1524
|
-
/** Which input made a proposal: a pointer or keyboard gesture, or the application's own code. */
|
|
1525
|
-
type CalendarInputMethod = "pointer" | "keyboard" | "api";
|
|
1526
|
-
/** What a proposal says beside the change itself; `onEventChangeResult` gets it back. */
|
|
1527
1453
|
interface CalendarProposalDetail {
|
|
1454
|
+
/**
|
|
1455
|
+
* What the proposer asks for beside the placement, such as the title an agent gives a new
|
|
1456
|
+
* event. The engine only models placement and the application owns its records, so these reach
|
|
1457
|
+
* policies and `onEventChange` as they came, unvalidated: the application decides which it
|
|
1458
|
+
* accepts, and refuses the rest from a policy or by throwing.
|
|
1459
|
+
*/
|
|
1460
|
+
readonly fields?: Readonly<Record<string, unknown>>;
|
|
1528
1461
|
/** Set on the inverse an event history proposes to undo or redo a step. */
|
|
1529
1462
|
readonly history?: "undo" | "redo";
|
|
1530
1463
|
readonly input: CalendarInputMethod;
|
|
@@ -1539,9 +1472,26 @@ type CalendarTransactionResult<TEvent, TEventId extends EventId, TResourceId ext
|
|
|
1539
1472
|
readonly reason: string;
|
|
1540
1473
|
readonly status: "rejected";
|
|
1541
1474
|
};
|
|
1475
|
+
/**
|
|
1476
|
+
* A proposal still being decided: its policies answer asynchronously (`validating`), or its handler
|
|
1477
|
+
* returned a promise (`saving`). `result` settles with the outcome and never rejects.
|
|
1478
|
+
*/
|
|
1479
|
+
interface CalendarPendingProposal<TEvent, TEventId extends EventId, TResourceId extends ResourceId> {
|
|
1480
|
+
readonly change: CalendarEventChange<TEvent, TEventId, TResourceId>;
|
|
1481
|
+
readonly phase: "validating" | "saving";
|
|
1482
|
+
readonly result: Promise<CalendarTransactionResult<TEvent, TEventId, TResourceId>>;
|
|
1483
|
+
readonly status: "pending";
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* What `proposeNow` returns: the outcome itself when it is known before anything waits, as a
|
|
1487
|
+
* policy's synchronous refusal or a synchronous save, and the pending proposal otherwise.
|
|
1488
|
+
*/
|
|
1489
|
+
type CalendarProposalOutcome<TEvent, TEventId extends EventId, TResourceId extends ResourceId> = CalendarTransactionResult<TEvent, TEventId, TResourceId> | CalendarPendingProposal<TEvent, TEventId, TResourceId>;
|
|
1542
1490
|
interface CalendarTransactionContext<TEvent, TEventId extends EventId, TResourceId extends ResourceId> {
|
|
1543
1491
|
/** The root's working hours, handed to policies. */
|
|
1544
1492
|
readonly availability?: AvailabilitySnapshot;
|
|
1493
|
+
/** Which input proposes the change, handed to policies and the handler; `{ input: "api" }` if absent. */
|
|
1494
|
+
readonly detail?: CalendarProposalDetail;
|
|
1545
1495
|
readonly onEventChange: CalendarEventChangeHandler<TEvent, TEventId, TResourceId>;
|
|
1546
1496
|
readonly policies?: readonly CalendarPolicy<TEvent, TEventId, TResourceId>[];
|
|
1547
1497
|
/** The application's events, without pending changes applied. */
|
|
@@ -1562,8 +1512,6 @@ interface CalendarPendingChange<TEvent, TEventId extends EventId, TResourceId ex
|
|
|
1562
1512
|
}
|
|
1563
1513
|
/** Pending proposals by change ID, in the order they were proposed. */
|
|
1564
1514
|
type CalendarPendingChanges<TEvent, TEventId extends EventId, TResourceId extends ResourceId> = ReadonlyMap<string, CalendarPendingChange<TEvent, TEventId, TResourceId>>;
|
|
1565
|
-
//#endregion
|
|
1566
|
-
//#region src/history/types.d.ts
|
|
1567
1515
|
/** Which way a history step is taken: back with `undo`, forward again with `redo`. */
|
|
1568
1516
|
type EventHistoryDirection = "undo" | "redo";
|
|
1569
1517
|
/**
|
|
@@ -1665,7 +1613,7 @@ interface EventHistoryOptions<TEvent, TEventId extends EventId, TResourceId exte
|
|
|
1665
1613
|
* one placement change, such as changes to occurrences of a recurring event.
|
|
1666
1614
|
*/
|
|
1667
1615
|
readonly filter?: (change: CalendarEventChange<TEvent, TEventId, TResourceId>, detail: CalendarProposalDetail) => boolean;
|
|
1668
|
-
/** The inputs whose changes are recorded;
|
|
1616
|
+
/** The inputs whose changes are recorded; every input, an agent's included, by default. */
|
|
1669
1617
|
readonly inputs?: readonly CalendarInputMethod[];
|
|
1670
1618
|
/** The most steps the undo stack keeps; the oldest drops. 100 by default. */
|
|
1671
1619
|
readonly limit?: number;
|
|
@@ -1715,8 +1663,6 @@ interface EventHistory<TEvent, TEventId extends EventId, TResourceId extends Res
|
|
|
1715
1663
|
*/
|
|
1716
1664
|
readonly undo: (context: EventHistoryContext<TEvent, TEventId, TResourceId>) => Promise<EventHistoryOutcome<TEvent, TEventId, TResourceId>>;
|
|
1717
1665
|
}
|
|
1718
|
-
//#endregion
|
|
1719
|
-
//#region src/history/event-history.d.ts
|
|
1720
1666
|
/**
|
|
1721
1667
|
* Records committed event changes as steps, and undoes and redoes them by proposing their
|
|
1722
1668
|
* inverses through a calendar's pipeline, so policies run and `onEventChange` saves them. A step
|
|
@@ -1728,8 +1674,6 @@ interface EventHistory<TEvent, TEventId extends EventId, TResourceId extends Res
|
|
|
1728
1674
|
* ```
|
|
1729
1675
|
*/
|
|
1730
1676
|
export declare function createEventHistory<TEvent, TEventId extends EventId = EventId, TResourceId extends ResourceId = ResourceId>(options?: EventHistoryOptions<TEvent, TEventId, TResourceId>): EventHistory<TEvent, TEventId, TResourceId>;
|
|
1731
|
-
//#endregion
|
|
1732
|
-
//#region src/transactions/event-transactions.d.ts
|
|
1733
1677
|
/** Members are plain functions, so they can be passed on, as to `useSyncExternalStore`. */
|
|
1734
1678
|
interface EventTransactions<TEvent, TEventId extends EventId, TResourceId extends ResourceId> {
|
|
1735
1679
|
/** Pending placements for `applyEventOverlay`. The map identity changes only on updates. */
|
|
@@ -1745,6 +1689,13 @@ interface EventTransactions<TEvent, TEventId extends EventId, TResourceId extend
|
|
|
1745
1689
|
* settles with the outcome and never rejects.
|
|
1746
1690
|
*/
|
|
1747
1691
|
readonly propose: (proposal: CalendarEventProposal<TEventId, TResourceId, TEvent>, context: CalendarTransactionContext<TEvent, TEventId, TResourceId>) => Promise<CalendarTransactionResult<TEvent, TEventId, TResourceId>>;
|
|
1692
|
+
/**
|
|
1693
|
+
* `propose`, returning the outcome itself when nothing waits: a policy's synchronous refusal, a
|
|
1694
|
+
* synchronous save, or a proposal that can't apply. Otherwise the pending proposal, with its
|
|
1695
|
+
* change and a `result` that never rejects. A caller that must answer at once, as an agent's
|
|
1696
|
+
* step, learns a refusal without running the policies a second time.
|
|
1697
|
+
*/
|
|
1698
|
+
readonly proposeNow: (proposal: CalendarEventProposal<TEventId, TResourceId, TEvent>, context: CalendarTransactionContext<TEvent, TEventId, TResourceId>) => CalendarProposalOutcome<TEvent, TEventId, TResourceId>;
|
|
1748
1699
|
/**
|
|
1749
1700
|
* Runs a proposal through the policies without showing or saving it, as a gesture's preview
|
|
1750
1701
|
* does, against the same events `propose` would see. `null` for an unknown event, or when a
|
|
@@ -1760,15 +1711,11 @@ interface EventTransactions<TEvent, TEventId extends EventId, TResourceId extend
|
|
|
1760
1711
|
* the handler runs; a rejection rolls them back, and the latest proposal for an event wins.
|
|
1761
1712
|
*/
|
|
1762
1713
|
export declare function createEventTransactions<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(): EventTransactions<TEvent, TEventId, TResourceId>;
|
|
1763
|
-
//#endregion
|
|
1764
|
-
//#region src/transactions/overlay.d.ts
|
|
1765
1714
|
/**
|
|
1766
1715
|
* Applies pending placements to a snapshot. Returns the snapshot itself when nothing is pending
|
|
1767
1716
|
* for an event it contains.
|
|
1768
1717
|
*/
|
|
1769
1718
|
export declare function applyEventOverlay<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(snapshot: EventSnapshot<TEvent, TEventId, TResourceId>, pending: CalendarPendingPlacements<TEventId, TResourceId>): EventSnapshot<TEvent, TEventId, TResourceId>;
|
|
1770
|
-
//#endregion
|
|
1771
|
-
//#region src/transactions/wall-clock.d.ts
|
|
1772
1719
|
type DurationInput = Temporal.Duration | Temporal.DurationLike;
|
|
1773
1720
|
/**
|
|
1774
1721
|
* A wall-clock offset. Its calendar part (years to days) and time part may differ in sign, as in
|
|
@@ -1786,8 +1733,6 @@ interface CalendarWallClockDelta {
|
|
|
1786
1733
|
readonly weeks?: number;
|
|
1787
1734
|
readonly years?: number;
|
|
1788
1735
|
}
|
|
1789
|
-
//#endregion
|
|
1790
|
-
//#region src/transactions/placement.d.ts
|
|
1791
1736
|
/** The placement of a normalized event, without its title, record, or other fields. */
|
|
1792
1737
|
export declare function eventPlacement<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(event: NormalizedCalendarEvent<TEvent, TEventId, TResourceId>): CalendarEventPlacement<TResourceId>;
|
|
1793
1738
|
/**
|
|
@@ -1821,8 +1766,6 @@ export declare function toAllDayPlacement<TResourceId extends ResourceId>(placem
|
|
|
1821
1766
|
}>;
|
|
1822
1767
|
/** Converts a placement to a timed one that starts at `start` and lasts `duration`. */
|
|
1823
1768
|
export declare function toTimedPlacement<TResourceId extends ResourceId>(placement: CalendarEventPlacement<TResourceId>, start: Temporal.ZonedDateTime, duration: DurationInput): CalendarEventPlacement<TResourceId>;
|
|
1824
|
-
//#endregion
|
|
1825
|
-
//#region src/transactions/targets.d.ts
|
|
1826
1769
|
/**
|
|
1827
1770
|
* What a pointer or keyboard interaction is over: a snapped wall-clock time in a time-grid
|
|
1828
1771
|
* column, or a whole day (a month cell, or a time grid's all-day row). In a resource view it is
|
|
@@ -1862,8 +1805,6 @@ export declare function resizePlacementToTarget<TResourceId extends ResourceId>(
|
|
|
1862
1805
|
* times, or whole days, in the anchor's resource. `null` across axes or resources.
|
|
1863
1806
|
*/
|
|
1864
1807
|
export declare function createPlacementBetween<TResourceId extends ResourceId>(anchor: CalendarInteractionTarget, target: CalendarInteractionTarget, { snap }: Pick<CalendarInteractionOptions, "snap">): CalendarEventPlacement<TResourceId> | null;
|
|
1865
|
-
//#endregion
|
|
1866
|
-
//#region src/navigation/list.d.ts
|
|
1867
1808
|
/**
|
|
1868
1809
|
* Spatial navigation for an agenda from `projectList`, whose items are events on their dates.
|
|
1869
1810
|
* Up and down move to the previous and next item, Page Up and Page Down to the first item of the
|
|
@@ -1872,8 +1813,6 @@ export declare function createPlacementBetween<TResourceId extends ResourceId>(a
|
|
|
1872
1813
|
* as a day carried over from another view, moves from where that date would be.
|
|
1873
1814
|
*/
|
|
1874
1815
|
export declare function listSpatialNavigation({ command, focus, projection }: CalendarSpatialNavigationInput<ListProjection<unknown, EventId, ResourceId>, unknown>): CalendarSpatialNavigation | null;
|
|
1875
|
-
//#endregion
|
|
1876
|
-
//#region src/navigation/month.d.ts
|
|
1877
1816
|
type Projection$1 = MonthProjection<unknown, EventId, ResourceId>;
|
|
1878
1817
|
/**
|
|
1879
1818
|
* Spatial navigation for a month grid from `projectMonth`. Day cells move by a day or a week,
|
|
@@ -1883,8 +1822,6 @@ type Projection$1 = MonthProjection<unknown, EventId, ResourceId>;
|
|
|
1883
1822
|
* leave an event as they would leave its day.
|
|
1884
1823
|
*/
|
|
1885
1824
|
export declare function monthSpatialNavigation({ command, environment, focus, projection }: CalendarSpatialNavigationInput<Projection$1, unknown>): CalendarSpatialNavigation | null;
|
|
1886
|
-
//#endregion
|
|
1887
|
-
//#region src/navigation/year.d.ts
|
|
1888
1825
|
type Projection = YearProjection<unknown, EventId, ResourceId>;
|
|
1889
1826
|
/**
|
|
1890
1827
|
* Spatial navigation for a year from `projectYear`. Days move by a day or a week, across months
|
|
@@ -1894,8 +1831,6 @@ type Projection = YearProjection<unknown, EventId, ResourceId>;
|
|
|
1894
1831
|
* them in its own way, such as in a popover.
|
|
1895
1832
|
*/
|
|
1896
1833
|
export declare function yearSpatialNavigation({ command, environment, focus, projection }: CalendarSpatialNavigationInput<Projection, unknown>): CalendarSpatialNavigation | null;
|
|
1897
|
-
//#endregion
|
|
1898
|
-
//#region src/navigation/time-grid.d.ts
|
|
1899
1834
|
/**
|
|
1900
1835
|
* Spatial navigation for a day, week, or N-day time grid from `projectTimeGrid`.
|
|
1901
1836
|
*
|
|
@@ -1910,8 +1845,6 @@ export declare function yearSpatialNavigation({ command, environment, focus, pro
|
|
|
1910
1845
|
* all-day cell and below to the first slot.
|
|
1911
1846
|
*/
|
|
1912
1847
|
export declare function timeGridSpatialNavigation(input: CalendarSpatialNavigationInput<TimeGridProjection<unknown>, unknown>): CalendarSpatialNavigation | null;
|
|
1913
|
-
//#endregion
|
|
1914
|
-
//#region src/navigation/resource-columns.d.ts
|
|
1915
1848
|
/**
|
|
1916
1849
|
* Spatial navigation for resource columns from `projectResourceColumns`, laid out resource by
|
|
1917
1850
|
* resource, each with its dates. Within a column it is `timeGridSpatialNavigation`'s; left and
|
|
@@ -1920,8 +1853,6 @@ export declare function timeGridSpatialNavigation(input: CalendarSpatialNavigati
|
|
|
1920
1853
|
* Down by the range within the resource. Every focus names its column's resource.
|
|
1921
1854
|
*/
|
|
1922
1855
|
export declare function resourceColumnsSpatialNavigation(input: CalendarSpatialNavigationInput<ResourceColumnsProjection<unknown>, unknown>): CalendarSpatialNavigation | null;
|
|
1923
|
-
//#endregion
|
|
1924
|
-
//#region src/navigation/resource-timeline.d.ts
|
|
1925
1856
|
type Input = CalendarSpatialNavigationInput<ResourceTimelineProjection<unknown>, unknown>;
|
|
1926
1857
|
/**
|
|
1927
1858
|
* Spatial navigation for a resource timeline from `projectResourceTimeline`: the time grid's moves
|
|
@@ -1941,15 +1872,11 @@ type Input = CalendarSpatialNavigationInput<ResourceTimelineProjection<unknown>,
|
|
|
1941
1872
|
* moves from the first row.
|
|
1942
1873
|
*/
|
|
1943
1874
|
export declare function resourceTimelineSpatialNavigation(input: Input): CalendarSpatialNavigation | null;
|
|
1944
|
-
//#endregion
|
|
1945
|
-
//#region src/navigation/reveal.d.ts
|
|
1946
1875
|
/**
|
|
1947
1876
|
* The anchor whose range shows `date`, reached from `anchor` by whole `navigate` steps, so a view
|
|
1948
1877
|
* keeps paging by its own range (a 3-day view moves 3 days at a time).
|
|
1949
1878
|
*/
|
|
1950
1879
|
export declare function anchorShowingDate<TOptions>(strategy: Pick<CalendarViewStrategy<unknown, TOptions>, "getRange" | "navigate">, anchor: Temporal.PlainDate, date: Temporal.PlainDate, environment: CalendarEnvironmentBase, options: TOptions): Temporal.PlainDate;
|
|
1951
|
-
//#endregion
|
|
1952
|
-
//#region src/keyboard/announcements.d.ts
|
|
1953
1880
|
type CalendarInteractionCause = "create" | "move" | "resize-end" | "resize-start";
|
|
1954
1881
|
interface CalendarInteractionUpdateBase {
|
|
1955
1882
|
readonly cause: CalendarInteractionCause;
|
|
@@ -2036,8 +1963,6 @@ export declare function formatPlacementRange(placement: CalendarEventInterval, {
|
|
|
2036
1963
|
readonly locale?: Intl.Locale | string;
|
|
2037
1964
|
readonly timeZone: string;
|
|
2038
1965
|
}): string;
|
|
2039
|
-
//#endregion
|
|
2040
|
-
//#region src/keyboard/session.d.ts
|
|
2041
1966
|
/** A keyboard move, resize, or create between grabbing and committing or cancelling. */
|
|
2042
1967
|
interface CalendarKeyboardSession<TEventId extends EventId = EventId, TResourceId extends ResourceId = ResourceId> {
|
|
2043
1968
|
readonly cause: CalendarInteractionCause;
|
|
@@ -2076,8 +2001,6 @@ export declare function startKeyboardSession<TEventId extends EventId, TResource
|
|
|
2076
2001
|
export declare function moveKeyboardCursor<TEventId extends EventId, TResourceId extends ResourceId>(session: CalendarKeyboardSession<TEventId, TResourceId>, cursor: CalendarCellFocus, options: CalendarInteractionOptions): CalendarKeyboardSession<TEventId, TResourceId>;
|
|
2077
2002
|
/** The proposal committing the session makes; `null` when it would change nothing. */
|
|
2078
2003
|
export declare function keyboardSessionProposal<TEventId extends EventId, TResourceId extends ResourceId>(session: CalendarKeyboardSession<TEventId, TResourceId>): CalendarEventProposal<TEventId, TResourceId> | null;
|
|
2079
|
-
//#endregion
|
|
2080
|
-
//#region src/policies/availability.d.ts
|
|
2081
2004
|
interface AvailabilityPolicyOptions {
|
|
2082
2005
|
/**
|
|
2083
2006
|
* `"block"` (the default) rejects a change outside the hours it must fit; `"warn"` lets it
|
|
@@ -2098,8 +2021,6 @@ export declare function fitsAvailability(placement: CalendarEventPlacement<Resou
|
|
|
2098
2021
|
* the hours can still be edited. Deletes always pass.
|
|
2099
2022
|
*/
|
|
2100
2023
|
export declare function availabilityPolicy<TEvent, TEventId extends EventId, TResourceId extends ResourceId>({ mode }?: AvailabilityPolicyOptions): CalendarPolicy<TEvent, TEventId, TResourceId>;
|
|
2101
|
-
//#endregion
|
|
2102
|
-
//#region src/policies/conflict.d.ts
|
|
2103
2024
|
/**
|
|
2104
2025
|
* What double-booking a resource does: `"block"` rejects the change, `"warn"` lets it through,
|
|
2105
2026
|
* flagged in its `warnings`, and `"allow"` lets it through as it is.
|
|
@@ -2131,8 +2052,6 @@ interface ConflictPolicyOptions<TResourceId extends ResourceId = ResourceId> {
|
|
|
2131
2052
|
* and otherwise any `"warn"` flags it. Resources in `"allow"` mode aren't checked at all.
|
|
2132
2053
|
*/
|
|
2133
2054
|
export declare function conflictPolicy<TEvent, TEventId extends EventId, TResourceId extends ResourceId>({ getResourceMode, mode }?: ConflictPolicyOptions<TResourceId>): CalendarPolicy<TEvent, TEventId, TResourceId>;
|
|
2134
|
-
//#endregion
|
|
2135
|
-
//#region src/policies/bounds.d.ts
|
|
2136
2055
|
/**
|
|
2137
2056
|
* Rejects changes that would place an event outside `[start, end)`. All-day and floating events
|
|
2138
2057
|
* are compared on the display time zone's wall clock.
|
|
@@ -2141,32 +2060,23 @@ export declare function boundsPolicy<TEvent, TEventId extends EventId, TResource
|
|
|
2141
2060
|
readonly end?: Temporal.Instant;
|
|
2142
2061
|
readonly start?: Temporal.Instant;
|
|
2143
2062
|
}): CalendarPolicy<TEvent, TEventId, TResourceId>;
|
|
2144
|
-
//#endregion
|
|
2145
|
-
//#region src/policies/minimum-duration.d.ts
|
|
2146
2063
|
/**
|
|
2147
2064
|
* Lengthens timed and floating changes shorter than `minimum`. A resized start moves earlier;
|
|
2148
2065
|
* otherwise the end moves later.
|
|
2149
2066
|
*/
|
|
2150
2067
|
export declare function minimumDurationPolicy<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(minimum: DurationInput): CalendarPolicy<TEvent, TEventId, TResourceId>;
|
|
2151
|
-
//#endregion
|
|
2152
|
-
//#region src/policies/read-only.d.ts
|
|
2153
2068
|
/** Rejects changes to events the adapter marks read-only. */
|
|
2154
2069
|
export declare function readOnlyPolicy<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(): CalendarPolicy<TEvent, TEventId, TResourceId>;
|
|
2155
|
-
//#endregion
|
|
2156
|
-
//#region src/policies/read-only-resources.d.ts
|
|
2157
2070
|
/**
|
|
2158
2071
|
* Rejects changes to the schedule of a resource `isReadOnly` marks: creating, deleting, or moving
|
|
2159
2072
|
* an event on it in time, and assigning an event to it or taking one away. An event that keeps a
|
|
2160
2073
|
* read-only resource and its time may still move between its other resources.
|
|
2161
2074
|
*/
|
|
2162
2075
|
export declare function readOnlyResourcesPolicy<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(isReadOnly: (resourceId: TResourceId) => boolean): CalendarPolicy<TEvent, TEventId, TResourceId>;
|
|
2163
|
-
//#endregion
|
|
2164
|
-
//#region src/policies/snap.d.ts
|
|
2165
2076
|
/**
|
|
2166
2077
|
* Rounds timed and floating changes to a wall-clock grid in the display time zone, such as
|
|
2167
2078
|
* `{ minutes: 15 }`. Moves keep their duration and resizes snap only the dragged edge. A change
|
|
2168
2079
|
* that snapping would empty is left as proposed.
|
|
2169
2080
|
*/
|
|
2170
2081
|
export declare function snapPolicy<TEvent, TEventId extends EventId, TResourceId extends ResourceId>(increment: DurationInput): CalendarPolicy<TEvent, TEventId, TResourceId>;
|
|
2171
|
-
|
|
2172
|
-
export type { AllDayCalendarEvent, AllDayCalendarEventInterval, AnnotationId, AnnotationSnapshot, AnnotationSnapshotIssue, AnnotationSourceSummary, AvailabilityBand, AvailabilityException, AvailabilityExtent, AvailabilityHours, AvailabilityIssue, AvailabilityPolicyOptions, AvailabilityRule, AvailabilitySchedule, AvailabilitySnapshot, AvailabilitySnapshotInput, AvailabilityStatus, BusyQuery, BusyResourcesQuery, BusyStatus, CalendarAnnotation, CalendarAnnotationSource, CalendarAnnouncementBuilder, CalendarAnnouncementContext, CalendarAnnouncementMessages, CalendarAnnouncer, CalendarAvailability, CalendarCellFocus, CalendarChangeCause, CalendarDayFocus, CalendarDirection, CalendarDraft, CalendarEntityId, CalendarEnvironment, CalendarEnvironmentBase, CalendarEvent, CalendarEventBase, CalendarEventChange, CalendarEventChangeHandler, CalendarEventContractValidation, CalendarEventCreateChange, CalendarEventDeleteChange, CalendarEventFocus, CalendarEventInput, CalendarEventInterval, CalendarEventIntervalComparators, CalendarEventIntervalOf, CalendarEventPlacement, CalendarEventPlacementInput, CalendarEventProposal, CalendarEventSource, CalendarEventUpdateChange, CalendarEventValidationIssue, CalendarFocus, CalendarInputMethod, CalendarInteractionCause, CalendarInteractionCheck, CalendarInteractionOptions, CalendarInteractionPhase, CalendarInteractionTarget, CalendarInteractionUpdate, CalendarKeyboardSession, CalendarKeyboardSessionStart, CalendarNavigationCommand, CalendarNowSource, CalendarPendingChange, CalendarPendingChangePhase, CalendarPendingChanges, CalendarPendingPlacements, CalendarPolicy, CalendarPolicyContext, CalendarPolicyDecision, CalendarPolicyResult, CalendarProposalDetail, CalendarResource, CalendarSecondaryTimeZone, CalendarSelection, CalendarSlotFocus, CalendarSpatialNavigation, CalendarSpatialNavigationInput, CalendarTransactionContext, CalendarTransactionResult, CalendarViewProjectionInput, CalendarViewStrategy, CalendarWallClockDelta, CalendarWeekRules, ClosedDate, ClosedTime, ConflictMode, ConflictPolicyOptions, DayGridOverflow, DayGridRow, DayGridSegment, EventAdapter, EventAdapterAccessor, EventDayFragment, EventHistory, EventHistoryActivity, EventHistoryContext, EventHistoryDirection, EventHistoryOptions, EventHistoryOutcome, EventHistorySnapshot, EventHistoryStep, EventId, EventSnapshot, EventSnapshotCache, EventSnapshotIssue, EventSnapshotOptions, EventSnapshotQueryCacheStatistics, EventSnapshotQueryOptions, EventTransactions, FloatingCalendarEvent, FloatingCalendarEventInterval, InvalidCalendarEventPolicy, IsoDayOfWeek, ListDay, ListItem, ListProjection, ListViewOptions, LocalDateRange, MonthDay, MonthProjection, MonthWeek, NormalizedAllDayCalendarEvent, NormalizedCalendarEvent, NormalizedFloatingCalendarEvent, NormalizedTimedCalendarEvent, OverlapLayout, OverlapLayoutOptions, ResolvedSecondaryTimeZones, ResourceAvailability, ResourceColumn, ResourceColumnsProjection, ResourceColumnsProjectionInput, ResourceId, ResourceOverlapLayoutOptions, ResourceStatus, ResourceTimelineBar, ResourceTimelineDayRow, ResourceTimelineHourRow, ResourceTimelineLayoutOptions, ResourceTimelineOptions, ResourceTimelineProjection, ResourceTimelineProjectionInput, ResourceTimelineSpan, ResourceTree, ResourceTreeInput, ResourceTreeNode, ResourceVisibilityOptions, SecondaryTimeZoneIssue, TimeGridAnnotationGeometry, TimeGridAnnotationMark, TimeGridBand, TimeGridColumn, TimeGridDay, TimeGridEventLayout, TimeGridLayoutOptions, TimeGridPointOptions, TimeGridPosition, TimeGridProjection, TimeGridProjectionInput, TimeGridSpan, TimeGridZoneAxis, TimeGridZoneAxisOptions, TimeGridZoneRow, TimeGridZoneShift, TimeGridZoneTime, TimedCalendarEvent, TimedCalendarEventInterval, TimedOverlapOptions, TimelineExtent, UnavailableReason, ValidatedCalendarEvent, ValidatedCalendarEventInterval, VisibleResource, YearDay, YearMonth, YearProjection, YearWeek };
|
|
2082
|
+
export type { AllDayCalendarEvent, AllDayCalendarEventInterval, AnnotationId, AnnotationSnapshot, AnnotationSnapshotIssue, AnnotationSourceSummary, AvailabilityBand, AvailabilityException, AvailabilityExtent, AvailabilityHours, AvailabilityIssue, AvailabilityPolicyOptions, AvailabilityRule, AvailabilitySchedule, AvailabilitySnapshot, AvailabilitySnapshotInput, AvailabilityStatus, BusyQuery, BusyResourcesQuery, BusyStatus, CalendarAnnotation, CalendarAnnotationSource, CalendarAnnouncementBuilder, CalendarAnnouncementContext, CalendarAnnouncementMessages, CalendarAnnouncer, CalendarAvailability, CalendarCellFocus, CalendarChangeCause, CalendarDayFocus, CalendarDirection, CalendarDraft, CalendarEntityId, CalendarEnvironment, CalendarEnvironmentBase, CalendarEvent, CalendarEventBase, CalendarEventChange, CalendarEventChangeHandler, CalendarEventContractValidation, CalendarEventCreateChange, CalendarEventDeleteChange, CalendarEventFocus, CalendarEventInput, CalendarEventInterval, CalendarEventIntervalComparators, CalendarEventIntervalOf, CalendarEventPlacement, CalendarEventPlacementInput, CalendarEventProposal, CalendarEventSource, CalendarEventUpdateChange, CalendarEventValidationIssue, CalendarFocus, CalendarInputMethod, CalendarInteractionCause, CalendarInteractionCheck, CalendarInteractionOptions, CalendarInteractionPhase, CalendarInteractionTarget, CalendarInteractionUpdate, CalendarKeyboardSession, CalendarKeyboardSessionStart, CalendarNavigationCommand, CalendarNowSource, CalendarPendingChange, CalendarPendingChangePhase, CalendarPendingChanges, CalendarPendingPlacements, CalendarPendingProposal, CalendarPolicy, CalendarPolicyContext, CalendarPolicyDecision, CalendarPolicyResult, CalendarProposalDetail, CalendarProposalOutcome, CalendarResource, CalendarSecondaryTimeZone, CalendarSelection, CalendarSlotFocus, CalendarSpatialNavigation, CalendarSpatialNavigationInput, CalendarTransactionContext, CalendarTransactionResult, CalendarViewProjectionInput, CalendarViewStrategy, CalendarWallClockDelta, CalendarWeekRules, ClosedDate, ClosedTime, ConflictMode, ConflictPolicyOptions, DayGridOverflow, DayGridRow, DayGridSegment, EventAdapter, EventAdapterAccessor, EventDayFragment, EventHistory, EventHistoryActivity, EventHistoryContext, EventHistoryDirection, EventHistoryOptions, EventHistoryOutcome, EventHistorySnapshot, EventHistoryStep, EventId, EventSnapshot, EventSnapshotCache, EventSnapshotIssue, EventSnapshotOptions, EventSnapshotQueryCacheStatistics, EventSnapshotQueryOptions, EventTransactions, FloatingCalendarEvent, FloatingCalendarEventInterval, InvalidCalendarEventPolicy, IsoDayOfWeek, ListDay, ListItem, ListProjection, ListViewOptions, LocalDateRange, MonthDay, MonthProjection, MonthWeek, NormalizedAllDayCalendarEvent, NormalizedCalendarEvent, NormalizedFloatingCalendarEvent, NormalizedTimedCalendarEvent, OverlapLayout, OverlapLayoutOptions, ResolvedSecondaryTimeZones, ResourceAvailability, ResourceColumn, ResourceColumnsProjection, ResourceColumnsProjectionInput, ResourceId, ResourceOverlapLayoutOptions, ResourceStatus, ResourceTimelineBar, ResourceTimelineDayRow, ResourceTimelineHourRow, ResourceTimelineLayoutOptions, ResourceTimelineOptions, ResourceTimelineProjection, ResourceTimelineProjectionInput, ResourceTimelineSpan, ResourceTree, ResourceTreeInput, ResourceTreeNode, ResourceVisibilityOptions, SecondaryTimeZoneIssue, TimeGridAnnotationGeometry, TimeGridAnnotationMark, TimeGridBand, TimeGridColumn, TimeGridDay, TimeGridEventLayout, TimeGridLayoutOptions, TimeGridPointOptions, TimeGridPosition, TimeGridProjection, TimeGridProjectionInput, TimeGridSpan, TimeGridZoneAxis, TimeGridZoneAxisOptions, TimeGridZoneRow, TimeGridZoneShift, TimeGridZoneTime, TimedCalendarEvent, TimedCalendarEventInterval, TimedOverlapOptions, TimelineExtent, UnavailableReason, ValidatedCalendarEvent, ValidatedCalendarEventInterval, VisibleResource, YearDay, YearMonth, YearProjection, YearWeek };
|