arktype 3.0.0-beta.1 → 3.0.0-rc.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 (312) hide show
  1. package/README.md +48 -144
  2. package/out/_internal/regex/charset.d.ts +24 -0
  3. package/out/_internal/regex/escape.d.ts +29 -0
  4. package/out/_internal/regex/execArray.d.ts +24 -0
  5. package/out/_internal/regex/group.d.ts +34 -0
  6. package/out/_internal/regex/index.d.ts +2 -0
  7. package/out/_internal/regex/internal.d.ts +9 -0
  8. package/out/_internal/regex/parse.d.ts +10 -0
  9. package/out/_internal/regex/quantify.d.ts +59 -0
  10. package/out/_internal/regex/regex.d.ts +38 -0
  11. package/out/_internal/regex/state.d.ts +383 -0
  12. package/out/_internal/schema/codecs.d.ts +2 -0
  13. package/out/_internal/schema/config.d.ts +103 -0
  14. package/out/_internal/schema/constraint.d.ts +78 -0
  15. package/out/_internal/schema/errors.d.ts +1 -0
  16. package/out/_internal/schema/generic.d.ts +85 -0
  17. package/out/_internal/schema/i18n.d.ts +3 -0
  18. package/out/_internal/schema/index.d.ts +54 -0
  19. package/out/_internal/schema/internal.d.ts +15 -0
  20. package/out/_internal/schema/intrinsic.d.ts +28 -0
  21. package/out/_internal/schema/kinds.d.ts +76 -0
  22. package/out/_internal/schema/module.d.ts +23 -0
  23. package/out/_internal/schema/mutatesInput.d.ts +2 -0
  24. package/out/_internal/schema/node.d.ts +349 -0
  25. package/out/_internal/schema/parse.d.ts +77 -0
  26. package/out/_internal/schema/parseSchema.d.ts +116 -0
  27. package/out/_internal/schema/predicate.d.ts +46 -0
  28. package/out/_internal/schema/refinements/after.d.ts +32 -0
  29. package/out/_internal/schema/refinements/before.d.ts +32 -0
  30. package/out/_internal/schema/refinements/divisor.d.ts +41 -0
  31. package/out/_internal/schema/refinements/exactLength.d.ts +43 -0
  32. package/out/_internal/schema/refinements/kinds.d.ts +40 -0
  33. package/out/_internal/schema/refinements/max.d.ts +33 -0
  34. package/out/_internal/schema/refinements/maxLength.d.ts +32 -0
  35. package/out/_internal/schema/refinements/min.d.ts +33 -0
  36. package/out/_internal/schema/refinements/minLength.d.ts +32 -0
  37. package/out/_internal/schema/refinements/notEqual.d.ts +38 -0
  38. package/out/_internal/schema/refinements/notEqualLength.d.ts +38 -0
  39. package/out/_internal/schema/refinements/pattern.d.ts +43 -0
  40. package/out/_internal/schema/refinements/range.d.ts +101 -0
  41. package/out/_internal/schema/roots/alias.d.ts +49 -0
  42. package/out/_internal/schema/roots/basis.d.ts +12 -0
  43. package/out/_internal/schema/roots/domain.d.ts +45 -0
  44. package/out/_internal/schema/roots/intersection.d.ts +72 -0
  45. package/out/_internal/schema/roots/morph.d.ts +59 -0
  46. package/out/_internal/schema/roots/proto.d.ts +42 -0
  47. package/out/_internal/schema/roots/root.d.ts +163 -0
  48. package/out/_internal/schema/roots/union.d.ts +146 -0
  49. package/out/_internal/schema/roots/unit.d.ts +36 -0
  50. package/out/_internal/schema/runtime.d.ts +29 -0
  51. package/out/_internal/schema/runtimeLean.d.ts +2 -0
  52. package/out/_internal/schema/runtimeNone.d.ts +2 -0
  53. package/out/_internal/schema/runtimeNoneLean.d.ts +2 -0
  54. package/out/_internal/schema/scope.d.ts +203 -0
  55. package/out/_internal/schema/shared/codecs.d.ts +5 -0
  56. package/out/_internal/schema/shared/compile.d.ts +144 -0
  57. package/out/_internal/schema/shared/configured.d.ts +14 -0
  58. package/out/_internal/schema/shared/declare.d.ts +100 -0
  59. package/out/_internal/schema/shared/disjoint.d.ts +45 -0
  60. package/out/_internal/schema/shared/enWriters.d.ts +30 -0
  61. package/out/_internal/schema/shared/errorModes.d.ts +25 -0
  62. package/out/_internal/schema/shared/errorWriters.d.ts +34 -0
  63. package/out/_internal/schema/shared/errors.d.ts +264 -0
  64. package/out/_internal/schema/shared/implement.d.ts +154 -0
  65. package/out/_internal/schema/shared/inPlace.d.ts +8 -0
  66. package/out/_internal/schema/shared/issueFeatures.d.ts +38 -0
  67. package/out/_internal/schema/shared/issues.d.ts +261 -0
  68. package/out/_internal/schema/shared/issuesLean.d.ts +80 -0
  69. package/out/_internal/schema/shared/issuesNone.d.ts +22 -0
  70. package/out/_internal/schema/shared/issuesNoneLean.d.ts +20 -0
  71. package/out/_internal/schema/shared/issuesUndetailed.d.ts +25 -0
  72. package/out/_internal/schema/shared/jsonSchema.d.ts +153 -0
  73. package/out/_internal/schema/shared/listed.d.ts +15 -0
  74. package/out/_internal/schema/shared/locale.d.ts +149 -0
  75. package/out/_internal/schema/shared/registry.d.ts +16 -0
  76. package/out/_internal/schema/shared/render.d.ts +3 -0
  77. package/out/_internal/schema/shared/rootApply.d.ts +19 -0
  78. package/out/_internal/schema/shared/sets.d.ts +26 -0
  79. package/out/_internal/schema/shared/standardFailure.d.ts +22 -0
  80. package/out/_internal/schema/shared/standardSchema.d.ts +124 -0
  81. package/out/_internal/schema/shared/toJsonSchema.d.ts +229 -0
  82. package/out/_internal/schema/shared/transform.d.ts +35 -0
  83. package/out/_internal/schema/shared/traversal.d.ts +288 -0
  84. package/out/_internal/schema/shared/utils.d.ts +59 -0
  85. package/out/_internal/schema/structure/index.d.ts +43 -0
  86. package/out/_internal/schema/structure/optional.d.ts +61 -0
  87. package/out/_internal/schema/structure/prop.d.ts +45 -0
  88. package/out/_internal/schema/structure/required.d.ts +49 -0
  89. package/out/_internal/schema/structure/sequence.d.ts +127 -0
  90. package/out/_internal/schema/structure/shared.d.ts +3 -0
  91. package/out/_internal/schema/structure/structure.d.ts +178 -0
  92. package/out/_internal/schema/units.d.ts +123 -0
  93. package/out/_internal/sets/algebra.d.ts +26 -0
  94. package/out/_internal/sets/constraint.d.ts +19 -0
  95. package/out/_internal/sets/engine.d.ts +2 -0
  96. package/out/_internal/sets/formats.d.ts +23 -0
  97. package/out/_internal/sets/fromJsonSchema.d.ts +15 -0
  98. package/out/_internal/sets/implement.d.ts +16 -0
  99. package/out/_internal/sets/index.d.ts +2 -0
  100. package/out/_internal/sets/internal.d.ts +20 -0
  101. package/out/_internal/sets/intersections.d.ts +5 -0
  102. package/out/_internal/sets/kinds.d.ts +3 -0
  103. package/out/_internal/sets/refinements.d.ts +14 -0
  104. package/out/_internal/sets/roots/alias.d.ts +3 -0
  105. package/out/_internal/sets/roots/domain.d.ts +3 -0
  106. package/out/_internal/sets/roots/intersection.d.ts +4 -0
  107. package/out/_internal/sets/roots/morph.d.ts +4 -0
  108. package/out/_internal/sets/roots/proto.d.ts +3 -0
  109. package/out/_internal/sets/roots/union.d.ts +16 -0
  110. package/out/_internal/sets/roots/unit.d.ts +3 -0
  111. package/out/_internal/sets/structure/index.d.ts +3 -0
  112. package/out/_internal/sets/structure/prop.d.ts +8 -0
  113. package/out/_internal/sets/structure/sequence.d.ts +3 -0
  114. package/out/_internal/sets/structure/structure.d.ts +3 -0
  115. package/out/_internal/sets/toJsonSchema.d.ts +25 -0
  116. package/out/_internal/util/arrays.d.ts +130 -0
  117. package/out/_internal/util/clone.d.ts +4 -0
  118. package/out/_internal/util/describe.d.ts +25 -0
  119. package/out/_internal/util/domain.d.ts +49 -0
  120. package/out/_internal/util/errors.d.ts +29 -0
  121. package/out/_internal/util/facts.d.ts +22 -0
  122. package/out/_internal/util/flatMorph.d.ts +41 -0
  123. package/out/_internal/util/formats.d.ts +8 -0
  124. package/out/_internal/util/functions.d.ts +33 -0
  125. package/out/_internal/util/generics.d.ts +65 -0
  126. package/out/_internal/util/get.d.ts +9 -0
  127. package/out/_internal/util/hkt.d.ts +27 -0
  128. package/out/_internal/util/i18n.d.ts +12 -0
  129. package/out/_internal/util/index.d.ts +28 -0
  130. package/out/_internal/util/internal.d.ts +2 -0
  131. package/out/_internal/util/intersections.d.ts +50 -0
  132. package/out/_internal/util/isomorphic.d.ts +8 -0
  133. package/out/_internal/util/keys.d.ts +18 -0
  134. package/out/_internal/util/lazily.d.ts +7 -0
  135. package/out/_internal/util/numbers.d.ts +82 -0
  136. package/out/_internal/util/objectKinds.d.ts +157 -0
  137. package/out/_internal/util/path.d.ts +16 -0
  138. package/out/_internal/util/primitive.d.ts +16 -0
  139. package/out/_internal/util/records.d.ts +173 -0
  140. package/out/_internal/util/registry.d.ts +13 -0
  141. package/out/_internal/util/scanner.d.ts +110 -0
  142. package/out/_internal/util/serialize.d.ts +40 -0
  143. package/out/_internal/util/strings.d.ts +35 -0
  144. package/out/_internal/util/traits.d.ts +89 -0
  145. package/out/_internal/util/unionToTuple.d.ts +14 -0
  146. package/out/_internal/util/weak.d.ts +8 -0
  147. package/out/attributes.d.ts +15 -11
  148. package/out/checkers.d.ts +1 -1
  149. package/out/chunk-22RQSVV3.js +0 -0
  150. package/out/chunk-3HZC67MT.js +965 -0
  151. package/out/chunk-3KBOPH3J.js +1564 -0
  152. package/out/chunk-3SH2BQ4T.js +15 -0
  153. package/out/chunk-46PLKNON.js +126 -0
  154. package/out/{chunk-G45P2CLE.js → chunk-4FTHWK63.js} +6 -1
  155. package/out/{chunk-UK5UGFOX.js → chunk-4HREHNIV.js} +23 -11
  156. package/out/chunk-4NZCLVBD.js +14 -0
  157. package/out/chunk-6FMBO47M.js +7 -0
  158. package/out/chunk-7TALAWYX.js +10 -0
  159. package/out/{chunk-DLWCO4RV.js → chunk-BCYKO54Z.js} +11 -2
  160. package/out/chunk-BDJVONP7.js +168 -0
  161. package/out/{chunk-E3DZXEZK.js → chunk-C2JOL5M2.js} +4 -2
  162. package/out/{chunk-2U2AWCI3.js → chunk-C2V6QPE3.js} +126 -97
  163. package/out/chunk-C3B4IFQL.js +6408 -0
  164. package/out/chunk-CWSF57VM.js +10 -0
  165. package/out/chunk-F5BACUJS.js +7 -0
  166. package/out/{chunk-EVCML554.js → chunk-FWRSDUJ2.js} +14 -5
  167. package/out/chunk-GID3FSQA.js +161 -0
  168. package/out/chunk-I2KLQ2HA.js +22 -0
  169. package/out/chunk-K7SLP5D2.js +84 -0
  170. package/out/chunk-KQPSKGUI.js +9 -0
  171. package/out/chunk-KXOC3JEX.js +8234 -0
  172. package/out/chunk-KXOSUYRA.js +405 -0
  173. package/out/chunk-LHNEY6QW.js +0 -0
  174. package/out/chunk-MTWKGAGO.js +323 -0
  175. package/out/chunk-NU73GNCX.js +170 -0
  176. package/out/{chunk-RAZ3TXOE.js → chunk-P5W67FQH.js} +34 -19
  177. package/out/chunk-PDLTEX6Z.js +1118 -0
  178. package/out/{chunk-VV6YDN2D.js → chunk-QUS4IAXJ.js} +304 -263
  179. package/out/chunk-R7WXIH5P.js +94 -0
  180. package/out/chunk-TACLEIDM.js +95 -0
  181. package/out/chunk-UJJGG4VQ.js +71 -0
  182. package/out/chunk-US6BWOGJ.js +109 -0
  183. package/out/chunk-VMMMOO4R.js +945 -0
  184. package/out/chunk-VYMXHSFR.js +439 -0
  185. package/out/chunk-W2XOI5DY.js +141 -0
  186. package/out/chunk-WC5L5YRP.js +25 -0
  187. package/out/{chunk-NRIGTMPM.js → chunk-WKOSL2G6.js} +4 -1
  188. package/out/chunk-XLG66ZDF.js +0 -0
  189. package/out/{chunk-5U2ZMDNI.js → chunk-XNUAQSJ4.js} +52 -30
  190. package/out/chunk-ZRYEHGSG.js +79 -0
  191. package/out/cli.d.ts +28 -0
  192. package/out/cli.js +636 -0
  193. package/out/codecs.d.ts +6 -5
  194. package/out/codecs.js +23 -7
  195. package/out/config.d.ts +5 -17
  196. package/out/config.js +11 -2
  197. package/out/declare.d.ts +40 -12
  198. package/out/deferred.d.ts +2 -2
  199. package/out/errors.d.ts +1 -1
  200. package/out/errors.js +10 -2
  201. package/out/fn.d.ts +20 -13
  202. package/out/fromJsonSchema.d.ts +18 -0
  203. package/out/generic.d.ts +9 -6
  204. package/out/i18n.d.ts +2 -2
  205. package/out/i18n.js +9 -2
  206. package/out/index.d.ts +16 -7
  207. package/out/index.js +25 -8
  208. package/out/internal.d.ts +4 -0
  209. package/out/internal.js +41 -17
  210. package/out/island.js +22 -6
  211. package/out/islandDependency.js +42 -18
  212. package/out/jsonSchema/infer.d.ts +805 -0
  213. package/out/jsonSchema/validate.d.ts +416 -0
  214. package/out/keywords/Array.d.ts +2 -2
  215. package/out/keywords/builtins.d.ts +3 -3
  216. package/out/keywords/constructors.d.ts +1 -1
  217. package/out/keywords/functions.d.ts +5 -192
  218. package/out/keywords/keywords.d.ts +3 -3
  219. package/out/keywords/number.d.ts +2 -2
  220. package/out/keywords/phrases.d.ts +4 -191
  221. package/out/keywords/string.d.ts +3 -3
  222. package/out/keywords/ts.d.ts +18 -18
  223. package/out/keywords/ts.js +19 -4
  224. package/out/locale.d.ts +6 -2
  225. package/out/locales/de.js +9 -2
  226. package/out/locales/en.js +21 -5
  227. package/out/match.d.ts +13 -10
  228. package/out/module.d.ts +2 -2
  229. package/out/mutatesInput.js +18 -3
  230. package/out/nary.d.ts +220 -194
  231. package/out/parser/ast/bounds.d.ts +2 -2
  232. package/out/parser/ast/default.d.ts +2 -2
  233. package/out/parser/ast/divisor.d.ts +2 -2
  234. package/out/parser/ast/generic.d.ts +2 -2
  235. package/out/parser/ast/infer.d.ts +1 -1
  236. package/out/parser/ast/keyof.d.ts +2 -2
  237. package/out/parser/ast/utils.d.ts +1 -1
  238. package/out/parser/ast/validate.d.ts +2 -2
  239. package/out/parser/definition.d.ts +4 -4
  240. package/out/parser/objectLiteral.d.ts +2 -2
  241. package/out/parser/property.d.ts +2 -2
  242. package/out/parser/reduce/dynamic.d.ts +2 -2
  243. package/out/parser/reduce/shared.d.ts +1 -1
  244. package/out/parser/reduce/static.d.ts +1 -1
  245. package/out/parser/shift/operand/enclosed.d.ts +2 -2
  246. package/out/parser/shift/operand/genericArgs.d.ts +2 -2
  247. package/out/parser/shift/operand/operand.d.ts +1 -1
  248. package/out/parser/shift/operand/unenclosed.d.ts +2 -2
  249. package/out/parser/shift/operand/unresolvable.d.ts +2 -2
  250. package/out/parser/shift/operator/bounds.d.ts +2 -2
  251. package/out/parser/shift/operator/brand.d.ts +2 -2
  252. package/out/parser/shift/operator/default.d.ts +4 -4
  253. package/out/parser/shift/operator/divisor.d.ts +1 -1
  254. package/out/parser/shift/operator/operator.d.ts +1 -1
  255. package/out/parser/shift/tokens.d.ts +1 -1
  256. package/out/parser/string.d.ts +2 -2
  257. package/out/parser/tupleExpressions.d.ts +6 -8
  258. package/out/parser/tupleLiteral.d.ts +2 -2
  259. package/out/precompiled.d.ts +1 -1
  260. package/out/precompiled.js +16 -2
  261. package/out/regex.d.ts +1 -0
  262. package/out/regex.js +2 -0
  263. package/out/runtime.d.ts +10 -8
  264. package/out/runtime.js +6 -4
  265. package/out/runtimeDevelopment.js +70 -52
  266. package/out/schema.d.ts +1 -0
  267. package/out/schema.js +15 -0
  268. package/out/schemaInternal.d.ts +1 -0
  269. package/out/schemaInternal.js +1401 -0
  270. package/out/schemaIssueFeatures.d.ts +1 -0
  271. package/out/schemaRuntime.d.ts +1 -0
  272. package/out/schemaRuntime.js +7 -0
  273. package/out/schemaRuntimeLean.d.ts +1 -0
  274. package/out/schemaRuntimeLean.js +1870 -0
  275. package/out/schemaRuntimeNone.d.ts +1 -0
  276. package/out/schemaRuntimeNone.js +1774 -0
  277. package/out/schemaRuntimeNoneLean.d.ts +1 -0
  278. package/out/schemaRuntimeNoneLean.js +1767 -0
  279. package/out/scope.d.ts +3 -4
  280. package/out/shared/issueFeatures.d.ts +38 -0
  281. package/out/shared/issueFeatures.js +40 -0
  282. package/out/standalone/artifact.d.ts +6 -6
  283. package/out/standalone/baking.d.ts +2 -2
  284. package/out/standalone/combinators.d.ts +1 -1
  285. package/out/standalone/compilers.d.ts +1 -1
  286. package/out/standalone/fallbacks.d.ts +1 -1
  287. package/out/standalone/keys.d.ts +1 -1
  288. package/out/standalone/sites.d.ts +3 -3
  289. package/out/standalone/units.d.ts +1 -1
  290. package/out/standalone/values.d.ts +1 -1
  291. package/out/type.d.ts +6 -6
  292. package/out/util.d.ts +1 -0
  293. package/out/util.js +137 -0
  294. package/out/variants/array.d.ts +6 -6
  295. package/out/variants/base.d.ts +61 -10
  296. package/out/variants/date.d.ts +5 -5
  297. package/out/variants/instantiate.d.ts +1 -1
  298. package/out/variants/number.d.ts +6 -6
  299. package/out/variants/object.d.ts +25 -12
  300. package/out/variants/string.d.ts +8 -8
  301. package/package.json +183 -8
  302. package/skills/arktype/SKILL.md +93 -93
  303. package/skills/arktype/references/migrating.md +144 -158
  304. package/skills/arktype/references/precompile.md +7 -7
  305. package/out/chunk-4CUA5XIP.js +0 -7
  306. package/out/chunk-GPNK5353.js +0 -2529
  307. package/out/chunk-MLKGABMK.js +0 -9
  308. package/out/chunk-PRTMQCHS.js +0 -3
  309. package/out/chunk-R5G57XC7.js +0 -7
  310. package/out/chunk-SWOOCAHN.js +0 -4
  311. package/out/chunk-TAHPKDNM.js +0 -3
  312. package/out/chunk-UETB6YE2.js +0 -14
