@evolu/common 8.2.0 → 8.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 (221) hide show
  1. package/dist/src/Function.d.ts +1 -0
  2. package/dist/src/Function.d.ts.map +1 -1
  3. package/dist/src/Http.d.ts +9 -0
  4. package/dist/src/Http.d.ts.map +1 -1
  5. package/dist/src/Object.d.ts +1 -0
  6. package/dist/src/Object.d.ts.map +1 -1
  7. package/dist/src/RefCount.d.ts +1 -0
  8. package/dist/src/RefCount.d.ts.map +1 -1
  9. package/dist/src/Relation.d.ts +2 -0
  10. package/dist/src/Relation.d.ts.map +1 -1
  11. package/dist/src/Resource.d.ts +1 -0
  12. package/dist/src/Resource.d.ts.map +1 -1
  13. package/dist/src/Result.d.ts +383 -548
  14. package/dist/src/Result.d.ts.map +1 -1
  15. package/dist/src/Result.js +296 -46
  16. package/dist/src/StackTrace.d.ts +1 -0
  17. package/dist/src/StackTrace.d.ts.map +1 -1
  18. package/dist/src/Task.d.ts +985 -1069
  19. package/dist/src/Task.d.ts.map +1 -1
  20. package/dist/src/Task.js +1007 -156
  21. package/dist/src/Time.d.ts +1 -0
  22. package/dist/src/Time.d.ts.map +1 -1
  23. package/dist/src/Type.d.ts +1285 -734
  24. package/dist/src/Type.d.ts.map +1 -1
  25. package/dist/src/Type.js +1057 -193
  26. package/dist/src/intl/_en.d.ts +126 -0
  27. package/dist/src/intl/_en.d.ts.map +1 -0
  28. package/dist/src/intl/_en.js +267 -0
  29. package/dist/src/intl/ar.d.ts +117 -0
  30. package/dist/src/intl/ar.d.ts.map +1 -0
  31. package/dist/src/intl/ar.js +245 -0
  32. package/dist/src/intl/bn.d.ts +117 -0
  33. package/dist/src/intl/bn.d.ts.map +1 -0
  34. package/dist/src/intl/bn.js +258 -0
  35. package/dist/src/intl/ca.d.ts +117 -0
  36. package/dist/src/intl/ca.d.ts.map +1 -0
  37. package/dist/src/intl/ca.js +258 -0
  38. package/dist/src/intl/cs.d.ts +20 -7
  39. package/dist/src/intl/cs.d.ts.map +1 -1
  40. package/dist/src/intl/cs.js +54 -27
  41. package/dist/src/intl/da.d.ts +117 -0
  42. package/dist/src/intl/da.d.ts.map +1 -0
  43. package/dist/src/intl/da.js +258 -0
  44. package/dist/src/intl/de.d.ts +117 -0
  45. package/dist/src/intl/de.d.ts.map +1 -0
  46. package/dist/src/intl/de.js +258 -0
  47. package/dist/src/intl/el.d.ts +117 -0
  48. package/dist/src/intl/el.d.ts.map +1 -0
  49. package/dist/src/intl/el.js +265 -0
  50. package/dist/src/intl/es.d.ts +117 -0
  51. package/dist/src/intl/es.d.ts.map +1 -0
  52. package/dist/src/intl/es.js +258 -0
  53. package/dist/src/intl/fa.d.ts +117 -0
  54. package/dist/src/intl/fa.d.ts.map +1 -0
  55. package/dist/src/intl/fa.js +258 -0
  56. package/dist/src/intl/fi.d.ts +117 -0
  57. package/dist/src/intl/fi.d.ts.map +1 -0
  58. package/dist/src/intl/fi.js +258 -0
  59. package/dist/src/intl/fil.d.ts +117 -0
  60. package/dist/src/intl/fil.d.ts.map +1 -0
  61. package/dist/src/intl/fil.js +258 -0
  62. package/dist/src/intl/fr.d.ts +117 -0
  63. package/dist/src/intl/fr.d.ts.map +1 -0
  64. package/dist/src/intl/fr.js +258 -0
  65. package/dist/src/intl/he.d.ts +117 -0
  66. package/dist/src/intl/he.d.ts.map +1 -0
  67. package/dist/src/intl/he.js +258 -0
  68. package/dist/src/intl/hi.d.ts +117 -0
  69. package/dist/src/intl/hi.d.ts.map +1 -0
  70. package/dist/src/intl/hi.js +258 -0
  71. package/dist/src/intl/hr.d.ts +117 -0
  72. package/dist/src/intl/hr.d.ts.map +1 -0
  73. package/dist/src/intl/hr.js +265 -0
  74. package/dist/src/intl/hu.d.ts +63 -0
  75. package/dist/src/intl/hu.d.ts.map +1 -0
  76. package/dist/src/intl/hu.js +204 -0
  77. package/dist/src/intl/id.d.ts +117 -0
  78. package/dist/src/intl/id.d.ts.map +1 -0
  79. package/dist/src/intl/id.js +258 -0
  80. package/dist/src/intl/index.d.ts +42 -0
  81. package/dist/src/intl/index.d.ts.map +1 -1
  82. package/dist/src/intl/index.js +42 -0
  83. package/dist/src/intl/it.d.ts +117 -0
  84. package/dist/src/intl/it.d.ts.map +1 -0
  85. package/dist/src/intl/it.js +258 -0
  86. package/dist/src/intl/ja.d.ts +117 -0
  87. package/dist/src/intl/ja.d.ts.map +1 -0
  88. package/dist/src/intl/ja.js +258 -0
  89. package/dist/src/intl/ko.d.ts +117 -0
  90. package/dist/src/intl/ko.d.ts.map +1 -0
  91. package/dist/src/intl/ko.js +258 -0
  92. package/dist/src/intl/ml.d.ts +117 -0
  93. package/dist/src/intl/ml.d.ts.map +1 -0
  94. package/dist/src/intl/ml.js +258 -0
  95. package/dist/src/intl/mr.d.ts +117 -0
  96. package/dist/src/intl/mr.d.ts.map +1 -0
  97. package/dist/src/intl/mr.js +258 -0
  98. package/dist/src/intl/ms.d.ts +117 -0
  99. package/dist/src/intl/ms.d.ts.map +1 -0
  100. package/dist/src/intl/ms.js +245 -0
  101. package/dist/src/intl/nb.d.ts +63 -0
  102. package/dist/src/intl/nb.d.ts.map +1 -0
  103. package/dist/src/intl/nb.js +191 -0
  104. package/dist/src/intl/nl.d.ts +117 -0
  105. package/dist/src/intl/nl.d.ts.map +1 -0
  106. package/dist/src/intl/nl.js +258 -0
  107. package/dist/src/intl/pa.d.ts +117 -0
  108. package/dist/src/intl/pa.d.ts.map +1 -0
  109. package/dist/src/intl/pa.js +258 -0
  110. package/dist/src/intl/pl.d.ts +117 -0
  111. package/dist/src/intl/pl.d.ts.map +1 -0
  112. package/dist/src/intl/pl.js +242 -0
  113. package/dist/src/intl/pt-BR.d.ts +117 -0
  114. package/dist/src/intl/pt-BR.d.ts.map +1 -0
  115. package/dist/src/intl/pt-BR.js +258 -0
  116. package/dist/src/intl/pt.d.ts +117 -0
  117. package/dist/src/intl/pt.d.ts.map +1 -0
  118. package/dist/src/intl/pt.js +246 -0
  119. package/dist/src/intl/ro.d.ts +117 -0
  120. package/dist/src/intl/ro.d.ts.map +1 -0
  121. package/dist/src/intl/ro.js +258 -0
  122. package/dist/src/intl/sk.d.ts +117 -0
  123. package/dist/src/intl/sk.d.ts.map +1 -0
  124. package/dist/src/intl/sk.js +244 -0
  125. package/dist/src/intl/sl.d.ts +117 -0
  126. package/dist/src/intl/sl.d.ts.map +1 -0
  127. package/dist/src/intl/sl.js +258 -0
  128. package/dist/src/intl/sv.d.ts +117 -0
  129. package/dist/src/intl/sv.d.ts.map +1 -0
  130. package/dist/src/intl/sv.js +258 -0
  131. package/dist/src/intl/sw.d.ts +63 -0
  132. package/dist/src/intl/sw.d.ts.map +1 -0
  133. package/dist/src/intl/sw.js +191 -0
  134. package/dist/src/intl/ta.d.ts +117 -0
  135. package/dist/src/intl/ta.d.ts.map +1 -0
  136. package/dist/src/intl/ta.js +258 -0
  137. package/dist/src/intl/te.d.ts +117 -0
  138. package/dist/src/intl/te.d.ts.map +1 -0
  139. package/dist/src/intl/te.js +258 -0
  140. package/dist/src/intl/th.d.ts +117 -0
  141. package/dist/src/intl/th.d.ts.map +1 -0
  142. package/dist/src/intl/th.js +258 -0
  143. package/dist/src/intl/tr.d.ts +117 -0
  144. package/dist/src/intl/tr.d.ts.map +1 -0
  145. package/dist/src/intl/tr.js +255 -0
  146. package/dist/src/intl/uk.d.ts +117 -0
  147. package/dist/src/intl/uk.d.ts.map +1 -0
  148. package/dist/src/intl/uk.js +258 -0
  149. package/dist/src/intl/ur.d.ts +117 -0
  150. package/dist/src/intl/ur.d.ts.map +1 -0
  151. package/dist/src/intl/ur.js +245 -0
  152. package/dist/src/intl/vi.d.ts +117 -0
  153. package/dist/src/intl/vi.d.ts.map +1 -0
  154. package/dist/src/intl/vi.js +255 -0
  155. package/dist/src/intl/zh-CN.d.ts +117 -0
  156. package/dist/src/intl/zh-CN.d.ts.map +1 -0
  157. package/dist/src/intl/zh-CN.js +258 -0
  158. package/dist/src/intl/zh-TW.d.ts +117 -0
  159. package/dist/src/intl/zh-TW.d.ts.map +1 -0
  160. package/dist/src/intl/zh-TW.js +258 -0
  161. package/dist/src/local-first/Owner.d.ts +156 -62
  162. package/dist/src/local-first/Owner.d.ts.map +1 -1
  163. package/dist/src/local-first/Owner.js +119 -20
  164. package/package.json +1 -1
  165. package/src/Function.ts +2 -0
  166. package/src/Http.ts +9 -0
  167. package/src/Object.ts +2 -0
  168. package/src/RefCount.ts +2 -0
  169. package/src/Relation.ts +4 -0
  170. package/src/Resource.ts +2 -0
  171. package/src/Result.ts +397 -560
  172. package/src/StackTrace.ts +2 -0
  173. package/src/Task.ts +1143 -1222
  174. package/src/Time.ts +2 -0
  175. package/src/Type.ts +1598 -712
  176. package/src/intl/_en.ts +497 -0
  177. package/src/intl/ar.ts +417 -0
  178. package/src/intl/bn.ts +486 -0
  179. package/src/intl/ca.ts +488 -0
  180. package/src/intl/cs.ts +95 -31
  181. package/src/intl/da.ts +488 -0
  182. package/src/intl/de.ts +488 -0
  183. package/src/intl/el.ts +494 -0
  184. package/src/intl/es.ts +488 -0
  185. package/src/intl/fa.ts +487 -0
  186. package/src/intl/fi.ts +487 -0
  187. package/src/intl/fil.ts +488 -0
  188. package/src/intl/fr.ts +488 -0
  189. package/src/intl/he.ts +486 -0
  190. package/src/intl/hi.ts +487 -0
  191. package/src/intl/hr.ts +494 -0
  192. package/src/intl/hu.ts +387 -0
  193. package/src/intl/id.ts +487 -0
  194. package/src/intl/index.ts +42 -0
  195. package/src/intl/it.ts +488 -0
  196. package/src/intl/ja.ts +488 -0
  197. package/src/intl/ko.ts +487 -0
  198. package/src/intl/ml.ts +487 -0
  199. package/src/intl/mr.ts +487 -0
  200. package/src/intl/ms.ts +410 -0
  201. package/src/intl/nb.ts +364 -0
  202. package/src/intl/nl.ts +488 -0
  203. package/src/intl/pa.ts +487 -0
  204. package/src/intl/pl.ts +450 -0
  205. package/src/intl/pt-BR.ts +487 -0
  206. package/src/intl/pt.ts +424 -0
  207. package/src/intl/ro.ts +488 -0
  208. package/src/intl/sk.ts +412 -0
  209. package/src/intl/sl.ts +487 -0
  210. package/src/intl/sv.ts +488 -0
  211. package/src/intl/sw.ts +324 -0
  212. package/src/intl/ta.ts +487 -0
  213. package/src/intl/te.ts +487 -0
  214. package/src/intl/th.ts +484 -0
  215. package/src/intl/tr.ts +487 -0
  216. package/src/intl/uk.ts +488 -0
  217. package/src/intl/ur.ts +410 -0
  218. package/src/intl/vi.ts +435 -0
  219. package/src/intl/zh-CN.ts +482 -0
  220. package/src/intl/zh-TW.ts +482 -0
  221. package/src/local-first/Owner.ts +156 -62
