@parischap/conversions 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +50 -49
  2. package/cjs/BigDecimal.js +2 -2
  3. package/cjs/BigInt.js +7 -5
  4. package/cjs/BigInt.js.map +1 -1
  5. package/cjs/DateTime.js +144 -136
  6. package/cjs/DateTime.js.map +1 -1
  7. package/cjs/DateTimeFormat.js +7 -2
  8. package/cjs/DateTimeFormat.js.map +1 -1
  9. package/cjs/DateTimeFormatContext.js +11 -6
  10. package/cjs/DateTimeFormatContext.js.map +1 -1
  11. package/cjs/Email.js +11 -15
  12. package/cjs/Email.js.map +1 -1
  13. package/cjs/Integer.js +33 -23
  14. package/cjs/Integer.js.map +1 -1
  15. package/cjs/NumberBase10Format.js +65 -65
  16. package/cjs/PositiveInteger.js +44 -29
  17. package/cjs/PositiveInteger.js.map +1 -1
  18. package/cjs/PositiveReal.js +34 -24
  19. package/cjs/PositiveReal.js.map +1 -1
  20. package/cjs/Real.js +29 -18
  21. package/cjs/Real.js.map +1 -1
  22. package/cjs/RoundingMode.js +7 -4
  23. package/cjs/RoundingMode.js.map +1 -1
  24. package/cjs/RoundingOption.js +6 -6
  25. package/cjs/RoundingOption.js.map +1 -1
  26. package/cjs/Schema.js +29 -28
  27. package/cjs/Schema.js.map +1 -1
  28. package/cjs/SemVer.js +19 -20
  29. package/cjs/SemVer.js.map +1 -1
  30. package/cjs/Template.js +36 -31
  31. package/cjs/Template.js.map +1 -1
  32. package/cjs/TemplatePart.js +4 -4
  33. package/cjs/TemplateParts.js +3 -2
  34. package/cjs/TemplateParts.js.map +1 -1
  35. package/cjs/TemplatePlaceholder.js +56 -45
  36. package/cjs/TemplatePlaceholder.js.map +1 -1
  37. package/cjs/TemplateSeparator.js +17 -24
  38. package/cjs/TemplateSeparator.js.map +1 -1
  39. package/cjs/internal/Int.js +5 -8
  40. package/cjs/internal/Int.js.map +1 -1
  41. package/cjs/internal/Positive.js +5 -8
  42. package/cjs/internal/Positive.js.map +1 -1
  43. package/dts/BigDecimal.d.ts +2 -2
  44. package/dts/BigDecimal.d.ts.map +1 -1
  45. package/dts/BigInt.d.ts +7 -5
  46. package/dts/BigInt.d.ts.map +1 -1
  47. package/dts/DateTime.d.ts +145 -137
  48. package/dts/DateTime.d.ts.map +1 -1
  49. package/dts/DateTimeFormat.d.ts +7 -2
  50. package/dts/DateTimeFormat.d.ts.map +1 -1
  51. package/dts/DateTimeFormatContext.d.ts +17 -12
  52. package/dts/DateTimeFormatContext.d.ts.map +1 -1
  53. package/dts/Email.d.ts +16 -13
  54. package/dts/Email.d.ts.map +1 -1
  55. package/dts/Integer.d.ts +43 -21
  56. package/dts/Integer.d.ts.map +1 -1
  57. package/dts/NumberBase10Format.d.ts +68 -68
  58. package/dts/PositiveInteger.d.ts +54 -27
  59. package/dts/PositiveInteger.d.ts.map +1 -1
  60. package/dts/PositiveReal.d.ts +44 -22
  61. package/dts/PositiveReal.d.ts.map +1 -1
  62. package/dts/Real.d.ts +39 -16
  63. package/dts/Real.d.ts.map +1 -1
  64. package/dts/RoundingMode.d.ts +6 -3
  65. package/dts/RoundingMode.d.ts.map +1 -1
  66. package/dts/RoundingOption.d.ts +6 -6
  67. package/dts/Schema.d.ts +32 -33
  68. package/dts/Schema.d.ts.map +1 -1
  69. package/dts/SemVer.d.ts +25 -13
  70. package/dts/SemVer.d.ts.map +1 -1
  71. package/dts/Template.d.ts +30 -29
  72. package/dts/Template.d.ts.map +1 -1
  73. package/dts/TemplatePart.d.ts +4 -4
  74. package/dts/TemplateParts.d.ts +4 -3
  75. package/dts/TemplateParts.d.ts.map +1 -1
  76. package/dts/TemplatePlaceholder.d.ts +56 -44
  77. package/dts/TemplatePlaceholder.d.ts.map +1 -1
  78. package/dts/TemplateSeparator.d.ts +9 -51
  79. package/dts/TemplateSeparator.d.ts.map +1 -1
  80. package/dts/internal/Int.d.ts +0 -4
  81. package/dts/internal/Int.d.ts.map +1 -1
  82. package/dts/internal/Positive.d.ts +0 -4
  83. package/dts/internal/Positive.d.ts.map +1 -1
  84. package/esm/BigDecimal.js +2 -2
  85. package/esm/BigInt.js +7 -5
  86. package/esm/BigInt.js.map +1 -1
  87. package/esm/DateTime.js +144 -136
  88. package/esm/DateTime.js.map +1 -1
  89. package/esm/DateTimeFormat.js +7 -2
  90. package/esm/DateTimeFormat.js.map +1 -1
  91. package/esm/DateTimeFormatContext.js +11 -6
  92. package/esm/DateTimeFormatContext.js.map +1 -1
  93. package/esm/Email.js +10 -13
  94. package/esm/Email.js.map +1 -1
  95. package/esm/Integer.js +33 -23
  96. package/esm/Integer.js.map +1 -1
  97. package/esm/NumberBase10Format.js +65 -65
  98. package/esm/PositiveInteger.js +44 -29
  99. package/esm/PositiveInteger.js.map +1 -1
  100. package/esm/PositiveReal.js +34 -24
  101. package/esm/PositiveReal.js.map +1 -1
  102. package/esm/Real.js +29 -18
  103. package/esm/Real.js.map +1 -1
  104. package/esm/RoundingMode.js +6 -3
  105. package/esm/RoundingMode.js.map +1 -1
  106. package/esm/RoundingOption.js +6 -6
  107. package/esm/RoundingOption.js.map +1 -1
  108. package/esm/Schema.js +33 -34
  109. package/esm/Schema.js.map +1 -1
  110. package/esm/SemVer.js +18 -18
  111. package/esm/SemVer.js.map +1 -1
  112. package/esm/Template.js +36 -31
  113. package/esm/Template.js.map +1 -1
  114. package/esm/TemplatePart.js +4 -4
  115. package/esm/TemplateParts.js +3 -2
  116. package/esm/TemplateParts.js.map +1 -1
  117. package/esm/TemplatePlaceholder.js +55 -44
  118. package/esm/TemplatePlaceholder.js.map +1 -1
  119. package/esm/TemplateSeparator.js +16 -24
  120. package/esm/TemplateSeparator.js.map +1 -1
  121. package/esm/internal/Int.js +5 -7
  122. package/esm/internal/Int.js.map +1 -1
  123. package/esm/internal/Positive.js +5 -7
  124. package/esm/internal/Positive.js.map +1 -1
  125. package/package.json +2 -2