@@ -0,0 +1,116 @@
1
+ import { type array, type BuiltinObjectKind, type Constructor, type Key, type listable, type show } from "../util/index.js";
2
+ import { type Constraint } from "./constraint.ts";
3
+ import type { nodeOfKind, Prerequisite, reducibleKindOf } from "./kinds.ts";
4
+ import { type BaseParseOptions } from "./parse.ts";
5
+ import type { Predicate } from "./predicate.ts";
6
+ import type { Domain } from "./roots/domain.ts";
7
+ import type { Intersection } from "./roots/intersection.ts";
8
+ import type { Morph } from "./roots/morph.ts";
9
+ import { BaseRoot } from "./roots/root.ts";
10
+ import { type BaseScope } from "./scope.ts";
11
+ import type { ArkEnv, TypeMeta } from "./shared/declare.ts";
12
+ import { type ConstraintKind, type NodeKind, type OpenNodeKind, type RootKind } from "./shared/implement.ts";
13
+ import type { Index } from "./structure/index.ts";
14
+ import type { UndeclaredKeyBehavior } from "./structure/structure.ts";
15
+ type withMetaPrefixedKeys<o> = {
16
+ [k in keyof o as k extends string ? `meta.${k}` : never]: o[k];
17
+ };
18
+ export interface BaseNormalizedSchema extends withMetaPrefixedKeys<TypeMeta> {
19
+ readonly meta?: ArkEnv.meta | string;
20
+ }
21
+ interface AliasSchema<alias extends string = string> extends BaseNormalizedSchema {
22
+ readonly reference: alias;
23
+ readonly resolve?: () => BaseRoot;
24
+ readonly operator?: string;
25
+ readonly operands?: readonly BaseRoot[];
26
+ }
27
+ interface DomainSchema<domain extends Domain.NonEnumerable> extends BaseNormalizedSchema, Domain.Inner<domain> {
28
+ }
29
+ interface ProtoSchema<proto extends Constructor | BuiltinObjectKind> extends BaseNormalizedSchema {
30
+ readonly proto: proto;
31
+ readonly dateAllowsInvalid?: boolean;
32
+ }
33
+ interface UnitSchema<value = unknown> extends BaseNormalizedSchema {
34
+ readonly unit: value;
35
+ }
36
+ interface UnionSchema extends BaseNormalizedSchema {
37
+ readonly branches: array<RootSchema>;
38
+ readonly ordered?: true;
39
+ }
40
+ interface MorphSchema extends BaseNormalizedSchema {
41
+ /** the schema its pipeline starts with, as morphs' first element can be */
42
+ readonly in?: RootSchema;
43
+ readonly morphs: listable<Morph | RootSchema>;
44
+ readonly declaredIn?: BaseRoot;
45
+ readonly declaredOut?: BaseRoot;
46
+ }
47
+ export type IntersectionSchema<inferredBasis = any> = show<BaseNormalizedSchema & {
48
+ domain?: NodeSchema<"domain">;
49
+ proto?: NodeSchema<"proto">;
50
+ } & conditionalRootOf<inferredBasis>>;
51
+ interface StructureSchema extends BaseNormalizedSchema {
52
+ readonly optional?: readonly OptionalSchema[];
53
+ readonly required?: readonly PropSchema[];
54
+ readonly index?: readonly IndexSchema[];
55
+ readonly sequence?: SequenceSchema;
56
+ readonly undeclared?: UndeclaredKeyBehavior;
57
+ readonly order?: readonly Key[];
58
+ }
59
+ interface PropSchema extends BaseNormalizedSchema {
60
+ readonly key: Key;
61
+ readonly value: RootSchema;
62
+ }
63
+ interface OptionalSchema extends PropSchema {
64
+ readonly default?: unknown;
65
+ }
66
+ interface IndexSchema extends BaseNormalizedSchema {
67
+ readonly signature: RootSchema<Index.KeyKind>;
68
+ readonly value: RootSchema;
69
+ }
70
+ interface ExpandedSequenceSchema extends BaseNormalizedSchema {
71
+ readonly prefix?: array<RootSchema>;
72
+ readonly defaultables?: array<[schema: RootSchema, defaultValue: unknown]>;
73
+ readonly optionals?: array<RootSchema>;
74
+ readonly variadic?: RootSchema;
75
+ readonly minVariadicLength?: number;
76
+ readonly postfix?: array<RootSchema>;
77
+ }
78
+ type SequenceSchema = ExpandedSequenceSchema | RootSchema;
79
+ interface RootSchemaList extends ReadonlyArray<RootSchema> {
80
+ }
81
+ export interface NodeSchemasByKind {
82
+ alias: `$${string}` | AliasSchema;
83
+ domain: Domain.NonEnumerable | DomainSchema<Domain.NonEnumerable>;
84
+ proto: Constructor | BuiltinObjectKind | ProtoSchema<Constructor | BuiltinObjectKind>;
85
+ unit: UnitSchema;
86
+ union: UnionSchema | RootSchemaList;
87
+ morph: MorphSchema;
88
+ intersection: IntersectionSchema;
89
+ structure: StructureSchema;
90
+ required: PropSchema;
91
+ optional: OptionalSchema;
92
+ index: IndexSchema;
93
+ sequence: SequenceSchema;
94
+ predicate: Predicate.Schema;
95
+ }
96
+ export type NodeSchema<kind extends NodeKind> = kind extends keyof NodeSchemasByKind ? NodeSchemasByKind[kind] : kind extends Constraint.PrimitiveKind ? Constraint.Schema<kind> : never;
97
+ export type RootSchema<kind extends RootKind = RootKind> = NodeSchema<kind>;
98
+ type ConditionalTerminalIntersectionRoot = {
99
+ undeclared?: UndeclaredKeyBehavior;
100
+ order?: readonly Key[];
101
+ };
102
+ type ConditionalTerminalIntersectionKey = keyof ConditionalTerminalIntersectionRoot;
103
+ type ConditionalIntersectionKey = ConstraintKind | ConditionalTerminalIntersectionKey;
104
+ export type constraintKindOf<t> = {
105
+ [k in ConstraintKind]: t extends Prerequisite<k> ? k : never;
106
+ }[ConstraintKind];
107
+ type conditionalIntersectionKeyOf<t> = constraintKindOf<t> | (t extends object ? ConditionalTerminalIntersectionKey : never);
108
+ type intersectionChildSchemaValueOf<k extends Intersection.FlattenedChildKind> = k extends OpenNodeKind ? listable<NodeSchema<k>> : NodeSchema<k>;
109
+ type conditionalSchemaValueOfKey<k extends ConditionalIntersectionKey> = k extends Intersection.FlattenedChildKind ? intersectionChildSchemaValueOf<k> : ConditionalTerminalIntersectionRoot[k & ConditionalTerminalIntersectionKey];
110
+ export type conditionalRootOf<t> = {
111
+ [k in conditionalIntersectionKeyOf<t>]?: conditionalSchemaValueOfKey<k>;
112
+ };
113
+ export declare const parseSchema: (schema: unknown, $: BaseScope, opts?: BaseParseOptions) => BaseRoot;
114
+ export declare const parseNodeSchema: <kind extends NodeKind>(kind: kind, schema: unknown, $: BaseScope, opts?: BaseParseOptions) => nodeOfKind<reducibleKindOf<kind>>;
115
+ export declare const schemaKindOf: <kind extends RootKind = RootKind>(schema: unknown, allowedKinds?: readonly kind[]) => kind;
116
+ export {};
@@ -0,0 +1,46 @@
1
+ import { BaseConstraint } from "./constraint.ts";
2
+ import type { Morph } from "./roots/morph.ts";
3
+ import type { NodeCompiler } from "./shared/compile.ts";
4
+ import type { BaseErrorContext, BaseNodeInput, declareNode } from "./shared/declare.ts";
5
+ import { type nodeImplementationOf } from "./shared/implement.ts";
6
+ import { type AliasDepth, type InternalTraversal, type Traversal } from "./shared/traversal.ts";
7
+ export declare namespace Predicate {
8
+ type Schema<predicate extends Predicate = Predicate> = ExpandedSchema<predicate> | predicate;
9
+ interface ExpandedSchema<predicate extends Predicate = Predicate> extends BaseNodeInput {
10
+ readonly predicate: predicate;
11
+ }
12
+ interface Inner<predicate extends Predicate = Predicate> {
13
+ readonly predicate: predicate;
14
+ }
15
+ interface ErrorContext extends BaseErrorContext<"predicate"> {
16
+ readonly predicate?: Predicate;
17
+ /** the morph that threw, for pipe.try */
18
+ readonly morph?: Morph;
19
+ readonly cause?: unknown;
20
+ }
21
+ interface Declaration extends declareNode<{
22
+ kind: "predicate";
23
+ inner: Inner;
24
+ stacks: true;
25
+ errorCtx: ErrorContext;
26
+ }> {
27
+ }
28
+ type Node = PredicateNode;
29
+ }
30
+ export declare class PredicateNode extends BaseConstraint<Predicate.Declaration> {
31
+ implied: null;
32
+ expression: string;
33
+ tAllows(data: unknown, ctx: InternalTraversal | AliasDepth): boolean;
34
+ errorCtx: Predicate.ErrorContext;
35
+ tApply(data: unknown, ctx: InternalTraversal): void;
36
+ compile(js: NodeCompiler): void;
37
+ }
38
+ export declare const Predicate: {
39
+ impl: nodeImplementationOf<Predicate.Declaration>;
40
+ Node: typeof PredicateNode;
41
+ };
42
+ export type Predicate<data = any> = (data: data, ctx: Traversal) => boolean;
43
+ export declare namespace Predicate {
44
+ type Casted<input = never, narrowed extends input = input> = (input: input, ctx: Traversal) => input is narrowed;
45
+ type Castable<input = never, narrowed extends input = input> = Predicate<input> | Casted<input, narrowed>;
46
+ }
@@ -0,0 +1,32 @@
1
+ import type { BaseRoot } from "../roots/root.ts";
2
+ import type { BaseErrorContext, declareNode } from "../shared/declare.ts";
3
+ import { type nodeImplementationOf } from "../shared/implement.ts";
4
+ import { BaseRange, type BaseRangeInner, type LimitSchemaValue, type UnknownExpandedRangeSchema } from "./range.ts";
5
+ export declare namespace After {
6
+ interface Inner extends BaseRangeInner {
7
+ rule: Date;
8
+ }
9
+ interface ExpandedSchema extends UnknownExpandedRangeSchema {
10
+ rule: LimitSchemaValue;
11
+ }
12
+ type Schema = ExpandedSchema | LimitSchemaValue;
13
+ interface ErrorContext extends BaseErrorContext<"after">, Inner {
14
+ }
15
+ interface Declaration extends declareNode<{
16
+ kind: "after";
17
+ inner: Inner;
18
+ prerequisite: Date;
19
+ errorCtx: ErrorContext;
20
+ }> {
21
+ }
22
+ type Node = AfterNode;
23
+ }
24
+ export declare class AfterNode extends BaseRange<After.Declaration> {
25
+ implied: BaseRoot;
26
+ collapsibleLimitString: string;
27
+ tAllows(data: Date): boolean;
28
+ }
29
+ export declare const After: {
30
+ impl: nodeImplementationOf<After.Declaration>;
31
+ Node: typeof AfterNode;
32
+ };
@@ -0,0 +1,32 @@
1
+ import type { BaseRoot } from "../roots/root.ts";
2
+ import type { BaseErrorContext, declareNode } from "../shared/declare.ts";
3
+ import { type nodeImplementationOf } from "../shared/implement.ts";
4
+ import { BaseRange, type BaseRangeInner, type LimitSchemaValue, type UnknownExpandedRangeSchema } from "./range.ts";
5
+ export declare namespace Before {
6
+ interface Inner extends BaseRangeInner {
7
+ rule: Date;
8
+ }
9
+ interface ExpandedSchema extends UnknownExpandedRangeSchema {
10
+ rule: LimitSchemaValue;
11
+ }
12
+ type Schema = ExpandedSchema | LimitSchemaValue;
13
+ interface ErrorContext extends BaseErrorContext<"before">, Inner {
14
+ }
15
+ interface Declaration extends declareNode<{
16
+ kind: "before";
17
+ inner: Inner;
18
+ prerequisite: Date;
19
+ errorCtx: ErrorContext;
20
+ }> {
21
+ }
22
+ type Node = BeforeNode;
23
+ }
24
+ export declare class BeforeNode extends BaseRange<Before.Declaration> {
25
+ collapsibleLimitString: string;
26
+ tAllows(data: Date): boolean;
27
+ implied: BaseRoot;
28
+ }
29
+ export declare const Before: {
30
+ impl: nodeImplementationOf<Before.Declaration>;
31
+ Node: typeof BeforeNode;
32
+ };
@@ -0,0 +1,41 @@
1
+ import { InternalPrimitiveConstraint, writeInvalidOperandMessage } from "../constraint.ts";
2
+ import type { BaseRoot } from "../roots/root.ts";
3
+ import type { NodeCompiler } from "../shared/compile.ts";
4
+ import type { BaseErrorContext, BaseNodeInput, declareNode } from "../shared/declare.ts";
5
+ import { type nodeImplementationOf } from "../shared/implement.ts";
6
+ export declare namespace Divisor {
7
+ interface Inner {
8
+ readonly rule: number;
9
+ }
10
+ interface ExpandedSchema extends BaseNodeInput {
11
+ readonly rule: number;
12
+ }
13
+ type Schema = ExpandedSchema | number;
14
+ interface ErrorContext extends BaseErrorContext<"divisor">, Inner {
15
+ }
16
+ interface Declaration extends declareNode<{
17
+ kind: "divisor";
18
+ inner: Inner;
19
+ prerequisite: number;
20
+ errorCtx: ErrorContext;
21
+ }> {
22
+ }
23
+ type Node = DivisorNode;
24
+ }
25
+ export declare class DivisorNode extends InternalPrimitiveConstraint<Divisor.Declaration> {
26
+ constructor(...args: ConstructorParameters<typeof InternalPrimitiveConstraint>);
27
+ tAllows(data: number): boolean;
28
+ jsCond(js: NodeCompiler, data: string): string;
29
+ readonly implied: BaseRoot;
30
+ readonly expression: string;
31
+ }
32
+ export declare const Divisor: {
33
+ impl: nodeImplementationOf<Divisor.Declaration>;
34
+ Node: typeof DivisorNode;
35
+ };
36
+ export declare const writeIndivisibleMessage: (t: BaseRoot) => string;
37
+ export type writeIndivisibleMessage<actual> = writeInvalidOperandMessage<"divisor", actual>;
38
+ export declare const writeNonIntegerDivisorMessage: <divisor extends number>(divisor: divisor) => writeNonIntegerDivisorMessage<divisor>;
39
+ export type writeNonIntegerDivisorMessage<divisor extends number> = `divisor must be an integer (was ${divisor})`;
40
+ export declare const zeroDivisorMessage = "divisor must be non-zero";
41
+ export type zeroDivisorMessage = typeof zeroDivisorMessage;
@@ -0,0 +1,43 @@
1
+ import { InternalPrimitiveConstraint } from "../constraint.ts";
2
+ import type { BaseRoot } from "../roots/root.ts";
3
+ import type { NodeCompiler } from "../shared/compile.ts";
4
+ import type { BaseErrorContext, BaseNodeInput, declareNode } from "../shared/declare.ts";
5
+ import { type nodeImplementationOf } from "../shared/implement.ts";
6
+ import { type LengthBoundableData } from "./range.ts";
7
+ export declare namespace ExactLength {
8
+ interface Inner {
9
+ readonly rule: number;
10
+ }
11
+ interface ExpandedSchema extends BaseNodeInput {
12
+ readonly rule: number;
13
+ }
14
+ type Schema = ExpandedSchema | number;
15
+ interface ErrorContext extends BaseErrorContext<"exactLength">, Inner {
16
+ }
17
+ type Declaration = declareNode<{
18
+ kind: "exactLength";
19
+ inner: Inner;
20
+ prerequisite: LengthBoundableData;
21
+ errorCtx: ErrorContext;
22
+ }>;
23
+ type Node = ExactLengthNode;
24
+ }
25
+ export declare class ExactLengthNode extends InternalPrimitiveConstraint<ExactLength.Declaration> {
26
+ constructor(...args: ConstructorParameters<typeof InternalPrimitiveConstraint>);
27
+ tAllows(data: LengthBoundableData): boolean;
28
+ jsCond(js: NodeCompiler, data: string): string;
29
+ readonly implied: BaseRoot;
30
+ readonly expression: string;
31
+ }
32
+ export declare const ExactLength: {
33
+ impl: nodeImplementationOf<{
34
+ stacks: false;
35
+ childKind: never;
36
+ reducibleTo: "exactLength";
37
+ kind: "exactLength";
38
+ inner: ExactLength.Inner;
39
+ prerequisite: LengthBoundableData;
40
+ errorCtx: ExactLength.ErrorContext;
41
+ }>;
42
+ Node: typeof ExactLengthNode;
43
+ };
@@ -0,0 +1,40 @@
1
+ import type { BaseConstraint } from "../constraint.ts";
2
+ import type { nodeImplementationOf } from "../shared/implement.ts";
3
+ import { After } from "./after.ts";
4
+ import { Before } from "./before.ts";
5
+ import { ExactLength } from "./exactLength.ts";
6
+ import { Max } from "./max.ts";
7
+ import { MaxLength } from "./maxLength.ts";
8
+ import { Min } from "./min.ts";
9
+ import { MinLength } from "./minLength.ts";
10
+ import { NotEqual } from "./notEqual.ts";
11
+ import { NotEqualLength } from "./notEqualLength.ts";
12
+ export interface BoundDeclarations {
13
+ min: Min.Declaration;
14
+ max: Max.Declaration;
15
+ minLength: MinLength.Declaration;
16
+ maxLength: MaxLength.Declaration;
17
+ exactLength: ExactLength.Declaration;
18
+ after: After.Declaration;
19
+ before: Before.Declaration;
20
+ notEqual: NotEqual.Declaration;
21
+ notEqualLength: NotEqualLength.Declaration;
22
+ }
23
+ export interface BoundNodesByKind {
24
+ min: Min.Node;
25
+ max: Max.Node;
26
+ minLength: MinLength.Node;
27
+ maxLength: MaxLength.Node;
28
+ exactLength: ExactLength.Node;
29
+ after: After.Node;
30
+ before: Before.Node;
31
+ notEqual: NotEqual.Node;
32
+ notEqualLength: NotEqualLength.Node;
33
+ }
34
+ export type BoundKind = keyof BoundDeclarations;
35
+ export type RangeKind = Exclude<BoundKind, "exactLength" | "notEqual" | "notEqualLength">;
36
+ export type boundImplementationsByKind = {
37
+ [k in BoundKind]: nodeImplementationOf<BoundDeclarations[k]>;
38
+ };
39
+ export declare const boundImplementationsByKind: boundImplementationsByKind;
40
+ export declare const boundClassesByKind: Record<BoundKind, typeof BaseConstraint<any>>;
@@ -0,0 +1,33 @@
1
+ import type { BaseRoot } from "../roots/root.ts";
2
+ import type { BaseErrorContext, declareNode } from "../shared/declare.ts";
3
+ import { type nodeImplementationOf } from "../shared/implement.ts";
4
+ import type { TraverseAllows } from "../shared/traversal.ts";
5
+ import { BaseRange, type BaseRangeInner, type UnknownExpandedRangeSchema } from "./range.ts";
6
+ export declare namespace Max {
7
+ interface Inner extends BaseRangeInner {
8
+ rule: number;
9
+ exclusive?: true;
10
+ }
11
+ interface ExpandedSchema extends UnknownExpandedRangeSchema {
12
+ rule: number;
13
+ }
14
+ type Schema = ExpandedSchema | number;
15
+ interface ErrorContext extends BaseErrorContext<"max">, Inner {
16
+ }
17
+ interface Declaration extends declareNode<{
18
+ kind: "max";
19
+ inner: Inner;
20
+ prerequisite: number;
21
+ errorCtx: ErrorContext;
22
+ }> {
23
+ }
24
+ type Node = MaxNode;
25
+ }
26
+ export declare class MaxNode extends BaseRange<Max.Declaration> {
27
+ implied: BaseRoot;
28
+ tAllows: TraverseAllows<number>;
29
+ }
30
+ export declare const Max: {
31
+ impl: nodeImplementationOf<Max.Declaration>;
32
+ Node: typeof MaxNode;
33
+ };
@@ -0,0 +1,32 @@
1
+ import type { BaseRoot } from "../roots/root.ts";
2
+ import type { BaseErrorContext, declareNode } from "../shared/declare.ts";
3
+ import { type nodeImplementationOf } from "../shared/implement.ts";
4
+ import { BaseRange, type BaseRangeInner, type LengthBoundableData, type UnknownExpandedRangeSchema } from "./range.ts";
5
+ export declare namespace MaxLength {
6
+ interface Inner extends BaseRangeInner {
7
+ rule: number;
8
+ }
9
+ interface ExpandedSchema extends UnknownExpandedRangeSchema {
10
+ rule: number;
11
+ }
12
+ type Schema = ExpandedSchema | number;
13
+ interface ErrorContext extends BaseErrorContext<"maxLength">, Inner {
14
+ }
15
+ interface Declaration extends declareNode<{
16
+ kind: "maxLength";
17
+ reducibleTo: "exactLength";
18
+ inner: Inner;
19
+ prerequisite: LengthBoundableData;
20
+ errorCtx: ErrorContext;
21
+ }> {
22
+ }
23
+ type Node = MaxLengthNode;
24
+ }
25
+ export declare class MaxLengthNode extends BaseRange<MaxLength.Declaration> {
26
+ readonly implied: BaseRoot;
27
+ tAllows(data: LengthBoundableData): boolean;
28
+ }
29
+ export declare const MaxLength: {
30
+ impl: nodeImplementationOf<MaxLength.Declaration>;
31
+ Node: typeof MaxLengthNode;
32
+ };
@@ -0,0 +1,33 @@
1
+ import type { BaseRoot } from "../roots/root.ts";
2
+ import type { BaseErrorContext, declareNode } from "../shared/declare.ts";
3
+ import { type nodeImplementationOf } from "../shared/implement.ts";
4
+ import type { TraverseAllows } from "../shared/traversal.ts";
5
+ import { BaseRange, type BaseRangeInner, type UnknownExpandedRangeSchema } from "./range.ts";
6
+ export declare namespace Min {
7
+ interface Inner extends BaseRangeInner {
8
+ rule: number;
9
+ exclusive?: true;
10
+ }
11
+ interface ExpandedSchema extends UnknownExpandedRangeSchema {
12
+ rule: number;
13
+ }
14
+ type Schema = ExpandedSchema | number;
15
+ interface ErrorContext extends BaseErrorContext<"min">, Inner {
16
+ }
17
+ interface Declaration extends declareNode<{
18
+ kind: "min";
19
+ inner: Inner;
20
+ prerequisite: number;
21
+ errorCtx: ErrorContext;
22
+ }> {
23
+ }
24
+ type Node = MinNode;
25
+ }
26
+ export declare class MinNode extends BaseRange<Min.Declaration> {
27
+ readonly implied: BaseRoot;
28
+ tAllows: TraverseAllows<number>;
29
+ }
30
+ export declare const Min: {
31
+ impl: nodeImplementationOf<Min.Declaration>;
32
+ Node: typeof MinNode;
33
+ };
@@ -0,0 +1,32 @@
1
+ import type { BaseRoot } from "../roots/root.ts";
2
+ import type { BaseErrorContext, declareNode } from "../shared/declare.ts";
3
+ import { type nodeImplementationOf } from "../shared/implement.ts";
4
+ import { BaseRange, type BaseRangeInner, type LengthBoundableData, type UnknownExpandedRangeSchema } from "./range.ts";
5
+ export declare namespace MinLength {
6
+ interface Inner extends BaseRangeInner {
7
+ rule: number;
8
+ }
9
+ interface ExpandedSchema extends UnknownExpandedRangeSchema {
10
+ rule: number;
11
+ }
12
+ type Schema = ExpandedSchema | number;
13
+ interface ErrorContext extends BaseErrorContext<"minLength">, Inner {
14
+ }
15
+ interface Declaration extends declareNode<{
16
+ kind: "minLength";
17
+ inner: Inner;
18
+ prerequisite: LengthBoundableData;
19
+ reducibleTo: "intersection";
20
+ errorCtx: ErrorContext;
21
+ }> {
22
+ }
23
+ type Node = MinLengthNode;
24
+ }
25
+ export declare class MinLengthNode extends BaseRange<MinLength.Declaration> {
26
+ readonly implied: BaseRoot;
27
+ tAllows(data: LengthBoundableData): boolean;
28
+ }
29
+ export declare const MinLength: {
30
+ impl: nodeImplementationOf<MinLength.Declaration>;
31
+ Node: typeof MinLengthNode;
32
+ };
@@ -0,0 +1,38 @@
1
+ import { InternalPrimitiveConstraint } from "../constraint.ts";
2
+ import type { BaseRoot } from "../roots/root.ts";
3
+ import type { NodeCompiler } from "../shared/compile.ts";
4
+ import type { BaseErrorContext, BaseNodeInput, declareNode } from "../shared/declare.ts";
5
+ import { type nodeImplementationOf } from "../shared/implement.ts";
6
+ import type { LimitSchemaValue, LimitValue } from "./range.ts";
7
+ export declare namespace NotEqual {
8
+ interface Inner {
9
+ readonly rule: LimitValue;
10
+ }
11
+ interface ExpandedSchema extends BaseNodeInput {
12
+ readonly rule: LimitSchemaValue;
13
+ }
14
+ type Schema = ExpandedSchema | LimitSchemaValue;
15
+ interface ErrorContext extends BaseErrorContext<"notEqual">, Inner {
16
+ }
17
+ interface Declaration extends declareNode<{
18
+ kind: "notEqual";
19
+ inner: Inner;
20
+ stacks: true;
21
+ prerequisite: number | Date;
22
+ errorCtx: ErrorContext;
23
+ }> {
24
+ }
25
+ type Node = NotEqualNode;
26
+ }
27
+ export declare class NotEqualNode extends InternalPrimitiveConstraint<NotEqual.Declaration> {
28
+ private readonly isDate;
29
+ readonly numRule: number;
30
+ tAllows: (data: number | Date) => boolean;
31
+ jsCond(js: NodeCompiler, data: string): string;
32
+ readonly implied: BaseRoot;
33
+ readonly expression: string;
34
+ }
35
+ export declare const NotEqual: {
36
+ impl: nodeImplementationOf<NotEqual.Declaration>;
37
+ Node: typeof NotEqualNode;
38
+ };
@@ -0,0 +1,38 @@
1
+ import { InternalPrimitiveConstraint } from "../constraint.ts";
2
+ import type { BaseRoot } from "../roots/root.ts";
3
+ import type { NodeCompiler } from "../shared/compile.ts";
4
+ import type { BaseErrorContext, BaseNodeInput, declareNode } from "../shared/declare.ts";
5
+ import { type nodeImplementationOf } from "../shared/implement.ts";
6
+ import { type LengthBoundableData } from "./range.ts";
7
+ export declare namespace NotEqualLength {
8
+ interface Inner {
9
+ readonly rule: number;
10
+ }
11
+ interface ExpandedSchema extends BaseNodeInput {
12
+ readonly rule: number;
13
+ }
14
+ type Schema = ExpandedSchema | number;
15
+ interface ErrorContext extends BaseErrorContext<"notEqualLength">, Inner {
16
+ }
17
+ interface Declaration extends declareNode<{
18
+ kind: "notEqualLength";
19
+ inner: Inner;
20
+ stacks: true;
21
+ reducibleTo: "intersection";
22
+ prerequisite: LengthBoundableData;
23
+ errorCtx: ErrorContext;
24
+ }> {
25
+ }
26
+ type Node = NotEqualLengthNode;
27
+ }
28
+ export declare class NotEqualLengthNode extends InternalPrimitiveConstraint<NotEqualLength.Declaration> {
29
+ constructor(...args: ConstructorParameters<typeof InternalPrimitiveConstraint>);
30
+ tAllows(data: LengthBoundableData): boolean;
31
+ jsCond(js: NodeCompiler, data: string): string;
32
+ readonly implied: BaseRoot;
33
+ readonly expression: string;
34
+ }
35
+ export declare const NotEqualLength: {
36
+ impl: nodeImplementationOf<NotEqualLength.Declaration>;
37
+ Node: typeof NotEqualLengthNode;
38
+ };
@@ -0,0 +1,43 @@
1
+ import { InternalPrimitiveConstraint } from "../constraint.ts";
2
+ import type { BaseRoot } from "../roots/root.ts";
3
+ import type { NodeCompiler } from "../shared/compile.ts";
4
+ import type { BaseErrorContext, BaseNodeInput, declareNode } from "../shared/declare.ts";
5
+ import { type nodeImplementationOf } from "../shared/implement.ts";
6
+ export declare namespace Pattern {
7
+ interface ExpandedSchema extends BaseNodeInput {
8
+ readonly rule: string;
9
+ readonly flags?: string;
10
+ }
11
+ interface Inner {
12
+ readonly rule: string;
13
+ readonly flags?: string;
14
+ }
15
+ type Schema = ExpandedSchema | string | RegExp;
16
+ interface ErrorContext extends BaseErrorContext<"pattern">, Inner {
17
+ }
18
+ interface Declaration extends declareNode<{
19
+ kind: "pattern";
20
+ inner: Inner;
21
+ stacks: true;
22
+ prerequisite: string;
23
+ errorCtx: ErrorContext;
24
+ }> {
25
+ }
26
+ type Node = PatternNode;
27
+ }
28
+ export declare class PatternNode extends InternalPrimitiveConstraint<Pattern.Declaration> {
29
+ constructor(...args: ConstructorParameters<typeof InternalPrimitiveConstraint>);
30
+ readonly instance: RegExp;
31
+ readonly tested: RegExp;
32
+ readonly expression: string;
33
+ readonly test: ((s: string) => boolean) | undefined;
34
+ private readonly isRepeated;
35
+ private readonly resetsLastIndex;
36
+ tAllows: (string: string) => boolean;
37
+ jsCond(js: NodeCompiler, data: string): string;
38
+ readonly implied: BaseRoot;
39
+ }
40
+ export declare const Pattern: {
41
+ impl: nodeImplementationOf<Pattern.Declaration>;
42
+ Node: typeof PatternNode;
43
+ };