@craftguild/jscalendar 0.5.2 → 0.5.4

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.
Files changed (124) hide show
  1. package/README.md +130 -94
  2. package/dist/index.cjs +3923 -0
  3. package/dist/index.d.cts +802 -0
  4. package/dist/index.d.mts +802 -0
  5. package/dist/index.mjs +3927 -0
  6. package/package.json +46 -31
  7. package/dist/__tests__/builders.test.d.ts +0 -1
  8. package/dist/__tests__/builders.test.js +0 -101
  9. package/dist/__tests__/calendar-extra.test.d.ts +0 -1
  10. package/dist/__tests__/calendar-extra.test.js +0 -221
  11. package/dist/__tests__/calendar.test.d.ts +0 -1
  12. package/dist/__tests__/calendar.test.js +0 -97
  13. package/dist/__tests__/ical-extra.test.d.ts +0 -1
  14. package/dist/__tests__/ical-extra.test.js +0 -87
  15. package/dist/__tests__/ical.test.d.ts +0 -1
  16. package/dist/__tests__/ical.test.js +0 -72
  17. package/dist/__tests__/index.test.d.ts +0 -1
  18. package/dist/__tests__/index.test.js +0 -9
  19. package/dist/__tests__/patch.test.d.ts +0 -1
  20. package/dist/__tests__/patch.test.js +0 -47
  21. package/dist/__tests__/recurrence.test.d.ts +0 -1
  22. package/dist/__tests__/recurrence.test.js +0 -640
  23. package/dist/__tests__/search.test.d.ts +0 -1
  24. package/dist/__tests__/search.test.js +0 -264
  25. package/dist/__tests__/timezones.test.d.ts +0 -1
  26. package/dist/__tests__/timezones.test.js +0 -12
  27. package/dist/__tests__/utils.test.d.ts +0 -1
  28. package/dist/__tests__/utils.test.js +0 -127
  29. package/dist/__tests__/validation.test.d.ts +0 -1
  30. package/dist/__tests__/validation.test.js +0 -224
  31. package/dist/ical.d.ts +0 -13
  32. package/dist/ical.js +0 -270
  33. package/dist/index.d.ts +0 -3
  34. package/dist/index.js +0 -2
  35. package/dist/jscal/base.d.ts +0 -89
  36. package/dist/jscal/base.js +0 -173
  37. package/dist/jscal/builders.d.ts +0 -183
  38. package/dist/jscal/builders.js +0 -287
  39. package/dist/jscal/constants.d.ts +0 -11
  40. package/dist/jscal/constants.js +0 -11
  41. package/dist/jscal/datetime.d.ts +0 -14
  42. package/dist/jscal/datetime.js +0 -42
  43. package/dist/jscal/defaults.d.ts +0 -31
  44. package/dist/jscal/defaults.js +0 -102
  45. package/dist/jscal/duration.d.ts +0 -43
  46. package/dist/jscal/duration.js +0 -75
  47. package/dist/jscal/event.d.ts +0 -23
  48. package/dist/jscal/event.js +0 -78
  49. package/dist/jscal/group.d.ts +0 -31
  50. package/dist/jscal/group.js +0 -69
  51. package/dist/jscal/guards.d.ts +0 -19
  52. package/dist/jscal/guards.js +0 -25
  53. package/dist/jscal/ids.d.ts +0 -11
  54. package/dist/jscal/ids.js +0 -77
  55. package/dist/jscal/normalize.d.ts +0 -32
  56. package/dist/jscal/normalize.js +0 -45
  57. package/dist/jscal/task.d.ts +0 -23
  58. package/dist/jscal/task.js +0 -67
  59. package/dist/jscal/types.d.ts +0 -38
  60. package/dist/jscal/types.js +0 -1
  61. package/dist/jscal.d.ts +0 -145
  62. package/dist/jscal.js +0 -126
  63. package/dist/patch.d.ts +0 -18
  64. package/dist/patch.js +0 -216
  65. package/dist/recurrence/constants.d.ts +0 -13
  66. package/dist/recurrence/constants.js +0 -13
  67. package/dist/recurrence/date-utils.d.ts +0 -125
  68. package/dist/recurrence/date-utils.js +0 -259
  69. package/dist/recurrence/expand.d.ts +0 -23
  70. package/dist/recurrence/expand.js +0 -315
  71. package/dist/recurrence/rule-candidates.d.ts +0 -21
  72. package/dist/recurrence/rule-candidates.js +0 -120
  73. package/dist/recurrence/rule-generate.d.ts +0 -11
  74. package/dist/recurrence/rule-generate.js +0 -36
  75. package/dist/recurrence/rule-matchers.d.ts +0 -34
  76. package/dist/recurrence/rule-matchers.js +0 -120
  77. package/dist/recurrence/rule-normalize.d.ts +0 -9
  78. package/dist/recurrence/rule-normalize.js +0 -57
  79. package/dist/recurrence/rule-selectors.d.ts +0 -7
  80. package/dist/recurrence/rule-selectors.js +0 -21
  81. package/dist/recurrence/rules.d.ts +0 -14
  82. package/dist/recurrence/rules.js +0 -57
  83. package/dist/recurrence/types.d.ts +0 -27
  84. package/dist/recurrence/types.js +0 -1
  85. package/dist/recurrence.d.ts +0 -2
  86. package/dist/recurrence.js +0 -1
  87. package/dist/search.d.ts +0 -44
  88. package/dist/search.js +0 -292
  89. package/dist/timezones/chunk_1.d.ts +0 -2
  90. package/dist/timezones/chunk_1.js +0 -72
  91. package/dist/timezones/chunk_2.d.ts +0 -2
  92. package/dist/timezones/chunk_2.js +0 -72
  93. package/dist/timezones/chunk_3.d.ts +0 -2
  94. package/dist/timezones/chunk_3.js +0 -72
  95. package/dist/timezones/chunk_4.d.ts +0 -2
  96. package/dist/timezones/chunk_4.js +0 -72
  97. package/dist/timezones/chunk_5.d.ts +0 -2
  98. package/dist/timezones/chunk_5.js +0 -72
  99. package/dist/timezones/chunk_6.d.ts +0 -2
  100. package/dist/timezones/chunk_6.js +0 -72
  101. package/dist/timezones/chunk_7.d.ts +0 -2
  102. package/dist/timezones/chunk_7.js +0 -6
  103. package/dist/timezones.d.ts +0 -9
  104. package/dist/timezones.js +0 -452
  105. package/dist/types.d.ts +0 -246
  106. package/dist/types.js +0 -1
  107. package/dist/utils.d.ts +0 -82
  108. package/dist/utils.js +0 -164
  109. package/dist/validate/asserts.d.ts +0 -155
  110. package/dist/validate/asserts.js +0 -381
  111. package/dist/validate/constants.d.ts +0 -25
  112. package/dist/validate/constants.js +0 -33
  113. package/dist/validate/error.d.ts +0 -19
  114. package/dist/validate/error.js +0 -25
  115. package/dist/validate/validators-common.d.ts +0 -64
  116. package/dist/validate/validators-common.js +0 -390
  117. package/dist/validate/validators-objects.d.ts +0 -8
  118. package/dist/validate/validators-objects.js +0 -70
  119. package/dist/validate/validators-recurrence.d.ts +0 -15
  120. package/dist/validate/validators-recurrence.js +0 -115
  121. package/dist/validate/validators.d.ts +0 -1
  122. package/dist/validate/validators.js +0 -1
  123. package/dist/validate.d.ts +0 -2
  124. package/dist/validate.js +0 -2
