effect 3.9.2 → 3.10.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 (202) hide show
  1. package/Arbitrary/package.json +6 -0
  2. package/FastCheck/package.json +6 -0
  3. package/JSONSchema/package.json +6 -0
  4. package/ParseResult/package.json +6 -0
  5. package/Pretty/package.json +6 -0
  6. package/Schema/package.json +6 -0
  7. package/SchemaAST/package.json +6 -0
  8. package/TSubscriptionRef/package.json +6 -0
  9. package/dist/cjs/Arbitrary.js +490 -0
  10. package/dist/cjs/Arbitrary.js.map +1 -0
  11. package/dist/cjs/Effect.js +247 -16
  12. package/dist/cjs/Effect.js.map +1 -1
  13. package/dist/cjs/FastCheck.js +17 -0
  14. package/dist/cjs/FastCheck.js.map +1 -0
  15. package/dist/cjs/Inspectable.js +43 -3
  16. package/dist/cjs/Inspectable.js.map +1 -1
  17. package/dist/cjs/JSONSchema.js +418 -0
  18. package/dist/cjs/JSONSchema.js.map +1 -0
  19. package/dist/cjs/ParseResult.js +1539 -0
  20. package/dist/cjs/ParseResult.js.map +1 -0
  21. package/dist/cjs/Predicate.js +3 -1
  22. package/dist/cjs/Predicate.js.map +1 -1
  23. package/dist/cjs/Pretty.js +183 -0
  24. package/dist/cjs/Pretty.js.map +1 -0
  25. package/dist/cjs/Schema.js +5529 -0
  26. package/dist/cjs/Schema.js.map +1 -0
  27. package/dist/cjs/SchemaAST.js +2365 -0
  28. package/dist/cjs/SchemaAST.js.map +1 -0
  29. package/dist/cjs/Stream.js +17 -3
  30. package/dist/cjs/Stream.js.map +1 -1
  31. package/dist/cjs/TPubSub.js +9 -1
  32. package/dist/cjs/TPubSub.js.map +1 -1
  33. package/dist/cjs/TQueue.js.map +1 -1
  34. package/dist/cjs/TRef.js.map +1 -1
  35. package/dist/cjs/TSubscriptionRef.js +96 -0
  36. package/dist/cjs/TSubscriptionRef.js.map +1 -0
  37. package/dist/cjs/index.js +18 -2
  38. package/dist/cjs/index.js.map +1 -1
  39. package/dist/cjs/internal/cause.js +2 -2
  40. package/dist/cjs/internal/cause.js.map +1 -1
  41. package/dist/cjs/internal/core.js +4 -4
  42. package/dist/cjs/internal/core.js.map +1 -1
  43. package/dist/cjs/internal/fiberRuntime.js +14 -12
  44. package/dist/cjs/internal/fiberRuntime.js.map +1 -1
  45. package/dist/cjs/internal/logger.js +7 -6
  46. package/dist/cjs/internal/logger.js.map +1 -1
  47. package/dist/cjs/internal/redacted.js +4 -0
  48. package/dist/cjs/internal/redacted.js.map +1 -1
  49. package/dist/cjs/internal/schema/errors.js +116 -0
  50. package/dist/cjs/internal/schema/errors.js.map +1 -0
  51. package/dist/cjs/internal/schema/filters.js +41 -0
  52. package/dist/cjs/internal/schema/filters.js.map +1 -0
  53. package/dist/cjs/internal/schema/util.js +96 -0
  54. package/dist/cjs/internal/schema/util.js.map +1 -0
  55. package/dist/cjs/internal/stm/core.js +2 -3
  56. package/dist/cjs/internal/stm/core.js.map +1 -1
  57. package/dist/cjs/internal/stm/tPubSub.js.map +1 -1
  58. package/dist/cjs/internal/stm/tQueue.js +1 -2
  59. package/dist/cjs/internal/stm/tQueue.js.map +1 -1
  60. package/dist/cjs/internal/stm/tRef.js +6 -2
  61. package/dist/cjs/internal/stm/tRef.js.map +1 -1
  62. package/dist/cjs/internal/stm/tSubscriptionRef.js +178 -0
  63. package/dist/cjs/internal/stm/tSubscriptionRef.js.map +1 -0
  64. package/dist/cjs/internal/stream.js +36 -16
  65. package/dist/cjs/internal/stream.js.map +1 -1
  66. package/dist/cjs/internal/version.js +1 -1
  67. package/dist/cjs/internal/version.js.map +1 -1
  68. package/dist/dts/Arbitrary.d.ts +45 -0
  69. package/dist/dts/Arbitrary.d.ts.map +1 -0
  70. package/dist/dts/Effect.d.ts +298 -30
  71. package/dist/dts/Effect.d.ts.map +1 -1
  72. package/dist/dts/FastCheck.d.ts +9 -0
  73. package/dist/dts/FastCheck.d.ts.map +1 -0
  74. package/dist/dts/Inspectable.d.ts +28 -0
  75. package/dist/dts/Inspectable.d.ts.map +1 -1
  76. package/dist/dts/JSONSchema.d.ts +181 -0
  77. package/dist/dts/JSONSchema.d.ts.map +1 -0
  78. package/dist/dts/ParseResult.d.ts +551 -0
  79. package/dist/dts/ParseResult.d.ts.map +1 -0
  80. package/dist/dts/Predicate.d.ts.map +1 -1
  81. package/dist/dts/Pretty.d.ts +26 -0
  82. package/dist/dts/Pretty.d.ts.map +1 -0
  83. package/dist/dts/Schema.d.ts +4562 -0
  84. package/dist/dts/Schema.d.ts.map +1 -0
  85. package/dist/dts/SchemaAST.d.ts +1321 -0
  86. package/dist/dts/SchemaAST.d.ts.map +1 -0
  87. package/dist/dts/Stream.d.ts +67 -2
  88. package/dist/dts/Stream.d.ts.map +1 -1
  89. package/dist/dts/TPubSub.d.ts +8 -0
  90. package/dist/dts/TPubSub.d.ts.map +1 -1
  91. package/dist/dts/TQueue.d.ts +7 -7
  92. package/dist/dts/TQueue.d.ts.map +1 -1
  93. package/dist/dts/TRef.d.ts +2 -1
  94. package/dist/dts/TRef.d.ts.map +1 -1
  95. package/dist/dts/TSubscriptionRef.d.ts +251 -0
  96. package/dist/dts/TSubscriptionRef.d.ts.map +1 -0
  97. package/dist/dts/index.d.ts +32 -0
  98. package/dist/dts/index.d.ts.map +1 -1
  99. package/dist/dts/internal/fiberRuntime.d.ts.map +1 -1
  100. package/dist/dts/internal/schema/errors.d.ts +2 -0
  101. package/dist/dts/internal/schema/errors.d.ts.map +1 -0
  102. package/dist/dts/internal/schema/filters.d.ts +2 -0
  103. package/dist/dts/internal/schema/filters.d.ts.map +1 -0
  104. package/dist/dts/internal/schema/util.d.ts +2 -0
  105. package/dist/dts/internal/schema/util.d.ts.map +1 -0
  106. package/dist/dts/internal/stm/tRef.d.ts +3 -1
  107. package/dist/dts/internal/stm/tRef.d.ts.map +1 -1
  108. package/dist/dts/internal/stm/tSubscriptionRef.d.ts +2 -0
  109. package/dist/dts/internal/stm/tSubscriptionRef.d.ts.map +1 -0
  110. package/dist/dts/internal/stream.d.ts.map +1 -1
  111. package/dist/esm/Arbitrary.js +472 -0
  112. package/dist/esm/Arbitrary.js.map +1 -0
  113. package/dist/esm/Effect.js +256 -18
  114. package/dist/esm/Effect.js.map +1 -1
  115. package/dist/esm/FastCheck.js +9 -0
  116. package/dist/esm/FastCheck.js.map +1 -0
  117. package/dist/esm/Inspectable.js +39 -2
  118. package/dist/esm/Inspectable.js.map +1 -1
  119. package/dist/esm/JSONSchema.js +408 -0
  120. package/dist/esm/JSONSchema.js.map +1 -0
  121. package/dist/esm/ParseResult.js +1503 -0
  122. package/dist/esm/ParseResult.js.map +1 -0
  123. package/dist/esm/Predicate.js +2 -1
  124. package/dist/esm/Predicate.js.map +1 -1
  125. package/dist/esm/Pretty.js +173 -0
  126. package/dist/esm/Pretty.js.map +1 -0
  127. package/dist/esm/Schema.js +5328 -0
  128. package/dist/esm/Schema.js.map +1 -0
  129. package/dist/esm/SchemaAST.js +2300 -0
  130. package/dist/esm/SchemaAST.js.map +1 -0
  131. package/dist/esm/Stream.js +14 -0
  132. package/dist/esm/Stream.js.map +1 -1
  133. package/dist/esm/TPubSub.js +8 -0
  134. package/dist/esm/TPubSub.js.map +1 -1
  135. package/dist/esm/TQueue.js.map +1 -1
  136. package/dist/esm/TRef.js.map +1 -1
  137. package/dist/esm/TSubscriptionRef.js +87 -0
  138. package/dist/esm/TSubscriptionRef.js.map +1 -0
  139. package/dist/esm/index.js +32 -0
  140. package/dist/esm/index.js.map +1 -1
  141. package/dist/esm/internal/cause.js +3 -3
  142. package/dist/esm/internal/cause.js.map +1 -1
  143. package/dist/esm/internal/core.js +4 -4
  144. package/dist/esm/internal/core.js.map +1 -1
  145. package/dist/esm/internal/fiberRuntime.js +14 -12
  146. package/dist/esm/internal/fiberRuntime.js.map +1 -1
  147. package/dist/esm/internal/logger.js +7 -6
  148. package/dist/esm/internal/logger.js.map +1 -1
  149. package/dist/esm/internal/redacted.js +4 -0
  150. package/dist/esm/internal/redacted.js.map +1 -1
  151. package/dist/esm/internal/schema/errors.js +87 -0
  152. package/dist/esm/internal/schema/errors.js.map +1 -0
  153. package/dist/esm/internal/schema/filters.js +35 -0
  154. package/dist/esm/internal/schema/filters.js.map +1 -0
  155. package/dist/esm/internal/schema/util.js +78 -0
  156. package/dist/esm/internal/schema/util.js.map +1 -0
  157. package/dist/esm/internal/stm/core.js +1 -2
  158. package/dist/esm/internal/stm/core.js.map +1 -1
  159. package/dist/esm/internal/stm/tPubSub.js.map +1 -1
  160. package/dist/esm/internal/stm/tQueue.js +1 -2
  161. package/dist/esm/internal/stm/tQueue.js.map +1 -1
  162. package/dist/esm/internal/stm/tRef.js +5 -1
  163. package/dist/esm/internal/stm/tRef.js.map +1 -1
  164. package/dist/esm/internal/stm/tSubscriptionRef.js +166 -0
  165. package/dist/esm/internal/stm/tSubscriptionRef.js.map +1 -0
  166. package/dist/esm/internal/stream.js +33 -15
  167. package/dist/esm/internal/stream.js.map +1 -1
  168. package/dist/esm/internal/version.js +1 -1
  169. package/dist/esm/internal/version.js.map +1 -1
  170. package/package.json +68 -1
  171. package/src/Arbitrary.ts +563 -0
  172. package/src/Effect.ts +302 -31
  173. package/src/FastCheck.ts +9 -0
  174. package/src/Inspectable.ts +56 -2
  175. package/src/JSONSchema.ts +601 -0
  176. package/src/ParseResult.ts +2027 -0
  177. package/src/Predicate.ts +3 -1
  178. package/src/Pretty.ts +204 -0
  179. package/src/Schema.ts +10388 -0
  180. package/src/SchemaAST.ts +2827 -0
  181. package/src/Stream.ts +77 -9
  182. package/src/TPubSub.ts +9 -0
  183. package/src/TQueue.ts +7 -7
  184. package/src/TRef.ts +2 -1
  185. package/src/TSubscriptionRef.ts +284 -0
  186. package/src/index.ts +40 -0
  187. package/src/internal/cause.ts +3 -3
  188. package/src/internal/core-effect.ts +2 -2
  189. package/src/internal/core.ts +4 -4
  190. package/src/internal/fiberRuntime.ts +14 -12
  191. package/src/internal/logger.ts +7 -6
  192. package/src/internal/redacted.ts +4 -0
  193. package/src/internal/schema/errors.ts +189 -0
  194. package/src/internal/schema/filters.ts +86 -0
  195. package/src/internal/schema/util.ts +113 -0
  196. package/src/internal/stm/core.ts +1 -2
  197. package/src/internal/stm/tPubSub.ts +1 -0
  198. package/src/internal/stm/tQueue.ts +2 -2
  199. package/src/internal/stm/tRef.ts +7 -2
  200. package/src/internal/stm/tSubscriptionRef.ts +286 -0
  201. package/src/internal/stream.ts +97 -20
  202. package/src/internal/version.ts +1 -1