package/dts/DateTime.d.ts CHANGED
@@ -1,21 +1,22 @@
1
1
  /**
2
- * This module implements an immutable DateTime object.
2
+ * This module implements an immutable `CVDateTime` object.
3
3
  *
4
- * DateTime objects keep an internal state. But all provided functions look pure insofar as they
5
- * will always yield the same result whatever the state the object is in. The state is only used to
4
+ * `CVDateTime` objects keep an internal state. But all provided functions are pure insofar as they
5
+ * always yield the same result whatever the state the object is in. The state is only used to
6
6
  * improve performance but does not alter the results.
7
7
  *
8
- * Unlike the Javascript Date objects and the Effect DateTime objects, DateTime objects handle both
9
- * the Gregorian and Iso calendars. So you can easily get/set the iso year and iso week of a
10
- * DateTime object.
8
+ * Unlike the Javascript `Date` objects and the Effect `DateTime` objects, `CVDateTime` objects
9
+ * handle both the Gregorian and Iso calendars. So you can easily get/set the iso year and iso week
10
+ * of a `CVDateTime` object.
11
11
  *
12
- * A DateTime object has a `zoneOffset` which is the difference in hours between the time in the
13
- * local zone and UTC time (e.g zoneOffset=1 for timezone +1:00). All the data in a DateTime object
14
- * is `zoneOffset-dependent`, except `timestamp`. An important thing to note is that a DateTime
15
- * object with a timestamp t and a zoneOffset zo has exactly the same date parts (year, ordinalDay,
16
- * month, monthDay, isoYear...) as a DateTime object with a timestamp t+zox3600 and a 0 zoneOffset.
17
- * That's the reason for the _zonedTimestamp field which is equal to t+zox3600. All calculations are
18
- * performed UTC using _zonedTimestamp instead of timestamp.
12
+ * A `CVDateTime` object has a `zoneOffset` which is the difference in hours between the time in the
13
+ * local zone and UTC time (e.g `zoneOffset=1` for timezone +1:00). All the data in a `CVDateTime`
14
+ * object is `zoneOffset-dependent`, except `timestamp`. An important thing to note is that a
15
+ * `CVDateTime` object with a timestamp `t` and a zoneOffset `zo` has exactly the same date parts
16
+ * (`year`, `ordinalDay`, `month`, `monthDay`, `isoYear`...) as a `CVDateTime` object with
17
+ * `timestamp = t+zox3600` and `zoneOffset = 0`. That's the reason for the _zonedTimestamp field
18
+ * which is equal to `t+zox3600`. All calculations are performed UTC using _zonedTimestamp instead
19
+ * of timestamp.
19
20
  */
20
21
  import { MInputError, MInspectable, MTypes } from '@parischap/effect-lib';
21
22
  import { DateTime, Either, Equal, Equivalence, Inspectable, Option, Pipeable, Predicate } from 'effect';
