@timestamp-js/core 0.1.0-rc.0 → 0.1.0-rc.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.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import type { CalendarDateParts, CalendarId, CalendarSystem } from './calendar.js';
2
+ export { formatCalendarDate, gregorianCalendar } from './calendar.js';
3
+ export type { CalendarDateParts, CalendarId, CalendarSystem } from './calendar.js';
1
4
  /**
2
5
  * Matches supported date and date-time input.
3
6
  *
@@ -192,10 +195,18 @@ export type DisabledDays = DisabledDay[];
192
195
  /**
193
196
  * Immutable timestamp data used by all parser, comparison, and date math helpers.
194
197
  *
195
- * Timestamps use Gregorian calendar fields and preserve optional ISO timezone
196
- * suffixes without converting the wall-clock values into another zone.
198
+ * Core parser helpers produce Gregorian calendar fields and preserve optional
199
+ * ISO timezone suffixes without converting the wall-clock values into another
200
+ * zone. Calendar adapter helpers can also produce timestamp-shaped values whose
201
+ * year/month/day fields belong to the adapter identified by `calendarId`.
197
202
  */
198
203
  export interface Timestamp {
204
+ /**
205
+ * Optional calendar-system identifier for adapter-produced timestamps.
206
+ *
207
+ * Core Gregorian helpers omit this field for backwards compatibility.
208
+ */
209
+ readonly calendarId?: CalendarId;
199
210
  /**
200
211
  * Date string in `YYYY-MM-DD` form when the timestamp has a day.
201
212
  */
@@ -205,15 +216,16 @@ export interface Timestamp {
205
216
  */
206
217
  readonly hasDay: boolean;
207
218
  /**
208
- * Four-digit Gregorian year.
219
+ * Calendar year. Core parser helpers use Gregorian years.
209
220
  */
210
221
  readonly year: number;
211
222
  /**
212
- * Gregorian month number, where January is `1` and December is `12`.
223
+ * Calendar month number, where the first month is `1`. Core parser helpers
224
+ * use Gregorian month numbers.
213
225
  */
214
226
  readonly month: number;
215
227
  /**
216
- * Day of the month.
228
+ * Calendar day of the month.
217
229
  */
218
230
  readonly day: number;
219
231
  /**
@@ -379,6 +391,73 @@ export interface TimestampDuration {
379
391
  */
380
392
  readonly milliseconds: number;
381
393
  }
394
+ /**
395
+ * Options used when creating a Timestamp from calendar adapter fields.
396
+ */
397
+ export interface CalendarTimestampOptions {
398
+ /**
399
+ * Include formatted time data when true. Defaults to true for compatibility
400
+ * with calendar-view workflows that expect `00:00` when no explicit time is supplied.
401
+ */
402
+ readonly hasTime?: boolean;
403
+ /**
404
+ * Hour in 24-hour format.
405
+ */
406
+ readonly hour?: number;
407
+ /**
408
+ * Minute of the hour.
409
+ */
410
+ readonly minute?: number;
411
+ /**
412
+ * Optional second of the minute.
413
+ */
414
+ readonly second?: number;
415
+ /**
416
+ * Optional millisecond of the second.
417
+ */
418
+ readonly millisecond?: number;
419
+ /**
420
+ * Optional parsed ISO timezone suffix such as `Z`, `+06:00`, or `-0700`.
421
+ */
422
+ readonly timezone?: string;
423
+ /**
424
+ * Optional comparison timestamp from the same calendar system.
425
+ */
426
+ readonly now?: Timestamp | null;
427
+ }
428
+ /**
429
+ * Options used when creating a calendar-aware day list.
430
+ */
431
+ export interface CalendarDayListOptions {
432
+ /**
433
+ * Weekday numbers to include, from `0` Sunday to `6` Saturday.
434
+ */
435
+ readonly weekdays?: number[];
436
+ /**
437
+ * Disable days before this calendar date string.
438
+ */
439
+ readonly disabledBefore?: string;
440
+ /**
441
+ * Disable days after this calendar date string.
442
+ */
443
+ readonly disabledAfter?: string;
444
+ /**
445
+ * Weekday numbers to mark disabled.
446
+ */
447
+ readonly disabledWeekdays?: number[];
448
+ /**
449
+ * Specific dates or date ranges to mark disabled.
450
+ */
451
+ readonly disabledDays?: DisabledDays;
452
+ /**
453
+ * Maximum number of days to return.
454
+ */
455
+ readonly max?: number;
456
+ /**
457
+ * Minimum number of days to return.
458
+ */
459
+ readonly min?: number;
460
+ }
382
461
  /**
383
462
  * Options for formatting a TimestampDuration.
384
463
  */
@@ -403,11 +482,20 @@ export declare const Timestamp: Timestamp;
403
482
  * Frozen empty time-object template.
404
483
  */
405
484
  export declare const TimeObject: TimeObject;
485
+ /**
486
+ * Extracts calendar date fields from a timestamp-shaped value.
487
+ *
488
+ * @param timestamp Timestamp or timestamp-like object to read.
489
+ * @returns Plain calendar date fields.
490
+ * @category calendar
491
+ */
492
+ export declare function toCalendarDateParts(timestamp: Pick<Timestamp, 'year' | 'month' | 'day'>): CalendarDateParts;
406
493
  /**
407
494
  * Validates whether an input string matches the supported timestamp grammar.
408
495
  *
409
496
  * @param {string} input A string in the form `YYYY-MM-DD`, `YYYY-MM-DD HH:mm`, or a full ISO-like date time.
410
497
  * @returns {boolean} True if parseable
498
+ * @category validation
411
499
  */
412
500
  export declare function validateTimestamp(input: string): boolean;
413
501
  /**
@@ -419,6 +507,7 @@ export declare function validateTimestamp(input: string): boolean;
419
507
  *
420
508
  * @param {string} input In the form `YYYY-MM-DD`, `YYYY-MM-DD HH:mm:ss`, or an ISO-like date time with optional milliseconds and timezone suffix.
421
509
  * @returns {Timestamp} Minimal Timestamp object, or `null` when the input cannot be parsed.
510
+ * @category parsing
422
511
  */
423
512
  export declare function parsed(input: string): Timestamp | null;
424
513
  /**
@@ -429,6 +518,7 @@ export declare function parsed(input: string): Timestamp | null;
429
518
  *
430
519
  * @param {Date} date JavaScript Date to convert.
431
520
  * @returns {Timestamp} Formatted Timestamp object, or `null` for invalid input.
521
+ * @category parsing
432
522
  */
433
523
  export declare function parseDate(date: Date): Timestamp | null;
434
524
  /**
@@ -439,6 +529,7 @@ export declare function parseDate(date: Date): Timestamp | null;
439
529
  *
440
530
  * @param {Date} date JavaScript Date to convert.
441
531
  * @returns {Timestamp} Formatted Timestamp object, or `null` for invalid input.
532
+ * @category parsing
442
533
  */
443
534
  export declare function parseDateUTC(date: Date): Timestamp | null;
444
535
  /**
@@ -448,12 +539,14 @@ export declare function parseDateUTC(date: Date): Timestamp | null;
448
539
  * @param {number} x The number to pad
449
540
  * @param {number} length The length of the required number as a string
450
541
  * @returns {string} The padded number (as a string). (ie: 5 = '05')
542
+ * @category formatting
451
543
  */
452
544
  export declare function padNumber(x: number, length: number): string;
453
545
  /**
454
546
  * Returns if the passed year is a leap year
455
547
  * @param {number} year The year to check (ie: 1999, 2020)
456
548
  * @returns {boolean} True if the year is a leap year
549
+ * @category calendar
457
550
  */
458
551
  export declare function isLeapYear(year: number): boolean;
459
552
  /**
@@ -461,6 +554,7 @@ export declare function isLeapYear(year: number): boolean;
461
554
  * @param {number} year The year (ie: 1999, 2020)
462
555
  * @param {number} month The Gregorian month number, where January is `1`
463
556
  * @returns {number} The number of days in the month (corrected for leap years)
557
+ * @category calendar
464
558
  */
465
559
  export declare function daysInMonth(year: number, month: number): number;
466
560
  /**
@@ -468,6 +562,7 @@ export declare function daysInMonth(year: number, month: number): number;
468
562
  *
469
563
  * @param {Timestamp} timestamp Base Timestamp object.
470
564
  * @returns {Timestamp} New Timestamp representing the next day.
565
+ * @category arithmetic
471
566
  */
472
567
  export declare function nextDay(timestamp: Timestamp): Timestamp;
473
568
  /**
@@ -475,6 +570,7 @@ export declare function nextDay(timestamp: Timestamp): Timestamp;
475
570
  *
476
571
  * @param {Timestamp} timestamp Base Timestamp object.
477
572
  * @returns {Timestamp} New Timestamp representing the previous day.
573
+ * @category arithmetic
478
574
  */
479
575
  export declare function prevDay(timestamp: Timestamp): Timestamp;
480
576
  /**
@@ -485,6 +581,7 @@ export declare function prevDay(timestamp: Timestamp): Timestamp;
485
581
  * wants a stable UTC calendar date instead.
486
582
  *
487
583
  * @returns {string} Date string in the form `YYYY-MM-DD`
584
+ * @category state
488
585
  */
489
586
  export declare function today(): string;
490
587
  /**
@@ -496,6 +593,7 @@ export declare function today(): string;
496
593
  *
497
594
  * @param {Date} date Date source to read. Defaults to the current Date.
498
595
  * @returns {string} UTC date string in the form `YYYY-MM-DD`
596
+ * @category state
499
597
  */
500
598
  export declare function todayUTC(date?: Date): string;
501
599
  /**
@@ -507,12 +605,14 @@ export declare function todayUTC(date?: Date): string;
507
605
  *
508
606
  * @param {Date} date Date source to read. Defaults to the current Date.
509
607
  * @returns {Timestamp} Immutable Timestamp built from UTC fields.
608
+ * @category state
510
609
  */
511
610
  export declare function nowUTC(date?: Date): Timestamp;
512
611
  /**
513
612
  * Takes a date string ('YYYY-MM-DD') and validates if it is today's date
514
613
  * @param {string} date Date string in the form 'YYYY-MM-DD'
515
614
  * @returns {boolean} True if the date is today's date
615
+ * @category comparison
516
616
  */
517
617
  export declare function isToday(date: string): boolean;
518
618
  /**
@@ -524,6 +624,7 @@ export declare function isToday(date: string): boolean;
524
624
  * @param {string} date Date string in the form `YYYY-MM-DD`.
525
625
  * @param {Date} now Date source to read. Defaults to the current Date.
526
626
  * @returns {boolean} True when the date matches the UTC date.
627
+ * @category comparison
527
628
  */
528
629
  export declare function isTodayUTC(date: string, now?: Date): boolean;
529
630
  /**
@@ -533,6 +634,7 @@ export declare function isTodayUTC(date: string, now?: Date): boolean;
533
634
  * @param {number[]} weekdays The array is [0,1,2,3,4,5,6] where 0=Sunday and 6=Saturday
534
635
  * @param {Timestamp=} today Current timestamp used to update relative information
535
636
  * @returns {Timestamp} A new Timestamp representing the start of the week
637
+ * @category ranges
536
638
  */
537
639
  export declare function getStartOfWeek(timestamp: Timestamp, weekdays: number[], today: Timestamp): Timestamp;
538
640
  /**
@@ -542,18 +644,21 @@ export declare function getStartOfWeek(timestamp: Timestamp, weekdays: number[],
542
644
  * @param {number[]} weekdays The array is [0,1,2,3,4,5,6] where 0=Sunday and 6=Saturday
543
645
  * @param {Timestamp=} today Current timestamp used to update relative information
544
646
  * @returns {Timestamp} A new Timestamp representing the end of the week
647
+ * @category ranges
545
648
  */
546
649
  export declare function getEndOfWeek(timestamp: Timestamp, weekdays: number[], today: Timestamp): Timestamp;
547
650
  /**
548
651
  * Finds the start of the month based on the passed in Timestamp
549
652
  * @param {Timestamp} timestamp The Timestamp to use to find the start of the month
550
653
  * @returns {Timestamp} A Timestamp of the start of the month
654
+ * @category ranges
551
655
  */
552
656
  export declare function getStartOfMonth(timestamp: Timestamp): Timestamp;
553
657
  /**
554
658
  * Finds the end of the month based on the passed in Timestamp
555
659
  * @param {Timestamp} timestamp The Timestamp to use to find the end of the month
556
660
  * @returns {Timestamp} A Timestamp of the end of the month
661
+ * @category ranges
557
662
  */
558
663
  export declare function getEndOfMonth(timestamp: Timestamp): Timestamp;
559
664
  /**
@@ -564,6 +669,7 @@ export declare function getEndOfMonth(timestamp: Timestamp): Timestamp;
564
669
  *
565
670
  * @param input - Minutes since midnight, a time string, or an object with hour and minute fields.
566
671
  * @returns Minutes since midnight, or `false` when the input cannot be parsed.
672
+ * @category parsing
567
673
  */
568
674
  export declare function parseTime(input: number | string | {
569
675
  hour: number;
@@ -575,6 +681,7 @@ export declare function parseTime(input: number | string | {
575
681
  * @param {Timestamp} ts1 First Timestamp object.
576
682
  * @param {Timestamp} ts2 Second Timestamp object.
577
683
  * @returns {boolean} True when both timestamps match exactly.
684
+ * @category comparison
578
685
  */
579
686
  export declare function compareTimestamps(ts1: Timestamp, ts2: Timestamp): boolean;
580
687
  /**
@@ -583,6 +690,7 @@ export declare function compareTimestamps(ts1: Timestamp, ts2: Timestamp): boole
583
690
  * @param {Timestamp} ts1 First Timestamp object.
584
691
  * @param {Timestamp} ts2 Second Timestamp object.
585
692
  * @returns {boolean} True when both dates are the same.
693
+ * @category comparison
586
694
  */
587
695
  export declare function compareDate(ts1: Timestamp, ts2: Timestamp): boolean;
588
696
  /**
@@ -591,6 +699,7 @@ export declare function compareDate(ts1: Timestamp, ts2: Timestamp): boolean;
591
699
  * @param {Timestamp} ts1 First Timestamp object.
592
700
  * @param {Timestamp} ts2 Second Timestamp object.
593
701
  * @returns {boolean} True when both times are the same.
702
+ * @category comparison
594
703
  */
595
704
  export declare function compareTime(ts1: Timestamp, ts2: Timestamp): boolean;
596
705
  /**
@@ -599,6 +708,7 @@ export declare function compareTime(ts1: Timestamp, ts2: Timestamp): boolean;
599
708
  * @param {Timestamp} ts1 First Timestamp object.
600
709
  * @param {Timestamp} ts2 Second Timestamp object.
601
710
  * @returns {boolean} True when both date-time values are the same.
711
+ * @category comparison
602
712
  */
603
713
  export declare function compareDateTime(ts1: Timestamp, ts2: Timestamp): boolean;
604
714
  /**
@@ -610,6 +720,7 @@ export declare function compareDateTime(ts1: Timestamp, ts2: Timestamp): boolean
610
720
  * @param {string} input Date or date-time string, such as `YYYY-MM-DD`, `YYYY-MM-DD HH:mm:ss`, or an ISO-like value with optional milliseconds and timezone suffix.
611
721
  * @param {Timestamp} now Optional Timestamp used to calculate relative flags.
612
722
  * @returns {Timestamp} Formatted Timestamp object, or `null` when the input cannot be parsed.
723
+ * @category parsing
613
724
  */
614
725
  export declare function parseTimestamp(input: string, now?: Timestamp | null): Timestamp | null;
615
726
  /**
@@ -617,13 +728,235 @@ export declare function parseTimestamp(input: string, now?: Timestamp | null): T
617
728
  *
618
729
  * @param {Timestamp} timestamp Timestamp object to read.
619
730
  * @returns {number} Numeric date identifier.
731
+ * @category conversion
620
732
  */
621
733
  export declare function getDayIdentifier(timestamp: Timestamp): number;
734
+ /**
735
+ * Converts a Timestamp date into a stable serial day for a calendar system.
736
+ *
737
+ * The default Gregorian value is the number of UTC days since 1970-01-01.
738
+ * Alternate calendar adapters should map their year/month/day fields to the
739
+ * same serial day space so ranges and comparisons can be calendar-agnostic.
740
+ *
741
+ * @param {Timestamp} timestamp Timestamp object to read.
742
+ * @param {CalendarSystem=} calendar Calendar implementation to use.
743
+ * @returns {number} Stable serial day.
744
+ * @category conversion
745
+ */
746
+ export declare function getEpochDay(timestamp: Timestamp, calendar?: CalendarSystem): number;
747
+ /**
748
+ * Converts a Timestamp date into a stable serial-day identifier for a calendar system.
749
+ *
750
+ * This is an alias-friendly helper for calendar views that need sorted keys,
751
+ * range comparisons, or virtualized day rows across different calendar adapters.
752
+ *
753
+ * @param timestamp Timestamp object to read.
754
+ * @param calendar Calendar implementation to use.
755
+ * @returns Stable serial day.
756
+ * @category calendar
757
+ */
758
+ export declare function getCalendarDayIdentifier(timestamp: Timestamp, calendar?: CalendarSystem): number;
759
+ /**
760
+ * Returns true when calendar date fields are valid for a calendar system.
761
+ *
762
+ * @param date Calendar date fields to validate.
763
+ * @param calendar Calendar implementation to use.
764
+ * @returns True when year, month, and day can exist in the calendar.
765
+ * @category calendar
766
+ */
767
+ export declare function isValidCalendarDate(date: CalendarDateParts, calendar?: CalendarSystem): boolean;
768
+ /**
769
+ * Creates an immutable Timestamp-shaped value from calendar adapter fields.
770
+ *
771
+ * The returned timestamp uses adapter year/month/day fields, is tagged with
772
+ * `calendarId`, and derives weekday/day-of-year values from the adapter.
773
+ *
774
+ * @param date Calendar date fields.
775
+ * @param calendar Calendar implementation to use.
776
+ * @param options Optional time and relative comparison settings.
777
+ * @returns Timestamp-shaped calendar value.
778
+ * @category calendar
779
+ */
780
+ export declare function createCalendarTimestamp(date: CalendarDateParts, calendar?: CalendarSystem, options?: CalendarTimestampOptions): Timestamp;
781
+ /**
782
+ * Parses a date or date-time string as calendar adapter fields.
783
+ *
784
+ * Unlike parseTimestamp(), this helper validates the date against the supplied
785
+ * calendar and derives weekday/day-of-year values through the adapter.
786
+ *
787
+ * @param input Date or date-time string.
788
+ * @param calendar Calendar implementation to use.
789
+ * @param now Optional comparison timestamp from the same calendar system.
790
+ * @returns Calendar timestamp, or `null` when the input cannot be parsed or validated.
791
+ * @category calendar
792
+ */
793
+ export declare function parseCalendarTimestamp(input: string, calendar?: CalendarSystem, now?: Timestamp | null): Timestamp | null;
794
+ /**
795
+ * Creates a calendar timestamp from a stable serial day.
796
+ *
797
+ * @param epochDay Stable serial day.
798
+ * @param calendar Calendar implementation to use.
799
+ * @param options Optional time and relative comparison settings.
800
+ * @returns Timestamp-shaped calendar value.
801
+ * @category calendar
802
+ */
803
+ export declare function createCalendarTimestampFromEpochDay(epochDay: number, calendar?: CalendarSystem, options?: CalendarTimestampOptions): Timestamp;
804
+ /**
805
+ * Updates formatted calendar metadata on a timestamp-shaped value.
806
+ *
807
+ * @param timestamp Timestamp object to transform.
808
+ * @param calendar Calendar implementation to use.
809
+ * @returns Timestamp with adapter date formatting and metadata.
810
+ * @category calendar
811
+ */
812
+ export declare function updateCalendarFormatted(timestamp: Timestamp, calendar?: CalendarSystem): Timestamp;
813
+ /**
814
+ * Returns a timestamp with relative flags compared through a calendar adapter.
815
+ *
816
+ * @param timestamp Timestamp object to update.
817
+ * @param now Timestamp representing the comparison point in the same calendar.
818
+ * @param calendar Calendar implementation to use.
819
+ * @param time Include time-of-day in the comparison when true.
820
+ * @returns New Timestamp object with relative flags.
821
+ * @category calendar
822
+ */
823
+ export declare function updateCalendarRelative(timestamp: Timestamp, now: Timestamp, calendar?: CalendarSystem, time?: boolean): Timestamp;
824
+ /**
825
+ * Returns a calendar timestamp for the next day.
826
+ *
827
+ * @param timestamp Base timestamp.
828
+ * @param calendar Calendar implementation to use.
829
+ * @returns New timestamp for the next adapter day.
830
+ * @category calendar
831
+ */
832
+ export declare function nextCalendarDay(timestamp: Timestamp, calendar?: CalendarSystem): Timestamp;
833
+ /**
834
+ * Returns a calendar timestamp for the previous day.
835
+ *
836
+ * @param timestamp Base timestamp.
837
+ * @param calendar Calendar implementation to use.
838
+ * @returns New timestamp for the previous adapter day.
839
+ * @category calendar
840
+ */
841
+ export declare function prevCalendarDay(timestamp: Timestamp, calendar?: CalendarSystem): Timestamp;
842
+ /**
843
+ * Adds a number of days through a calendar adapter.
844
+ *
845
+ * @param timestamp Base timestamp.
846
+ * @param amount Number of days to move.
847
+ * @param calendar Calendar implementation to use.
848
+ * @returns New timestamp after moving.
849
+ * @category calendar
850
+ */
851
+ export declare function addCalendarDays(timestamp: Timestamp, amount: number, calendar?: CalendarSystem): Timestamp;
852
+ /**
853
+ * Adds a number of months through a calendar adapter and clamps invalid days.
854
+ *
855
+ * @param timestamp Base timestamp.
856
+ * @param amount Number of calendar months to move.
857
+ * @param calendar Calendar implementation to use.
858
+ * @returns New timestamp after moving.
859
+ * @category calendar
860
+ */
861
+ export declare function addCalendarMonths(timestamp: Timestamp, amount: number, calendar?: CalendarSystem): Timestamp;
862
+ /**
863
+ * Adds a number of years through a calendar adapter and clamps invalid days.
864
+ *
865
+ * @param timestamp Base timestamp.
866
+ * @param amount Number of calendar years to move.
867
+ * @param calendar Calendar implementation to use.
868
+ * @returns New timestamp after moving.
869
+ * @category calendar
870
+ */
871
+ export declare function addCalendarYears(timestamp: Timestamp, amount: number, calendar?: CalendarSystem): Timestamp;
872
+ /**
873
+ * Returns the start of the calendar month for a timestamp.
874
+ *
875
+ * @param timestamp Base timestamp.
876
+ * @param calendar Calendar implementation to use.
877
+ * @returns First day of the adapter month.
878
+ * @category calendar
879
+ */
880
+ export declare function getCalendarStartOfMonth(timestamp: Timestamp, calendar?: CalendarSystem): Timestamp;
881
+ /**
882
+ * Returns the end of the calendar month for a timestamp.
883
+ *
884
+ * @param timestamp Base timestamp.
885
+ * @param calendar Calendar implementation to use.
886
+ * @returns Last day of the adapter month.
887
+ * @category calendar
888
+ */
889
+ export declare function getCalendarEndOfMonth(timestamp: Timestamp, calendar?: CalendarSystem): Timestamp;
890
+ /**
891
+ * Returns the start of the calendar year for a timestamp.
892
+ *
893
+ * @param timestamp Base timestamp.
894
+ * @param calendar Calendar implementation to use.
895
+ * @returns First day of the adapter year.
896
+ * @category calendar
897
+ */
898
+ export declare function getCalendarStartOfYear(timestamp: Timestamp, calendar?: CalendarSystem): Timestamp;
899
+ /**
900
+ * Returns the end of the calendar year for a timestamp.
901
+ *
902
+ * @param timestamp Base timestamp.
903
+ * @param calendar Calendar implementation to use.
904
+ * @returns Last day of the adapter year.
905
+ * @category calendar
906
+ */
907
+ export declare function getCalendarEndOfYear(timestamp: Timestamp, calendar?: CalendarSystem): Timestamp;
908
+ /**
909
+ * Finds the nearest matching weekday through a calendar adapter.
910
+ *
911
+ * @param timestamp Base timestamp.
912
+ * @param weekday Weekday number to find.
913
+ * @param calendar Calendar implementation to use.
914
+ * @param direction Direction to search.
915
+ * @param maxDays Maximum days to inspect.
916
+ * @returns Matching timestamp, or the last inspected timestamp.
917
+ * @category calendar
918
+ */
919
+ export declare function findCalendarWeekday(timestamp: Timestamp, weekday: number, calendar?: CalendarSystem, direction?: 'next' | 'prev', maxDays?: number): Timestamp;
920
+ /**
921
+ * Returns the start of a calendar week for a timestamp and weekday set.
922
+ *
923
+ * @param timestamp Base timestamp.
924
+ * @param weekdays Weekday numbers to include, from `0` Sunday to `6` Saturday.
925
+ * @param calendar Calendar implementation to use.
926
+ * @param now Optional comparison timestamp from the same calendar.
927
+ * @returns Start of the adapter week.
928
+ * @category calendar
929
+ */
930
+ export declare function getCalendarStartOfWeek(timestamp: Timestamp, weekdays: number[], calendar?: CalendarSystem, now?: Timestamp | null): Timestamp;
931
+ /**
932
+ * Returns the end of a calendar week for a timestamp and weekday set.
933
+ *
934
+ * @param timestamp Base timestamp.
935
+ * @param weekdays Weekday numbers to include, from `0` Sunday to `6` Saturday.
936
+ * @param calendar Calendar implementation to use.
937
+ * @param now Optional comparison timestamp from the same calendar.
938
+ * @returns End of the adapter week.
939
+ * @category calendar
940
+ */
941
+ export declare function getCalendarEndOfWeek(timestamp: Timestamp, weekdays: number[], calendar?: CalendarSystem, now?: Timestamp | null): Timestamp;
942
+ /**
943
+ * Creates an inclusive list of calendar adapter days between start and end.
944
+ *
945
+ * @param start First day in the list.
946
+ * @param end Last day boundary for the list.
947
+ * @param now Timestamp used to calculate relative flags.
948
+ * @param calendar Calendar implementation to use.
949
+ * @param options Optional weekday, disabled, and size filters.
950
+ * @returns Timestamp days for the adapter calendar.
951
+ * @category calendar
952
+ */
953
+ export declare function createCalendarDayList(start: Timestamp, end: Timestamp, now: Timestamp, calendar?: CalendarSystem, options?: CalendarDayListOptions): Timestamp[];
622
954
  /**
623
955
  * Converts a Timestamp time into a sortable numeric identifier.
624
956
  *
625
957
  * @param {Timestamp} timestamp Timestamp object to read.
626
958
  * @returns {number} Numeric time identifier.
959
+ * @category conversion
627
960
  */
628
961
  export declare function getTimeIdentifier(timestamp: Timestamp): number;
629
962
  /**
@@ -631,6 +964,7 @@ export declare function getTimeIdentifier(timestamp: Timestamp): number;
631
964
  *
632
965
  * @param {Timestamp} timestamp Timestamp object to read.
633
966
  * @returns {number} Numeric date-time identifier.
967
+ * @category conversion
634
968
  */
635
969
  export declare function getDayTimeIdentifier(timestamp: Timestamp): number;
636
970
  /**
@@ -639,6 +973,7 @@ export declare function getDayTimeIdentifier(timestamp: Timestamp): number;
639
973
  * @param {Timestamp} ts2 The second Timestamp
640
974
  * @param {boolean=} strict Optional flag to not to return negative numbers
641
975
  * @returns {number} The difference
976
+ * @category arithmetic
642
977
  */
643
978
  export declare function diffTimestamp(ts1: Timestamp, ts2: Timestamp, strict?: boolean): number;
644
979
  /**
@@ -652,6 +987,7 @@ export declare function diffTimestamp(ts1: Timestamp, ts2: Timestamp, strict?: b
652
987
  * @param {Timestamp} now Timestamp representing the comparison point.
653
988
  * @param {boolean=} time Include time-of-day in the comparison when true.
654
989
  * @returns {Timestamp} New Timestamp object with relative flags.
990
+ * @category state
655
991
  */
656
992
  export declare function updateRelative(timestamp: Timestamp, now: Timestamp, time?: boolean): Timestamp;
657
993
  /**
@@ -664,24 +1000,28 @@ export declare function updateRelative(timestamp: Timestamp, now: Timestamp, tim
664
1000
  * @param {number} minutes The number of minutes to set from midnight
665
1001
  * @param {Timestamp=} now Optional Timestamp representing current date and time
666
1002
  * @returns {Timestamp} A new Timestamp
1003
+ * @category arithmetic
667
1004
  */
668
1005
  export declare function updateMinutes(timestamp: Timestamp, minutes: number, now?: Timestamp | null): Timestamp;
669
1006
  /**
670
1007
  * Updates the Timestamp with the weekday
671
1008
  * @param {Timestamp} timestamp The Timestamp to transform
672
1009
  * @returns A new Timestamp
1010
+ * @category formatting
673
1011
  */
674
1012
  export declare function updateWeekday(timestamp: Timestamp): Timestamp;
675
1013
  /**
676
1014
  * Updates the Timestamp with the day of the year (doy)
677
1015
  * @param {Timestamp} timestamp The Timestamp to transform
678
1016
  * @returns A new Timestamp
1017
+ * @category formatting
679
1018
  */
680
1019
  export declare function updateDayOfYear(timestamp: Timestamp): Timestamp;
681
1020
  /**
682
1021
  * Updates the Timestamp with the workweek
683
1022
  * @param {Timestamp} timestamp The Timestamp to transform
684
1023
  * @returns A new Timestamp
1024
+ * @category formatting
685
1025
  */
686
1026
  export declare function updateWorkWeek(timestamp: Timestamp): Timestamp;
687
1027
  /**
@@ -692,30 +1032,35 @@ export declare function updateWorkWeek(timestamp: Timestamp): Timestamp;
692
1032
  * @param {number[]} [disabledWeekdays] An array of numbers representing weekdays [0 = Sun, ..., 6 = Sat]
693
1033
  * @param {DisabledDays} [disabledDays] An array of days in 'YYYY-MM-DD' format. If an array with a pair of dates is in first array, then this is treated as a range. Object entries can include date/from/to plus color metadata.
694
1034
  * @returns A new Timestamp
1035
+ * @category state
695
1036
  */
696
1037
  export declare function updateDisabled(timestamp: Timestamp, disabledBefore?: string, disabledAfter?: string, disabledWeekdays?: number[], disabledDays?: DisabledDays): Timestamp;
697
1038
  /**
698
1039
  * Updates the passed Timestamp with formatted data (time string, date string, weekday, day of year and workweek)
699
1040
  * @param {Timestamp} timestamp The Timestamp to transform
700
1041
  * @returns A new Timestamp
1042
+ * @category formatting
701
1043
  */
702
1044
  export declare function updateFormatted(timestamp: Timestamp): Timestamp;
703
1045
  /**
704
1046
  * Returns day of the year (doy) for the passed in Timestamp
705
1047
  * @param {Timestamp} timestamp The Timestamp to use
706
1048
  * @returns {number} The day of the year
1049
+ * @category formatting
707
1050
  */
708
1051
  export declare function getDayOfYear(timestamp: Timestamp): number | void;
709
1052
  /**
710
1053
  * Returns workweek for the passed in Timestamp
711
1054
  * @param {Timestamp} timestamp The Timestamp to use
712
1055
  * @returns {number} The work week
1056
+ * @category formatting
713
1057
  */
714
1058
  export declare function getWorkWeek(timestamp: Timestamp): number;
715
1059
  /**
716
1060
  * Returns weekday for the passed in Timestamp
717
1061
  * @param {Timestamp} timestamp The Timestamp to use
718
1062
  * @returns {number} The weekday
1063
+ * @category formatting
719
1064
  */
720
1065
  export declare function getWeekday(timestamp: Timestamp): number;
721
1066
  /**
@@ -723,6 +1068,7 @@ export declare function getWeekday(timestamp: Timestamp): number;
723
1068
  *
724
1069
  * @param {Timestamp} timestamp Timestamp object to copy.
725
1070
  * @returns {Timestamp} Frozen Timestamp copy.
1071
+ * @category state
726
1072
  */
727
1073
  export declare function copyTimestamp(timestamp: Timestamp): Timestamp;
728
1074
  /**
@@ -730,6 +1076,7 @@ export declare function copyTimestamp(timestamp: Timestamp): Timestamp;
730
1076
  *
731
1077
  * @param {Timestamp} timestamp Timestamp object to transform.
732
1078
  * @returns {Timestamp} New Timestamp at `00:00`.
1079
+ * @category ranges
733
1080
  */
734
1081
  export declare function getStartOfDay(timestamp: Timestamp): Timestamp;
735
1082
  /**
@@ -737,6 +1084,7 @@ export declare function getStartOfDay(timestamp: Timestamp): Timestamp;
737
1084
  *
738
1085
  * @param {Timestamp} timestamp Timestamp object to transform.
739
1086
  * @returns {Timestamp} New Timestamp at `23:59:59.999`.
1087
+ * @category ranges
740
1088
  */
741
1089
  export declare function getEndOfDay(timestamp: Timestamp): Timestamp;
742
1090
  /**
@@ -744,6 +1092,7 @@ export declare function getEndOfDay(timestamp: Timestamp): Timestamp;
744
1092
  *
745
1093
  * @param {Timestamp} timestamp Timestamp object to transform.
746
1094
  * @returns {Timestamp} New Timestamp for January 1 at `00:00`.
1095
+ * @category ranges
747
1096
  */
748
1097
  export declare function getStartOfYear(timestamp: Timestamp): Timestamp;
749
1098
  /**
@@ -751,6 +1100,7 @@ export declare function getStartOfYear(timestamp: Timestamp): Timestamp;
751
1100
  *
752
1101
  * @param {Timestamp} timestamp Timestamp object to transform.
753
1102
  * @returns {Timestamp} New Timestamp for December 31 at `23:59:59.999`.
1103
+ * @category ranges
754
1104
  */
755
1105
  export declare function getEndOfYear(timestamp: Timestamp): Timestamp;
756
1106
  /**
@@ -758,6 +1108,7 @@ export declare function getEndOfYear(timestamp: Timestamp): Timestamp;
758
1108
  *
759
1109
  * @param {Timestamp} timestamp Timestamp object to format.
760
1110
  * @returns {string} Date string such as `YYYY-MM-DD`.
1111
+ * @category conversion
761
1112
  */
762
1113
  export declare function getDate(timestamp: Timestamp): string;
763
1114
  /**
@@ -768,6 +1119,7 @@ export declare function getDate(timestamp: Timestamp): string;
768
1119
  *
769
1120
  * @param {Timestamp} timestamp Timestamp object to format.
770
1121
  * @returns {string} Time string, or an empty string when the timestamp has no time.
1122
+ * @category conversion
771
1123
  */
772
1124
  export declare function getTime(timestamp: Timestamp): string;
773
1125
  /**
@@ -775,6 +1127,7 @@ export declare function getTime(timestamp: Timestamp): string;
775
1127
  *
776
1128
  * @param {Timestamp} timestamp Timestamp object to format.
777
1129
  * @returns {string} Date-time string such as `YYYY-MM-DD HH:mm`.
1130
+ * @category conversion
778
1131
  */
779
1132
  export declare function getDateTime(timestamp: Timestamp): string;
780
1133
  /**
@@ -784,6 +1137,7 @@ export declare function getDateTime(timestamp: Timestamp): string;
784
1137
  * @param {number} [days=1] The number of days to move.
785
1138
  * @param {number[]} [allowedWeekdays=[ 0, 1, 2, 3, 4, 5, 6 ]] An array of numbers representing the weekdays. ie: [0 = Sun, ..., 6 = Sat].
786
1139
  * @returns A new Timestamp
1140
+ * @category ranges
787
1141
  */
788
1142
  export declare function moveRelativeDays(timestamp: Timestamp, mover?: typeof nextDay, days?: number, allowedWeekdays?: number[]): Timestamp;
789
1143
  /**
@@ -793,6 +1147,7 @@ export declare function moveRelativeDays(timestamp: Timestamp, mover?: typeof ne
793
1147
  * @param {number} [days=1] The number of days to move.
794
1148
  * @param {number[]} [allowedWeekdays=[ 0, 1, 2, 3, 4, 5, 6 ]] An array of numbers representing the weekdays. ie: [0 = Sun, ..., 6 = Sat].
795
1149
  * @returns A new Timestamp
1150
+ * @category ranges
796
1151
  */
797
1152
  export declare function relativeDays(timestamp: Timestamp, mover?: typeof nextDay, days?: number, allowedWeekdays?: number[]): Timestamp;
798
1153
  /**
@@ -802,6 +1157,7 @@ export declare function relativeDays(timestamp: Timestamp, mover?: typeof nextDa
802
1157
  * @param {function} [mover=nextDay] The function to use ({prevDay} or {nextDay}).
803
1158
  * @param {number} [maxDays=6] The number of days to look forward or back.
804
1159
  * @returns A new Timestamp
1160
+ * @category ranges
805
1161
  */
806
1162
  export declare function findWeekday(timestamp: Timestamp, weekday: number, mover?: typeof nextDay, maxDays?: number): Timestamp;
807
1163
  /**
@@ -821,6 +1177,7 @@ export declare function findWeekday(timestamp: Timestamp, weekday: number, mover
821
1177
  * @param {number} [max=42] Maximum number of days to return.
822
1178
  * @param {number} [min=0] Minimum number of days to return.
823
1179
  * @returns {Timestamp[]} Timestamp days.
1180
+ * @category ranges
824
1181
  */
825
1182
  export declare function createDayList(start: Timestamp, end: Timestamp, now: Timestamp, weekdays?: number[], disabledBefore?: string | undefined, disabledAfter?: string | undefined, disabledWeekdays?: number[], disabledDays?: DisabledDays, max?: number, min?: number): Timestamp[];
826
1183
  /**
@@ -832,6 +1189,7 @@ export declare function createDayList(start: Timestamp, end: Timestamp, now: Tim
832
1189
  * @param {number} count Number of intervals to create.
833
1190
  * @param {Timestamp} now Timestamp used to calculate relative flags.
834
1191
  * @returns {Timestamp[]} Interval Timestamp objects.
1192
+ * @category ranges
835
1193
  */
836
1194
  export declare function createIntervalList(timestamp: Timestamp, first: number, minutes: number, count: number, now: Timestamp): Timestamp[];
837
1195
  /**
@@ -862,6 +1220,7 @@ export type MonthFormatter = (_month: number, _type?: string, _locale?: string)
862
1220
  * @param {string} locale The locale to use (ie: en-US)
863
1221
  * @param {getOptions} cb The function to call for options. This function should return an Intl formatted object. The function is passed (timestamp, short).
864
1222
  * @returns {formatter} The function has params (timestamp, short). The short is to use the short options.
1223
+ * @category locale
865
1224
  */
866
1225
  export declare function createNativeLocaleFormatter(locale: string, cb: LocaleFormatter): (_timestamp: Timestamp, _short: boolean) => string;
867
1226
  /**
@@ -874,13 +1233,31 @@ export declare function createNativeLocaleFormatter(locale: string, cb: LocaleFo
874
1233
  * @param {string} locale The locale to use (ie: en-US)
875
1234
  * @param {getOptions} cb The function to call for options. This function should return an Intl formatted object. The function is passed (timestamp, short).
876
1235
  * @returns {formatter} The function has params (timestamp, short). The short is to use the short options.
1236
+ * @category locale
877
1237
  */
878
1238
  export declare function createNativeLocaleFormatterUTC(locale: string, cb: LocaleFormatter): (_timestamp: Timestamp, _short: boolean) => string;
1239
+ /**
1240
+ * Returns a UTC locale formatter for a calendar adapter.
1241
+ *
1242
+ * The formatter converts adapter date fields through the adapter's serial day
1243
+ * before constructing the native Date. When the adapter has an Intl calendar id,
1244
+ * it is supplied to Intl.DateTimeFormat unless the caller already provided a
1245
+ * `calendar` option. The helper supplies `timeZone: "UTC"` unless the caller
1246
+ * provides a different timezone.
1247
+ *
1248
+ * @param calendar Calendar implementation to use.
1249
+ * @param locale The locale to use.
1250
+ * @param cb Callback that returns Intl formatting options.
1251
+ * @returns Function that formats a calendar timestamp.
1252
+ * @category calendar
1253
+ */
1254
+ export declare function createCalendarLocaleFormatterUTC(calendar: CalendarSystem, locale: string, cb: LocaleFormatter): (_timestamp: Timestamp, _short: boolean) => string;
879
1255
  /**
880
1256
  * Converts a Timestamp date into a host-local JavaScript Date.
881
1257
  *
882
1258
  * @param {Timestamp} timestamp Timestamp object to convert.
883
1259
  * @returns {Date} Host-local JavaScript Date object.
1260
+ * @category conversion
884
1261
  */
885
1262
  export declare function makeDate(timestamp: Timestamp): Date;
886
1263
  /**
@@ -888,20 +1265,44 @@ export declare function makeDate(timestamp: Timestamp): Date;
888
1265
  *
889
1266
  * @param {Timestamp} timestamp Timestamp object to convert.
890
1267
  * @returns {Date} JavaScript Date object built with `Date.UTC()`.
1268
+ * @category conversion
891
1269
  */
892
1270
  export declare function makeDateUTC(timestamp: Timestamp): Date;
1271
+ /**
1272
+ * Converts an adapter calendar timestamp date into a UTC JavaScript Date.
1273
+ *
1274
+ * The native Date always represents the equivalent Gregorian civil day so Intl
1275
+ * can format the adapter date correctly when paired with a calendar option.
1276
+ *
1277
+ * @param timestamp Calendar timestamp object to convert.
1278
+ * @param calendar Calendar implementation to use.
1279
+ * @returns JavaScript Date object built with `Date.UTC()`.
1280
+ * @category calendar
1281
+ */
1282
+ export declare function makeCalendarDateUTC(timestamp: Timestamp, calendar?: CalendarSystem): Date;
893
1283
  /**
894
1284
  * Converts a Timestamp date and time into a host-local JavaScript Date.
895
1285
  *
896
1286
  * @param {Timestamp} timestamp Timestamp object to convert.
897
1287
  * @returns {Date} Host-local JavaScript Date object.
1288
+ * @category conversion
898
1289
  */
899
1290
  export declare function makeDateTime(timestamp: Timestamp): Date;
1291
+ /**
1292
+ * Converts an adapter calendar timestamp date-time into a UTC JavaScript Date.
1293
+ *
1294
+ * @param timestamp Calendar timestamp object to convert.
1295
+ * @param calendar Calendar implementation to use.
1296
+ * @returns JavaScript Date object built with `Date.UTC()`.
1297
+ * @category calendar
1298
+ */
1299
+ export declare function makeCalendarDateTimeUTC(timestamp: Timestamp, calendar?: CalendarSystem): Date;
900
1300
  /**
901
1301
  * Converts a Timestamp date and time into a UTC JavaScript Date.
902
1302
  *
903
1303
  * @param {Timestamp} timestamp Timestamp object to convert.
904
1304
  * @returns {Date} JavaScript Date object built with `Date.UTC()`.
1305
+ * @category conversion
905
1306
  */
906
1307
  export declare function makeDateTimeUTC(timestamp: Timestamp): Date;
907
1308
  /**
@@ -912,6 +1313,7 @@ export declare function makeDateTimeUTC(timestamp: Timestamp): Date;
912
1313
  *
913
1314
  * @param {Timestamp} timestamp Timestamp object to convert.
914
1315
  * @returns {number} Unix milliseconds.
1316
+ * @category conversion
915
1317
  */
916
1318
  export declare function toUnixMilliseconds(timestamp: Timestamp): number;
917
1319
  /**
@@ -921,6 +1323,7 @@ export declare function toUnixMilliseconds(timestamp: Timestamp): number;
921
1323
  *
922
1324
  * @param {Timestamp} timestamp Timestamp object to convert.
923
1325
  * @returns {number} Unix seconds.
1326
+ * @category conversion
924
1327
  */
925
1328
  export declare function toUnixSeconds(timestamp: Timestamp): number;
926
1329
  /**
@@ -928,6 +1331,7 @@ export declare function toUnixSeconds(timestamp: Timestamp): number;
928
1331
  *
929
1332
  * @param {number} milliseconds Unix milliseconds.
930
1333
  * @returns {Timestamp | null} Timestamp built from UTC fields, or `null` for invalid input.
1334
+ * @category conversion
931
1335
  */
932
1336
  export declare function fromUnixMilliseconds(milliseconds: number): Timestamp | null;
933
1337
  /**
@@ -935,6 +1339,7 @@ export declare function fromUnixMilliseconds(milliseconds: number): Timestamp |
935
1339
  *
936
1340
  * @param {number} seconds Unix seconds.
937
1341
  * @returns {Timestamp | null} Timestamp built from UTC fields, or `null` for invalid input.
1342
+ * @category conversion
938
1343
  */
939
1344
  export declare function fromUnixSeconds(seconds: number): Timestamp | null;
940
1345
  /**
@@ -944,6 +1349,7 @@ export declare function fromUnixSeconds(seconds: number): Timestamp | null;
944
1349
  *
945
1350
  * @param {Timestamp} timestamp Timestamp object to convert.
946
1351
  * @returns {Date} Local JavaScript Date object.
1352
+ * @category conversion
947
1353
  */
948
1354
  export declare function getDateObject(timestamp: Timestamp): Date;
949
1355
  /**
@@ -952,6 +1358,7 @@ export declare function getDateObject(timestamp: Timestamp): Date;
952
1358
  * @param input - The value to be validated. Can be a string or a number.
953
1359
  * @returns A boolean indicating whether the input is a finite number.
954
1360
  * Returns true if the input is a finite number, false otherwise.
1361
+ * @category validation
955
1362
  */
956
1363
  export declare function validateNumber(input: string | number): boolean;
957
1364
  /**
@@ -960,6 +1367,7 @@ export declare function validateNumber(input: string | number): boolean;
960
1367
  * @param {Timestamp[]} timestamps Timestamp objects to compare.
961
1368
  * @param {boolean=} useTime Include time-of-day in the comparison when true.
962
1369
  * @returns Latest Timestamp object.
1370
+ * @category comparison
963
1371
  */
964
1372
  export declare function maxTimestamp(timestamps: Timestamp[], useTime?: boolean): Timestamp;
965
1373
  /**
@@ -968,6 +1376,7 @@ export declare function maxTimestamp(timestamps: Timestamp[], useTime?: boolean)
968
1376
  * @param {Timestamp[]} timestamps Timestamp objects to compare.
969
1377
  * @param {boolean=} useTime Include time-of-day in the comparison when true.
970
1378
  * @returns Earliest Timestamp object.
1379
+ * @category comparison
971
1380
  */
972
1381
  export declare function minTimestamp(timestamps: Timestamp[], useTime?: boolean): Timestamp;
973
1382
  /**
@@ -977,6 +1386,7 @@ export declare function minTimestamp(timestamps: Timestamp[], useTime?: boolean)
977
1386
  * @param {Timestamp} end Second boundary.
978
1387
  * @param {boolean=} useTime Include time-of-day when ordering boundaries.
979
1388
  * @returns {TimestampRange} Frozen inclusive Timestamp range.
1389
+ * @category ranges
980
1390
  */
981
1391
  export declare function createTimestampRange(start: Timestamp, end: Timestamp, useTime?: boolean): TimestampRange;
982
1392
  /**
@@ -986,6 +1396,7 @@ export declare function createTimestampRange(start: Timestamp, end: Timestamp, u
986
1396
  * @param {TimestampRange} range Inclusive range to test against.
987
1397
  * @param {boolean=} useTime Include time-of-day in the comparison.
988
1398
  * @returns {boolean} True when the timestamp is inside the range.
1399
+ * @category comparison
989
1400
  */
990
1401
  export declare function isTimestampInRange(timestamp: Timestamp, range: TimestampRange, useTime?: boolean): boolean;
991
1402
  /**
@@ -995,6 +1406,7 @@ export declare function isTimestampInRange(timestamp: Timestamp, range: Timestam
995
1406
  * @param {TimestampRange} second Second range.
996
1407
  * @param {boolean=} useTime Include time-of-day in the comparison.
997
1408
  * @returns {boolean} True when the ranges overlap.
1409
+ * @category comparison
998
1410
  */
999
1411
  export declare function isRangeOverlapping(first: TimestampRange, second: TimestampRange, useTime?: boolean): boolean;
1000
1412
  /**
@@ -1004,6 +1416,7 @@ export declare function isRangeOverlapping(first: TimestampRange, second: Timest
1004
1416
  * @param {TimestampRange} second Second range.
1005
1417
  * @param {boolean=} useTime Include time-of-day in the comparison.
1006
1418
  * @returns {TimestampRange | null} Intersected range, or `null` when the ranges do not overlap.
1419
+ * @category ranges
1007
1420
  */
1008
1421
  export declare function intersectRanges(first: TimestampRange, second: TimestampRange, useTime?: boolean): TimestampRange | null;
1009
1422
  /**
@@ -1016,6 +1429,7 @@ export declare function intersectRanges(first: TimestampRange, second: Timestamp
1016
1429
  * @param {TimestampRange[]} ranges Ranges to merge.
1017
1430
  * @param {boolean=} useTime Include time-of-day in the comparison.
1018
1431
  * @returns {TimestampRange[]} Merged ranges sorted by start boundary.
1432
+ * @category ranges
1019
1433
  */
1020
1434
  export declare function mergeRanges(ranges: TimestampRange[], useTime?: boolean): TimestampRange[];
1021
1435
  /**
@@ -1028,6 +1442,7 @@ export declare function mergeRanges(ranges: TimestampRange[], useTime?: boolean)
1028
1442
  * @param {TimestampRange[]} blocked Ranges to remove from the source.
1029
1443
  * @param {boolean=} useTime Include time-of-day in the comparison.
1030
1444
  * @returns {TimestampRange[]} Remaining ranges.
1445
+ * @category ranges
1031
1446
  */
1032
1447
  export declare function subtractRanges(source: TimestampRange, blocked: TimestampRange[], useTime?: boolean): TimestampRange[];
1033
1448
  /**
@@ -1040,6 +1455,7 @@ export declare function subtractRanges(source: TimestampRange, blocked: Timestam
1040
1455
  * @param {TimestampRange[]} occupied Ranges that are not available.
1041
1456
  * @param {boolean=} useTime Include time-of-day in the comparison.
1042
1457
  * @returns {TimestampRange[]} Gap ranges.
1458
+ * @category ranges
1043
1459
  */
1044
1460
  export declare function findRangeGaps(source: TimestampRange, occupied: TimestampRange[], useTime?: boolean): TimestampRange[];
1045
1461
  /**
@@ -1050,6 +1466,7 @@ export declare function findRangeGaps(source: TimestampRange, occupied: Timestam
1050
1466
  * @param {Timestamp} endTimestamp Inclusive end boundary.
1051
1467
  * @param {boolean=} useTime Include time-of-day in the comparison when true.
1052
1468
  * @returns {boolean} True when the timestamp is inside the range.
1469
+ * @category comparison
1053
1470
  */
1054
1471
  export declare function isBetweenDates(timestamp: Timestamp, startTimestamp: Timestamp, endTimestamp: Timestamp, useTime?: boolean): boolean;
1055
1472
  /**
@@ -1060,6 +1477,7 @@ export declare function isBetweenDates(timestamp: Timestamp, startTimestamp: Tim
1060
1477
  * @param {Timestamp} firstTimestamp Start of the second range.
1061
1478
  * @param {Timestamp} lastTimestamp End of the second range.
1062
1479
  * @returns {boolean} True when the ranges overlap.
1480
+ * @category comparison
1063
1481
  */
1064
1482
  export declare function isOverlappingDates(startTimestamp: Timestamp, endTimestamp: Timestamp, firstTimestamp: Timestamp, lastTimestamp: Timestamp): boolean;
1065
1483
  /**
@@ -1116,6 +1534,7 @@ export interface AddToDateOptions {
1116
1534
  * @param {number=} options.second If positive, adds seconds. If negative, removes seconds.
1117
1535
  * @param {number=} options.millisecond If positive, adds milliseconds. If negative, removes milliseconds.
1118
1536
  * @returns {Timestamp} New normalized Timestamp object.
1537
+ * @category arithmetic
1119
1538
  */
1120
1539
  export declare function addToDate(timestamp: Timestamp, options: AddToDateOptions): Timestamp;
1121
1540
  /**
@@ -1140,6 +1559,7 @@ export declare function addToDate(timestamp: Timestamp, options: AddToDateOption
1140
1559
  * @param {number=} options.second If positive, adds seconds. If negative, removes seconds.
1141
1560
  * @param {number=} options.millisecond If positive, adds milliseconds. If negative, removes milliseconds.
1142
1561
  * @returns {Timestamp} New normalized Timestamp object.
1562
+ * @category arithmetic
1143
1563
  */
1144
1564
  export declare function addToDateClamped(timestamp: Timestamp, options: AddToDateOptions): Timestamp;
1145
1565
  /**
@@ -1147,12 +1567,14 @@ export declare function addToDateClamped(timestamp: Timestamp, options: AddToDat
1147
1567
  * @param {Timestamp} ts1 The first Timestamp
1148
1568
  * @param {Timestamp} ts2 The second Timestamp
1149
1569
  * @returns Number of days
1570
+ * @category arithmetic
1150
1571
  */
1151
1572
  export declare function daysBetween(ts1: Timestamp, ts2: Timestamp): number;
1152
1573
  /**
1153
1574
  * Returns number of weeks between two Timestamps
1154
1575
  * @param {Timestamp} ts1 The first Timestamp
1155
1576
  * @param {Timestamp} ts2 The second Timestamp
1577
+ * @category arithmetic
1156
1578
  */
1157
1579
  export declare function weeksBetween(ts1: Timestamp, ts2: Timestamp): number;
1158
1580
  /**
@@ -1160,6 +1582,7 @@ export declare function weeksBetween(ts1: Timestamp, ts2: Timestamp): number;
1160
1582
  *
1161
1583
  * @param {number} milliseconds Signed elapsed milliseconds.
1162
1584
  * @returns {TimestampDuration} Frozen duration object.
1585
+ * @category duration
1163
1586
  */
1164
1587
  export declare function createDuration(milliseconds: number): TimestampDuration;
1165
1588
  /**
@@ -1171,6 +1594,7 @@ export declare function createDuration(milliseconds: number): TimestampDuration;
1171
1594
  * @param {Timestamp} start Start timestamp.
1172
1595
  * @param {Timestamp} end End timestamp.
1173
1596
  * @returns {TimestampDuration} Frozen duration object.
1597
+ * @category duration
1174
1598
  */
1175
1599
  export declare function durationBetween(start: Timestamp, end: Timestamp): TimestampDuration;
1176
1600
  /**
@@ -1183,6 +1607,7 @@ export declare function durationBetween(start: Timestamp, end: Timestamp): Times
1183
1607
  * @param {Timestamp} timestamp Timestamp object to offset.
1184
1608
  * @param {TimestampDuration | number} duration Duration object or signed milliseconds.
1185
1609
  * @returns {Timestamp} Offset Timestamp.
1610
+ * @category duration
1186
1611
  */
1187
1612
  export declare function addDuration(timestamp: Timestamp, duration: TimestampDuration | number): Timestamp;
1188
1613
  /**
@@ -1191,6 +1616,7 @@ export declare function addDuration(timestamp: Timestamp, duration: TimestampDur
1191
1616
  * @param {Timestamp} timestamp Timestamp object to offset.
1192
1617
  * @param {TimestampDuration | number} duration Duration object or signed milliseconds.
1193
1618
  * @returns {Timestamp} Offset Timestamp.
1619
+ * @category duration
1194
1620
  */
1195
1621
  export declare function subtractDuration(timestamp: Timestamp, duration: TimestampDuration | number): Timestamp;
1196
1622
  /**
@@ -1201,6 +1627,7 @@ export declare function subtractDuration(timestamp: Timestamp, duration: Timesta
1201
1627
  * @param {TimestampDuration | number} duration Duration object or signed milliseconds.
1202
1628
  * @param {FormatDurationOptions=} options Formatting options.
1203
1629
  * @returns {string} Formatted duration.
1630
+ * @category duration
1204
1631
  */
1205
1632
  export declare function formatDuration(duration: TimestampDuration | number, options?: FormatDurationOptions): string;
1206
1633
  /**
@@ -1209,6 +1636,7 @@ export declare function formatDuration(duration: TimestampDuration | number, opt
1209
1636
  * @param {Timestamp} timestamp Timestamp object to round.
1210
1637
  * @param {number} minutes Interval size in minutes.
1211
1638
  * @returns {Timestamp} Rounded Timestamp.
1639
+ * @category arithmetic
1212
1640
  */
1213
1641
  export declare function floorToInterval(timestamp: Timestamp, minutes: number): Timestamp;
1214
1642
  /**
@@ -1217,6 +1645,7 @@ export declare function floorToInterval(timestamp: Timestamp, minutes: number):
1217
1645
  * @param {Timestamp} timestamp Timestamp object to round.
1218
1646
  * @param {number} minutes Interval size in minutes.
1219
1647
  * @returns {Timestamp} Rounded Timestamp.
1648
+ * @category arithmetic
1220
1649
  */
1221
1650
  export declare function ceilToInterval(timestamp: Timestamp, minutes: number): Timestamp;
1222
1651
  /**
@@ -1225,6 +1654,7 @@ export declare function ceilToInterval(timestamp: Timestamp, minutes: number): T
1225
1654
  * @param {Timestamp} timestamp Timestamp object to round.
1226
1655
  * @param {number} minutes Interval size in minutes.
1227
1656
  * @returns {Timestamp} Rounded Timestamp.
1657
+ * @category arithmetic
1228
1658
  */
1229
1659
  export declare function roundToInterval(timestamp: Timestamp, minutes: number): Timestamp;
1230
1660
  declare const weekdayDateMap: {
@@ -1252,6 +1682,7 @@ declare const weekdayDateMap: {
1252
1682
  * @param {string} [locale=''] - The locale to use for formatting.
1253
1683
  *
1254
1684
  * @returns {string} The formatted weekday.
1685
+ * @category locale
1255
1686
  */
1256
1687
  export declare function getWeekdayFormatter(): WeekdayFormatter;
1257
1688
  /**
@@ -1260,6 +1691,7 @@ export declare function getWeekdayFormatter(): WeekdayFormatter;
1260
1691
  * @param {string} type Format type: `narrow`, `short`, or `long`.
1261
1692
  * @param {string} locale Locale to use for formatting, such as `en-US`.
1262
1693
  * @returns {string[]} Localized weekday names in Sunday-first order.
1694
+ * @category locale
1263
1695
  */
1264
1696
  export declare function getWeekdayNames(type: string, locale: string): string[];
1265
1697
  /**
@@ -1273,6 +1705,7 @@ export declare function getWeekdayNames(type: string, locale: string): string[];
1273
1705
  * @returns {string} The formatted month name.
1274
1706
  *
1275
1707
  * @throws {Error} If Intl or Intl.DateTimeFormat is not supported in the environment.
1708
+ * @category locale
1276
1709
  */
1277
1710
  export declare function getMonthFormatter(): MonthFormatter;
1278
1711
  /**
@@ -1281,7 +1714,7 @@ export declare function getMonthFormatter(): MonthFormatter;
1281
1714
  * @param {string} type Format type: `narrow`, `short`, or `long`.
1282
1715
  * @param {string} locale Locale to use for formatting, such as `en-US`.
1283
1716
  * @returns {string[]} Localized month names in January-first order.
1717
+ * @category locale
1284
1718
  */
1285
1719
  export declare function getMonthNames(type: string, locale: string): string[];
1286
- export {};
1287
1720
  //# sourceMappingURL=index.d.ts.map