@@ -0,0 +1,1321 @@
1
+ /**
2
+ * @since 3.10.0
3
+ */
4
+ import * as Arr from "./Array.js";
5
+ import type { Effect } from "./Effect.js";
6
+ import type { Equivalence } from "./Equivalence.js";
7
+ import * as Option from "./Option.js";
8
+ import type { ParseIssue } from "./ParseResult.js";
9
+ import type { Concurrency } from "./Types.js";
10
+ /**
11
+ * @category model
12
+ * @since 3.10.0
13
+ */
14
+ export type AST = Declaration | Literal | UniqueSymbol | UndefinedKeyword | VoidKeyword | NeverKeyword | UnknownKeyword | AnyKeyword | StringKeyword | NumberKeyword | BooleanKeyword | BigIntKeyword | SymbolKeyword | ObjectKeyword | Enums | TemplateLiteral | Refinement | TupleType | TypeLiteral | Union | Suspend | Transformation;
15
+ /**
16
+ * @category annotations
17
+ * @since 3.10.0
18
+ */
19
+ export type BrandAnnotation = Arr.NonEmptyReadonlyArray<string | symbol>;
20
+ /**
21
+ * @category annotations
22
+ * @since 3.10.0
23
+ */
24
+ export declare const BrandAnnotationId: unique symbol;
25
+ /**
26
+ * @category annotations
27
+ * @since 3.10.0
28
+ */
29
+ export type SchemaIdAnnotation = string | symbol;
30
+ /**
31
+ * @category annotations
32
+ * @since 3.10.0
33
+ */
34
+ export declare const SchemaIdAnnotationId: unique symbol;
35
+ /**
36
+ * @category annotations
37
+ * @since 3.10.0
38
+ */
39
+ export type MessageAnnotation = (issue: ParseIssue) => string | Effect<string> | {
40
+ readonly message: string | Effect<string>;
41
+ readonly override: boolean;
42
+ };
43
+ /**
44
+ * @category annotations
45
+ * @since 3.10.0
46
+ */
47
+ export declare const MessageAnnotationId: unique symbol;
48
+ /**
49
+ * @category annotations
50
+ * @since 3.10.0
51
+ */
52
+ export type MissingMessageAnnotation = () => string | Effect<string>;
53
+ /**
54
+ * @category annotations
55
+ * @since 3.10.0
56
+ */
57
+ export declare const MissingMessageAnnotationId: unique symbol;
58
+ /**
59
+ * @category annotations
60
+ * @since 3.10.0
61
+ */
62
+ export type IdentifierAnnotation = string;
63
+ /**
64
+ * @category annotations
65
+ * @since 3.10.0
66
+ */
67
+ export declare const IdentifierAnnotationId: unique symbol;
68
+ /**
69
+ * @category annotations
70
+ * @since 3.10.0
71
+ */
72
+ export type TitleAnnotation = string;
73
+ /**
74
+ * @category annotations
75
+ * @since 3.10.0
76
+ */
77
+ export declare const TitleAnnotationId: unique symbol;
78
+ /**
79
+ * @category annotations
80
+ * @since 3.10.0
81
+ */
82
+ export type DescriptionAnnotation = string;
83
+ /**
84
+ * @category annotations
85
+ * @since 3.10.0
86
+ */
87
+ export declare const DescriptionAnnotationId: unique symbol;
88
+ /**
89
+ * @category annotations
90
+ * @since 3.10.0
91
+ */
92
+ export type ExamplesAnnotation<A> = Arr.NonEmptyReadonlyArray<A>;
93
+ /**
94
+ * @category annotations
95
+ * @since 3.10.0
96
+ */
97
+ export declare const ExamplesAnnotationId: unique symbol;
98
+ /**
99
+ * @category annotations
100
+ * @since 3.10.0
101
+ */
102
+ export type DefaultAnnotation<A> = A;
103
+ /**
104
+ * @category annotations
105
+ * @since 3.10.0
106
+ */
107
+ export declare const DefaultAnnotationId: unique symbol;
108
+ /**
109
+ * @category annotations
110
+ * @since 3.10.0
111
+ */
112
+ export type JSONSchemaAnnotation = object;
113
+ /**
114
+ * @category annotations
115
+ * @since 3.10.0
116
+ */
117
+ export declare const JSONSchemaAnnotationId: unique symbol;
118
+ /**
119
+ * @category annotations
120
+ * @since 3.10.0
121
+ */
122
+ export declare const ArbitraryAnnotationId: unique symbol;
123
+ /**
124
+ * @category annotations
125
+ * @since 3.10.0
126
+ */
127
+ export declare const PrettyAnnotationId: unique symbol;
128
+ /**
129
+ * @category annotations
130
+ * @since 3.10.0
131
+ */
132
+ export type EquivalenceAnnotation<A, TypeParameters extends ReadonlyArray<any> = readonly []> = (...equivalences: {
133
+ readonly [K in keyof TypeParameters]: Equivalence<TypeParameters[K]>;
134
+ }) => Equivalence<A>;
135
+ /**
136
+ * @category annotations
137
+ * @since 3.10.0
138
+ */
139
+ export declare const EquivalenceAnnotationId: unique symbol;
140
+ /**
141
+ * @category annotations
142
+ * @since 3.10.0
143
+ */
144
+ export type DocumentationAnnotation = string;
145
+ /**
146
+ * @category annotations
147
+ * @since 3.10.0
148
+ */
149
+ export declare const DocumentationAnnotationId: unique symbol;
150
+ /**
151
+ * @category annotations
152
+ * @since 3.10.0
153
+ */
154
+ export type ConcurrencyAnnotation = Concurrency | undefined;
155
+ /**
156
+ * @category annotations
157
+ * @since 3.10.0
158
+ */
159
+ export declare const ConcurrencyAnnotationId: unique symbol;
160
+ /**
161
+ * @category annotations
162
+ * @since 3.10.0
163
+ */
164
+ export type BatchingAnnotation = boolean | "inherit" | undefined;
165
+ /**
166
+ * @category annotations
167
+ * @since 3.10.0
168
+ */
169
+ export declare const BatchingAnnotationId: unique symbol;
170
+ /**
171
+ * @category annotations
172
+ * @since 3.10.0
173
+ */
174
+ export type ParseIssueTitleAnnotation = (issue: ParseIssue) => string | undefined;
175
+ /**
176
+ * @category annotations
177
+ * @since 3.10.0
178
+ */
179
+ export declare const ParseIssueTitleAnnotationId: unique symbol;
180
+ /**
181
+ * @category annotations
182
+ * @since 3.10.0
183
+ */
184
+ export declare const ParseOptionsAnnotationId: unique symbol;
185
+ /**
186
+ * @category annotations
187
+ * @since 3.10.0
188
+ */
189
+ export type DecodingFallbackAnnotation<A> = (issue: ParseIssue) => Effect<A, ParseIssue>;
190
+ /**
191
+ * @category annotations
192
+ * @since 3.10.0
193
+ */
194
+ export declare const DecodingFallbackAnnotationId: unique symbol;
195
+ /**
196
+ * @category annotations
197
+ * @since 3.10.0
198
+ */
199
+ export declare const SurrogateAnnotationId: unique symbol;
200
+ /**
201
+ * @category annotations
202
+ * @since 3.10.0
203
+ */
204
+ export type SurrogateAnnotation = AST;
205
+ /**
206
+ * @category annotations
207
+ * @since 3.10.0
208
+ */
209
+ export interface Annotations {
210
+ readonly [_: string]: unknown;
211
+ readonly [_: symbol]: unknown;
212
+ }
213
+ /**
214
+ * @category annotations
215
+ * @since 3.10.0
216
+ */
217
+ export interface Annotated {
218
+ readonly annotations: Annotations;
219
+ }
220
+ /**
221
+ * @category annotations
222
+ * @since 3.10.0
223
+ */
224
+ export declare const getAnnotation: {
225
+ /**
226
+ * @category annotations
227
+ * @since 3.10.0
228
+ */
229
+ <A>(key: symbol): (annotated: Annotated) => Option.Option<A>;
230
+ /**
231
+ * @category annotations
232
+ * @since 3.10.0
233
+ */
234
+ <A>(annotated: Annotated, key: symbol): Option.Option<A>;
235
+ };
236
+ /**
237
+ * @category annotations
238
+ * @since 3.10.0
239
+ */
240
+ export declare const getBrandAnnotation: (annotated: Annotated) => Option.Option<readonly [string | symbol, ...(string | symbol)[]]>;
241
+ /**
242
+ * @category annotations
243
+ * @since 3.10.0
244
+ */
245
+ export declare const getMessageAnnotation: (annotated: Annotated) => Option.Option<MessageAnnotation>;
246
+ /**
247
+ * @category annotations
248
+ * @since 3.10.0
249
+ */
250
+ export declare const getMissingMessageAnnotation: (annotated: Annotated) => Option.Option<MissingMessageAnnotation>;
251
+ /**
252
+ * @category annotations
253
+ * @since 3.10.0
254
+ */
255
+ export declare const getTitleAnnotation: (annotated: Annotated) => Option.Option<string>;
256
+ /**
257
+ * @category annotations
258
+ * @since 3.10.0
259
+ */
260
+ export declare const getIdentifierAnnotation: (annotated: Annotated) => Option.Option<string>;
261
+ /**
262
+ * @category annotations
263
+ * @since 3.10.0
264
+ */
265
+ export declare const getDescriptionAnnotation: (annotated: Annotated) => Option.Option<string>;
266
+ /**
267
+ * @category annotations
268
+ * @since 3.10.0
269
+ */
270
+ export declare const getExamplesAnnotation: (annotated: Annotated) => Option.Option<readonly [unknown, ...unknown[]]>;
271
+ /**
272
+ * @category annotations
273
+ * @since 3.10.0
274
+ */
275
+ export declare const getDefaultAnnotation: (annotated: Annotated) => Option.Option<unknown>;
276
+ /**
277
+ * @category annotations
278
+ * @since 3.10.0
279
+ */
280
+ export declare const getJSONSchemaAnnotation: (annotated: Annotated) => Option.Option<object>;
281
+ /**
282
+ * @category annotations
283
+ * @since 3.10.0
284
+ */
285
+ export declare const getDocumentationAnnotation: (annotated: Annotated) => Option.Option<string>;
286
+ /**
287
+ * @category annotations
288
+ * @since 3.10.0
289
+ */
290
+ export declare const getConcurrencyAnnotation: (annotated: Annotated) => Option.Option<ConcurrencyAnnotation>;
291
+ /**
292
+ * @category annotations
293
+ * @since 3.10.0
294
+ */
295
+ export declare const getBatchingAnnotation: (annotated: Annotated) => Option.Option<BatchingAnnotation>;
296
+ /**
297
+ * @category annotations
298
+ * @since 3.10.0
299
+ */
300
+ export declare const getParseIssueTitleAnnotation: (annotated: Annotated) => Option.Option<ParseIssueTitleAnnotation>;
301
+ /**
302
+ * @category annotations
303
+ * @since 3.10.0
304
+ */
305
+ export declare const getParseOptionsAnnotation: (annotated: Annotated) => Option.Option<ParseOptions>;
306
+ /**
307
+ * @category annotations
308
+ * @since 3.10.0
309
+ */
310
+ export declare const getDecodingFallbackAnnotation: (annotated: Annotated) => Option.Option<DecodingFallbackAnnotation<unknown>>;
311
+ /**
312
+ * @category annotations
313
+ * @since 3.10.0
314
+ */
315
+ export declare const getSurrogateAnnotation: (annotated: Annotated) => Option.Option<AST>;
316
+ /**
317
+ * @category annotations
318
+ * @since 3.10.0
319
+ */
320
+ export declare const JSONIdentifierAnnotationId: unique symbol;
321
+ /**
322
+ * @category annotations
323
+ * @since 3.10.0
324
+ */
325
+ export declare const getJSONIdentifierAnnotation: (annotated: Annotated) => Option.Option<string>;
326
+ /**
327
+ * @category annotations
328
+ * @since 3.10.0
329
+ */
330
+ export declare const getJSONIdentifier: (annotated: Annotated) => Option.Option<string>;
331
+ /**
332
+ * @category schema id
333
+ * @since 3.10.0
334
+ */
335
+ export declare const ParseJsonSchemaId: unique symbol;
336
+ /**
337
+ * @category model
338
+ * @since 3.10.0
339
+ */
340
+ export declare class Declaration implements Annotated {
341
+ readonly typeParameters: ReadonlyArray<AST>;
342
+ readonly decodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>;
343
+ readonly encodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>;
344
+ readonly annotations: Annotations;
345
+ /**
346
+ * @since 3.10.0
347
+ */
348
+ readonly _tag = "Declaration";
349
+ constructor(typeParameters: ReadonlyArray<AST>, decodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>, encodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>, annotations?: Annotations);
350
+ /**
351
+ * @since 3.10.0
352
+ */
353
+ toString(): string;
354
+ /**
355
+ * @since 3.10.0
356
+ */
357
+ toJSON(): object;
358
+ }
359
+ /**
360
+ * @category guards
361
+ * @since 3.10.0
362
+ */
363
+ export declare const isDeclaration: (ast: AST) => ast is Declaration;
364
+ /**
365
+ * @category model
366
+ * @since 3.10.0
367
+ */
368
+ export type LiteralValue = string | number | boolean | null | bigint;
369
+ /**
370
+ * @category model
371
+ * @since 3.10.0
372
+ */
373
+ export declare class Literal implements Annotated {
374
+ readonly literal: LiteralValue;
375
+ readonly annotations: Annotations;
376
+ /**
377
+ * @since 3.10.0
378
+ */
379
+ readonly _tag = "Literal";
380
+ constructor(literal: LiteralValue, annotations?: Annotations);
381
+ /**
382
+ * @since 3.10.0
383
+ */
384
+ toString(): string;
385
+ /**
386
+ * @since 3.10.0
387
+ */
388
+ toJSON(): object;
389
+ }
390
+ /**
391
+ * @category guards
392
+ * @since 3.10.0
393
+ */
394
+ export declare const isLiteral: (ast: AST) => ast is Literal;
395
+ declare const $null: Literal;
396
+ export {
397
+ /**
398
+ * @category constructors
399
+ * @since 3.10.0
400
+ */
401
+ $null as null };
402
+ /**
403
+ * @category model
404
+ * @since 3.10.0
405
+ */
406
+ export declare class UniqueSymbol implements Annotated {
407
+ readonly symbol: symbol;
408
+ readonly annotations: Annotations;
409
+ /**
410
+ * @since 3.10.0
411
+ */
412
+ readonly _tag = "UniqueSymbol";
413
+ constructor(symbol: symbol, annotations?: Annotations);
414
+ /**
415
+ * @since 3.10.0
416
+ */
417
+ toString(): string;
418
+ /**
419
+ * @since 3.10.0
420
+ */
421
+ toJSON(): object;
422
+ }
423
+ /**
424
+ * @category guards
425
+ * @since 3.10.0
426
+ */
427
+ export declare const isUniqueSymbol: (ast: AST) => ast is UniqueSymbol;
428
+ /**
429
+ * @category model
430
+ * @since 3.10.0
431
+ */
432
+ export declare class UndefinedKeyword implements Annotated {
433
+ readonly annotations: Annotations;
434
+ /**
435
+ * @since 3.10.0
436
+ */
437
+ readonly _tag = "UndefinedKeyword";
438
+ constructor(annotations?: Annotations);
439
+ /**
440
+ * @since 3.10.0
441
+ */
442
+ toString(): string;
443
+ /**
444
+ * @since 3.10.0
445
+ */
446
+ toJSON(): object;
447
+ }
448
+ /**
449
+ * @category constructors
450
+ * @since 3.10.0
451
+ */
452
+ export declare const undefinedKeyword: UndefinedKeyword;
453
+ /**
454
+ * @category guards
455
+ * @since 3.10.0
456
+ */
457
+ export declare const isUndefinedKeyword: (ast: AST) => ast is UndefinedKeyword;
458
+ /**
459
+ * @category model
460
+ * @since 3.10.0
461
+ */
462
+ export declare class VoidKeyword implements Annotated {
463
+ readonly annotations: Annotations;
464
+ /**
465
+ * @since 3.10.0
466
+ */
467
+ readonly _tag = "VoidKeyword";
468
+ constructor(annotations?: Annotations);
469
+ /**
470
+ * @since 3.10.0
471
+ */
472
+ toString(): string;
473
+ /**
474
+ * @since 3.10.0
475
+ */
476
+ toJSON(): object;
477
+ }
478
+ /**
479
+ * @category constructors
480
+ * @since 3.10.0
481
+ */
482
+ export declare const voidKeyword: VoidKeyword;
483
+ /**
484
+ * @category guards
485
+ * @since 3.10.0
486
+ */
487
+ export declare const isVoidKeyword: (ast: AST) => ast is VoidKeyword;
488
+ /**
489
+ * @category model
490
+ * @since 3.10.0
491
+ */
492
+ export declare class NeverKeyword implements Annotated {
493
+ readonly annotations: Annotations;
494
+ /**
495
+ * @since 3.10.0
496
+ */
497
+ readonly _tag = "NeverKeyword";
498
+ constructor(annotations?: Annotations);
499
+ /**
500
+ * @since 3.10.0
501
+ */
502
+ toString(): string;
503
+ /**
504
+ * @since 3.10.0
505
+ */
506
+ toJSON(): object;
507
+ }
508
+ /**
509
+ * @category constructors
510
+ * @since 3.10.0
511
+ */
512
+ export declare const neverKeyword: NeverKeyword;
513
+ /**
514
+ * @category guards
515
+ * @since 3.10.0
516
+ */
517
+ export declare const isNeverKeyword: (ast: AST) => ast is NeverKeyword;
518
+ /**
519
+ * @category model
520
+ * @since 3.10.0
521
+ */
522
+ export declare class UnknownKeyword implements Annotated {
523
+ readonly annotations: Annotations;
524
+ /**
525
+ * @since 3.10.0
526
+ */
527
+ readonly _tag = "UnknownKeyword";
528
+ constructor(annotations?: Annotations);
529
+ /**
530
+ * @since 3.10.0
531
+ */
532
+ toString(): string;
533
+ /**
534
+ * @since 3.10.0
535
+ */
536
+ toJSON(): object;
537
+ }
538
+ /**
539
+ * @category constructors
540
+ * @since 3.10.0
541
+ */
542
+ export declare const unknownKeyword: UnknownKeyword;
543
+ /**
544
+ * @category guards
545
+ * @since 3.10.0
546
+ */
547
+ export declare const isUnknownKeyword: (ast: AST) => ast is UnknownKeyword;
548
+ /**
549
+ * @category model
550
+ * @since 3.10.0
551
+ */
552
+ export declare class AnyKeyword implements Annotated {
553
+ readonly annotations: Annotations;
554
+ /**
555
+ * @since 3.10.0
556
+ */
557
+ readonly _tag = "AnyKeyword";
558
+ constructor(annotations?: Annotations);
559
+ /**
560
+ * @since 3.10.0
561
+ */
562
+ toString(): string;
563
+ /**
564
+ * @since 3.10.0
565
+ */
566
+ toJSON(): object;
567
+ }
568
+ /**
569
+ * @category constructors
570
+ * @since 3.10.0
571
+ */
572
+ export declare const anyKeyword: AnyKeyword;
573
+ /**
574
+ * @category guards
575
+ * @since 3.10.0
576
+ */
577
+ export declare const isAnyKeyword: (ast: AST) => ast is AnyKeyword;
578
+ /**
579
+ * @category model
580
+ * @since 3.10.0
581
+ */
582
+ export declare class StringKeyword implements Annotated {
583
+ readonly annotations: Annotations;
584
+ /**
585
+ * @since 3.10.0
586
+ */
587
+ readonly _tag = "StringKeyword";
588
+ constructor(annotations?: Annotations);
589
+ /**
590
+ * @since 3.10.0
591
+ */
592
+ toString(): string;
593
+ /**
594
+ * @since 3.10.0
595
+ */
596
+ toJSON(): object;
597
+ }
598
+ /**
599
+ * @category constructors
600
+ * @since 3.10.0
601
+ */
602
+ export declare const stringKeyword: StringKeyword;
603
+ /**
604
+ * @category guards
605
+ * @since 3.10.0
606
+ */
607
+ export declare const isStringKeyword: (ast: AST) => ast is StringKeyword;
608
+ /**
609
+ * @category model
610
+ * @since 3.10.0
611
+ */
612
+ export declare class NumberKeyword implements Annotated {
613
+ readonly annotations: Annotations;
614
+ /**
615
+ * @since 3.10.0
616
+ */
617
+ readonly _tag = "NumberKeyword";
618
+ constructor(annotations?: Annotations);
619
+ /**
620
+ * @since 3.10.0
621
+ */
622
+ toString(): string;
623
+ /**
624
+ * @since 3.10.0
625
+ */
626
+ toJSON(): object;
627
+ }
628
+ /**
629
+ * @category constructors
630
+ * @since 3.10.0
631
+ */
632
+ export declare const numberKeyword: NumberKeyword;
633
+ /**
634
+ * @category guards
635
+ * @since 3.10.0
636
+ */
637
+ export declare const isNumberKeyword: (ast: AST) => ast is NumberKeyword;
638
+ /**
639
+ * @category model
640
+ * @since 3.10.0
641
+ */
642
+ export declare class BooleanKeyword implements Annotated {
643
+ readonly annotations: Annotations;
644
+ /**
645
+ * @since 3.10.0
646
+ */
647
+ readonly _tag = "BooleanKeyword";
648
+ constructor(annotations?: Annotations);
649
+ /**
650
+ * @since 3.10.0
651
+ */
652
+ toString(): string;
653
+ /**
654
+ * @since 3.10.0
655
+ */
656
+ toJSON(): object;
657
+ }
658
+ /**
659
+ * @category constructors
660
+ * @since 3.10.0
661
+ */
662
+ export declare const booleanKeyword: BooleanKeyword;
663
+ /**
664
+ * @category guards
665
+ * @since 3.10.0
666
+ */
667
+ export declare const isBooleanKeyword: (ast: AST) => ast is BooleanKeyword;
668
+ /**
669
+ * @category model
670
+ * @since 3.10.0
671
+ */
672
+ export declare class BigIntKeyword implements Annotated {
673
+ readonly annotations: Annotations;
674
+ /**
675
+ * @since 3.10.0
676
+ */
677
+ readonly _tag = "BigIntKeyword";
678
+ constructor(annotations?: Annotations);
679
+ /**
680
+ * @since 3.10.0
681
+ */
682
+ toString(): string;
683
+ /**
684
+ * @since 3.10.0
685
+ */
686
+ toJSON(): object;
687
+ }
688
+ /**
689
+ * @category constructors
690
+ * @since 3.10.0
691
+ */
692
+ export declare const bigIntKeyword: BigIntKeyword;
693
+ /**
694
+ * @category guards
695
+ * @since 3.10.0
696
+ */
697
+ export declare const isBigIntKeyword: (ast: AST) => ast is BigIntKeyword;
698
+ /**
699
+ * @category model
700
+ * @since 3.10.0
701
+ */
702
+ export declare class SymbolKeyword implements Annotated {
703
+ readonly annotations: Annotations;
704
+ /**
705
+ * @since 3.10.0
706
+ */
707
+ readonly _tag = "SymbolKeyword";
708
+ constructor(annotations?: Annotations);
709
+ /**
710
+ * @since 3.10.0
711
+ */
712
+ toString(): string;
713
+ /**
714
+ * @since 3.10.0
715
+ */
716
+ toJSON(): object;
717
+ }
718
+ /**
719
+ * @category constructors
720
+ * @since 3.10.0
721
+ */
722
+ export declare const symbolKeyword: SymbolKeyword;
723
+ /**
724
+ * @category guards
725
+ * @since 3.10.0
726
+ */
727
+ export declare const isSymbolKeyword: (ast: AST) => ast is SymbolKeyword;
728
+ /**
729
+ * @category model
730
+ * @since 3.10.0
731
+ */
732
+ export declare class ObjectKeyword implements Annotated {
733
+ readonly annotations: Annotations;
734
+ /**
735
+ * @since 3.10.0
736
+ */
737
+ readonly _tag = "ObjectKeyword";
738
+ constructor(annotations?: Annotations);
739
+ /**
740
+ * @since 3.10.0
741
+ */
742
+ toString(): string;
743
+ /**
744
+ * @since 3.10.0
745
+ */
746
+ toJSON(): object;
747
+ }
748
+ /**
749
+ * @category constructors
750
+ * @since 3.10.0
751
+ */
752
+ export declare const objectKeyword: ObjectKeyword;
753
+ /**
754
+ * @category guards
755
+ * @since 3.10.0
756
+ */
757
+ export declare const isObjectKeyword: (ast: AST) => ast is ObjectKeyword;
758
+ /**
759
+ * @category model
760
+ * @since 3.10.0
761
+ */
762
+ export declare class Enums implements Annotated {
763
+ readonly enums: ReadonlyArray<readonly [string, string | number]>;
764
+ readonly annotations: Annotations;
765
+ /**
766
+ * @since 3.10.0
767
+ */
768
+ readonly _tag = "Enums";
769
+ constructor(enums: ReadonlyArray<readonly [string, string | number]>, annotations?: Annotations);
770
+ /**
771
+ * @since 3.10.0
772
+ */
773
+ toString(): string;
774
+ /**
775
+ * @since 3.10.0
776
+ */
777
+ toJSON(): object;
778
+ }
779
+ /**
780
+ * @category guards
781
+ * @since 3.10.0
782
+ */
783
+ export declare const isEnums: (ast: AST) => ast is Enums;
784
+ /**
785
+ * @category model
786
+ * @since 3.10.0
787
+ */
788
+ export declare class TemplateLiteralSpan {
789
+ readonly type: StringKeyword | NumberKeyword;
790
+ readonly literal: string;
791
+ constructor(type: StringKeyword | NumberKeyword, literal: string);
792
+ /**
793
+ * @since 3.10.0
794
+ */
795
+ toString(): string;
796
+ /**
797
+ * @since 3.10.0
798
+ */
799
+ toJSON(): object;
800
+ }
801
+ /**
802
+ * @category model
803
+ * @since 3.10.0
804
+ */
805
+ export declare class TemplateLiteral implements Annotated {
806
+ readonly head: string;
807
+ readonly spans: Arr.NonEmptyReadonlyArray<TemplateLiteralSpan>;
808
+ readonly annotations: Annotations;
809
+ /**
810
+ * @since 3.10.0
811
+ */
812
+ readonly _tag = "TemplateLiteral";
813
+ constructor(head: string, spans: Arr.NonEmptyReadonlyArray<TemplateLiteralSpan>, annotations?: Annotations);
814
+ /**
815
+ * @since 3.10.0
816
+ */
817
+ toString(): string;
818
+ /**
819
+ * @since 3.10.0
820
+ */
821
+ toJSON(): object;
822
+ }
823
+ /**
824
+ * @category guards
825
+ * @since 3.10.0
826
+ */
827
+ export declare const isTemplateLiteral: (ast: AST) => ast is TemplateLiteral;
828
+ /**
829
+ * @category model
830
+ * @since 3.10.0
831
+ */
832
+ export declare class Type implements Annotated {
833
+ readonly type: AST;
834
+ readonly annotations: Annotations;
835
+ constructor(type: AST, annotations?: Annotations);
836
+ /**
837
+ * @since 3.10.0
838
+ */
839
+ toJSON(): object;
840
+ /**
841
+ * @since 3.10.0
842
+ */
843
+ toString(): string;
844
+ }
845
+ /**
846
+ * @category model
847
+ * @since 3.10.0
848
+ */
849
+ export declare class OptionalType extends Type {
850
+ readonly isOptional: boolean;
851
+ constructor(type: AST, isOptional: boolean, annotations?: Annotations);
852
+ /**
853
+ * @since 3.10.0
854
+ */
855
+ toJSON(): object;
856
+ /**
857
+ * @since 3.10.0
858
+ */
859
+ toString(): string;
860
+ }
861
+ /**
862
+ * @category model
863
+ * @since 3.10.0
864
+ */
865
+ export declare class TupleType implements Annotated {
866
+ readonly elements: ReadonlyArray<OptionalType>;
867
+ readonly rest: ReadonlyArray<Type>;
868
+ readonly isReadonly: boolean;
869
+ readonly annotations: Annotations;
870
+ /**
871
+ * @since 3.10.0
872
+ */
873
+ readonly _tag = "TupleType";
874
+ constructor(elements: ReadonlyArray<OptionalType>, rest: ReadonlyArray<Type>, isReadonly: boolean, annotations?: Annotations);
875
+ /**
876
+ * @since 3.10.0
877
+ */
878
+ toString(): string;
879
+ /**
880
+ * @since 3.10.0
881
+ */
882
+ toJSON(): object;
883
+ }
884
+ /**
885
+ * @category guards
886
+ * @since 3.10.0
887
+ */
888
+ export declare const isTupleType: (ast: AST) => ast is TupleType;
889
+ /**
890
+ * @category model
891
+ * @since 3.10.0
892
+ */
893
+ export declare class PropertySignature extends OptionalType {
894
+ readonly name: PropertyKey;
895
+ readonly isReadonly: boolean;
896
+ constructor(name: PropertyKey, type: AST, isOptional: boolean, isReadonly: boolean, annotations?: Annotations);
897
+ /**
898
+ * @since 3.10.0
899
+ */
900
+ toString(): string;
901
+ /**
902
+ * @since 3.10.0
903
+ */
904
+ toJSON(): object;
905
+ }
906
+ /**
907
+ * @since 3.10.0
908
+ */
909
+ export type Parameter = StringKeyword | SymbolKeyword | TemplateLiteral | Refinement<Parameter>;
910
+ /**
911
+ * @since 3.10.0
912
+ */
913
+ export declare const isParameter: (ast: AST) => ast is Parameter;
914
+ /**
915
+ * @category model
916
+ * @since 3.10.0
917
+ */
918
+ export declare class IndexSignature {
919
+ readonly type: AST;
920
+ readonly isReadonly: boolean;
921
+ /**
922
+ * @since 3.10.0
923
+ */
924
+ readonly parameter: Parameter;
925
+ constructor(parameter: AST, type: AST, isReadonly: boolean);
926
+ /**
927
+ * @since 3.10.0
928
+ */
929
+ toString(): string;
930
+ /**
931
+ * @since 3.10.0
932
+ */
933
+ toJSON(): object;
934
+ }
935
+ /**
936
+ * @category model
937
+ * @since 3.10.0
938
+ */
939
+ export declare class TypeLiteral implements Annotated {
940
+ readonly annotations: Annotations;
941
+ /**
942
+ * @since 3.10.0
943
+ */
944
+ readonly _tag = "TypeLiteral";
945
+ /**
946
+ * @since 3.10.0
947
+ */
948
+ readonly propertySignatures: ReadonlyArray<PropertySignature>;
949
+ /**
950
+ * @since 3.10.0
951
+ */
952
+ readonly indexSignatures: ReadonlyArray<IndexSignature>;
953
+ constructor(propertySignatures: ReadonlyArray<PropertySignature>, indexSignatures: ReadonlyArray<IndexSignature>, annotations?: Annotations);
954
+ /**
955
+ * @since 3.10.0
956
+ */
957
+ toString(): string;
958
+ /**
959
+ * @since 3.10.0
960
+ */
961
+ toJSON(): object;
962
+ }
963
+ /**
964
+ * @category guards
965
+ * @since 3.10.0
966
+ */
967
+ export declare const isTypeLiteral: (ast: AST) => ast is TypeLiteral;
968
+ /**
969
+ * @since 3.10.0
970
+ */
971
+ export type Members<A> = readonly [A, A, ...Array<A>];
972
+ /**
973
+ * @category model
974
+ * @since 3.10.0
975
+ */
976
+ export declare class Union implements Annotated {
977
+ readonly types: Members<AST>;
978
+ readonly annotations: Annotations;
979
+ static make: (types: ReadonlyArray<AST>, annotations?: Annotations) => AST;
980
+ /**
981
+ * @since 3.10.0
982
+ */
983
+ readonly _tag = "Union";
984
+ private constructor();
985
+ /**
986
+ * @since 3.10.0
987
+ */
988
+ toString(): string;
989
+ /**
990
+ * @since 3.10.0
991
+ */
992
+ toJSON(): object;
993
+ }
994
+ /**
995
+ * @category guards
996
+ * @since 3.10.0
997
+ */
998
+ export declare const isUnion: (ast: AST) => ast is Union;
999
+ /**
1000
+ * @category model
1001
+ * @since 3.10.0
1002
+ */
1003
+ export declare class Suspend implements Annotated {
1004
+ readonly f: () => AST;
1005
+ readonly annotations: Annotations;
1006
+ /**
1007
+ * @since 3.10.0
1008
+ */
1009
+ readonly _tag = "Suspend";
1010
+ constructor(f: () => AST, annotations?: Annotations);
1011
+ /**
1012
+ * @since 3.10.0
1013
+ */
1014
+ toString(): string;
1015
+ /**
1016
+ * @since 3.10.0
1017
+ */
1018
+ toJSON(): object;
1019
+ }
1020
+ /**
1021
+ * @category guards
1022
+ * @since 3.10.0
1023
+ */
1024
+ export declare const isSuspend: (ast: AST) => ast is Suspend;
1025
+ /**
1026
+ * @category model
1027
+ * @since 3.10.0
1028
+ */
1029
+ export declare class Refinement<From extends AST = AST> implements Annotated {
1030
+ readonly from: From;
1031
+ readonly filter: (input: any, options: ParseOptions, self: Refinement) => Option.Option<ParseIssue>;
1032
+ readonly annotations: Annotations;
1033
+ /**
1034
+ * @since 3.10.0
1035
+ */
1036
+ readonly _tag = "Refinement";
1037
+ constructor(from: From, filter: (input: any, options: ParseOptions, self: Refinement) => Option.Option<ParseIssue>, annotations?: Annotations);
1038
+ /**
1039
+ * @since 3.10.0
1040
+ */
1041
+ toString(): string;
1042
+ /**
1043
+ * @since 3.10.0
1044
+ */
1045
+ toJSON(): object;
1046
+ }
1047
+ /**
1048
+ * @category guards
1049
+ * @since 3.10.0
1050
+ */
1051
+ export declare const isRefinement: (ast: AST) => ast is Refinement<AST>;
1052
+ /**
1053
+ * @category model
1054
+ * @since 3.10.0
1055
+ */
1056
+ export interface ParseOptions {
1057
+ /**
1058
+ * The `errors` option allows you to receive all parsing errors when
1059
+ * attempting to parse a value using a schema. By default only the first error
1060
+ * is returned, but by setting the `errors` option to `"all"`, you can receive
1061
+ * all errors that occurred during the parsing process. This can be useful for
1062
+ * debugging or for providing more comprehensive error messages to the user.
1063
+ *
1064
+ * default: "first"
1065
+ *
1066
+ * @since 3.10.0
1067
+ */
1068
+ readonly errors?: "first" | "all" | undefined;
1069
+ /**
1070
+ * When using a `Schema` to parse a value, by default any properties that are
1071
+ * not specified in the `Schema` will be stripped out from the output. This is
1072
+ * because the `Schema` is expecting a specific shape for the parsed value,
1073
+ * and any excess properties do not conform to that shape.
1074
+ *
1075
+ * However, you can use the `onExcessProperty` option (default value:
1076
+ * `"ignore"`) to trigger a parsing error. This can be particularly useful in
1077
+ * cases where you need to detect and handle potential errors or unexpected
1078
+ * values.
1079
+ *
1080
+ * If you want to allow excess properties to remain, you can use
1081
+ * `onExcessProperty` set to `"preserve"`.
1082
+ *
1083
+ * default: "ignore"
1084
+ *
1085
+ * @since 3.10.0
1086
+ */
1087
+ readonly onExcessProperty?: "ignore" | "error" | "preserve" | undefined;
1088
+ /**
1089
+ * The `propertyOrder` option provides control over the order of object fields
1090
+ * in the output. This feature is particularly useful when the sequence of
1091
+ * keys is important for the consuming processes or when maintaining the input
1092
+ * order enhances readability and usability.
1093
+ *
1094
+ * By default, the `propertyOrder` option is set to `"none"`. This means that
1095
+ * the internal system decides the order of keys to optimize parsing speed.
1096
+ * The order of keys in this mode should not be considered stable, and it's
1097
+ * recommended not to rely on key ordering as it may change in future updates
1098
+ * without notice.
1099
+ *
1100
+ * Setting `propertyOrder` to `"original"` ensures that the keys are ordered
1101
+ * as they appear in the input during the decoding/encoding process.
1102
+ *
1103
+ * default: "none"
1104
+ *
1105
+ * @since 3.10.0
1106
+ */
1107
+ readonly propertyOrder?: "none" | "original" | undefined;
1108
+ /**
1109
+ * Handles missing properties in data structures. By default, missing
1110
+ * properties are treated as if present with an `undefined` value. To treat
1111
+ * missing properties as errors, set the `exact` option to `true`. This
1112
+ * setting is already enabled by default for `is` and `asserts` functions,
1113
+ * treating absent properties strictly unless overridden.
1114
+ *
1115
+ * default: false
1116
+ *
1117
+ * @since 3.10.0
1118
+ */
1119
+ readonly exact?: boolean | undefined;
1120
+ }
1121
+ /**
1122
+ * @since 3.10.0
1123
+ */
1124
+ export declare const defaultParseOption: ParseOptions;
1125
+ /**
1126
+ * @category model
1127
+ * @since 3.10.0
1128
+ */
1129
+ export declare class Transformation implements Annotated {
1130
+ readonly from: AST;
1131
+ readonly to: AST;
1132
+ readonly transformation: TransformationKind;
1133
+ readonly annotations: Annotations;
1134
+ /**
1135
+ * @since 3.10.0
1136
+ */
1137
+ readonly _tag = "Transformation";
1138
+ constructor(from: AST, to: AST, transformation: TransformationKind, annotations?: Annotations);
1139
+ /**
1140
+ * @since 3.10.0
1141
+ */
1142
+ toString(): string;
1143
+ /**
1144
+ * @since 3.10.0
1145
+ */
1146
+ toJSON(): object;
1147
+ }
1148
+ /**
1149
+ * @category guards
1150
+ * @since 3.10.0
1151
+ */
1152
+ export declare const isTransformation: (ast: AST) => ast is Transformation;
1153
+ /**
1154
+ * @category model
1155
+ * @since 3.10.0
1156
+ */
1157
+ export type TransformationKind = FinalTransformation | ComposeTransformation | TypeLiteralTransformation;
1158
+ /**
1159
+ * @category model
1160
+ * @since 3.10.0
1161
+ */
1162
+ export declare class FinalTransformation {
1163
+ readonly decode: (fromA: any, options: ParseOptions, self: Transformation, fromI: any) => Effect<any, ParseIssue, any>;
1164
+ readonly encode: (toI: any, options: ParseOptions, self: Transformation, toA: any) => Effect<any, ParseIssue, any>;
1165
+ /**
1166
+ * @since 3.10.0
1167
+ */
1168
+ readonly _tag = "FinalTransformation";
1169
+ constructor(decode: (fromA: any, options: ParseOptions, self: Transformation, fromI: any) => Effect<any, ParseIssue, any>, encode: (toI: any, options: ParseOptions, self: Transformation, toA: any) => Effect<any, ParseIssue, any>);
1170
+ }
1171
+ /**
1172
+ * @category guards
1173
+ * @since 3.10.0
1174
+ */
1175
+ export declare const isFinalTransformation: (ast: TransformationKind) => ast is FinalTransformation;
1176
+ /**
1177
+ * @category model
1178
+ * @since 3.10.0
1179
+ */
1180
+ export declare class ComposeTransformation {
1181
+ /**
1182
+ * @since 3.10.0
1183
+ */
1184
+ readonly _tag = "ComposeTransformation";
1185
+ }
1186
+ /**
1187
+ * @category constructors
1188
+ * @since 3.10.0
1189
+ */
1190
+ export declare const composeTransformation: ComposeTransformation;
1191
+ /**
1192
+ * @category guards
1193
+ * @since 3.10.0
1194
+ */
1195
+ export declare const isComposeTransformation: (ast: TransformationKind) => ast is ComposeTransformation;
1196
+ /**
1197
+ * Represents a `PropertySignature -> PropertySignature` transformation
1198
+ *
1199
+ * The semantic of `decode` is:
1200
+ * - `none()` represents the absence of the key/value pair
1201
+ * - `some(value)` represents the presence of the key/value pair
1202
+ *
1203
+ * The semantic of `encode` is:
1204
+ * - `none()` you don't want to output the key/value pair
1205
+ * - `some(value)` you want to output the key/value pair
1206
+ *
1207
+ * @category model
1208
+ * @since 3.10.0
1209
+ */
1210
+ export declare class PropertySignatureTransformation {
1211
+ readonly from: PropertyKey;
1212
+ readonly to: PropertyKey;
1213
+ readonly decode: (o: Option.Option<any>) => Option.Option<any>;
1214
+ readonly encode: (o: Option.Option<any>) => Option.Option<any>;
1215
+ constructor(from: PropertyKey, to: PropertyKey, decode: (o: Option.Option<any>) => Option.Option<any>, encode: (o: Option.Option<any>) => Option.Option<any>);
1216
+ }
1217
+ /**
1218
+ * @category model
1219
+ * @since 3.10.0
1220
+ */
1221
+ export declare class TypeLiteralTransformation {
1222
+ readonly propertySignatureTransformations: ReadonlyArray<PropertySignatureTransformation>;
1223
+ /**
1224
+ * @since 3.10.0
1225
+ */
1226
+ readonly _tag = "TypeLiteralTransformation";
1227
+ constructor(propertySignatureTransformations: ReadonlyArray<PropertySignatureTransformation>);
1228
+ }
1229
+ /**
1230
+ * @category guards
1231
+ * @since 3.10.0
1232
+ */
1233
+ export declare const isTypeLiteralTransformation: (ast: TransformationKind) => ast is TypeLiteralTransformation;
1234
+ /**
1235
+ * Merges a set of new annotations with existing ones, potentially overwriting
1236
+ * any duplicates.
1237
+ *
1238
+ * @since 3.10.0
1239
+ */
1240
+ export declare const annotations: (ast: AST, annotations: Annotations) => AST;
1241
+ /**
1242
+ * Equivalent at runtime to the TypeScript type-level `keyof` operator.
1243
+ *
1244
+ * @since 3.10.0
1245
+ */
1246
+ export declare const keyof: (ast: AST) => AST;
1247
+ /**
1248
+ * @since 3.10.0
1249
+ */
1250
+ export declare const getTemplateLiteralRegExp: (ast: TemplateLiteral) => RegExp;
1251
+ /**
1252
+ * @since 3.10.0
1253
+ */
1254
+ export declare const getTemplateLiteralCapturingRegExp: (ast: TemplateLiteral) => RegExp;
1255
+ /**
1256
+ * @since 3.10.0
1257
+ */
1258
+ export declare const getPropertySignatures: (ast: AST) => Array<PropertySignature>;
1259
+ /**
1260
+ * Equivalent at runtime to the built-in TypeScript utility type `Pick`.
1261
+ *
1262
+ * @since 3.10.0
1263
+ */
1264
+ export declare const pick: (ast: AST, keys: ReadonlyArray<PropertyKey>) => TypeLiteral | Transformation;
1265
+ /**
1266
+ * Equivalent at runtime to the built-in TypeScript utility type `Omit`.
1267
+ *
1268
+ * @since 3.10.0
1269
+ */
1270
+ export declare const omit: (ast: AST, keys: ReadonlyArray<PropertyKey>) => TypeLiteral | Transformation;
1271
+ /**
1272
+ * Equivalent at runtime to the built-in TypeScript utility type `Partial`.
1273
+ *
1274
+ * @since 3.10.0
1275
+ */
1276
+ export declare const partial: (ast: AST, options?: {
1277
+ readonly exact: true;
1278
+ }) => AST;
1279
+ /**
1280
+ * Equivalent at runtime to the built-in TypeScript utility type `Required`.
1281
+ *
1282
+ * @since 3.10.0
1283
+ */
1284
+ export declare const required: (ast: AST) => AST;
1285
+ /**
1286
+ * Creates a new AST with shallow mutability applied to its properties.
1287
+ *
1288
+ * @param ast - The original AST to make properties mutable (shallowly).
1289
+ *
1290
+ * @since 3.10.0
1291
+ */
1292
+ export declare const mutable: (ast: AST) => AST;
1293
+ /**
1294
+ * @since 3.10.0
1295
+ */
1296
+ export type Compiler<A> = (ast: AST, path: ReadonlyArray<PropertyKey>) => A;
1297
+ /**
1298
+ * @since 3.10.0
1299
+ */
1300
+ export type Match<A> = {
1301
+ [K in AST["_tag"]]: (ast: Extract<AST, {
1302
+ _tag: K;
1303
+ }>, compile: Compiler<A>, path: ReadonlyArray<PropertyKey>) => A;
1304
+ };
1305
+ /**
1306
+ * @since 3.10.0
1307
+ */
1308
+ export declare const getCompiler: <A>(match: Match<A>) => Compiler<A>;
1309
+ /**
1310
+ * @since 3.10.0
1311
+ */
1312
+ export declare const typeAST: (ast: AST) => AST;
1313
+ /**
1314
+ * @since 3.10.0
1315
+ */
1316
+ export declare const encodedAST: (ast: AST) => AST;
1317
+ /**
1318
+ * @since 3.10.0
1319
+ */
1320
+ export declare const encodedBoundAST: (ast: AST) => AST;
1321
+ //# sourceMappingURL=SchemaAST.d.ts.map