@@ -209,7 +210,7 @@ declare namespace GregorianDate {
209
210
  /**
210
211
  * Returns the `yearIsLeap` property of `self`
211
212
  *
212
- * @category Destructors
213
+ * @category Predicates
213
214
  */
214
215
  export const yearIsLeap: Predicate.Predicate<Type>;
215
216
  /**
@@ -280,22 +281,22 @@ declare namespace GregorianDate {
280
281
  */
281
282
  declare namespace IsoDate {
282
283
  /**
283
- * Type of an IsoYearDescriptor
284
+ * Type of an IsoDate
284
285
  *
285
286
  * @category Models
286
287
  */
287
288
  interface Type extends Inspectable.Inspectable, Pipeable.Pipeable {
288
289
  /** Timestamp of any moment of the day represented by this IsoDate */
289
290
  readonly timestamp: number;
290
- /** The iso year of this IsoDate, range: [MIN_FULL_YEAR, MAX_FULL_YEAR] */
291
+ /** The Iso year of this IsoDate, range: [MIN_FULL_YEAR, MAX_FULL_YEAR] */
291
292
  readonly year: number;
292
293
  /** If true, iso year `year` counts 53 weeks. Otherwise, it counts 52 weeks */
293
294
  readonly yearIsLong: boolean;
294
295
  /** Timestamp of the first millisecond of UTC iso year `year` */
295
296
  readonly yearStartTimestamp: number;
296
- /** The iso week of this IsoYear, range:[1, 53] */
297
+ /** The Iso week of this IsoDate, range:[1, 53] */
297
298
  readonly isoWeek: Option.Option<number>;
298
- /** The weekday of this DateTime, range:[1, 7], 1 is monday, 7 is sunday */
299
+ /** The weekday of this IsoDate, range:[1, 7], 1 is monday, 7 is sunday */
299
300
  readonly weekday: Option.Option<number>;
300
301
  }
301
302
  /**
@@ -362,7 +363,7 @@ declare namespace IsoDate {
362
363
  /**
363
364
  * Returns the `yearIsLong` property of `self`
364
365
  *
365
- * @category Destructors
366
+ * @category Predicates
366
367
  */
367
368
  const yearIsLong: Predicate.Predicate<Type>;
368
369
  /**
@@ -655,9 +656,9 @@ export declare const equivalence: Equivalence.Equivalence<Type>;
655
656
  */
656
657
  export declare const getIsoString: (self: Type) => string;
657
658
  /**
658
- * Tries to build a DateTime from `timestamp`, the number of milliseconds since 1/1/1970
659
+ * Tries to build a `CVDateTime` from `timestamp`, the number of milliseconds since 1/1/1970
659
660
  * 00:00:00:000+0:00, and `zoneOffset` which gives the offset between the local time and the UTC
660
- * time. Returns a `right` of a DateTime if successful.
661
+ * time. Returns a `Right` if successful, a `Left` otherwise.
661
662
  *
662
663
  * `timestamp` must be greater than or equal to MIN_TIMESTAMP and less than or equal to
663
664
  * MAX_TIMESTAMP.
@@ -689,7 +690,7 @@ export declare const fromTimestamp: (timestamp: number, zoneOffset?: number | {
689
690
  readonly zoneSecond: number;
690
691
  }) => Either.Either<Type, MInputError.Type>;
691
692
  /**
692
- * Same as fromTimestamp but returns directly the DateTime or throws if it cannot be built
693
+ * Same as `fromTimestamp` but returns directly a `CVDateTime` or throws if it cannot be built
693
694
  *
694
695
  * @category Constructors
695
696
  */
@@ -699,7 +700,7 @@ export declare const fromTimestampOrThrow: (timestamp: number, zoneOffset?: numb
699
700
  readonly zoneSecond: number;
700
701
  }) => Type;
701
702
  /**
702
- * Builds a DateTime using Date.now() as timestamp. `zoneOffset` is set to 0.
703
+ * Builds a `CVDateTime` using Date.now() as `timestamp`. `zoneOffset` is set to 0.
703
704
  *
704
705
  * @category Constructors
705
706
  */
@@ -756,8 +757,8 @@ export declare namespace Parts {
756
757
  }
757
758
  }
758
759
  /**
759
- * Tries to build a DateTime from the provided DateTime parts. Returns a `right` of this DateTime if
760
- * successful. Returns a `left` of an error otherwise.
760
+ * Tries to build a `CVDateTime` from the provided parts. Returns a `Right` if successful, a `Left`
761
+ * otherwise.
761
762
  *
762
763
  * `year` must comprised in the range [MIN_FULL_YEAR, MAX_FULL_YEAR]. `ordinalDay` must be greater
763
764
  * than or equal to 1 and less than or equal to the number of days in the current year. `month` must
@@ -831,31 +832,31 @@ export declare namespace Parts {
831
832
  */
832
833
  export declare const fromParts: ({ year, ordinalDay, month, monthDay, isoYear, isoWeek, weekday, hour23, hour11, meridiem, minute, second, millisecond, zoneOffset, zoneHour, zoneMinute, zoneSecond }: Parts.Type) => Either.Either<Type, MInputError.Type>;
833
834
  /**
834
- * Same as fromParts but returns directly the DateTime or throws if it cannot be built
835
+ * Same as `fromParts` but returns directly a `CVDateTime` or throws if it cannot be built
835
836
  *
836
837
  * @category Constructors
837
838
  */
838
839
  export declare const fromPartsOrThrow: (parts: Parts.Type) => Type;
839
840
  /**
840
- * Builds a CVDateTime from a Javascript Date
841
+ * Builds a `CVDateTime` from a Javascript `Date`
841
842
  *
842
843
  * @category Constructors
843
844
  */
844
845
  export declare const fromDate: (date: Date) => Type;
845
846
  /**
846
- * Builds a CVDateTime from an Effect DateTime
847
+ * Builds a `CVDateTime` from an `Effect.DateTime.Zoned`
847
848
  *
848
849
  * @category Constructors
849
850
  */
850
851
  export declare const fromEffectDateTime: (date: DateTime.Zoned) => Type;
851
852
  /**
852
- * Builds a Javascript Date from a CVDateTime
853
+ * Builds a Javascript `Date` from a `CVDateTime`
853
854
  *
854
855
  * @category Conversions
855
856
  */
856
857
  export declare const toDate: (self: Type) => Date;
857
858
  /**
858
- * Builds an Effect DateTime from a CVDateTime
859
+ * Builds an `Effect.DateTime.Zoned` from a `CVDateTime`
859
860
  *
860
861
  * @category Conversions
861
862
  */
@@ -872,13 +873,6 @@ export declare const timestamp: MTypes.OneArgFunction<Type, number>;
872
873
  * @category Getters
873
874
  */
874
875
  export declare const getYear: MTypes.OneArgFunction<Type, number>;