@@ -0,0 +1,126 @@
1
+ /**
2
+ * English Evolu Type error formatters.
3
+ *
4
+ * This module mirrors Type's default English formatters. It is the canonical
5
+ * source for translating Type error messages into other languages. Update this
6
+ * file whenever Type adds, removes, or changes a default formatter.
7
+ *
8
+ * Every formatter is exported separately so applications bundle only messages
9
+ * referenced by their localized Type collections. Parameterized Type factories
10
+ * reuse one formatter for every parameter value; for example,
11
+ * {@link formatMinLengthError} formats both `MinLength1` and `MinLength100`.
12
+ *
13
+ * @module
14
+ */
15
+ import type { ArrayError, Base64UrlError, BetweenError, CapitalizedError, DateIsoError, DateIsoFromDateError, DecimalStringError, DiscriminatedUnionError, EvoluTypeError, FiniteError, GreaterThanError, GreaterThanOrEqualToError, InstanceOfError, Int64Error, Int64StringError, IntError, IdError, JsonError, JsonValueError, LengthError, LessThanError, LessThanOrEqualToError, LiteralError, MaxLengthError, MinLengthError, MnemonicError, MultipleOfError, NegativeDecimalStringError, NegativeError, NameError, NeverError, NonNaNError, NonNegativeDecimalStringError, NonNegativeError, NonPositiveDecimalStringError, NonPositiveError, ObjectError, ObjectTagError, PositiveDecimalStringError, PositiveError, RecordError, RegexError, SetError, TableIdError, TemplateLiteralError, TrimmedError, TupleElementsError, TupleError, TypeError, TypeErrorFormatter, TypeOfError, UInt64Error, UnionError } from "../Type.ts";
16
+ /** Formats a NeverError in English. */
17
+ export declare const formatNeverError: TypeErrorFormatter<NeverError>;
18
+ /** Formats a String TypeOfError in English. */
19
+ export declare const formatStringError: TypeErrorFormatter<TypeOfError<"String">>;
20
+ /** Formats a TemplateLiteralError in English. */
21
+ export declare const formatTemplateLiteralError: TypeErrorFormatter<TemplateLiteralError>;
22
+ /** Formats a Number TypeOfError in English. */
23
+ export declare const formatNumberError: TypeErrorFormatter<TypeOfError<"Number">>;
24
+ /** Formats a BigInt TypeOfError in English. */
25
+ export declare const formatBigIntError: TypeErrorFormatter<TypeOfError<"BigInt">>;
26
+ /** Formats a Boolean TypeOfError in English. */
27
+ export declare const formatBooleanError: TypeErrorFormatter<TypeOfError<"Boolean">>;
28
+ /** Formats a Symbol TypeOfError in English. */
29
+ export declare const formatSymbolError: TypeErrorFormatter<TypeOfError<"Symbol">>;
30
+ /** Formats a Function TypeOfError in English. */
31
+ export declare const formatFunctionError: TypeErrorFormatter<TypeOfError<"Function">>;
32
+ /** Formats an EvoluTypeError in English. */
33
+ export declare const formatEvoluTypeError: TypeErrorFormatter<EvoluTypeError>;
34
+ /** Formats an ObjectTagError in English. */
35
+ export declare const formatObjectTagError: TypeErrorFormatter<ObjectTagError>;
36
+ /** Formats an InstanceOfError in English. */
37
+ export declare const formatInstanceOfError: TypeErrorFormatter<InstanceOfError>;
38
+ /** Formats a LiteralError in English. */
39
+ export declare const formatLiteralError: TypeErrorFormatter<LiteralError>;
40
+ /** Formats a UnionError in English. */
41
+ export declare const formatUnionError: TypeErrorFormatter<UnionError>;
42
+ /** Formats a DateIsoError in English. */
43
+ export declare const formatDateIsoError: TypeErrorFormatter<DateIsoError>;
44
+ /** Formats a DateIsoFromDateError in English. */
45
+ export declare const formatDateIsoFromDateError: TypeErrorFormatter<DateIsoFromDateError>;
46
+ /** Formats a DecimalStringError in English. */
47
+ export declare const formatDecimalStringError: TypeErrorFormatter<DecimalStringError>;
48
+ /** Formats an Int64Error in English. */
49
+ export declare const formatInt64Error: TypeErrorFormatter<Int64Error>;
50
+ /** Formats a UInt64Error in English. */
51
+ export declare const formatUInt64Error: TypeErrorFormatter<UInt64Error>;
52
+ /** Formats an Int64StringError in English. */
53
+ export declare const formatInt64StringError: TypeErrorFormatter<Int64StringError>;
54
+ /** Formats a CapitalizedError in English. */
55
+ export declare const formatCapitalizedError: TypeErrorFormatter<CapitalizedError>;
56
+ /** Formats a TrimmedError in English. */
57
+ export declare const formatTrimmedError: TypeErrorFormatter<TrimmedError>;
58
+ /** Formats a MinLengthError in English. */
59
+ export declare const formatMinLengthError: TypeErrorFormatter<MinLengthError>;
60
+ /** Formats a MaxLengthError in English. */
61
+ export declare const formatMaxLengthError: TypeErrorFormatter<MaxLengthError>;
62
+ /** Formats a LengthError in English. */
63
+ export declare const formatLengthError: TypeErrorFormatter<LengthError>;
64
+ /** Formats a RegexError in English. */
65
+ export declare const formatRegexError: TypeErrorFormatter<RegexError>;
66
+ /** Formats a Base64UrlError in English. */
67
+ export declare const formatBase64UrlError: TypeErrorFormatter<Base64UrlError>;
68
+ /** Formats a NameError in English. */
69
+ export declare const formatNameError: TypeErrorFormatter<NameError>;
70
+ /** Formats a MnemonicError in English. */
71
+ export declare const formatMnemonicError: TypeErrorFormatter<MnemonicError>;
72
+ /** Formats an IdError in English. */
73
+ export declare const formatIdError: TypeErrorFormatter<IdError>;
74
+ /** Formats a TableIdError in English. */
75
+ export declare const formatTableIdError: TypeErrorFormatter<TableIdError>;
76
+ /** Formats a NonNegativeError in English. */
77
+ export declare const formatNonNegativeError: TypeErrorFormatter<NonNegativeError>;
78
+ /** Formats a NonNegativeDecimalStringError in English. */
79
+ export declare const formatNonNegativeDecimalStringError: TypeErrorFormatter<NonNegativeDecimalStringError>;
80
+ /** Formats a PositiveError in English. */
81
+ export declare const formatPositiveError: TypeErrorFormatter<PositiveError>;
82
+ /** Formats a PositiveDecimalStringError in English. */
83
+ export declare const formatPositiveDecimalStringError: TypeErrorFormatter<PositiveDecimalStringError>;
84
+ /** Formats a NonPositiveError in English. */
85
+ export declare const formatNonPositiveError: TypeErrorFormatter<NonPositiveError>;
86
+ /** Formats a NonPositiveDecimalStringError in English. */
87
+ export declare const formatNonPositiveDecimalStringError: TypeErrorFormatter<NonPositiveDecimalStringError>;
88
+ /** Formats a NegativeError in English. */
89
+ export declare const formatNegativeError: TypeErrorFormatter<NegativeError>;
90
+ /** Formats a NegativeDecimalStringError in English. */
91
+ export declare const formatNegativeDecimalStringError: TypeErrorFormatter<NegativeDecimalStringError>;
92
+ /** Formats an IntError in English. */
93
+ export declare const formatIntError: TypeErrorFormatter<IntError>;
94
+ /** Formats a GreaterThanError in English. */
95
+ export declare const formatGreaterThanError: TypeErrorFormatter<GreaterThanError>;
96
+ /** Formats a GreaterThanOrEqualToError in English. */
97
+ export declare const formatGreaterThanOrEqualToError: TypeErrorFormatter<GreaterThanOrEqualToError>;
98
+ /** Formats a LessThanError in English. */
99
+ export declare const formatLessThanError: TypeErrorFormatter<LessThanError>;
100
+ /** Formats a LessThanOrEqualToError in English. */
101
+ export declare const formatLessThanOrEqualToError: TypeErrorFormatter<LessThanOrEqualToError>;
102
+ /** Formats a NonNaNError in English. */
103
+ export declare const formatNonNaNError: TypeErrorFormatter<NonNaNError>;
104
+ /** Formats a FiniteError in English. */
105
+ export declare const formatFiniteError: TypeErrorFormatter<FiniteError>;
106
+ /** Formats a MultipleOfError in English. */
107
+ export declare const formatMultipleOfError: TypeErrorFormatter<MultipleOfError>;
108
+ /** Formats a BetweenError in English. */
109
+ export declare const formatBetweenError: TypeErrorFormatter<BetweenError>;
110
+ /** Formats an ArrayError in English. */
111
+ export declare const formatArrayError: TypeErrorFormatter<ArrayError>;
112
+ /** Formats a SetError in English. */
113
+ export declare const formatSetError: TypeErrorFormatter<SetError>;
114
+ /** Formats a TupleError in English. */
115
+ export declare const formatTupleError: TypeErrorFormatter<TupleError | TupleElementsError<TypeError>>;
116
+ /** Formats a RecordError in English. */
117
+ export declare const formatRecordError: TypeErrorFormatter<RecordError>;
118
+ /** Formats an ObjectError in English. */
119
+ export declare const formatObjectError: TypeErrorFormatter<ObjectError>;
120
+ /** Formats a DiscriminatedUnionError in English. */
121
+ export declare const formatDiscriminatedUnionError: TypeErrorFormatter<DiscriminatedUnionError>;
122
+ /** Formats a JsonValueError in English. */
123
+ export declare const formatJsonValueError: TypeErrorFormatter<JsonValueError>;
124
+ /** Formats a JsonError in English. */
125
+ export declare const formatJsonError: TypeErrorFormatter<JsonError>;
126
+ //# sourceMappingURL=_en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_en.d.ts","sourceRoot":"","sources":["../../../src/intl/_en.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,EACf,0BAA0B,EAC1B,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,6BAA6B,EAC7B,gBAAgB,EAChB,6BAA6B,EAC7B,gBAAgB,EAChB,WAAW,EAGX,cAAc,EAEd,0BAA0B,EAC1B,aAAa,EACb,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AAoBpB,uCAAuC;AACvC,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,CAAC,UAAU,CACwB,CAAC;AAErF,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,EAAE,k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AC5C,eAAO,MAAM,qBAAqB,EAAE,kBAAkB,CAAC,eAAe,CAG2B,CAAC;AAElG,yCAAyC;AACzC,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,YAAY,CACmD,CAAC;AAEpH,wCAAwC;AACxC,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,CAAC,UAAU,CAgB3D,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,cAAc,EAAE,kBAAkB,CAAC,QAAQ,CAgBvD,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,CAC/C,UAAU,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAqB3C,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,WAAW,CAsB7D,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,CAAC,WAAW,CA4B7D,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAC5D,uBAAuB,CAoBxB,CAAC;AAEF,2CAA2C;AAC3C,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,cAAc,CAyBnE,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,eAAe,EAAE,kBAAkB,CAAC,SAAS,CACkC,CAAC"}
@@ -0,0 +1,267 @@
1
+ /**
2
+ * English Evolu Type error formatters.
3
+ *
4
+ * This module mirrors Type's default English formatters. It is the canonical
5
+ * source for translating Type error messages into other languages. Update this
6
+ * file whenever Type adds, removes, or changes a default formatter.
7
+ *
8
+ * Every formatter is exported separately so applications bundle only messages
9
+ * referenced by their localized Type collections. Parameterized Type factories
10
+ * reuse one formatter for every parameter value; for example,
11
+ * {@link formatMinLengthError} formats both `MinLength1` and `MinLength100`.
12
+ *
13
+ * @module
14
+ */
15
+ import { assertNonNullable } from "../Assert.js";
16
+ import { safelyStringifyUnknownValue } from "../String.js";
17
+ const formatTypeOfError = (error) => {
18
+ const typeOf = error.expected.toLowerCase();
19
+ return `A value ${safelyStringifyUnknownValue(error.value)} is not a ${typeOf}.`;
20
+ };
21
+ const formatPlainObjectRootError = (reason) => reason.kind === "NotObject"
22
+ ? `A value ${safelyStringifyUnknownValue(reason.value)} is not an object.`
23
+ : "The value is an object, but an Object Output must be a plain object or have a null prototype.";
24
+ /** Formats a NeverError in English. */
25
+ export const formatNeverError = (error) => `A value ${safelyStringifyUnknownValue(error.value)} is not valid for type Never.`;
26
+ /** Formats a String TypeOfError in English. */
27
+ export const formatStringError = formatTypeOfError;
28
+ /** Formats a TemplateLiteralError in English. */
29
+ export const formatTemplateLiteralError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} does not match the template literal.`;
30
+ /** Formats a Number TypeOfError in English. */
31
+ export const formatNumberError = formatTypeOfError;
32
+ /** Formats a BigInt TypeOfError in English. */
33
+ export const formatBigIntError = formatTypeOfError;
34
+ /** Formats a Boolean TypeOfError in English. */
35
+ export const formatBooleanError = formatTypeOfError;
36
+ /** Formats a Symbol TypeOfError in English. */
37
+ export const formatSymbolError = formatTypeOfError;
38
+ /** Formats a Function TypeOfError in English. */
39
+ export const formatFunctionError = formatTypeOfError;
40
+ /** Formats an EvoluTypeError in English. */
41
+ export const formatEvoluTypeError = (error) => `A value ${safelyStringifyUnknownValue(error.value)} is not an Evolu Type.`;
42
+ /** Formats an ObjectTagError in English. */
43
+ export const formatObjectTagError = (error) => `A value ${safelyStringifyUnknownValue(error.value)} does not have the expected object tag ${safelyStringifyUnknownValue(error.expected)}.`;
44
+ /** Formats an InstanceOfError in English. */
45
+ export const formatInstanceOfError = (error) => `A value ${safelyStringifyUnknownValue(error.value)} is not an instance of ${error.constructorName}.`;
46
+ /** Formats a LiteralError in English. */
47
+ export const formatLiteralError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not strictly equal to the expected literal: ${globalThis.String(error.expected)}.`;
48
+ /** Formats a UnionError in English. */
49
+ export const formatUnionError = () => "A value does not match any allowed variant.";
50
+ /** Formats a DateIsoError in English. */
51
+ export const formatDateIsoError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not a canonical ISO date-time string.`;
52
+ /** Formats a DateIsoFromDateError in English. */
53
+ export const formatDateIsoFromDateError = () => "The Date cannot be represented as DateIso.";
54
+ /** Formats a DecimalStringError in English. */
55
+ export const formatDecimalStringError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be a canonical decimal string.`;
56
+ /** Formats an Int64Error in English. */
57
+ export const formatInt64Error = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not a valid signed 64-bit integer (Int64).`;
58
+ /** Formats a UInt64Error in English. */
59
+ export const formatUInt64Error = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not a valid unsigned 64-bit integer (UInt64).`;
60
+ /** Formats an Int64StringError in English. */
61
+ export const formatInt64StringError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not a valid Int64 string.`;
62
+ /** Formats a CapitalizedError in English. */
63
+ export const formatCapitalizedError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be capitalized.`;
64
+ /** Formats a TrimmedError in English. */
65
+ export const formatTrimmedError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be trimmed.`;
66
+ /** Formats a MinLengthError in English. */
67
+ export const formatMinLengthError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} does not meet the minimum length of ${error.min}.`;
68
+ /** Formats a MaxLengthError in English. */
69
+ export const formatMaxLengthError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} exceeds the maximum length of ${error.max}.`;
70
+ /** Formats a LengthError in English. */
71
+ export const formatLengthError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} does not have the required length of ${error.exact}.`;
72
+ /** Formats a RegexError in English. */
73
+ export const formatRegexError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} does not match /${error.source}/${error.flags}.`;
74
+ /** Formats a Base64UrlError in English. */
75
+ export const formatBase64UrlError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not a valid Base64Url string.`;
76
+ /** Formats a NameError in English. */
77
+ export const formatNameError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not a valid Name.`;
78
+ /** Formats a MnemonicError in English. */
79
+ export const formatMnemonicError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not a valid English BIP39 mnemonic.`;
80
+ /** Formats an IdError in English. */
81
+ export const formatIdError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not a valid Id.`;
82
+ /** Formats a TableIdError in English. */
83
+ export const formatTableIdError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} is not a valid Id for table ${error.table}.`;
84
+ /** Formats a NonNegativeError in English. */
85
+ export const formatNonNegativeError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be non-negative (>= 0).`;
86
+ /** Formats a NonNegativeDecimalStringError in English. */
87
+ export const formatNonNegativeDecimalStringError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be a non-negative decimal string.`;
88
+ /** Formats a PositiveError in English. */
89
+ export const formatPositiveError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be positive (> 0).`;
90
+ /** Formats a PositiveDecimalStringError in English. */
91
+ export const formatPositiveDecimalStringError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be a positive decimal string.`;
92
+ /** Formats a NonPositiveError in English. */
93
+ export const formatNonPositiveError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be non-positive (<= 0).`;
94
+ /** Formats a NonPositiveDecimalStringError in English. */
95
+ export const formatNonPositiveDecimalStringError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be a non-positive decimal string.`;
96
+ /** Formats a NegativeError in English. */
97
+ export const formatNegativeError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be negative (< 0).`;
98
+ /** Formats a NegativeDecimalStringError in English. */
99
+ export const formatNegativeDecimalStringError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be a negative decimal string.`;
100
+ /** Formats an IntError in English. */
101
+ export const formatIntError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be a safe integer.`;
102
+ /** Formats a GreaterThanError in English. */
103
+ export const formatGreaterThanError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be greater than ${error.min}.`;
104
+ /** Formats a GreaterThanOrEqualToError in English. */
105
+ export const formatGreaterThanOrEqualToError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be greater than or equal to ${error.min}.`;
106
+ /** Formats a LessThanError in English. */
107
+ export const formatLessThanError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be less than ${error.max}.`;
108
+ /** Formats a LessThanOrEqualToError in English. */
109
+ export const formatLessThanOrEqualToError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be less than or equal to ${error.max}.`;
110
+ /** Formats a NonNaNError in English. */
111
+ export const formatNonNaNError = () => "The value must not be NaN.";
112
+ /** Formats a FiniteError in English. */
113
+ export const formatFiniteError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be finite.`;
114
+ /** Formats a MultipleOfError in English. */
115
+ export const formatMultipleOfError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be a multiple of ${error.divisor}.`;
116
+ /** Formats a BetweenError in English. */
117
+ export const formatBetweenError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} must be between ${error.min} and ${error.max}, inclusive.`;
118
+ /** Formats an ArrayError in English. */
119
+ export const formatArrayError = (error) => {
120
+ if (error.reason.kind === "NotArray") {
121
+ return `A value ${safelyStringifyUnknownValue(error.reason.value)} is not an array.`;
122
+ }
123
+ const issue = error.reason.issues[0];
124
+ switch (issue.kind) {
125
+ case "Hole":
126
+ return `An array element at index ${issue.index} is missing.`;
127
+ case "Accessor":
128
+ return `An array element at index ${issue.index} must be a data property.`;
129
+ case "ExcessProperty":
130
+ return "An excess Array property is not allowed. Remove it or use a different Type.";
131
+ case "Element":
132
+ return `An array element at index ${issue.index} is invalid.`;
133
+ }
134
+ };
135
+ /** Formats a SetError in English. */
136
+ export const formatSetError = (error) => {
137
+ if (error.reason.kind === "NotSet") {
138
+ return `A value ${safelyStringifyUnknownValue(error.reason.value)} is not a Set.`;
139
+ }
140
+ if (error.reason.kind === "UnexpectedPrototype") {
141
+ return "The value is an instance of a Set subclass, but a Set Output must be a direct Set instance.";
142
+ }
143
+ const issue = error.reason.issues[0];
144
+ switch (issue.kind) {
145
+ case "ExcessProperty":
146
+ return `An excess Set property ${safelyStringifyUnknownValue(issue.key)} is not allowed.`;
147
+ case "Element":
148
+ return `A Set element at index ${issue.index} is invalid.`;
149
+ }
150
+ };
151
+ /** Formats a TupleError in English. */
152
+ export const formatTupleError = (error) => {
153
+ if (error.reason.kind === "NotArray") {
154
+ return `A value ${safelyStringifyUnknownValue(error.reason.value)} is not a tuple.`;
155
+ }
156
+ if (error.reason.kind === "InvalidLength") {
157
+ return `A Tuple must contain exactly ${error.reason.expected} elements, but the value contains ${error.reason.actual}.`;
158
+ }
159
+ const issue = error.reason.issues[0];
160
+ switch (issue.kind) {
161
+ case "Hole":
162
+ return `A Tuple element at index ${issue.index} is missing.`;
163
+ case "Accessor":
164
+ return `A Tuple element at index ${issue.index} must be a data property.`;
165
+ case "ExcessProperty":
166
+ return "An excess Tuple property is not allowed. Remove it or use a different Type.";
167
+ case "Element":
168
+ return `A Tuple element at index ${issue.index} is invalid.`;
169
+ }
170
+ };
171
+ /** Formats a RecordError in English. */
172
+ export const formatRecordError = (error) => {
173
+ if (error.reason.kind === "NotRecord") {
174
+ return `A value ${safelyStringifyUnknownValue(error.reason.value)} is not a Record.`;
175
+ }
176
+ if (error.reason.kind === "NotPlainRecord") {
177
+ return "The value is an object, but a Record Output must be a plain object or have a null prototype.";
178
+ }
179
+ const issue = error.reason.issues[0];
180
+ switch (issue.kind) {
181
+ case "Key":
182
+ return `Property key ${safelyStringifyUnknownValue(issue.key)} is invalid.`;
183
+ case "Value":
184
+ return `The value of property ${safelyStringifyUnknownValue(issue.key)} is invalid.`;
185
+ case "Accessor":
186
+ return `A Record property ${safelyStringifyUnknownValue(issue.key)} must be a data property.`;
187
+ case "NonEnumerable":
188
+ return `A Record property ${safelyStringifyUnknownValue(issue.key)} must be enumerable.`;
189
+ case "Collision":
190
+ return `Record keys ${safelyStringifyUnknownValue(issue.previousKey)} and ${safelyStringifyUnknownValue(issue.key)} decode to the same key ${safelyStringifyUnknownValue(issue.outputKey)}.`;
191
+ }
192
+ };
193
+ /** Formats an ObjectError in English. */
194
+ export const formatObjectError = (error) => {
195
+ if (error.reason.kind !== "Properties") {
196
+ return formatPlainObjectRootError(error.reason);
197
+ }
198
+ const key = Reflect.ownKeys(error.reason.errors).at(0);
199
+ assertNonNullable(key);
200
+ const propertyError = error.reason.errors[key];
201
+ assertNonNullable(propertyError);
202
+ if (propertyError.type === "ObjectPropertyAccess") {
203
+ switch (propertyError.reason) {
204
+ case "Accessor":
205
+ return "An Object property must be a data property. Materialize accessor values into plain data before using this Type or use a different Type.";
206
+ case "NonEnumerable":
207
+ return "An Object property must be enumerable. Make it enumerable or use a different Type.";
208
+ }
209
+ }
210
+ if (propertyError.type === "ObjectMissingProperty") {
211
+ return `The required property ${safelyStringifyUnknownValue(key)} is missing.`;
212
+ }
213
+ if (typeof key === "symbol") {
214
+ return "An Object property key must be a string. Remove the symbol property or use a different Type.";
215
+ }
216
+ if (propertyError.type === "ObjectExcessProperty") {
217
+ return `The property ${safelyStringifyUnknownValue(key)} is not allowed. Remove it or use a different Type.`;
218
+ }
219
+ return `The property ${safelyStringifyUnknownValue(key)} is invalid.`;
220
+ };
221
+ /** Formats a DiscriminatedUnionError in English. */
222
+ export const formatDiscriminatedUnionError = (error) => {
223
+ switch (error.reason.kind) {
224
+ case "Object":
225
+ return formatPlainObjectRootError(error.reason.error.reason);
226
+ case "PropertyAccess": {
227
+ const property = `The discriminator property ${safelyStringifyUnknownValue(error.reason.key)}`;
228
+ if (error.reason.reason === "Accessor") {
229
+ return `${property} must be a data property.`;
230
+ }
231
+ if (error.reason.reason === "Inherited") {
232
+ return `${property} must be an own property.`;
233
+ }
234
+ return `${property} must be enumerable.`;
235
+ }
236
+ case "Discriminator":
237
+ return `The discriminator property ${safelyStringifyUnknownValue(error.reason.key)} has an unexpected value ${safelyStringifyUnknownValue(error.reason.value)}.`;
238
+ case "Member":
239
+ return `The selected variant ${safelyStringifyUnknownValue(error.reason.discriminator)} is invalid.`;
240
+ }
241
+ };
242
+ /** Formats a JsonValueError in English. */
243
+ export const formatJsonValueError = (error) => {
244
+ const issue = error.reason.issues[0];
245
+ switch (issue.kind) {
246
+ case "InvalidType":
247
+ return `A value ${safelyStringifyUnknownValue(issue.value)} is not a JSON value.`;
248
+ case "NonFiniteNumber":
249
+ return "A JSON number must be finite.";
250
+ case "UnexpectedPrototype":
251
+ return "The value is an object, but a JsonValue object must be a plain object or have a null prototype.";
252
+ case "Accessor":
253
+ return "A JSON property must be a data property. Materialize accessor values into plain data before using this Type or use a different Type.";
254
+ case "NonEnumerable":
255
+ return "A JSON object property must be enumerable. Remove it or use a different Type.";
256
+ case "SymbolProperty":
257
+ return "A JSON object property key must be a string. Remove the symbol property or use a different Type.";
258
+ case "Hole":
259
+ return "A JSON array element is missing.";
260
+ case "ExcessProperty":
261
+ return "An excess JSON array property is not allowed. Remove it or use a different Type.";
262
+ case "CircularReference":
263
+ return "A JsonValue must not contain circular references.";
264
+ }
265
+ };
266
+ /** Formats a JsonError in English. */
267
+ export const formatJsonError = (error) => `The value ${safelyStringifyUnknownValue(error.value)} cannot be parsed into a JsonValue.`;
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Arabic Evolu Type error formatters.
3
+ *
4
+ * @module
5
+ */
6
+ import type { ArrayError, Base64UrlError, BetweenError, CapitalizedError, DateIsoError, DateIsoFromDateError, DecimalStringError, DiscriminatedUnionError, EvoluTypeError, FiniteError, GreaterThanError, GreaterThanOrEqualToError, InstanceOfError, Int64Error, Int64StringError, IntError, IdError, JsonError, JsonValueError, LengthError, LessThanError, LessThanOrEqualToError, LiteralError, MaxLengthError, MinLengthError, MnemonicError, MultipleOfError, NegativeDecimalStringError, NegativeError, NameError, NeverError, NonNaNError, NonNegativeDecimalStringError, NonNegativeError, NonPositiveDecimalStringError, NonPositiveError, ObjectError, ObjectTagError, PositiveDecimalStringError, PositiveError, RecordError, RegexError, SetError, TableIdError, TemplateLiteralError, TrimmedError, TupleElementsError, TupleError, TypeError, TypeErrorFormatter, TypeOfError, UInt64Error, UnionError } from "../Type.ts";
7
+ /** Formats a NeverError in Arabic. */
8
+ export declare const formatNeverError: TypeErrorFormatter<NeverError>;
9
+ /** Formats a String TypeOfError in Arabic. */
10
+ export declare const formatStringError: TypeErrorFormatter<TypeOfError<"String">>;
11
+ /** Formats a TemplateLiteralError in Arabic. */
12
+ export declare const formatTemplateLiteralError: TypeErrorFormatter<TemplateLiteralError>;
13
+ /** Formats a Number TypeOfError in Arabic. */
14
+ export declare const formatNumberError: TypeErrorFormatter<TypeOfError<"Number">>;
15
+ /** Formats a BigInt TypeOfError in Arabic. */
16
+ export declare const formatBigIntError: TypeErrorFormatter<TypeOfError<"BigInt">>;
17
+ /** Formats a Boolean TypeOfError in Arabic. */
18
+ export declare const formatBooleanError: TypeErrorFormatter<TypeOfError<"Boolean">>;
19
+ /** Formats a Symbol TypeOfError in Arabic. */
20
+ export declare const formatSymbolError: TypeErrorFormatter<TypeOfError<"Symbol">>;
21
+ /** Formats a Function TypeOfError in Arabic. */
22
+ export declare const formatFunctionError: TypeErrorFormatter<TypeOfError<"Function">>;
23
+ /** Formats an EvoluTypeError in Arabic. */
24
+ export declare const formatEvoluTypeError: TypeErrorFormatter<EvoluTypeError>;
25
+ /** Formats an ObjectTagError in Arabic. */
26
+ export declare const formatObjectTagError: TypeErrorFormatter<ObjectTagError>;
27
+ /** Formats an InstanceOfError in Arabic. */
28
+ export declare const formatInstanceOfError: TypeErrorFormatter<InstanceOfError>;
29
+ /** Formats a LiteralError in Arabic. */
30
+ export declare const formatLiteralError: TypeErrorFormatter<LiteralError>;
31
+ /** Formats a UnionError in Arabic. */
32
+ export declare const formatUnionError: TypeErrorFormatter<UnionError>;
33
+ /** Formats a DateIsoError in Arabic. */
34
+ export declare const formatDateIsoError: TypeErrorFormatter<DateIsoError>;
35
+ /** Formats a DateIsoFromDateError in Arabic. */
36
+ export declare const formatDateIsoFromDateError: TypeErrorFormatter<DateIsoFromDateError>;
37
+ /** Formats a DecimalStringError in Arabic. */
38
+ export declare const formatDecimalStringError: TypeErrorFormatter<DecimalStringError>;
39
+ /** Formats an Int64Error in Arabic. */
40
+ export declare const formatInt64Error: TypeErrorFormatter<Int64Error>;
41
+ /** Formats a UInt64Error in Arabic. */
42
+ export declare const formatUInt64Error: TypeErrorFormatter<UInt64Error>;
43
+ /** Formats an Int64StringError in Arabic. */
44
+ export declare const formatInt64StringError: TypeErrorFormatter<Int64StringError>;
45
+ /** Formats a CapitalizedError in Arabic. */
46
+ export declare const formatCapitalizedError: TypeErrorFormatter<CapitalizedError>;
47
+ /** Formats a TrimmedError in Arabic. */
48
+ export declare const formatTrimmedError: TypeErrorFormatter<TrimmedError>;
49
+ /** Formats a MinLengthError in Arabic. */
50
+ export declare const formatMinLengthError: TypeErrorFormatter<MinLengthError>;
51
+ /** Formats a MaxLengthError in Arabic. */
52
+ export declare const formatMaxLengthError: TypeErrorFormatter<MaxLengthError>;
53
+ /** Formats a LengthError in Arabic. */
54
+ export declare const formatLengthError: TypeErrorFormatter<LengthError>;
55
+ /** Formats a RegexError in Arabic. */
56
+ export declare const formatRegexError: TypeErrorFormatter<RegexError>;
57
+ /** Formats a Base64UrlError in Arabic. */
58
+ export declare const formatBase64UrlError: TypeErrorFormatter<Base64UrlError>;
59
+ /** Formats a NameError in Arabic. */
60
+ export declare const formatNameError: TypeErrorFormatter<NameError>;
61
+ /** Formats a MnemonicError in Arabic. */
62
+ export declare const formatMnemonicError: TypeErrorFormatter<MnemonicError>;
63
+ /** Formats an IdError in Arabic. */
64
+ export declare const formatIdError: TypeErrorFormatter<IdError>;
65
+ /** Formats a TableIdError in Arabic. */
66
+ export declare const formatTableIdError: TypeErrorFormatter<TableIdError>;
67
+ /** Formats a NonNegativeError in Arabic. */
68
+ export declare const formatNonNegativeError: TypeErrorFormatter<NonNegativeError>;
69
+ /** Formats a NonNegativeDecimalStringError in Arabic. */
70
+ export declare const formatNonNegativeDecimalStringError: TypeErrorFormatter<NonNegativeDecimalStringError>;
71
+ /** Formats a PositiveError in Arabic. */
72
+ export declare const formatPositiveError: TypeErrorFormatter<PositiveError>;
73
+ /** Formats a PositiveDecimalStringError in Arabic. */
74
+ export declare const formatPositiveDecimalStringError: TypeErrorFormatter<PositiveDecimalStringError>;
75
+ /** Formats a NonPositiveError in Arabic. */
76
+ export declare const formatNonPositiveError: TypeErrorFormatter<NonPositiveError>;
77
+ /** Formats a NonPositiveDecimalStringError in Arabic. */
78
+ export declare const formatNonPositiveDecimalStringError: TypeErrorFormatter<NonPositiveDecimalStringError>;
79
+ /** Formats a NegativeError in Arabic. */
80
+ export declare const formatNegativeError: TypeErrorFormatter<NegativeError>;
81
+ /** Formats a NegativeDecimalStringError in Arabic. */
82
+ export declare const formatNegativeDecimalStringError: TypeErrorFormatter<NegativeDecimalStringError>;
83
+ /** Formats an IntError in Arabic. */
84
+ export declare const formatIntError: TypeErrorFormatter<IntError>;
85
+ /** Formats a GreaterThanError in Arabic. */
86
+ export declare const formatGreaterThanError: TypeErrorFormatter<GreaterThanError>;
87
+ /** Formats a GreaterThanOrEqualToError in Arabic. */
88
+ export declare const formatGreaterThanOrEqualToError: TypeErrorFormatter<GreaterThanOrEqualToError>;
89
+ /** Formats a LessThanError in Arabic. */
90
+ export declare const formatLessThanError: TypeErrorFormatter<LessThanError>;
91
+ /** Formats a LessThanOrEqualToError in Arabic. */
92
+ export declare const formatLessThanOrEqualToError: TypeErrorFormatter<LessThanOrEqualToError>;
93
+ /** Formats a NonNaNError in Arabic. */
94
+ export declare const formatNonNaNError: TypeErrorFormatter<NonNaNError>;
95
+ /** Formats a FiniteError in Arabic. */
96
+ export declare const formatFiniteError: TypeErrorFormatter<FiniteError>;
97
+ /** Formats a MultipleOfError in Arabic. */
98
+ export declare const formatMultipleOfError: TypeErrorFormatter<MultipleOfError>;
99
+ /** Formats a BetweenError in Arabic. */
100
+ export declare const formatBetweenError: TypeErrorFormatter<BetweenError>;
101
+ /** Formats an ArrayError in Arabic. */
102
+ export declare const formatArrayError: TypeErrorFormatter<ArrayError>;
103
+ /** Formats a SetError in Arabic. */
104
+ export declare const formatSetError: TypeErrorFormatter<SetError>;
105
+ /** Formats a TupleError in Arabic. */
106
+ export declare const formatTupleError: TypeErrorFormatter<TupleError | TupleElementsError<TypeError>>;
107
+ /** Formats a RecordError in Arabic. */
108
+ export declare const formatRecordError: TypeErrorFormatter<RecordError>;
109
+ /** Formats an ObjectError in Arabic. */
110
+ export declare const formatObjectError: TypeErrorFormatter<ObjectError>;
111
+ /** Formats a DiscriminatedUnionError in Arabic. */
112
+ export declare const formatDiscriminatedUnionError: TypeErrorFormatter<DiscriminatedUnionError>;
113
+ /** Formats a JsonValueError in Arabic. */
114
+ export declare const formatJsonValueError: TypeErrorFormatter<JsonValueError>;
115
+ /** Formats a JsonError in Arabic. */
116
+ export declare const formatJsonError: TypeErrorFormatter<JsonError>;
117
+ //# sourceMappingURL=ar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src/intl/ar.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,SAAS,EACT,cAAc,EACd,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,EACf,0BAA0B,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