@@ -0,0 +1,802 @@
1
+ //#region src/timezones.d.ts
2
+ type TimeZoneId$1 = "Africa/Abidjan" | "Africa/Accra" | "Africa/Addis_Ababa" | "Africa/Algiers" | "Africa/Asmara" | "Africa/Bamako" | "Africa/Bangui" | "Africa/Banjul" | "Africa/Bissau" | "Africa/Blantyre" | "Africa/Brazzaville" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Ceuta" | "Africa/Conakry" | "Africa/Dakar" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Douala" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Kampala" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Lome" | "Africa/Luanda" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Malabo" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Mogadishu" | "Africa/Monrovia" | "Africa/Nairobi" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Porto-Novo" | "Africa/Sao_Tome" | "Africa/Tripoli" | "Africa/Tunis" | "Africa/Windhoek" | "America/Adak" | "America/Anchorage" | "America/Anguilla" | "America/Antigua" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Aruba" | "America/Asuncion" | "America/Atikokan" | "America/Bahia" | "America/Bahia_Banderas" | "America/Barbados" | "America/Belem" | "America/Belize" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Bogota" | "America/Boise" | "America/Cambridge_Bay" | "America/Campo_Grande" | "America/Cancun" | "America/Caracas" | "America/Cayenne" | "America/Cayman" | "America/Chicago" | "America/Chihuahua" | "America/Costa_Rica" | "America/Creston" | "America/Cuiaba" | "America/Curacao" | "America/Danmarkshavn" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Detroit" | "America/Dominica" | "America/Edmonton" | "America/Eirunepe" | "America/El_Salvador" | "America/Fort_Nelson" | "America/Fortaleza" | "America/Glace_Bay" | "America/Godthab" | "America/Goose_Bay" | "America/Grand_Turk" | "America/Grenada" | "America/Guadeloupe" | "America/Guatemala" | "America/Guayaquil" | "America/Guyana" | "America/Halifax" | "America/Havana" | "America/Hermosillo" | "America/Indiana/Indianapolis" | "America/Indiana/Knox" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Tell_City" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Inuvik" | "America/Iqaluit" | "America/Jamaica" | "America/Juneau" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/Kralendijk" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Lower_Princes" | "America/Maceio" | "America/Managua" | "America/Manaus" | "America/Marigot" | "America/Martinique" | "America/Matamoros" | "America/Mazatlan" | "America/Menominee" | "America/Merida" | "America/Metlakatla" | "America/Mexico_City" | "America/Miquelon" | "America/Moncton" | "America/Monterrey" | "America/Montevideo" | "America/Montserrat" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Nome" | "America/Noronha" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Ojinaga" | "America/Panama" | "America/Pangnirtung" | "America/Paramaribo" | "America/Phoenix" | "America/Port-au-Prince" | "America/Port_of_Spain" | "America/Porto_Velho" | "America/Puerto_Rico" | "America/Punta_Arenas" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Recife" | "America/Regina" | "America/Resolute" | "America/Rio_Branco" | "America/Santarem" | "America/Santiago" | "America/Santo_Domingo" | "America/Sao_Paulo" | "America/Scoresbysund" | "America/Sitka" | "America/St_Barthelemy" | "America/St_Johns" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Thule" | "America/Thunder_Bay" | "America/Tijuana" | "America/Toronto" | "America/Tortola" | "America/Vancouver" | "America/Whitehorse" | "America/Winnipeg" | "America/Yakutat" | "America/Yellowknife" | "Antarctica/Casey" | "Antarctica/Davis" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Antarctica/Mawson" | "Antarctica/McMurdo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Antarctica/Syowa" | "Antarctica/Troll" | "Antarctica/Vostok" | "Arctic/Longyearbyen" | "Asia/Aden" | "Asia/Almaty" | "Asia/Amman" | "Asia/Anadyr" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Atyrau" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Barnaul" | "Asia/Beirut" | "Asia/Bishkek" | "Asia/Brunei" | "Asia/Chita" | "Asia/Choibalsan" | "Asia/Colombo" | "Asia/Damascus" | "Asia/Dhaka" | "Asia/Dili" | "Asia/Dubai" | "Asia/Dushanbe" | "Asia/Famagusta" | "Asia/Gaza" | "Asia/Hebron" | "Asia/Ho_Chi_Minh" | "Asia/Hong_Kong" | "Asia/Hovd" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jayapura" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kathmandu" | "Asia/Khandyga" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Kuwait" | "Asia/Macau" | "Asia/Magadan" | "Asia/Makassar" | "Asia/Manila" | "Asia/Muscat" | "Asia/Nicosia" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Omsk" | "Asia/Oral" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Pyongyang" | "Asia/Qatar" | "Asia/Qyzylorda" | "Asia/Riyadh" | "Asia/Sakhalin" | "Asia/Samarkand" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Thimphu" | "Asia/Tokyo" | "Asia/Tomsk" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Ust-Nera" | "Asia/Vientiane" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yangon" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Bermuda" | "Atlantic/Canary" | "Atlantic/Cape_Verde" | "Atlantic/Faroe" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/South_Georgia" | "Atlantic/St_Helena" | "Atlantic/Stanley" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Broken_Hill" | "Australia/Currie" | "Australia/Darwin" | "Australia/Eucla" | "Australia/Hobart" | "Australia/Lindeman" | "Australia/Lord_Howe" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Astrakhan" | "Europe/Athens" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Busingen" | "Europe/Chisinau" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Gibraltar" | "Europe/Guernsey" | "Europe/Helsinki" | "Europe/Isle_of_Man" | "Europe/Istanbul" | "Europe/Jersey" | "Europe/Kaliningrad" | "Europe/Kiev" | "Europe/Kirov" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Mariehamn" | "Europe/Minsk" | "Europe/Monaco" | "Europe/Moscow" | "Europe/Oslo" | "Europe/Paris" | "Europe/Podgorica" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/San_Marino" | "Europe/Sarajevo" | "Europe/Saratov" | "Europe/Simferopol" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Tirane" | "Europe/Ulyanovsk" | "Europe/Uzhgorod" | "Europe/Vaduz" | "Europe/Vatican" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zaporozhye" | "Europe/Zurich" | "Indian/Antananarivo" | "Indian/Chagos" | "Indian/Christmas" | "Indian/Cocos" | "Indian/Comoro" | "Indian/Kerguelen" | "Indian/Mahe" | "Indian/Maldives" | "Indian/Mauritius" | "Indian/Mayotte" | "Indian/Reunion" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Bougainville" | "Pacific/Chatham" | "Pacific/Chuuk" | "Pacific/Easter" | "Pacific/Efate" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Galapagos" | "Pacific/Gambier" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Kiritimati" | "Pacific/Kosrae" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Marquesas" | "Pacific/Midway" | "Pacific/Nauru" | "Pacific/Niue" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Palau" | "Pacific/Pitcairn" | "Pacific/Pohnpei" | "Pacific/Port_Moresby" | "Pacific/Rarotonga" | "Pacific/Saipan" | "Pacific/Tahiti" | "Pacific/Tarawa" | "Pacific/Tongatapu" | "Pacific/Wake" | "Pacific/Wallis";
3
+ type TimeZoneInput = TimeZoneId$1 | Lowercase<TimeZoneId$1>;
4
+ /**
5
+ * Resolve a time zone input to its canonical ID.
6
+ * @param input Time zone input.
7
+ * @return Canonical TimeZoneId.
8
+ */
9
+ declare function resolveTimeZone(input: TimeZoneInput): TimeZoneId$1;
10
+ //#endregion
11
+ //#region src/types.d.ts
12
+ type Id = string;
13
+ type Int = number;
14
+ type UnsignedInt = number;
15
+ type UTCDateTime = string;
16
+ type LocalDateTime = string;
17
+ type Duration = string;
18
+ type SignedDuration = string;
19
+ type BooleanMap = Record<string, true>;
20
+ type JsonPrimitive = string | number | boolean | null;
21
+ type JsonValue = JsonPrimitive | JsonValue[] | {
22
+ [key: string]: JsonValue;
23
+ };
24
+ type PatchValue = JsonValue | null;
25
+ interface PatchObject {
26
+ [key: string]: PatchValue;
27
+ }
28
+ type PatchFields<T> = { [K in keyof Omit<T, "@type">]?: T[K] | null };
29
+ type PatchTag<TTag extends string> = {
30
+ __patchType?: TTag;
31
+ };
32
+ type EventPatch = PatchFields<Event> & PatchTag<"Event">;
33
+ type TaskPatch = PatchFields<Task> & PatchTag<"Task">;
34
+ type GroupPatch = PatchFields<Group> & PatchTag<"Group">;
35
+ type ParticipantPatch = PatchFields<Participant>;
36
+ type LocationPatch = PatchFields<Location>;
37
+ type VirtualLocationPatch = PatchFields<VirtualLocation>;
38
+ type AlertPatch = PatchFields<Alert>;
39
+ type RelationPatch = PatchFields<Relation>;
40
+ type LinkPatch = PatchFields<Link>;
41
+ type TimeZonePatch = PatchFields<TimeZone>;
42
+ type TimeZoneRulePatch = PatchFields<TimeZoneRule>;
43
+ type RecurrenceRulePatch = PatchFields<RecurrenceRule>;
44
+ type NDayPatch = PatchFields<NDay>;
45
+ type PatchLike = PatchObject | EventPatch | TaskPatch | GroupPatch | TimeZoneRulePatch;
46
+ interface Relation {
47
+ "@type": "Relation";
48
+ relation?: BooleanMap;
49
+ }
50
+ interface Link {
51
+ "@type": "Link";
52
+ href: string;
53
+ cid?: string;
54
+ contentType?: string;
55
+ size?: UnsignedInt;
56
+ rel?: string;
57
+ display?: string;
58
+ title?: string;
59
+ }
60
+ interface Location {
61
+ "@type": "Location";
62
+ name?: string;
63
+ description?: string;
64
+ locationTypes?: BooleanMap;
65
+ relativeTo?: string;
66
+ timeZone?: TimeZoneId;
67
+ coordinates?: string;
68
+ links?: Record<Id, Link>;
69
+ }
70
+ interface VirtualLocation {
71
+ "@type": "VirtualLocation";
72
+ name?: string;
73
+ description?: string;
74
+ uri: string;
75
+ features?: BooleanMap;
76
+ }
77
+ interface Participant {
78
+ "@type": "Participant";
79
+ name?: string;
80
+ email?: string;
81
+ description?: string;
82
+ sendTo?: Record<string, string>;
83
+ kind?: string;
84
+ roles: BooleanMap;
85
+ locationId?: Id;
86
+ language?: string;
87
+ participationStatus?: string;
88
+ participationComment?: string;
89
+ expectReply?: boolean;
90
+ scheduleAgent?: string;
91
+ scheduleForceSend?: boolean;
92
+ scheduleSequence?: UnsignedInt;
93
+ scheduleStatus?: string[];
94
+ scheduleUpdated?: UTCDateTime;
95
+ sentBy?: string;
96
+ invitedBy?: Id;
97
+ delegatedTo?: Record<Id, true>;
98
+ delegatedFrom?: Record<Id, true>;
99
+ memberOf?: Record<Id, true>;
100
+ links?: Record<Id, Link>;
101
+ progress?: string;
102
+ progressUpdated?: UTCDateTime;
103
+ percentComplete?: UnsignedInt;
104
+ }
105
+ interface OffsetTrigger {
106
+ "@type": "OffsetTrigger";
107
+ offset: SignedDuration;
108
+ relativeTo?: "start" | "end" | string;
109
+ }
110
+ interface AbsoluteTrigger {
111
+ "@type": "AbsoluteTrigger";
112
+ when: UTCDateTime;
113
+ }
114
+ interface UnknownTrigger {
115
+ "@type": string;
116
+ [key: string]: JsonValue;
117
+ }
118
+ type Trigger = OffsetTrigger | AbsoluteTrigger | UnknownTrigger;
119
+ interface Alert {
120
+ "@type": "Alert";
121
+ trigger: Trigger;
122
+ acknowledged?: UTCDateTime;
123
+ relatedTo?: Record<string, Relation>;
124
+ action?: string;
125
+ }
126
+ type DayOfWeek = "mo" | "tu" | "we" | "th" | "fr" | "sa" | "su";
127
+ interface NDay {
128
+ "@type": "NDay";
129
+ day: DayOfWeek;
130
+ nthOfPeriod?: Int;
131
+ }
132
+ interface RecurrenceRule {
133
+ "@type": "RecurrenceRule";
134
+ frequency: "yearly" | "monthly" | "weekly" | "daily" | "hourly" | "minutely" | "secondly";
135
+ interval?: UnsignedInt;
136
+ rscale?: string;
137
+ skip?: "omit" | "backward" | "forward";
138
+ firstDayOfWeek?: DayOfWeek;
139
+ byDay?: NDay[];
140
+ byMonthDay?: Int[];
141
+ byMonth?: string[];
142
+ byYearDay?: Int[];
143
+ byWeekNo?: Int[];
144
+ byHour?: UnsignedInt[];
145
+ byMinute?: UnsignedInt[];
146
+ bySecond?: UnsignedInt[];
147
+ bySetPosition?: Int[];
148
+ count?: UnsignedInt;
149
+ until?: LocalDateTime;
150
+ }
151
+ interface TimeZoneRule {
152
+ "@type": "TimeZoneRule";
153
+ start: LocalDateTime;
154
+ offsetFrom: string;
155
+ offsetTo: string;
156
+ recurrenceRules?: RecurrenceRule[];
157
+ recurrenceOverrides?: Record<LocalDateTime, TimeZoneRulePatch>;
158
+ names?: BooleanMap;
159
+ comments?: string[];
160
+ }
161
+ interface TimeZone {
162
+ "@type": "TimeZone";
163
+ tzId: string;
164
+ updated?: UTCDateTime;
165
+ url?: string;
166
+ validUntil?: UTCDateTime;
167
+ aliases?: BooleanMap;
168
+ standard?: TimeZoneRule[];
169
+ daylight?: TimeZoneRule[];
170
+ }
171
+ interface JSCalendarCommon {
172
+ "@type": string;
173
+ uid: string;
174
+ relatedTo?: Record<string, Relation>;
175
+ prodId?: string;
176
+ created?: UTCDateTime;
177
+ updated: UTCDateTime;
178
+ sequence?: UnsignedInt;
179
+ method?: string;
180
+ title?: string;
181
+ description?: string;
182
+ descriptionContentType?: string;
183
+ showWithoutTime?: boolean;
184
+ locations?: Record<Id, Location>;
185
+ virtualLocations?: Record<Id, VirtualLocation>;
186
+ links?: Record<Id, Link>;
187
+ locale?: string;
188
+ keywords?: BooleanMap;
189
+ categories?: BooleanMap;
190
+ color?: string;
191
+ recurrenceId?: LocalDateTime;
192
+ recurrenceIdTimeZone?: TimeZoneId | null;
193
+ recurrenceRules?: RecurrenceRule[];
194
+ excludedRecurrenceRules?: RecurrenceRule[];
195
+ excluded?: boolean;
196
+ priority?: Int;
197
+ freeBusyStatus?: string;
198
+ privacy?: string;
199
+ replyTo?: Record<string, string>;
200
+ sentBy?: string;
201
+ participants?: Record<Id, Participant>;
202
+ requestStatus?: string;
203
+ useDefaultAlerts?: boolean;
204
+ alerts?: Record<Id, Alert>;
205
+ timeZone?: TimeZoneId | null;
206
+ timeZones?: Partial<Record<TimeZoneId, TimeZone>>;
207
+ }
208
+ interface Event extends JSCalendarCommon {
209
+ "@type": "Event";
210
+ start: LocalDateTime;
211
+ duration?: Duration;
212
+ status?: string;
213
+ localizations?: Record<string, EventPatch>;
214
+ recurrenceOverrides?: Record<LocalDateTime, EventPatch>;
215
+ }
216
+ interface Task extends JSCalendarCommon {
217
+ "@type": "Task";
218
+ due?: LocalDateTime;
219
+ start?: LocalDateTime;
220
+ estimatedDuration?: Duration;
221
+ percentComplete?: UnsignedInt;
222
+ progress?: string;
223
+ progressUpdated?: UTCDateTime;
224
+ localizations?: Record<string, TaskPatch>;
225
+ recurrenceOverrides?: Record<LocalDateTime, TaskPatch>;
226
+ }
227
+ interface Group extends JSCalendarCommon {
228
+ "@type": "Group";
229
+ entries: Array<Event | Task>;
230
+ source?: string;
231
+ localizations?: Record<string, GroupPatch>;
232
+ recurrenceOverrides?: Record<LocalDateTime, GroupPatch>;
233
+ }
234
+ type JSCalendarObject = Event | Task | Group;
235
+ type CalendarType = JSCalendarObject["@type"];
236
+ type CreateInput<TType extends CalendarType> = TType extends "Event" ? Omit<Event, "@type" | "uid" | "updated"> & {
237
+ type?: "Event" | "event";
238
+ "@type"?: "Event";
239
+ uid?: string;
240
+ updated?: UTCDateTime;
241
+ } : TType extends "Task" ? Omit<Task, "@type" | "uid" | "updated"> & {
242
+ type?: "Task" | "task";
243
+ "@type"?: "Task";
244
+ uid?: string;
245
+ updated?: UTCDateTime;
246
+ } : Omit<Group, "@type" | "uid" | "updated"> & {
247
+ type?: "Group" | "group";
248
+ "@type"?: "Group";
249
+ uid?: string;
250
+ updated?: UTCDateTime;
251
+ };
252
+ type AnyCreateInput = CreateInput<"Event"> | CreateInput<"Task"> | CreateInput<"Group">;
253
+ type CalendarLike = JSCalendarObject | PatchObject | JsonValue;
254
+ //#endregion
255
+ //#region src/search.d.ts
256
+ type DateRangeValue = string | Date;
257
+ type DateRange = {
258
+ start?: DateRangeValue;
259
+ end?: DateRangeValue;
260
+ };
261
+ type DateRangeOptions = {
262
+ includeIncomparable?: boolean;
263
+ };
264
+ //#endregion
265
+ //#region src/ical.d.ts
266
+ type ICalOptions = {
267
+ prodId?: string;
268
+ method?: string;
269
+ includeXJSCalendar?: boolean;
270
+ };
271
+ //#endregion
272
+ //#region src/patch.d.ts
273
+ /**
274
+ * Apply a JSCalendar PatchObject to an input object.
275
+ * @param input Input object.
276
+ * @param patch Patch object to apply.
277
+ * @return Patched clone of the input object.
278
+ */
279
+ declare function applyPatch<T extends object>(input: T, patch: PatchLike): T;
280
+ //#endregion
281
+ //#region src/jscal/types.d.ts
282
+ type CreateOptions = {
283
+ now?: () => UTCDateTime;
284
+ validate?: boolean;
285
+ };
286
+ type UpdateOptions = {
287
+ touch?: boolean;
288
+ sequence?: boolean;
289
+ now?: () => UTCDateTime;
290
+ validate?: boolean;
291
+ };
292
+ type DateInput = string | Date;
293
+ type DurationInput = string | number;
294
+ type EntryInput = Event | Task | {
295
+ data: Event | Task;
296
+ };
297
+ type EventInput = Omit<Event, "@type" | "uid" | "updated" | "created" | "start" | "duration" | "timeZone"> & {
298
+ start: DateInput;
299
+ duration?: DurationInput;
300
+ timeZone?: TimeZoneInput | null;
301
+ uid?: string;
302
+ updated?: DateInput;
303
+ created?: DateInput;
304
+ };
305
+ type TaskInput = Omit<Task, "@type" | "uid" | "updated" | "created" | "start" | "due" | "timeZone"> & {
306
+ uid?: string;
307
+ updated?: DateInput;
308
+ created?: DateInput;
309
+ start?: DateInput;
310
+ due?: DateInput;
311
+ timeZone?: TimeZoneInput | null;
312
+ };
313
+ type GroupInput = Omit<Group, "@type" | "uid" | "updated" | "created" | "entries"> & {
314
+ entries: EntryInput[];
315
+ uid?: string;
316
+ updated?: DateInput;
317
+ created?: DateInput;
318
+ };
319
+ //#endregion
320
+ //#region src/jscal/base.d.ts
321
+ declare abstract class Base<T extends JSCalendarObject, TPatch extends PatchLike, TSelf extends Base<T, TPatch, TSelf>> {
322
+ data: T;
323
+ /**
324
+ * Create a new base instance that wraps a JSCalendar object.
325
+ * @param data Underlying JSCalendar data.
326
+ * @return Result.
327
+ */
328
+ constructor(data: T);
329
+ /**
330
+ * Wrap updated data in a new instance.
331
+ * @param data Updated JSCalendar data.
332
+ * @return New instance containing the data.
333
+ */
334
+ protected abstract wrap(data: T): TSelf;
335
+ /**
336
+ * Return a deep-cloned plain object for safe serialization.
337
+ * @return Cloned JSCalendar data.
338
+ */
339
+ eject(): T;
340
+ /**
341
+ * Clone the current instance with a deep-cloned payload.
342
+ * @return New instance with cloned data.
343
+ */
344
+ clone(): TSelf;
345
+ /**
346
+ * Read a field value from the underlying data.
347
+ * @param key Field key.
348
+ * @return Field value.
349
+ */
350
+ get<K extends keyof T>(key: K): T[K];
351
+ /**
352
+ * Set a field value and update metadata as needed.
353
+ * @param key Field key.
354
+ * @param value Field value.
355
+ * @return New instance with the updated field.
356
+ */
357
+ set<K extends keyof T>(key: K, value: T[K]): TSelf;
358
+ /**
359
+ * Apply a PatchObject and touch updated/sequence metadata.
360
+ * @param patch Patch to apply.
361
+ * @param options Update options.
362
+ * @return New instance with applied patch.
363
+ */
364
+ patch(patch: TPatch, options?: UpdateOptions): TSelf;
365
+ /**
366
+ * Update updated/sequence metadata for modified keys.
367
+ * @param keys Modified keys.
368
+ * @param options Update options.
369
+ * @return Updated instance.
370
+ */
371
+ protected touchKeys(data: T, keys: string[], options?: UpdateOptions): T;
372
+ /**
373
+ * Update updated/sequence metadata for PatchObject changes.
374
+ * @param patch Patch applied to the object.
375
+ * @param options Update options.
376
+ * @return Updated instance.
377
+ */
378
+ protected touchFromPatch(data: T, patch: PatchLike, options?: UpdateOptions): T;
379
+ }
380
+ //#endregion
381
+ //#region src/jscal/event.d.ts
382
+ declare class EventObject extends Base<Event, EventPatch, EventObject> {
383
+ /**
384
+ * Wrap updated data in a new EventObject.
385
+ * @param data Updated event data.
386
+ * @return New EventObject instance.
387
+ */
388
+ protected wrap(data: Event): EventObject;
389
+ /**
390
+ * Create an event with normalized dates, duration, and RFC defaults.
391
+ * @param input Event input values to normalize.
392
+ * @param options Creation options (validation, clock).
393
+ * @return EventObject instance.
394
+ */
395
+ constructor(input: EventInput, options?: CreateOptions);
396
+ /**
397
+ * Clone the event as a new EventObject instance.
398
+ * @return Cloned EventObject.
399
+ */
400
+ clone(): EventObject;
401
+ }
402
+ //#endregion
403
+ //#region src/jscal/task.d.ts
404
+ declare class TaskObject extends Base<Task, TaskPatch, TaskObject> {
405
+ /**
406
+ * Wrap updated data in a new TaskObject.
407
+ * @param data Updated task data.
408
+ * @return New TaskObject instance.
409
+ */
410
+ protected wrap(data: Task): TaskObject;
411
+ /**
412
+ * Create a task with normalized date fields and RFC defaults applied.
413
+ * @param input Task input values to normalize.
414
+ * @param options Creation options (validation, clock).
415
+ * @return TaskObject instance.
416
+ */
417
+ constructor(input?: TaskInput, options?: CreateOptions);
418
+ /**
419
+ * Clone the task as a new TaskObject instance.
420
+ * @return Cloned TaskObject.
421
+ */
422
+ clone(): TaskObject;
423
+ }
424
+ //#endregion
425
+ //#region src/jscal/group.d.ts
426
+ declare class GroupObject extends Base<Group, GroupPatch, GroupObject> {
427
+ /**
428
+ * Wrap updated data in a new GroupObject.
429
+ * @param data Updated group data.
430
+ * @return New GroupObject instance.
431
+ */
432
+ protected wrap(data: Group): GroupObject;
433
+ /**
434
+ * Create a group with normalized entries and RFC defaults.
435
+ * @param input Group input values to normalize.
436
+ * @param options Creation options (validation, clock).
437
+ * @return GroupObject instance.
438
+ */
439
+ constructor(input: GroupInput, options?: CreateOptions);
440
+ /**
441
+ * Clone the group as a new GroupObject instance.
442
+ * @return Cloned GroupObject.
443
+ */
444
+ clone(): GroupObject;
445
+ }
446
+ //#endregion
447
+ //#region src/jscal/ids.d.ts
448
+ /**
449
+ * Create a UUID-like identifier.
450
+ * @return UUID string.
451
+ */
452
+ declare function createUid(): string;
453
+ /**
454
+ * Create a compact base64url identifier.
455
+ * @return Base64url ID string.
456
+ */
457
+ declare function createId(): Id;
458
+ //#endregion
459
+ //#region src/jscal/guards.d.ts
460
+ /**
461
+ * Type guard for JSCalendar Event objects.
462
+ * @param obj JSCalendar object to check.
463
+ * @return True when the object is an Event.
464
+ */
465
+ declare function isEvent(obj: JSCalendarObject): obj is Event;
466
+ /**
467
+ * Type guard for JSCalendar Task objects.
468
+ * @param obj JSCalendar object to check.
469
+ * @return True when the object is a Task.
470
+ */
471
+ declare function isTask(obj: JSCalendarObject): obj is Task;
472
+ /**
473
+ * Type guard for JSCalendar Group objects.
474
+ * @param obj JSCalendar object to check.
475
+ * @return True when the object is a Group.
476
+ */
477
+ declare function isGroup(obj: JSCalendarObject): obj is Group;
478
+ //#endregion
479
+ //#region src/jscal/builders.d.ts
480
+ declare const TYPE_PARTICIPANT = "Participant";
481
+ declare const TYPE_LOCATION = "Location";
482
+ declare const TYPE_VIRTUAL_LOCATION = "VirtualLocation";
483
+ declare const TYPE_ALERT = "Alert";
484
+ declare const TYPE_OFFSET_TRIGGER = "OffsetTrigger";
485
+ declare const TYPE_ABSOLUTE_TRIGGER = "AbsoluteTrigger";
486
+ declare const TYPE_RELATION = "Relation";
487
+ declare const TYPE_LINK = "Link";
488
+ declare const TYPE_TIME_ZONE = "TimeZone";
489
+ declare const TYPE_TIME_ZONE_RULE = "TimeZoneRule";
490
+ declare const TYPE_RECURRENCE_RULE = "RecurrenceRule";
491
+ declare const TYPE_NDAY = "NDay";
492
+ type WithOptionalType<T, TypeName extends string> = Omit<T, "@type"> & {
493
+ "@type"?: TypeName;
494
+ };
495
+ type ParticipantInput = WithOptionalType<Participant, typeof TYPE_PARTICIPANT>;
496
+ type LocationInput = WithOptionalType<Location, typeof TYPE_LOCATION>;
497
+ type VirtualLocationInput = WithOptionalType<VirtualLocation, typeof TYPE_VIRTUAL_LOCATION>;
498
+ type AlertInput = WithOptionalType<Alert, typeof TYPE_ALERT>;
499
+ type OffsetTriggerInput = WithOptionalType<OffsetTrigger, typeof TYPE_OFFSET_TRIGGER>;
500
+ type AbsoluteTriggerInput = WithOptionalType<AbsoluteTrigger, typeof TYPE_ABSOLUTE_TRIGGER>;
501
+ type RelationInput = WithOptionalType<Relation, typeof TYPE_RELATION>;
502
+ type LinkInput = WithOptionalType<Link, typeof TYPE_LINK>;
503
+ type TimeZoneInput$1 = WithOptionalType<TimeZone, typeof TYPE_TIME_ZONE>;
504
+ type TimeZoneRuleInput = WithOptionalType<TimeZoneRule, typeof TYPE_TIME_ZONE_RULE>;
505
+ type RecurrenceRuleInput = WithOptionalType<RecurrenceRule, typeof TYPE_RECURRENCE_RULE>;
506
+ type NDayInput = WithOptionalType<NDay, typeof TYPE_NDAY>;
507
+ type EventPatchInput = EventPatch;
508
+ type TaskPatchInput = TaskPatch;
509
+ type GroupPatchInput = GroupPatch;
510
+ type IdValueInput<TInput> = {
511
+ id?: Id;
512
+ value: TInput;
513
+ };
514
+ /**
515
+ * Build a Participant object with @type set and validated.
516
+ * @param input Participant fields without @type.
517
+ * @return Validated Participant object.
518
+ */
519
+ declare function buildParticipant(input: ParticipantInput): Participant;
520
+ /**
521
+ * Build a Location object with @type set and validated.
522
+ * @param input Location fields without @type.
523
+ * @return Validated Location object.
524
+ */
525
+ declare function buildLocation(input: LocationInput): Location;
526
+ /**
527
+ * Build a VirtualLocation object with @type set and validated.
528
+ * @param input VirtualLocation fields without @type.
529
+ * @return Validated VirtualLocation object.
530
+ */
531
+ declare function buildVirtualLocation(input: VirtualLocationInput): VirtualLocation;
532
+ /**
533
+ * Build an Alert object with @type set and validated.
534
+ * @param input Alert fields without @type.
535
+ * @return Validated Alert object.
536
+ */
537
+ declare function buildAlert(input: AlertInput): Alert;
538
+ /**
539
+ * Build an OffsetTrigger object with @type set and validated.
540
+ * @param input OffsetTrigger fields without @type.
541
+ * @return Validated OffsetTrigger object.
542
+ */
543
+ declare function buildOffsetTrigger(input: OffsetTriggerInput): OffsetTrigger;
544
+ /**
545
+ * Build an AbsoluteTrigger object with @type set and validated.
546
+ * @param input AbsoluteTrigger fields without @type.
547
+ * @return Validated AbsoluteTrigger object.
548
+ */
549
+ declare function buildAbsoluteTrigger(input: AbsoluteTriggerInput): AbsoluteTrigger;
550
+ /**
551
+ * Build a Relation object with @type set and validated.
552
+ * @param input Relation fields without @type.
553
+ * @return Validated Relation object.
554
+ */
555
+ declare function buildRelation(input: RelationInput): Relation;
556
+ /**
557
+ * Build a Link object with @type set and validated.
558
+ * @param input Link fields without @type.
559
+ * @return Validated Link object.
560
+ */
561
+ declare function buildLink(input: LinkInput): Link;
562
+ /**
563
+ * Build a TimeZone object with @type set and validated.
564
+ * @param input TimeZone fields without @type.
565
+ * @return Validated TimeZone object.
566
+ */
567
+ declare function buildTimeZone(input: TimeZoneInput$1): TimeZone;
568
+ /**
569
+ * Build a TimeZoneRule object with @type set and validated.
570
+ * @param input TimeZoneRule fields without @type.
571
+ * @return Validated TimeZoneRule object.
572
+ */
573
+ declare function buildTimeZoneRule(input: TimeZoneRuleInput): TimeZoneRule;
574
+ /**
575
+ * Build a RecurrenceRule object with @type set and validated.
576
+ * @param input RecurrenceRule fields without @type.
577
+ * @return Validated RecurrenceRule object.
578
+ */
579
+ declare function buildRecurrenceRule(input: RecurrenceRuleInput): RecurrenceRule;
580
+ /**
581
+ * Build an NDay object with @type set and validated.
582
+ * @param input NDay fields without @type.
583
+ * @return Validated NDay object.
584
+ */
585
+ declare function buildNDay(input: NDayInput): NDay;
586
+ /**
587
+ * Build a patch object for Event-like updates with JSON value validation.
588
+ * @param input Patch fields for an event.
589
+ * @return Validated PatchObject.
590
+ */
591
+ declare function buildEventPatch(input: EventPatchInput): EventPatch;
592
+ /**
593
+ * Build a patch object for Task-like updates with JSON value validation.
594
+ * @param input Patch fields for a task.
595
+ * @return Validated PatchObject.
596
+ */
597
+ declare function buildTaskPatch(input: TaskPatchInput): TaskPatch;
598
+ /**
599
+ * Build a patch object for Group-like updates with JSON value validation.
600
+ * @param input Patch fields for a group.
601
+ * @return Validated PatchObject.
602
+ */
603
+ declare function buildGroupPatch(input: GroupPatchInput): GroupPatch;
604
+ /**
605
+ * Build a record of Participant objects keyed by Ids.
606
+ * @param items Participant inputs with optional explicit ids.
607
+ * @param existing Existing participant record to merge into.
608
+ * @return Participant record keyed by Id.
609
+ */
610
+ declare function buildParticipants(items: Array<IdValueInput<ParticipantInput>>, existing?: Record<Id, Participant>): Record<Id, Participant>;
611
+ /**
612
+ * Build a record of Location objects keyed by Ids.
613
+ * @param items Location inputs with optional explicit ids.
614
+ * @param existing Existing location record to merge into.
615
+ * @return Location record keyed by Id.
616
+ */
617
+ declare function buildLocations(items: Array<IdValueInput<LocationInput>>, existing?: Record<Id, Location>): Record<Id, Location>;
618
+ /**
619
+ * Build a record of VirtualLocation objects keyed by Ids.
620
+ * @param items VirtualLocation inputs with optional explicit ids.
621
+ * @param existing Existing virtual location record to merge into.
622
+ * @return VirtualLocation record keyed by Id.
623
+ */
624
+ declare function buildVirtualLocations(items: Array<IdValueInput<VirtualLocationInput>>, existing?: Record<Id, VirtualLocation>): Record<Id, VirtualLocation>;
625
+ /**
626
+ * Build a record of Alert objects keyed by Ids.
627
+ * @param items Alert inputs with optional explicit ids.
628
+ * @param existing Existing alert record to merge into.
629
+ * @return Alert record keyed by Id.
630
+ */
631
+ declare function buildAlerts(items: Array<IdValueInput<AlertInput>>, existing?: Record<Id, Alert>): Record<Id, Alert>;
632
+ /**
633
+ * Build a record of Link objects keyed by Ids.
634
+ * @param items Link inputs with optional explicit ids.
635
+ * @param existing Existing link record to merge into.
636
+ * @return Link record keyed by Id.
637
+ */
638
+ declare function buildLinks(items: Array<IdValueInput<LinkInput>>, existing?: Record<Id, Link>): Record<Id, Link>;
639
+ /**
640
+ * Build a record of Relation objects keyed by Ids.
641
+ * @param items Relation inputs with optional explicit ids.
642
+ * @param existing Existing relation record to merge into.
643
+ * @return Relation record keyed by Id.
644
+ */
645
+ declare function buildRelatedTo(items: Array<IdValueInput<RelationInput>>, existing?: Record<Id, Relation>): Record<Id, Relation>;
646
+ /**
647
+ * Build a record of TimeZone objects keyed by tzId.
648
+ * @param items TimeZone inputs.
649
+ * @return TimeZone record keyed by tzId.
650
+ */
651
+ declare function buildTimeZoneMap(items: TimeZoneInput$1[]): Record<string, TimeZone>;
652
+ //#endregion
653
+ //#region src/jscal.d.ts
654
+ declare const JsCal: {
655
+ Event: typeof EventObject;
656
+ Task: typeof TaskObject;
657
+ Group: typeof GroupObject;
658
+ createUid: typeof createUid;
659
+ createId: typeof createId;
660
+ isEvent: typeof isEvent;
661
+ isGroup: typeof isGroup;
662
+ isTask: typeof isTask;
663
+ duration: {
664
+ seconds(value: number): string;
665
+ minutes(value: number): string;
666
+ hours(value: number): string;
667
+ days(value: number): string;
668
+ from(parts: {
669
+ days?: number;
670
+ hours?: number;
671
+ minutes?: number;
672
+ seconds?: number;
673
+ }): string;
674
+ };
675
+ timeZone: typeof resolveTimeZone;
676
+ timeZones: TimeZoneId$1[];
677
+ applyPatch: typeof applyPatch;
678
+ Participant: typeof buildParticipant;
679
+ Location: typeof buildLocation;
680
+ VirtualLocation: typeof buildVirtualLocation;
681
+ Alert: typeof buildAlert;
682
+ OffsetTrigger: typeof buildOffsetTrigger;
683
+ AbsoluteTrigger: typeof buildAbsoluteTrigger;
684
+ Relation: typeof buildRelation;
685
+ Link: typeof buildLink;
686
+ TimeZone: typeof buildTimeZone;
687
+ TimeZoneRule: typeof buildTimeZoneRule;
688
+ RecurrenceRule: typeof buildRecurrenceRule;
689
+ NDay: typeof buildNDay;
690
+ ByDay: typeof buildNDay;
691
+ EventPatch: typeof buildEventPatch;
692
+ TaskPatch: typeof buildTaskPatch;
693
+ GroupPatch: typeof buildGroupPatch;
694
+ participants: typeof buildParticipants;
695
+ locations: typeof buildLocations;
696
+ virtualLocations: typeof buildVirtualLocations;
697
+ alerts: typeof buildAlerts;
698
+ links: typeof buildLinks;
699
+ relatedTo: typeof buildRelatedTo;
700
+ timeZonesMap: typeof buildTimeZoneMap;
701
+ /**
702
+ * Find a JSCalendar object by UID.
703
+ * @param items JSCalendar objects or JsCal instances.
704
+ * @param uid UID to match.
705
+ * @return Matching object, if found.
706
+ */
707
+ findByUid(items: Array<JSCalendarObject | {
708
+ data: JSCalendarObject;
709
+ }>, uid: string): JSCalendarObject | undefined;
710
+ /**
711
+ * Filter JSCalendar objects by @type.
712
+ * @param items JSCalendar objects or JsCal instances.
713
+ * @param type JSCalendar @type to match.
714
+ * @return Matching objects.
715
+ */
716
+ filterByType(items: Array<JSCalendarObject | {
717
+ data: JSCalendarObject;
718
+ }>, type: JSCalendarObject["@type"]): JSCalendarObject[];
719
+ /**
720
+ * Group JSCalendar objects by @type.
721
+ * @param items JSCalendar objects or JsCal instances.
722
+ * @return Record keyed by @type.
723
+ */
724
+ groupByType(items: Array<JSCalendarObject | {
725
+ data: JSCalendarObject;
726
+ }>): Record<string, JSCalendarObject[]>;
727
+ /**
728
+ * Filter JSCalendar objects whose text fields match a query.
729
+ * @param items JSCalendar objects or JsCal instances.
730
+ * @param query Text query to match.
731
+ * @return Matching objects.
732
+ */
733
+ filterByText(items: Array<JSCalendarObject | {
734
+ data: JSCalendarObject;
735
+ }>, query: string): JSCalendarObject[];
736
+ /**
737
+ * Filter JSCalendar objects that overlap a date range.
738
+ * @param items JSCalendar objects or JsCal instances.
739
+ * @param range Date range bounds.
740
+ * @param options Range comparison options.
741
+ * @return Matching objects.
742
+ */
743
+ filterByDateRange(items: Array<JSCalendarObject | {
744
+ data: JSCalendarObject;
745
+ }>, range: DateRange, options?: DateRangeOptions): JSCalendarObject[];
746
+ /**
747
+ * Expand recurrence rules into concrete occurrences.
748
+ * @param items JSCalendar objects or JsCal instances.
749
+ * @param range Date range bounds.
750
+ * @return Generator of expanded JSCalendar objects.
751
+ */
752
+ expandRecurrence(items: Array<JSCalendarObject | {
753
+ data: JSCalendarObject;
754
+ }>, range: {
755
+ from: Date;
756
+ to: Date;
757
+ }): Generator<JSCalendarObject>;
758
+ /**
759
+ * Expand recurrence rules with pagination support.
760
+ * @param items JSCalendar objects or JsCal instances.
761
+ * @param range Date range bounds.
762
+ * @param options Pagination options.
763
+ * @return Page of expanded items plus an optional next cursor.
764
+ */
765
+ expandRecurrencePaged(items: Array<JSCalendarObject | {
766
+ data: JSCalendarObject;
767
+ }>, range: {
768
+ from: Date;
769
+ to: Date;
770
+ }, options: {
771
+ limit: number;
772
+ cursor?: string;
773
+ }): {
774
+ items: JSCalendarObject[];
775
+ nextCursor?: string;
776
+ };
777
+ /**
778
+ * Convert JSCalendar objects to iCalendar text.
779
+ * @param value JSCalendar objects or JsCal instances.
780
+ * @param options iCalendar export options.
781
+ * @return iCalendar text.
782
+ */
783
+ toICal(value: Array<JSCalendarObject | {
784
+ data: JSCalendarObject;
785
+ }>, options?: ICalOptions): string;
786
+ };
787
+ //#endregion
788
+ //#region src/validate/error.d.ts
789
+ /**
790
+ * Error thrown when validation fails.
791
+ */
792
+ declare class ValidationError extends Error {
793
+ path: string;
794
+ /**
795
+ * Create a new ValidationError.
796
+ * @param path Validation path.
797
+ * @param message Error message.
798
+ */
799
+ constructor(path: string, message: string);
800
+ }
801
+ //#endregion
802
+ export { AbsoluteTrigger, Alert, AlertPatch, AnyCreateInput, BooleanMap, CalendarLike, CalendarType, CreateInput, DayOfWeek, Duration, Event, EventPatch, Group, GroupPatch, Id, Int, JSCalendarCommon, JSCalendarObject, JsCal, JsonPrimitive, JsonValue, Link, LinkPatch, LocalDateTime, Location, LocationPatch, NDay, NDayPatch, OffsetTrigger, Participant, ParticipantPatch, PatchLike, PatchObject, PatchValue, RecurrenceRule, RecurrenceRulePatch, Relation, RelationPatch, SignedDuration, Task, TaskPatch, TimeZone, type TimeZoneId$1 as TimeZoneId, type TimeZoneInput, TimeZonePatch, TimeZoneRule, TimeZoneRulePatch, Trigger, UTCDateTime, UnknownTrigger, UnsignedInt, ValidationError, VirtualLocation, VirtualLocationPatch };