875
- /**
876
- * Returns true if the (Gregorian) year of `self` for the given time zone is a leap year. Returns
877
- * false otherwise
878
- *
879
- * @category Getters
880
- */
881
- export declare const yearIsLeap: MTypes.OneArgFunction<Type, boolean>;
882
876
  /**
883
877
  * Returns the ordinalDay of `self` for the given time zone
884
878
  *
@@ -903,13 +897,6 @@ export declare const getMonthDay: MTypes.OneArgFunction<Type, number>;
903
897
  * @category Getters
904
898
  */
905
899
  export declare const getIsoYear: MTypes.OneArgFunction<Type, number>;
906
- /**
907
- * Returns true if the isoYear of `self` for the given time zone is a long year. Returns false
908
- * otherwise
909
- *
910
- * @category Getters
911
- */
912
- export declare const isoYearIsLong: MTypes.OneArgFunction<Type, boolean>;
913
900
  /**
914
901
  * Returns the isoWeek of `self` for the given time zone
915
902
  *
@@ -977,53 +964,53 @@ export declare const getZoneMinute: MTypes.OneArgFunction<Type, number>;
977
964
  */
978
965
  export declare const getZoneSecond: MTypes.OneArgFunction<Type, number>;
979
966
  /**
980
- * If possible, returns a right of a DateTime having year `year` and the same `month`, `monthDay`,
981
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of an
982
- * error otherwise. `year` must be an integer comprised in the range [MIN_FULL_YEAR,
967
+ * If possible, returns a `Right` of a `CVDateTime` having year `year` and the same `month`,
968
+ * `monthDay`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
969
+ * `Left` otherwise. `year` must be an integer comprised in the range [MIN_FULL_YEAR,
983
970
  * MAX_FULL_YEAR].
984
971
  *
985
972
  * @category Setters
986
973
  */
987
974
  export declare const setYear: (year: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
988
975
  /**
989
- * Same as setYear but returns directly a DateTime or throws in case of an error
976
+ * Same as `setYear` but returns directly a `CVDateTime` or throws in case of an error
990
977
  *
991
978
  * @category Setters
992
979
  */
993
980
  export declare const setYearOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
994
981
  /**
995
- * If possible, returns a right of a DateTime having ordinalDay `ordinalDay` and the same `year`,
996
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of an
997
- * error otherwise. `ordinalDay` must be an integer greater than or equal to 1 and less than or
998
- * equal to the number of days in the current year
982
+ * If possible, returns a `Right` of a `CVDateTime` having ordinalDay `ordinalDay` and the same
983
+ * `year`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left`
984
+ * of an error otherwise. `ordinalDay` must be an integer greater than or equal to 1 and less than
985
+ * or equal to the number of days in the current year
999
986
  *
1000
987
  * @category Setters
1001
988
  */
1002
989
  export declare const setOrdinalDay: (ordinalDay: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1003
990
  /**
1004
- * Same as setOrdinalDay but returns directly a DateTime or throws in case of an error
991
+ * Same as `setOrdinalDay` but returns directly a `CVDateTime` or throws in case of an error
1005
992
  *
1006
993
  * @category Setters
1007
994
  */
1008
995
  export declare const setOrdinalDayOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1009
996
  /**
1010
- * If possible, returns a right of a DateTime having month `month` and the same `year`, `monthDay`,
1011
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of an
1012
- * error otherwise. `month` must be an integer greater than or equal to 1 (January) and less than or
1013
- * equal to 12 (December)
997
+ * If possible, returns a `Right` of a `CVDateTime` having month `month` and the same `year`,
998
+ * `monthDay`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
999
+ * `Left` of an error otherwise. `month` must be an integer greater than or equal to 1 (January) and
1000
+ * less than or equal to 12 (December)
1014
1001
  *
1015
1002
  * @category Setters
1016
1003
  */
1017
1004
  export declare const setMonth: (month: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1018
1005
  /**
1019
- * Same as setMonth but returns directly a DateTime or throws in case of an error
1006
+ * Same as `setMonth` but returns directly a `CVDateTime` or throws in case of an error
1020
1007
  *
1021
1008
  * @category Setters
1022
1009
  */
1023
1010
  export declare const setMonthOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1024
1011
  /**
1025
- * If possible, returns a right of a DateTime having monthDay `monthDay` and the same `year`,
1026
- * `month`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left`
1012
+ * If possible, returns a `Right` of a `CVDateTime` having monthDay `monthDay` and the same `year`,
1013
+ * `month`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left`
1027
1014
  * of an error otherwise. `monthDay` must be an integer greater than or equal to 1 and less than or
1028
1015
  * equal to the number of days in the current month.
1029
1016
  *
@@ -1031,59 +1018,59 @@ export declare const setMonthOrThrow: MTypes.OneArgFunction<number, MTypes.OneAr
1031
1018
  */
1032
1019
  export declare const setMonthDay: (monthDay: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1033
1020
  /**
1034
- * Same as setMonthDay but returns directly a DateTime or throws in case of an error
1021
+ * Same as `setMonthDay` but returns directly a `CVDateTime` or throws in case of an error
1035
1022
  *
1036
1023
  * @category Setters
1037
1024
  */
1038
1025
  export declare const setMonthDayOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1039
1026
  /**
1040
- * If possible, returns a right of a DateTime having isoYear `isoYear` and the same `isoWeek`,
1027
+ * If possible, returns a `Right` of a `CVDateTime` having isoYear `isoYear` and the same `isoWeek`,
1041
1028
  * `weekday`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1042
- * `left` of an error otherwise. `isoYear` must be an integer comprised in the range [MIN_FULL_YEAR,
1029
+ * `Left` of an error otherwise. `isoYear` must be an integer comprised in the range [MIN_FULL_YEAR,
1043
1030
  * MAX_FULL_YEAR].
1044
1031
  *
1045
1032
  * @category Setters
1046
1033
  */
1047
1034
  export declare const setIsoYear: (isoYear: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1048
1035
  /**
1049
- * Same as setIsoYear but returns directly a DateTime or throws in case of an error
1036
+ * Same as `setIsoYear` but returns directly a `CVDateTime` or throws in case of an error
1050
1037
  *
1051
1038
  * @category Setters
1052
1039
  */
1053
1040
  export declare const setIsoYearOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1054
1041
  /**
1055
- * If possible, returns a right of a DateTime having isoWeek `isoWeek` and the same `isoYear`,
1042
+ * If possible, returns a Right of a `CVDateTime` having isoWeek `isoWeek` and the same `isoYear`,
1056
1043
  * `weekday`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1057
- * `left` of an error otherwise. `isoWeek` must be an integer greater than or equal to 1 and less
1044
+ * `Left` of an error otherwise. `isoWeek` must be an integer greater than or equal to 1 and less
1058
1045
  * than or equal to the number of iso weeks in the current year.
1059
1046
  *
1060
1047
  * @category Setters
1061
1048
  */
1062
1049
  export declare const setIsoWeek: (isoWeek: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1063
1050
  /**
1064
- * Same as setIsoWeek but returns directly a DateTime or throws in case of an error
1051
+ * Same as `setIsoWeek` but returns directly a `CVDateTime` or throws in case of an error
1065
1052
  *
1066
1053
  * @category Setters
1067
1054
  */
1068
1055
  export declare const setIsoWeekOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1069
1056
  /**
1070
- * If possible, returns a right of a DateTime having weekday `weekday` and the same `isoYear`,
1057
+ * If possible, returns a `Right` of a `CVDateTime` having weekday `weekday` and the same `isoYear`,
1071
1058
  * `isoWeek`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1072
- * `left` of an error otherwise. `weekday` must be an integer greater than or equal to 1 (monday)
1059
+ * `Left` of an error otherwise. `weekday` must be an integer greater than or equal to 1 (monday)
1073
1060
  * and less than or equal to 7 (sunday).
1074
1061
  *
1075
1062
  * @category Setters
1076
1063
  */
1077
1064
  export declare const setWeekday: (weekday: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1078
1065
  /**
1079
- * Same as setWeekday but returns directly a DateTime or throws in case of an error
1066
+ * Same as `setWeekday` but returns directly a `CVDateTime` or throws in case of an error
1080
1067
  *
1081
1068
  * @category Setters
1082
1069
  */
1083
1070
  export declare const setWeekdayOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1084
1071
  /**
1085
- * If possible, returns a right of a DateTime having hour23 `hour23` and the same `year`,
1086
- * `ordinalDay`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of
1072
+ * If possible, returns a `Right` of a `CVDateTime` having hour23 `hour23` and the same `year`,
1073
+ * `ordinalDay`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left` of
1087
1074
  * an error otherwise. `hour23` must be an integer greater than or equal to 0 and less than or equal
1088
1075
  * to 23
1089
1076
  *
@@ -1091,36 +1078,36 @@ export declare const setWeekdayOrThrow: MTypes.OneArgFunction<number, MTypes.One
1091
1078
  */
1092
1079
  export declare const setHour23: (hour23: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1093
1080
  /**
1094
- * Same as setHour23 but returns directly a DateTime or throws in case of an error
1081
+ * Same as `setHour23` but returns directly a `CVDateTime` or throws in case of an error
1095
1082
  *
1096
1083
  * @category Setters
1097
1084
  */
1098
1085
  export declare const setHour23OrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1099
1086
  /**
1100
- * If possible, returns a right of a DateTime having hour11 `hour11` and the same `year`,
1087
+ * If possible, returns a Right of a `CVDateTime` having hour11 `hour11` and the same `year`,
1101
1088
  * `ordinalDay`, `meridiem`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1102
- * `left` of an error otherwise. `hour11` must be an integer greater than or equal to 0 and less
1089
+ * `Left` of an error otherwise. `hour11` must be an integer greater than or equal to 0 and less
1103
1090
  * than or equal to 11.
1104
1091
  *
1105
1092
  * @category Setters
1106
1093
  */
1107
1094
  export declare const setHour11: (hour11: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1108
1095
  /**
1109
- * Same as setHour11 but returns directly a DateTime or throws in case of an error
1096
+ * Same as `setHour11` but returns directly a `CVDateTime` or throws in case of an error
1110
1097
  *
1111
1098
  * @category Setters
1112
1099
  */
1113
1100
  export declare const setHour11OrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1114
1101
  /**
1115
- * Returns a DateTime having meridiem `meridiem` and the same `year`, `ordinalDay`, `hour11`,
1102
+ * Returns a `CVDateTime` having meridiem `meridiem` and the same `year`, `ordinalDay`, `hour11`,
1116
1103
  * `minute`, `second`, `millisecond` and `zoneOffset` as `self`
1117
1104
  *
1118
1105
  * @category Setters
1119
1106
  */
1120
1107
  export declare const setMeridiem: (meridiem: 0 | 12) => (self: Type) => Type;
1121
1108
  /**
1122
- * If possible, returns a right of a DateTime having minute `minute` and the same `year`,
1123
- * `ordinalDay`, `hour23`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of
1109
+ * If possible, returns a `Right` of a `CVDateTime` having minute `minute` and the same `year`,
1110
+ * `ordinalDay`, `hour23`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left` of
1124
1111
  * an error otherwise. `minute` must be an integer greater than or equal to 0 and less than or equal
1125
1112
  * to 59
1126
1113
  *
@@ -1128,14 +1115,14 @@ export declare const setMeridiem: (meridiem: 0 | 12) => (self: Type) => Type;
1128
1115
  */
1129
1116
  export declare const setMinute: (minute: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1130
1117
  /**
1131
- * Same as setMinute but returns directly a DateTime or throws in case of an error
1118
+ * Same as `setMinute` but returns directly a `CVDateTime` or throws in case of an error
1132
1119
  *
1133
1120
  * @category Setters
1134
1121
  */
1135
1122
  export declare const setMinuteOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1136
1123
  /**
1137
- * If possible, returns a right of a DateTime having second `second` and the same `year`,
1138
- * `ordinalDay`, `hour23`, `minute`, `millisecond` and `zoneOffset` as `self`. Returns a `left` of
1124
+ * If possible, returns a Right of a `CVDateTime` having second `second` and the same `year`,
1125
+ * `ordinalDay`, `hour23`, `minute`, `millisecond` and `zoneOffset` as `self`. Returns a `Left` of
1139
1126
  * an error otherwise. `second` must be an integer greater than or equal to 0 and less than or equal
1140
1127
  * to 59
1141
1128
  *
@@ -1143,29 +1130,29 @@ export declare const setMinuteOrThrow: MTypes.OneArgFunction<number, MTypes.OneA
1143
1130
  */
1144
1131
  export declare const setSecond: (second: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1145
1132
  /**
1146
- * Same as setSecond but returns directly a DateTime or throws in case of an error
1133
+ * Same as `setSecond` but returns directly a `CVDateTime` or throws in case of an error
1147
1134
  *
1148
1135
  * @category Setters
1149
1136
  */
1150
1137
  export declare const setSecondOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1151
1138
  /**
1152
- * If possible, returns a right of a DateTime having millisecond `millisecond` and the same `year`,
1153
- * `ordinalDay`, `hour23`, `minute`, `second` and `zoneOffset` as `self`. Returns a `left` of an
1154
- * error otherwise. `millisecond` must be an integer greater than or equal to 0 and less than or
1155
- * equal to 999.
1139
+ * If possible, returns a `Right` of a `CVDateTime` having millisecond `millisecond` and the same
1140
+ * `year`, `ordinalDay`, `hour23`, `minute`, `second` and `zoneOffset` as `self`. Returns a `Left`
1141
+ * of an error otherwise. `millisecond` must be an integer greater than or equal to 0 and less than
1142
+ * or equal to 999.
1156
1143
  *
1157
1144
  * @category Setters
1158
1145
  */
1159
1146
  export declare const setMillisecond: (millisecond: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1160
1147
  /**
1161
- * Same as setMillisecond but returns directly a DateTime or throws in case of an error
1148
+ * Same as `setMillisecond` but returns directly a `CVDateTime` or throws in case of an error
1162
1149
  *
1163
1150
  * @category Setters
1164
1151
  */
1165
1152
  export declare const setMillisecondOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1166
1153
  /**
1167
- * If possible, returns a right of a copy of `self` with the same timestamp and zoneOffset set to
1168
- * `zoneOffset`.
1154
+ * If possible, returns a `Right` of a copy of `self` with the same `timestamp` and zoneOffset set
1155
+ * to `zoneOffset`.
1169
1156
  *
1170
1157
  * If `zoneOffset` is omitted, the local time zone offset of the machine this code is running on is
1171
1158
  * used.
@@ -1190,7 +1177,8 @@ export declare const setZoneOffsetKeepTimestamp: (zoneOffset?: number | {
1190
1177
  readonly zoneSecond: number;
1191
1178
  }) => MTypes.OneArgFunction<Type, Either.Either<Type, MInputError.Type>>;
1192
1179
  /**
1193
- * Same as setZoneOffsetKeepTimestamp but returns directly a DateTime or throws in case of an error
1180
+ * Same as `setZoneOffsetKeepTimestamp` but returns directly a `CVDateTime` or throws in case of an
1181
+ * error
1194
1182
  *
1195
1183
  * @category Setters
1196
1184
  */
@@ -1200,10 +1188,10 @@ export declare const setZoneOffsetKeepTimestampOrThrow: MTypes.OneArgFunction<nu
1200
1188
  readonly zoneSecond: number;
1201
1189
  }, MTypes.OneArgFunction<Type>>;
1202
1190
  /**
1203
- * If possible, returns a right of a copy of `self` with the same CVDateTime.Parts (except
1204
- * zoneOffset) and zoneOffset set to `zoneOffset`.
1191
+ * If possible, returns a `Right` of a copy of `self` with the same parts (except `zoneOffset`) and
1192
+ * zoneOffset set to `zoneOffset`.
1205
1193
  *
1206
- * See setZoneOffsetKeepTimestamp for more details
1194
+ * See `setZoneOffsetKeepTimestamp` for more details
1207
1195
  *
1208
1196
  * @category Setters
1209
1197
  */
@@ -1213,7 +1201,8 @@ export declare const setZoneOffsetKeepParts: (zoneOffset?: number | {
1213
1201
  readonly zoneSecond: number;
1214
1202
  }) => MTypes.OneArgFunction<Type, Either.Either<Type, MInputError.Type>>;
1215
1203
  /**
1216
- * Same as setZoneOffsetKeepTimestamp but returns directly a DateTime or throws in case of an error
1204
+ * Same as `setZoneOffsetKeepTimestamp` but returns directly a `CVDateTime` or throws in case of an
1205
+ * error
1217
1206
  *
1218
1207
  * @category Setters
1219
1208
  */
@@ -1223,37 +1212,51 @@ export declare const setZoneOffsetKeepPartsOrThrow: MTypes.OneArgFunction<number
1223
1212
  readonly zoneSecond: number;
1224
1213
  }, MTypes.OneArgFunction<Type>>;
1225
1214
  /**
1226
- * Returns true if self is the first day of a month in the given timezone
1215
+ * Returns true if the (Gregorian) year of `self` for the given time zone is a leap year. Returns
1216
+ * false otherwise
1217
+ *
1218
+ * @category Predicates
1219
+ */
1220
+ export declare const yearIsLeap: Predicate.Predicate<Type>;
1221
+ /**
1222
+ * Returns true if the isoYear of `self` for the given time zone is a long year. Returns false
1223
+ * otherwise
1224
+ *
1225
+ * @category Predicates
1226
+ */
1227
+ export declare const isoYearIsLong: Predicate.Predicate<Type>;
1228
+ /**
1229
+ * Returns true if `self` is the first day of a month in the given timezone
1227
1230
  *
1228
1231
  * @category Predicates
1229
1232
  */
1230
1233
  export declare const isFirstMonthDay: Predicate.Predicate<Type>;
1231
1234
  /**
1232
- * Returns true if self is the last day of a month in the given timezone
1235
+ * Returns true if `self` is the last day of a month in the given timezone
1233
1236
  *
1234
1237
  * @category Predicates
1235
1238
  */
1236
1239
  export declare const isLastMonthDay: Predicate.Predicate<Type>;
1237
1240
  /**
1238
- * Returns true if self is the first day of a year in the given timezone
1241
+ * Returns true if `self` is the first day of a year in the given timezone
1239
1242
  *
1240
1243
  * @category Predicates
1241
1244
  */
1242
1245
  export declare const isFirstYearDay: Predicate.Predicate<Type>;
1243
1246
  /**
1244
- * Returns true if self is the last day of a year in the given timezone
1247
+ * Returns true if `self` is the last day of a year in the given timezone
1245
1248
  *
1246
1249
  * @category Predicates
1247
1250
  */
1248
1251
  export declare const isLastYearDay: Predicate.Predicate<Type>;
1249
1252
  /**
1250
- * Returns true if self is the first day of an iso year in the given timezone
1253
+ * Returns true if `self` is the first day of an iso year in the given timezone
1251
1254
  *
1252
1255
  * @category Predicates
1253
1256
  */
1254
1257
  export declare const isFirstIsoYearDay: Predicate.Predicate<Type>;
1255
1258
  /**
1256
- * Returns true if self is the last day of an iso year in the given timezone
1259
+ * Returns true if `self` is the last day of an iso year in the given timezone
1257
1260
  *
1258
1261
  * @category Predicates
1259
1262
  */
@@ -1310,111 +1313,116 @@ export declare const toLastIsoYearWeek: (self: Type) => Type;
1310
1313
  */
1311
1314
  export declare const toLastIsoYearDay: (self: Type) => Type;
1312
1315
  /**
1313
- * If possible, returns a copy of `self` offset by `offset` years and having the same `month`,
1314
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. If `respectMonthEnd` is
1315
- * true and `self` is on the last day of a month, the new DateTime object's monthDay will be the
1316
- * last of the target month. Otherwise, it will be the same as `self`'s. Returns a `left` of an
1317
- * error otherwise.
1316
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` years and having the same
1317
+ * `month`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left`
1318
+ * of an error otherwise. If `respectMonthEnd` is true and `self` is on the last day of a month, the
1319
+ * new DateTime object's monthDay will be the last of the target month. Otherwise, it will be the
1320
+ * same as `self`
1318
1321
  *
1319
1322
  * @category Offsetters
1320
1323
  */
1321
1324
  export declare const offsetYears: (offset: number, respectMonthEnd: boolean) => MTypes.OneArgFunction<Type, Either.Either<Type, MInputError.Type>>;
1322
1325
  /**
1323
- * Same as offsetYears but returns directly a DateTime or throws in case of an error
1326
+ * Same as `offsetYears` but returns directly a `CVDateTime` or throws in case of an error
1324
1327
  *
1325
- * @category Setters
1328
+ * @category Offsetters
1326
1329
  */
1327
1330
  export declare const offsetYearsOrThrow: (offset: number, respectMonthEnd: boolean) => MTypes.OneArgFunction<Type>;
1328
1331
  /**
1329
- * If possible, returns a copy of `self` offset by `offset` months and having the same `hour23`,
1330
- * `minute`, `second`, `millisecond` and `zoneOffset` as `self`. If `respectMonthEnd` is true and
1331
- * `self` is on the last day of a month, the new DateTime object's monthDay will be the last of the
1332
- * target month. Otherwise, it will be the same as `self`'s. Returns a `left` of an error if the
1333
- * DateTime object can
1332
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` months and having the same
1333
+ * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a `Left` of an
1334
+ * error otherwise. If `respectMonthEnd` is true and `self` is on the last day of a month, the new
1335
+ * DateTime object's monthDay will be the last of the target month. Otherwise, it will be the same
1336
+ * as `self`'s
1334
1337
  *
1335
1338
  * @category Offsetters
1336
1339
  */
1337
1340
  export declare const offsetMonths: (offset: number, respectMonthEnd: boolean) => (self: Type) => Either.Either<Type, MInputError.Type>;
1338
1341
  /**
1339
- * Same as offsetMonths but returns directly a DateTime or throws in case of an error
1342
+ * Same as `offsetMonths` but returns directly a `CVDateTime` or throws in case of an error
1340
1343
  *
1341
- * @category Setters
1344
+ * @category Offsetters
1342
1345
  */
1343
1346
  export declare const offsetMonthsOrThrow: (offset: number, respectMonthEnd: boolean) => MTypes.OneArgFunction<Type>;
1344
1347
  /**
1345
- * Returns a copy of `self` offset by `offset` days
1348
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` days. Returns a `Left` of
1349
+ * an error otherwise.
1346
1350
  *
1347
1351
  * @category Offsetters
1348
1352
  */
1349
1353
  export declare const offsetDays: (offset: number) => MTypes.OneArgFunction<Type, Either.Either<Type, MInputError.Type>>;
1350
1354
  /**
1351
- * Same as offsetDays but returns directly a DateTime or throws in case of an error
1355
+ * Same as `offsetDays` but returns directly a `CVDateTime` or throws in case of an error
1352
1356
  *
1353
- * @category Setters
1357
+ * @category Offsetters
1354
1358
  */
1355
1359
  export declare const offsetDaysOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1356
1360
  /**
1357
- * If possible, returns a copy of `self` offset by `offset` iso years and having the same `weekday`,
1358
- * `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. If `respectYearEnd` is
1359
- * true and `self` is on the last day of an iso year, the new DateTime object's isoWeek will be the
1360
- * last of the target iso year. Otherwise, it will be the same as `self`'s. Returns a `left` of an
1361
- * error otherwise.
1361
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` iso years and having the
1362
+ * same `weekday`, `hour23`, `minute`, `second`, `millisecond` and `zoneOffset` as `self`. Returns a
1363
+ * `Left` of an error otherwise. If `respectYearEnd` is true and `self` is on the last day of an iso
1364
+ * year, the new DateTime object's isoWeek will be the last of the target iso year. Otherwise, it
1365
+ * will be the same as `self`'s.
1362
1366
  *
1363
1367
  * @category Offsetters
1364
1368
  */
1365
1369
  export declare const offsetIsoYears: (offset: number, respectYearEnd: boolean) => (self: Type) => Either.Either<Type, MInputError.Type>;
1366
1370
  /**
1367
- * Same as offsetIsoYears but returns directly a DateTime or throws in case of an error
1371
+ * Same as `offsetIsoYears` but returns directly a `CVDateTime` or throws in case of an error
1368
1372
  *
1369
- * @category Setters
1373
+ * @category Offsetters
1370
1374
  */
1371
1375
  export declare const offsetIsoYearsOrThrow: (offset: number, respectYearEnd: boolean) => MTypes.OneArgFunction<Type>;
1372
1376
  /**
1373
- * Returns a copy of `self` offset by `offset` hours
1377
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` hours. Returns a `Left` of
1378
+ * an error otherwise.
1374
1379
  *
1375
1380
  * @category Offsetters
1376
1381
  */
1377
1382
  export declare const offsetHours: (offset: number) => MTypes.OneArgFunction<Type, Either.Either<Type, MInputError.Type>>;
1378
1383
  /**
1379
- * Same as offsetHours but returns directly a DateTime or throws in case of an error
1384
+ * Same as `offsetHours` but returns directly a `CVDateTime` or throws in case of an error
1380
1385
  *
1381
- * @category Setters
1386
+ * @category Offsetters
1382
1387
  */
1383
1388
  export declare const offsetHoursOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1384
1389
  /**
1385
- * Returns a copy of `self` offset by `offset` minutes
1390
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` minutes. Returns a `Left`
1391
+ * of an error otherwise.
1386
1392
  *
1387
1393
  * @category Offsetters
1388
1394
  */
1389
1395
  export declare const offsetMinutes: (offset: number) => MTypes.OneArgFunction<Type, Either.Either<Type, MInputError.Type>>;
1390
1396
  /**
1391
- * Same as offsetMinutes but returns directly a DateTime or throws in case of an error
1397
+ * Same as `offsetMinutes` but returns directly a `CVDateTime` or throws in case of an error
1392
1398
  *
1393
- * @category Setters
1399
+ * @category Offsetters
1394
1400
  */
1395
1401
  export declare const offsetMinutesOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1396
1402
  /**
1397
- * Returns a copy of `self` offset by `offset` seconds
1403
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` seconds. Returns a `Left`
1404
+ * of an error otherwise.
1398
1405
  *
1399
1406
  * @category Offsetters
1400
1407
  */
1401
1408
  export declare const offsetSeconds: (offset: number) => MTypes.OneArgFunction<Type, Either.Either<Type, MInputError.Type>>;
1402
1409
  /**
1403
- * Same as offsetSeconds but returns directly a DateTime or throws in case of an error
1410
+ * Same as `offsetSeconds` but returns directly a `CVDateTime` or throws in case of an error
1404
1411
  *
1405
- * @category Setters
1412
+ * @category Offsetters
1406
1413
  */
1407
1414
  export declare const offsetSecondsOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1408
1415
  /**
1409
- * Returns a copy of `self` offset by `offset` milliseconds
1416
+ * If possible, returns a `Right` of a copy of `self` offset by `offset` milliseconds. Returns a
1417
+ * `Left` of an error otherwise.
1410
1418
  *
1411
1419
  * @category Offsetters
1412
1420
  */
1413
1421
  export declare const offsetMilliseconds: (offset: number) => (self: Type) => Either.Either<Type, MInputError.Type>;
1414
1422
  /**
1415
- * Same as offsetMilliseconds but returns directly a DateTime or throws in case of an error
1423
+ * Same as `offsetMilliseconds` but returns directly a `CVDateTime` or throws in case of an error
1416
1424
  *
1417
- * @category Setters
1425
+ * @category Offsetters
1418
1426
  */
1419
1427
  export declare const offsetMillisecondsOrThrow: MTypes.OneArgFunction<number, MTypes.OneArgFunction<Type>>;
1420
1428
  export {};