@ts-runtypes/core 0.10.0 → 0.11.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 (161) hide show
  1. package/README.md +31 -0
  2. package/dist/cjs/createRTFBinary.d.ts +10 -10
  3. package/dist/cjs/createRTFBinary.js +13 -13
  4. package/dist/cjs/createRTFunctions.d.ts +11 -10
  5. package/dist/cjs/createRTFunctions.js +13 -13
  6. package/dist/cjs/enrich/createFriendlyText.js +19 -0
  7. package/dist/cjs/fnHash.d.ts +1 -0
  8. package/dist/cjs/fnHash.js +10 -1
  9. package/dist/cjs/go-generated/fnHashes.generated.d.ts +49 -1
  10. package/dist/cjs/go-generated/fnHashes.generated.js +70 -2
  11. package/dist/cjs/go-generated/typeFormats.generated.d.ts +80 -0
  12. package/dist/cjs/go-generated/typeFormats.generated.js +24 -0
  13. package/dist/cjs/index.d.ts +7 -3
  14. package/dist/cjs/index.js +22 -13
  15. package/dist/cjs/mocking/binarySize.d.ts +2 -1
  16. package/dist/cjs/mocking/binarySize.js +2 -2
  17. package/dist/cjs/mocking/constants.mock.js +1 -0
  18. package/dist/cjs/mocking/createMockData.d.ts +2 -2
  19. package/dist/cjs/mocking/createMockData.js +6 -4
  20. package/dist/cjs/mocking/mockBigIntFormat.js +5 -7
  21. package/dist/cjs/mocking/mockDateTimeBounds.d.ts +5 -4
  22. package/dist/cjs/mocking/mockDateTimeBounds.js +23 -23
  23. package/dist/cjs/mocking/mockInvalid.d.ts +2 -1
  24. package/dist/cjs/mocking/mockInvalid.js +8 -6
  25. package/dist/cjs/mocking/mockNumberFormat.js +6 -8
  26. package/dist/cjs/mocking/mockOversized.js +12 -9
  27. package/dist/cjs/mocking/mockRandom.d.ts +20 -0
  28. package/dist/cjs/mocking/mockRandom.js +106 -0
  29. package/dist/cjs/mocking/mockRegistry.d.ts +2 -1
  30. package/dist/cjs/mocking/mockStringFormat.d.ts +2 -1
  31. package/dist/cjs/mocking/mockStringFormat.js +56 -82
  32. package/dist/cjs/mocking/mockTemporal.d.ts +2 -1
  33. package/dist/cjs/mocking/mockTemporal.js +46 -47
  34. package/dist/cjs/mocking/mockType.js +39 -35
  35. package/dist/cjs/mocking/mockTypes.d.ts +3 -0
  36. package/dist/cjs/standard/createStandardSchema.js +2 -2
  37. package/dist/createRTFBinary.d.ts +10 -10
  38. package/dist/createRTFBinary.d.ts.map +1 -1
  39. package/dist/createRTFBinary.js +10 -10
  40. package/dist/createRTFBinary.js.map +1 -1
  41. package/dist/createRTFunctions.d.ts +11 -10
  42. package/dist/createRTFunctions.d.ts.map +1 -1
  43. package/dist/createRTFunctions.js +10 -10
  44. package/dist/createRTFunctions.js.map +1 -1
  45. package/dist/enrich/createFriendlyText.d.ts.map +1 -1
  46. package/dist/enrich/createFriendlyText.js +19 -0
  47. package/dist/enrich/createFriendlyText.js.map +1 -1
  48. package/dist/fnHash.d.ts +1 -0
  49. package/dist/fnHash.d.ts.map +1 -1
  50. package/dist/fnHash.js +10 -1
  51. package/dist/fnHash.js.map +1 -1
  52. package/dist/go-generated/fnHashes.generated.d.ts +49 -1
  53. package/dist/go-generated/fnHashes.generated.d.ts.map +1 -1
  54. package/dist/go-generated/fnHashes.generated.js +70 -2
  55. package/dist/go-generated/fnHashes.generated.js.map +1 -1
  56. package/dist/go-generated/typeFormats.generated.d.ts +81 -0
  57. package/dist/go-generated/typeFormats.generated.d.ts.map +1 -0
  58. package/dist/go-generated/typeFormats.generated.js +22 -0
  59. package/dist/go-generated/typeFormats.generated.js.map +1 -0
  60. package/dist/index.d.ts +7 -3
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +6 -3
  63. package/dist/index.js.map +1 -1
  64. package/dist/mocking/binarySize.d.ts +2 -1
  65. package/dist/mocking/binarySize.d.ts.map +1 -1
  66. package/dist/mocking/binarySize.js +2 -2
  67. package/dist/mocking/binarySize.js.map +1 -1
  68. package/dist/mocking/constants.mock.d.ts.map +1 -1
  69. package/dist/mocking/constants.mock.js +1 -0
  70. package/dist/mocking/constants.mock.js.map +1 -1
  71. package/dist/mocking/createMockData.d.ts +2 -2
  72. package/dist/mocking/createMockData.d.ts.map +1 -1
  73. package/dist/mocking/createMockData.js +5 -3
  74. package/dist/mocking/createMockData.js.map +1 -1
  75. package/dist/mocking/mockBigIntFormat.js +5 -7
  76. package/dist/mocking/mockBigIntFormat.js.map +1 -1
  77. package/dist/mocking/mockDateTimeBounds.d.ts +5 -4
  78. package/dist/mocking/mockDateTimeBounds.d.ts.map +1 -1
  79. package/dist/mocking/mockDateTimeBounds.js +23 -23
  80. package/dist/mocking/mockDateTimeBounds.js.map +1 -1
  81. package/dist/mocking/mockInvalid.d.ts +2 -1
  82. package/dist/mocking/mockInvalid.d.ts.map +1 -1
  83. package/dist/mocking/mockInvalid.js +8 -6
  84. package/dist/mocking/mockInvalid.js.map +1 -1
  85. package/dist/mocking/mockNumberFormat.js +6 -8
  86. package/dist/mocking/mockNumberFormat.js.map +1 -1
  87. package/dist/mocking/mockOversized.d.ts.map +1 -1
  88. package/dist/mocking/mockOversized.js +12 -9
  89. package/dist/mocking/mockOversized.js.map +1 -1
  90. package/dist/mocking/mockRandom.d.ts +21 -0
  91. package/dist/mocking/mockRandom.d.ts.map +1 -0
  92. package/dist/mocking/mockRandom.js +102 -0
  93. package/dist/mocking/mockRandom.js.map +1 -0
  94. package/dist/mocking/mockRegistry.d.ts +2 -1
  95. package/dist/mocking/mockRegistry.d.ts.map +1 -1
  96. package/dist/mocking/mockRegistry.js.map +1 -1
  97. package/dist/mocking/mockStringFormat.d.ts +2 -1
  98. package/dist/mocking/mockStringFormat.d.ts.map +1 -1
  99. package/dist/mocking/mockStringFormat.js +56 -82
  100. package/dist/mocking/mockStringFormat.js.map +1 -1
  101. package/dist/mocking/mockTemporal.d.ts +2 -1
  102. package/dist/mocking/mockTemporal.d.ts.map +1 -1
  103. package/dist/mocking/mockTemporal.js +46 -47
  104. package/dist/mocking/mockTemporal.js.map +1 -1
  105. package/dist/mocking/mockType.d.ts.map +1 -1
  106. package/dist/mocking/mockType.js +39 -35
  107. package/dist/mocking/mockType.js.map +1 -1
  108. package/dist/mocking/mockTypes.d.ts +3 -0
  109. package/dist/mocking/mockTypes.d.ts.map +1 -1
  110. package/dist/standard/createStandardSchema.js +2 -2
  111. package/dist/standard/createStandardSchema.js.map +1 -1
  112. package/package.json +2 -2
  113. package/skills/rt-enrich-types/SKILL.md +48 -31
  114. package/skills/runtypes-friendly-type/SKILL.md +30 -28
  115. package/skills/runtypes-mock-data/SKILL.md +16 -16
  116. package/src/createRTFBinary.ts +43 -34
  117. package/src/createRTFunctions.ts +55 -46
  118. package/src/enrich/createFriendlyText.ts +30 -1
  119. package/src/enrich/mockData.ts +1 -1
  120. package/src/fnHash.ts +16 -1
  121. package/src/formats/bigintFormats.ts +1 -1
  122. package/src/formats/datetime/temporalFormats.ts +2 -2
  123. package/src/formats/numberFormats.ts +1 -1
  124. package/src/formats/scalars.ts +1 -1
  125. package/src/formats/string/stringFormats.ts +3 -3
  126. package/src/getRunType.ts +3 -3
  127. package/src/go-generated/fnHashes.generated.ts +70 -2
  128. package/src/go-generated/typeFormats.generated.ts +56 -0
  129. package/src/index.ts +48 -16
  130. package/src/markers.ts +4 -4
  131. package/src/mocking/binarySize.ts +4 -3
  132. package/src/mocking/constants.mock.ts +3 -0
  133. package/src/mocking/createMockData.ts +13 -7
  134. package/src/mocking/mockBigIntFormat.ts +6 -9
  135. package/src/mocking/mockDateTimeBounds.ts +31 -23
  136. package/src/mocking/mockInvalid.ts +18 -6
  137. package/src/mocking/mockNumberFormat.ts +7 -10
  138. package/src/mocking/mockOversized.ts +13 -9
  139. package/src/mocking/mockRandom.ts +181 -0
  140. package/src/mocking/mockRegistry.ts +8 -2
  141. package/src/mocking/mockStringFormat.ts +67 -89
  142. package/src/mocking/mockTemporal.ts +47 -47
  143. package/src/mocking/mockType.ts +60 -52
  144. package/src/mocking/mockTypes.ts +18 -3
  145. package/src/runtypes/dataOnly.ts +4 -4
  146. package/src/runtypes/dataView.ts +1 -1
  147. package/src/runtypes/entryTuple.ts +2 -2
  148. package/src/runtypes/rtUtils.ts +2 -2
  149. package/src/schema/atomic.ts +6 -6
  150. package/src/schema/compose.ts +2 -2
  151. package/src/schema/index.ts +1 -1
  152. package/src/schema/utility.ts +2 -2
  153. package/src/standard/createStandardSchema.ts +10 -5
  154. package/src/standard/issueMapping.ts +1 -1
  155. package/dist/cjs/mocking/mockUtils.d.ts +0 -10
  156. package/dist/cjs/mocking/mockUtils.js +0 -58
  157. package/dist/mocking/mockUtils.d.ts +0 -11
  158. package/dist/mocking/mockUtils.d.ts.map +0 -1
  159. package/dist/mocking/mockUtils.js +0 -47
  160. package/dist/mocking/mockUtils.js.map +0 -1
  161. package/src/mocking/mockUtils.ts +0 -64
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # @ts-runtypes/core
2
+
3
+ **Compile-time runtime types for TypeScript 7 / typescript-go (tsgo).**
4
+
5
+ TypeScript throws your types away before your code ever runs. RunTypes reads them
6
+ first, at build time, and hands the runtime back what it lost: validators, JSON and
7
+ binary (de)serializers, mock data, and reflection.
8
+
9
+ This is the runtime package: the sentinel markers the compiler looks for, plus the
10
+ small helper runtime the generated code calls into. It has **zero dependencies**.
11
+ The build-time half lives in
12
+ [`@ts-runtypes/devtools`](https://www.npmjs.com/package/@ts-runtypes/devtools).
13
+
14
+ ## Documentation
15
+
16
+ Install, guides, the factory reference, and benchmarks live at
17
+ **[runtypes.pages.dev](https://runtypes.pages.dev/)**.
18
+
19
+ - [Quick start](https://runtypes.pages.dev/introduction/quick-start)
20
+ - [Configuration](https://runtypes.pages.dev/introduction/configuration)
21
+ - [Source and issues](https://github.com/MionKit/ts-run-types)
22
+
23
+ ## Status
24
+
25
+ Experimental.
26
+
27
+ ## License
28
+
29
+ Proprietary — all rights reserved. No use, copying, or distribution without prior
30
+ written authorization. See
31
+ [LICENSE](https://github.com/MionKit/ts-run-types/blob/main/LICENSE).
@@ -22,15 +22,15 @@ export interface BinaryEncoderOptions {
22
22
  export interface BinaryDecoderOptions {
23
23
  cacheKey?: string;
24
24
  }
25
- export declare function createBinaryEncoder<T>(schema: RunType<T>, options: InitialSizeOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderSizeFn;
26
- export declare function createBinaryEncoder<T>(val: T | undefined, options: InitialSizeOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderSizeFn;
27
- export declare function createBinaryEncoder<T>(schema: RunType<T>, options: IntoBufferOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderIntoFn;
28
- export declare function createBinaryEncoder<T>(val: T | undefined, options: IntoBufferOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderIntoFn;
29
- export declare function createBinaryEncoder<T>(schema: RunType<T>, options?: BinaryEncoderOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderFn;
30
- export declare function createBinaryEncoder<T>(val?: T, options?: BinaryEncoderOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderFn;
25
+ export declare function createBinaryEncoderFn<T>(schema: RunType<T>, options: InitialSizeOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderSizeFn;
26
+ export declare function createBinaryEncoderFn<T>(val: T | undefined, options: InitialSizeOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderSizeFn;
27
+ export declare function createBinaryEncoderFn<T>(schema: RunType<T>, options: IntoBufferOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderIntoFn;
28
+ export declare function createBinaryEncoderFn<T>(val: T | undefined, options: IntoBufferOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderIntoFn;
29
+ export declare function createBinaryEncoderFn<T>(schema: RunType<T>, options?: BinaryEncoderOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderFn;
30
+ export declare function createBinaryEncoderFn<T>(val?: T, options?: BinaryEncoderOptions, id?: InjectTypeFnArgs<T, 'tb'>): BinaryEncoderFn;
31
31
  export type BinarySizerFn = (value: unknown) => number;
32
- export declare function createBinarySizer<T>(schema: RunType<T>, id?: InjectTypeFnArgs<T, 'tb'>): BinarySizerFn;
33
- export declare function createBinarySizer<T>(val?: T, id?: InjectTypeFnArgs<T, 'tb'>): BinarySizerFn;
34
- export declare function createBinaryDecoder<T>(schema: RunType<T>, options?: BinaryDecoderOptions, id?: InjectTypeFnArgs<T, 'fb'>): BinaryDecoderFn<DataOnly<T>>;
35
- export declare function createBinaryDecoder<T>(val?: T, options?: BinaryDecoderOptions, id?: InjectTypeFnArgs<T, 'fb'>): BinaryDecoderFn<DataOnly<T>>;
32
+ export declare function createBinarySizerFn<T>(schema: RunType<T>, id?: InjectTypeFnArgs<T, 'tb'>): BinarySizerFn;
33
+ export declare function createBinarySizerFn<T>(val?: T, id?: InjectTypeFnArgs<T, 'tb'>): BinarySizerFn;
34
+ export declare function createBinaryDecoderFn<T>(schema: RunType<T>, options?: BinaryDecoderOptions, id?: InjectTypeFnArgs<T, 'fb'>): BinaryDecoderFn<DataOnly<T>>;
35
+ export declare function createBinaryDecoderFn<T>(val?: T, options?: BinaryDecoderOptions, id?: InjectTypeFnArgs<T, 'fb'>): BinaryDecoderFn<DataOnly<T>>;
36
36
  export {};
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createBinaryEncoder = createBinaryEncoder;
4
- exports.createBinarySizer = createBinarySizer;
5
- exports.createBinaryDecoder = createBinaryDecoder;
3
+ exports.createBinaryEncoderFn = createBinaryEncoderFn;
4
+ exports.createBinarySizerFn = createBinarySizerFn;
5
+ exports.createBinaryDecoderFn = createBinaryDecoderFn;
6
6
  const rtUtils_ts_1 = require("./runtypes/rtUtils.js");
7
7
  const entryTuple_ts_1 = require("./runtypes/entryTuple.js");
8
8
  const dataView_ts_1 = require("./runtypes/dataView.js");
9
9
  const noopToBinaryFn = (_v, Ser) => Ser;
10
10
  const noopFromBinaryFn = (ret) => ret;
11
11
  function fixedBufferTooSmall(capacity) {
12
- return new RangeError(`createBinaryEncoder: the payload does not fit in the ${capacity}-byte buffer. ` +
13
- `Use createBinarySizer<T>() to compute the exact size, enlarge the buffer, or use sizeStrategy 'dynamic' / 'precalculate'.`);
12
+ return new RangeError(`createBinaryEncoderFn: the payload does not fit in the ${capacity}-byte buffer. ` +
13
+ `Use createBinarySizerFn<T>() to compute the exact size, enlarge the buffer, or use sizeStrategy 'dynamic' / 'precalculate'.`);
14
14
  }
15
15
  function encodeFixed(encodeFn, value, ser, capacity) {
16
16
  try {
@@ -32,10 +32,10 @@ function binarySizingKey(schemaId, injected) {
32
32
  return (0, entryTuple_ts_1.entryTupleKey)(injected).slice(entryTuple_ts_1.FN_HASH_LEN + 1);
33
33
  return 'unknown';
34
34
  }
35
- function createBinaryEncoder(valOrSchema, options, id) {
35
+ function createBinaryEncoderFn(valOrSchema, options, id) {
36
36
  const schemaId = (0, rtUtils_ts_1.isRunTypeSchema)(valOrSchema) ? valOrSchema.id : undefined;
37
37
  const cacheKey = options?.cacheKey ?? binarySizingKey(schemaId, id);
38
- const encodeFn = (0, entryTuple_ts_1.resolveEntryTupleFn)('createBinaryEncoder', noopToBinaryFn, schemaId, id);
38
+ const encodeFn = (0, entryTuple_ts_1.resolveEntryTupleFn)('createBinaryEncoderFn', noopToBinaryFn, schemaId, id);
39
39
  const sizeStrategy = options?.sizeStrategy ?? 'dynamic';
40
40
  if (sizeStrategy === 'precalculate') {
41
41
  const fn = (value) => {
@@ -51,7 +51,7 @@ function createBinaryEncoder(valOrSchema, options, id) {
51
51
  if (sizeStrategy === 'initialSize') {
52
52
  const fn = (value, size) => {
53
53
  if (typeof size !== 'number')
54
- throw new Error("createBinaryEncoder: sizeStrategy 'initialSize' requires a numeric `size` argument.");
54
+ throw new Error("createBinaryEncoderFn: sizeStrategy 'initialSize' requires a numeric `size` argument.");
55
55
  return encodeFixed(encodeFn, value, (0, dataView_ts_1.createDataViewSerializer)(cacheKey, { size, grow: false }), size);
56
56
  };
57
57
  return fn;
@@ -59,7 +59,7 @@ function createBinaryEncoder(valOrSchema, options, id) {
59
59
  if (sizeStrategy === 'intoBuffer') {
60
60
  const fn = (value, into) => {
61
61
  if (!(into instanceof ArrayBuffer))
62
- throw new Error("createBinaryEncoder: sizeStrategy 'intoBuffer' requires an ArrayBuffer `into` argument.");
62
+ throw new Error("createBinaryEncoderFn: sizeStrategy 'intoBuffer' requires an ArrayBuffer `into` argument.");
63
63
  return encodeFixed(encodeFn, value, (0, dataView_ts_1.createDataViewSerializer)(cacheKey, { buffer: into }), into.byteLength);
64
64
  };
65
65
  return fn;
@@ -73,20 +73,20 @@ function createBinaryEncoder(valOrSchema, options, id) {
73
73
  };
74
74
  return fn;
75
75
  }
76
- function createBinarySizer(valOrSchema, id) {
76
+ function createBinarySizerFn(valOrSchema, id) {
77
77
  const schemaId = (0, rtUtils_ts_1.isRunTypeSchema)(valOrSchema) ? valOrSchema.id : undefined;
78
78
  const cacheKey = binarySizingKey(schemaId, id);
79
- const encodeFn = (0, entryTuple_ts_1.resolveEntryTupleFn)('createBinarySizer', noopToBinaryFn, schemaId, id);
79
+ const encodeFn = (0, entryTuple_ts_1.resolveEntryTupleFn)('createBinarySizerFn', noopToBinaryFn, schemaId, id);
80
80
  return (value) => {
81
81
  const sizer = (0, dataView_ts_1.createSizingSerializer)(cacheKey);
82
82
  encodeFn(value, sizer);
83
83
  return sizer.getLength();
84
84
  };
85
85
  }
86
- function createBinaryDecoder(valOrSchema, options, id) {
86
+ function createBinaryDecoderFn(valOrSchema, options, id) {
87
87
  const schemaId = (0, rtUtils_ts_1.isRunTypeSchema)(valOrSchema) ? valOrSchema.id : undefined;
88
88
  const cacheKey = options?.cacheKey ?? binarySizingKey(schemaId, id);
89
- const decodeFn = (0, entryTuple_ts_1.resolveEntryTupleFn)('createBinaryDecoder', noopFromBinaryFn, schemaId, id);
89
+ const decodeFn = (0, entryTuple_ts_1.resolveEntryTupleFn)('createBinaryDecoderFn', noopFromBinaryFn, schemaId, id);
90
90
  return ((input) => {
91
91
  let des;
92
92
  if (input && typeof input.desString === 'function') {
@@ -6,6 +6,7 @@ export interface ValidateOptions {
6
6
  noLiterals?: boolean;
7
7
  noIsArrayCheck?: boolean;
8
8
  rejectCircularRefs?: boolean;
9
+ numberMode?: 'isFinite' | 'typeof' | 'notNaN';
9
10
  }
10
11
  export type ValidateFn<T = unknown> = (value: unknown) => value is DataOnly<T>;
11
12
  export interface RTPathSegment {
@@ -52,16 +53,16 @@ export type JsonDecoderStrategy = 'strip' | 'preserve' | 'compact';
52
53
  export type JsonDecoderOptions = {
53
54
  strategy?: JsonDecoderStrategy;
54
55
  };
55
- export declare const createValidate: (<T>(schema: RunType<T>, options?: CompTimeFnArgs<ValidateOptions>, id?: InjectTypeFnArgs<T, "val">) => ValidateFn<T>) & (<T>(val?: T, options?: CompTimeFnArgs<ValidateOptions>, id?: InjectTypeFnArgs<T, "val">) => ValidateFn<T>);
56
- export declare const createGetValidationErrors: (<T>(schema: RunType<T>, options?: CompTimeFnArgs<ValidateOptions>, id?: InjectTypeFnArgs<T, "verr">) => GetValidationErrorsFn) & (<T>(val?: T, options?: CompTimeFnArgs<ValidateOptions>, id?: InjectTypeFnArgs<T, "verr">) => GetValidationErrorsFn);
57
- export declare const createHasUnknownKeys: (<T>(schema: RunType<T>, options?: CompTimeFnArgs<HasUnknownKeysCompileOptions>, id?: InjectTypeFnArgs<T, "huk">) => HasUnknownKeysFn) & (<T>(val?: T, options?: CompTimeFnArgs<HasUnknownKeysCompileOptions>, id?: InjectTypeFnArgs<T, "huk">) => HasUnknownKeysFn);
58
- export declare const createCloneExactShape: (<T>(schema: RunType<T>, id?: InjectTypeFnArgs<T, "ces">) => CloneExactShapeFn<T>) & (<T>(val?: T, id?: InjectTypeFnArgs<T, "ces">) => CloneExactShapeFn<T>);
59
- export declare const createUnknownKeyErrors: (<T>(schema: RunType<T>, id?: InjectTypeFnArgs<T, "uke">) => UnknownKeyErrorsFn) & (<T>(val?: T, id?: InjectTypeFnArgs<T, "uke">) => UnknownKeyErrorsFn);
60
- export declare const createFormatTransform: (<T>(schema: RunType<T>, id?: InjectTypeFnArgs<T, "fmt">) => FormatTransformFn<T>) & (<T>(val?: T, id?: InjectTypeFnArgs<T, "fmt">) => FormatTransformFn<T>);
61
- export declare function createJsonEncoder<T>(schema: RunType<T>, options?: CompTimeFnArgs<JsonEncoderOptions>, id?: InjectTypeFnArgs<T, 'jsonEncoder'>): JsonEncoderFn;
62
- export declare function createJsonEncoder<T>(val?: T, options?: CompTimeFnArgs<JsonEncoderOptions>, id?: InjectTypeFnArgs<T, 'jsonEncoder'>): JsonEncoderFn;
63
- export declare function createJsonDecoder<T>(schema: RunType<T>, options?: CompTimeFnArgs<JsonDecoderOptions>, id?: InjectTypeFnArgs<T, 'jsonDecoder'>): JsonDecoderFn<DataOnly<T>>;
64
- export declare function createJsonDecoder<T>(val?: T, options?: CompTimeFnArgs<JsonDecoderOptions>, id?: InjectTypeFnArgs<T, 'jsonDecoder'>): JsonDecoderFn<DataOnly<T>>;
56
+ export declare const createValidateFn: (<T>(schema: RunType<T>, options?: CompTimeFnArgs<ValidateOptions>, id?: InjectTypeFnArgs<T, "val">) => ValidateFn<T>) & (<T>(val?: T, options?: CompTimeFnArgs<ValidateOptions>, id?: InjectTypeFnArgs<T, "val">) => ValidateFn<T>);
57
+ export declare const createGetValidationErrorsFn: (<T>(schema: RunType<T>, options?: CompTimeFnArgs<ValidateOptions>, id?: InjectTypeFnArgs<T, "verr">) => GetValidationErrorsFn) & (<T>(val?: T, options?: CompTimeFnArgs<ValidateOptions>, id?: InjectTypeFnArgs<T, "verr">) => GetValidationErrorsFn);
58
+ export declare const createHasUnknownKeysFn: (<T>(schema: RunType<T>, options?: CompTimeFnArgs<HasUnknownKeysCompileOptions>, id?: InjectTypeFnArgs<T, "huk">) => HasUnknownKeysFn) & (<T>(val?: T, options?: CompTimeFnArgs<HasUnknownKeysCompileOptions>, id?: InjectTypeFnArgs<T, "huk">) => HasUnknownKeysFn);
59
+ export declare const createCloneExactShapeFn: (<T>(schema: RunType<T>, id?: InjectTypeFnArgs<T, "ces">) => CloneExactShapeFn<T>) & (<T>(val?: T, id?: InjectTypeFnArgs<T, "ces">) => CloneExactShapeFn<T>);
60
+ export declare const createUnknownKeyErrorsFn: (<T>(schema: RunType<T>, id?: InjectTypeFnArgs<T, "uke">) => UnknownKeyErrorsFn) & (<T>(val?: T, id?: InjectTypeFnArgs<T, "uke">) => UnknownKeyErrorsFn);
61
+ export declare const createFormatTransformFn: (<T>(schema: RunType<T>, id?: InjectTypeFnArgs<T, "fmt">) => FormatTransformFn<T>) & (<T>(val?: T, id?: InjectTypeFnArgs<T, "fmt">) => FormatTransformFn<T>);
62
+ export declare function createJsonEncoderFn<T>(schema: RunType<T>, options?: CompTimeFnArgs<JsonEncoderOptions>, id?: InjectTypeFnArgs<T, 'jsonEncoder'>): JsonEncoderFn;
63
+ export declare function createJsonEncoderFn<T>(val?: T, options?: CompTimeFnArgs<JsonEncoderOptions>, id?: InjectTypeFnArgs<T, 'jsonEncoder'>): JsonEncoderFn;
64
+ export declare function createJsonDecoderFn<T>(schema: RunType<T>, options?: CompTimeFnArgs<JsonDecoderOptions>, id?: InjectTypeFnArgs<T, 'jsonDecoder'>): JsonDecoderFn<DataOnly<T>>;
65
+ export declare function createJsonDecoderFn<T>(val?: T, options?: CompTimeFnArgs<JsonDecoderOptions>, id?: InjectTypeFnArgs<T, 'jsonDecoder'>): JsonDecoderFn<DataOnly<T>>;
65
66
  export interface RTFunctionByKey {
66
67
  val: ValidateFn;
67
68
  verr: GetValidationErrorsFn;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFormatTransform = exports.createUnknownKeyErrors = exports.createCloneExactShape = exports.createHasUnknownKeys = exports.createGetValidationErrors = exports.createValidate = void 0;
4
- exports.createJsonEncoder = createJsonEncoder;
5
- exports.createJsonDecoder = createJsonDecoder;
3
+ exports.createFormatTransformFn = exports.createUnknownKeyErrorsFn = exports.createCloneExactShapeFn = exports.createHasUnknownKeysFn = exports.createGetValidationErrorsFn = exports.createValidateFn = void 0;
4
+ exports.createJsonEncoderFn = createJsonEncoderFn;
5
+ exports.createJsonDecoderFn = createJsonDecoderFn;
6
6
  exports.getRTFunction = getRTFunction;
7
7
  const rtUtils_ts_1 = require("./runtypes/rtUtils.js");
8
8
  const entryTuple_ts_1 = require("./runtypes/entryTuple.js");
@@ -19,19 +19,19 @@ function createRTFunction(fnName, identityFn) {
19
19
  const identityValueFn = (v) => v;
20
20
  const getValidationErrorsIdentity = () => [];
21
21
  const unknownKeyErrorsIdentity = () => [];
22
- exports.createValidate = createTypeFnArgsFunction('createValidate', (() => true));
23
- exports.createGetValidationErrors = createTypeFnArgsFunction('createGetValidationErrors', getValidationErrorsIdentity);
24
- exports.createHasUnknownKeys = createTypeFnArgsFunction('createHasUnknownKeys', () => false);
25
- exports.createCloneExactShape = createRTFunction('createCloneExactShape', identityValueFn);
26
- exports.createUnknownKeyErrors = createRTFunction('createUnknownKeyErrors', unknownKeyErrorsIdentity);
27
- exports.createFormatTransform = createRTFunction('createFormatTransform', identityValueFn);
22
+ exports.createValidateFn = createTypeFnArgsFunction('createValidateFn', (() => true));
23
+ exports.createGetValidationErrorsFn = createTypeFnArgsFunction('createGetValidationErrorsFn', getValidationErrorsIdentity);
24
+ exports.createHasUnknownKeysFn = createTypeFnArgsFunction('createHasUnknownKeysFn', () => false);
25
+ exports.createCloneExactShapeFn = createRTFunction('createCloneExactShapeFn', identityValueFn);
26
+ exports.createUnknownKeyErrorsFn = createRTFunction('createUnknownKeyErrorsFn', unknownKeyErrorsIdentity);
27
+ exports.createFormatTransformFn = createRTFunction('createFormatTransformFn', identityValueFn);
28
28
  const jsonStringifyFallback = (v) => JSON.stringify(v);
29
29
  const jsonParseFallback = (s) => JSON.parse(s);
30
- function createJsonEncoder(valOrSchema, _options, id) {
31
- return resolveTupleEntry('createJsonEncoder', jsonStringifyFallback, valOrSchema, id);
30
+ function createJsonEncoderFn(valOrSchema, _options, id) {
31
+ return resolveTupleEntry('createJsonEncoderFn', jsonStringifyFallback, valOrSchema, id);
32
32
  }
33
- function createJsonDecoder(valOrSchema, options, id) {
34
- return resolveTupleEntry('createJsonDecoder', jsonParseFallback, valOrSchema, id);
33
+ function createJsonDecoderFn(valOrSchema, options, id) {
34
+ return resolveTupleEntry('createJsonDecoderFn', jsonParseFallback, valOrSchema, id);
35
35
  }
36
36
  function getRTFunction(injected, fallback) {
37
37
  const identityFn = (fallback ?? ((value) => value));
@@ -188,6 +188,25 @@ function renderErrors(state, errs) {
188
188
  const sourceNode = state.source ? nodeAt(state.source, group.path) : undefined;
189
189
  const label = node?.rt$label || sourceNode?.rt$label || rawLabel(group.path);
190
190
  const index = numericIndex(group.path);
191
+ const first = group.errors[0];
192
+ const firstVal = primitiveVal(first.format?.val);
193
+ const rootProvides = resolveTemplate(node, constraintKey(first.format), firstVal, state.rootLocale) !== undefined;
194
+ const defaultNode = rootProvides ? node : sourceNode;
195
+ const defaultLocale = rootProvides ? state.rootLocale : state.sourceLocale;
196
+ const catchAll = leafTemplate(defaultNode?.rt$errors?.rt$default, firstVal, defaultLocale);
197
+ if (catchAll !== undefined) {
198
+ out.push({
199
+ path: group.pathStr,
200
+ label,
201
+ message: interpolate(catchAll, {
202
+ label,
203
+ valText: renderBoundText(state, first.format, firstVal),
204
+ path: group.pathStr,
205
+ index,
206
+ }),
207
+ });
208
+ continue;
209
+ }
191
210
  for (const err of group.errors) {
192
211
  const key = constraintKey(err.format);
193
212
  const val = primitiveVal(err.format?.val);
@@ -3,6 +3,7 @@ export type FnHashKey = keyof typeof FN_HASHES;
3
3
  export interface FnHashOptions {
4
4
  noLiterals?: boolean;
5
5
  noIsArrayCheck?: boolean;
6
+ numberMode?: string;
6
7
  strategy?: string;
7
8
  runsAfterValidation?: boolean;
8
9
  rejectCircularRefs?: boolean;
@@ -2,13 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getFnHash = getFnHash;
4
4
  const fnHashes_generated_ts_1 = require("./go-generated/fnHashes.generated.js");
5
+ function numberModeOptionName(mode) {
6
+ if (mode === 'typeof')
7
+ return 'numberTypeof';
8
+ if (mode === 'notNaN')
9
+ return 'numberNotNaN';
10
+ return '';
11
+ }
5
12
  function validateVariantToken(options) {
6
13
  if (!options)
7
14
  return '';
15
+ const numberModeName = numberModeOptionName(options.numberMode);
8
16
  let suffix = 'N';
9
17
  let hit = false;
10
18
  for (const [name, letter] of fnHashes_generated_ts_1.VALIDATE_OPTION_LETTERS) {
11
- if (options[name]) {
19
+ const present = name === numberModeName || options[name];
20
+ if (present) {
12
21
  suffix += letter;
13
22
  hit = true;
14
23
  }
@@ -119,10 +119,34 @@ export declare const FN_HASHES: {
119
119
  readonly C: "cCe";
120
120
  readonly NA: "WeU";
121
121
  readonly NAC: "fJb";
122
+ readonly NAM: "D77";
123
+ readonly NAMC: "ASI";
124
+ readonly NAT: "CG0";
125
+ readonly NATC: "jH9";
126
+ readonly NATM: "zd5";
127
+ readonly NATMC: "UQE";
122
128
  readonly NL: "N7J";
123
129
  readonly NLA: "GYK";
124
130
  readonly NLAC: "z9t";
131
+ readonly NLAM: "rXx";
132
+ readonly NLAMC: "oaW";
133
+ readonly NLAT: "qwq";
134
+ readonly NLATC: "XZn";
135
+ readonly NLATM: "TDn";
136
+ readonly NLATMC: "w46";
125
137
  readonly NLC: "iai";
138
+ readonly NLM: "iWy";
139
+ readonly NLMC: "HZv";
140
+ readonly NLT: "hvr";
141
+ readonly NLTC: "qOW";
142
+ readonly NLTM: "CEc";
143
+ readonly NLTMC: "TDx";
144
+ readonly NM: "ycI";
145
+ readonly NMC: "nzd";
146
+ readonly NT: "xLB";
147
+ readonly NTC: "WoE";
148
+ readonly NTM: "OOM";
149
+ readonly NTMC: "flj";
126
150
  };
127
151
  };
128
152
  readonly verr: {
@@ -133,12 +157,36 @@ export declare const FN_HASHES: {
133
157
  readonly C: "a8A";
134
158
  readonly NA: "UKg";
135
159
  readonly NAC: "F3L";
160
+ readonly NAM: "Vtr";
161
+ readonly NAMC: "OsE";
162
+ readonly NAT: "U2k";
163
+ readonly NATC: "xh1";
164
+ readonly NATM: "ZxF";
165
+ readonly NATMC: "eIg";
136
166
  readonly NL: "LD5";
137
167
  readonly NLA: "Yk4";
138
168
  readonly NLAC: "NJl";
169
+ readonly NLAM: "Rh7";
170
+ readonly NLAMC: "y2C";
171
+ readonly NLAT: "QQ0";
172
+ readonly NLATC: "hRZ";
173
+ readonly NLATM: "hdf";
174
+ readonly NLATMC: "eGg";
139
175
  readonly NLC: "IuS";
176
+ readonly NLM: "AiS";
177
+ readonly NLMC: "Vzn";
178
+ readonly NLT: "zRL";
179
+ readonly NLTC: "EoO";
180
+ readonly NLTM: "cYM";
181
+ readonly NLTMC: "dv9";
182
+ readonly NM: "wI4";
183
+ readonly NMC: "NTN";
184
+ readonly NT: "vhX";
185
+ readonly NTC: "wIe";
186
+ readonly NTM: "ga6";
187
+ readonly NTMC: "tVb";
140
188
  };
141
189
  };
142
190
  };
143
- export declare const VALIDATE_OPTION_LETTERS: readonly [readonly ["noLiterals", "L"], readonly ["noIsArrayCheck", "A"]];
191
+ export declare const VALIDATE_OPTION_LETTERS: readonly [readonly ["noLiterals", "L"], readonly ["noIsArrayCheck", "A"], readonly ["numberTypeof", "T"], readonly ["numberNotNaN", "M"]];
144
192
  export declare const HAS_UNKNOWN_KEYS_OPTION_LETTERS: readonly [readonly ["runsAfterValidation", "V"]];
@@ -34,16 +34,84 @@ exports.FN_HASHES = {
34
34
  val: {
35
35
  axis: 'validateOptions',
36
36
  circularGuarded: true,
37
- variants: { '': 'nPZ', C: 'cCe', NA: 'WeU', NAC: 'fJb', NL: 'N7J', NLA: 'GYK', NLAC: 'z9t', NLC: 'iai' },
37
+ variants: {
38
+ '': 'nPZ',
39
+ C: 'cCe',
40
+ NA: 'WeU',
41
+ NAC: 'fJb',
42
+ NAM: 'D77',
43
+ NAMC: 'ASI',
44
+ NAT: 'CG0',
45
+ NATC: 'jH9',
46
+ NATM: 'zd5',
47
+ NATMC: 'UQE',
48
+ NL: 'N7J',
49
+ NLA: 'GYK',
50
+ NLAC: 'z9t',
51
+ NLAM: 'rXx',
52
+ NLAMC: 'oaW',
53
+ NLAT: 'qwq',
54
+ NLATC: 'XZn',
55
+ NLATM: 'TDn',
56
+ NLATMC: 'w46',
57
+ NLC: 'iai',
58
+ NLM: 'iWy',
59
+ NLMC: 'HZv',
60
+ NLT: 'hvr',
61
+ NLTC: 'qOW',
62
+ NLTM: 'CEc',
63
+ NLTMC: 'TDx',
64
+ NM: 'ycI',
65
+ NMC: 'nzd',
66
+ NT: 'xLB',
67
+ NTC: 'WoE',
68
+ NTM: 'OOM',
69
+ NTMC: 'flj',
70
+ },
38
71
  },
39
72
  verr: {
40
73
  axis: 'validateOptions',
41
74
  circularGuarded: true,
42
- variants: { '': 'pBb', C: 'a8A', NA: 'UKg', NAC: 'F3L', NL: 'LD5', NLA: 'Yk4', NLAC: 'NJl', NLC: 'IuS' },
75
+ variants: {
76
+ '': 'pBb',
77
+ C: 'a8A',
78
+ NA: 'UKg',
79
+ NAC: 'F3L',
80
+ NAM: 'Vtr',
81
+ NAMC: 'OsE',
82
+ NAT: 'U2k',
83
+ NATC: 'xh1',
84
+ NATM: 'ZxF',
85
+ NATMC: 'eIg',
86
+ NL: 'LD5',
87
+ NLA: 'Yk4',
88
+ NLAC: 'NJl',
89
+ NLAM: 'Rh7',
90
+ NLAMC: 'y2C',
91
+ NLAT: 'QQ0',
92
+ NLATC: 'hRZ',
93
+ NLATM: 'hdf',
94
+ NLATMC: 'eGg',
95
+ NLC: 'IuS',
96
+ NLM: 'AiS',
97
+ NLMC: 'Vzn',
98
+ NLT: 'zRL',
99
+ NLTC: 'EoO',
100
+ NLTM: 'cYM',
101
+ NLTMC: 'dv9',
102
+ NM: 'wI4',
103
+ NMC: 'NTN',
104
+ NT: 'vhX',
105
+ NTC: 'wIe',
106
+ NTM: 'ga6',
107
+ NTMC: 'tVb',
108
+ },
43
109
  },
44
110
  };
45
111
  exports.VALIDATE_OPTION_LETTERS = [
46
112
  ['noLiterals', 'L'],
47
113
  ['noIsArrayCheck', 'A'],
114
+ ['numberTypeof', 'T'],
115
+ ['numberNotNaN', 'M'],
48
116
  ];
49
117
  exports.HAS_UNKNOWN_KEYS_OPTION_LETTERS = [['runsAfterValidation', 'V']];
@@ -0,0 +1,80 @@
1
+ import { type RunTypeKindValue } from './runTypeKind.generated.ts';
2
+ export interface TypeFormatMeta {
3
+ readonly name: FormatName;
4
+ readonly kind: RunTypeKindValue;
5
+ }
6
+ export declare const typeFormats: {
7
+ readonly bigintFormat: {
8
+ readonly name: "bigintFormat";
9
+ readonly kind: 9;
10
+ };
11
+ readonly date: {
12
+ readonly name: "date";
13
+ readonly kind: 5;
14
+ };
15
+ readonly dateTime: {
16
+ readonly name: "dateTime";
17
+ readonly kind: 5;
18
+ };
19
+ readonly domain: {
20
+ readonly name: "domain";
21
+ readonly kind: 5;
22
+ };
23
+ readonly email: {
24
+ readonly name: "email";
25
+ readonly kind: 5;
26
+ };
27
+ readonly ip: {
28
+ readonly name: "ip";
29
+ readonly kind: 5;
30
+ };
31
+ readonly nativeDate: {
32
+ readonly name: "nativeDate";
33
+ readonly kind: 20;
34
+ };
35
+ readonly numberFormat: {
36
+ readonly name: "numberFormat";
37
+ readonly kind: 6;
38
+ };
39
+ readonly stringFormat: {
40
+ readonly name: "stringFormat";
41
+ readonly kind: 5;
42
+ };
43
+ readonly temporalInstant: {
44
+ readonly name: "temporalInstant";
45
+ readonly kind: 20;
46
+ };
47
+ readonly temporalPlainDate: {
48
+ readonly name: "temporalPlainDate";
49
+ readonly kind: 20;
50
+ };
51
+ readonly temporalPlainDateTime: {
52
+ readonly name: "temporalPlainDateTime";
53
+ readonly kind: 20;
54
+ };
55
+ readonly temporalPlainTime: {
56
+ readonly name: "temporalPlainTime";
57
+ readonly kind: 20;
58
+ };
59
+ readonly temporalPlainYearMonth: {
60
+ readonly name: "temporalPlainYearMonth";
61
+ readonly kind: 20;
62
+ };
63
+ readonly temporalZonedDateTime: {
64
+ readonly name: "temporalZonedDateTime";
65
+ readonly kind: 20;
66
+ };
67
+ readonly time: {
68
+ readonly name: "time";
69
+ readonly kind: 5;
70
+ };
71
+ readonly url: {
72
+ readonly name: "url";
73
+ readonly kind: 5;
74
+ };
75
+ readonly uuid: {
76
+ readonly name: "uuid";
77
+ readonly kind: 5;
78
+ };
79
+ };
80
+ export type FormatName = keyof typeof typeFormats;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.typeFormats = void 0;
4
+ const runTypeKind_generated_ts_1 = require("./runTypeKind.generated.js");
5
+ exports.typeFormats = {
6
+ bigintFormat: { name: 'bigintFormat', kind: runTypeKind_generated_ts_1.RunTypeKind.bigint },
7
+ date: { name: 'date', kind: runTypeKind_generated_ts_1.RunTypeKind.string },
8
+ dateTime: { name: 'dateTime', kind: runTypeKind_generated_ts_1.RunTypeKind.string },
9
+ domain: { name: 'domain', kind: runTypeKind_generated_ts_1.RunTypeKind.string },
10
+ email: { name: 'email', kind: runTypeKind_generated_ts_1.RunTypeKind.string },
11
+ ip: { name: 'ip', kind: runTypeKind_generated_ts_1.RunTypeKind.string },
12
+ nativeDate: { name: 'nativeDate', kind: runTypeKind_generated_ts_1.RunTypeKind.class },
13
+ numberFormat: { name: 'numberFormat', kind: runTypeKind_generated_ts_1.RunTypeKind.number },
14
+ stringFormat: { name: 'stringFormat', kind: runTypeKind_generated_ts_1.RunTypeKind.string },
15
+ temporalInstant: { name: 'temporalInstant', kind: runTypeKind_generated_ts_1.RunTypeKind.class },
16
+ temporalPlainDate: { name: 'temporalPlainDate', kind: runTypeKind_generated_ts_1.RunTypeKind.class },
17
+ temporalPlainDateTime: { name: 'temporalPlainDateTime', kind: runTypeKind_generated_ts_1.RunTypeKind.class },
18
+ temporalPlainTime: { name: 'temporalPlainTime', kind: runTypeKind_generated_ts_1.RunTypeKind.class },
19
+ temporalPlainYearMonth: { name: 'temporalPlainYearMonth', kind: runTypeKind_generated_ts_1.RunTypeKind.class },
20
+ temporalZonedDateTime: { name: 'temporalZonedDateTime', kind: runTypeKind_generated_ts_1.RunTypeKind.class },
21
+ time: { name: 'time', kind: runTypeKind_generated_ts_1.RunTypeKind.string },
22
+ url: { name: 'url', kind: runTypeKind_generated_ts_1.RunTypeKind.string },
23
+ uuid: { name: 'uuid', kind: runTypeKind_generated_ts_1.RunTypeKind.string },
24
+ };
@@ -1,5 +1,7 @@
1
1
  export { type InjectRunTypeId, type InjectTypeFnArgs, type InjectPureFnHash, type CompTimeArgs, type CompTimeFnArgs, type PureFunction, type PureFunctionFactory, getRunTypeId, } from './markers.ts';
2
2
  export { getRTUtils, getRTFnCaches, type RTUtils } from './runtypes/rtUtils.ts';
3
+ export { type CompiledFnData, type CompiledTypeFn, type InitializedTypeFn, type CompiledFnArgs, type CompiledPureFunction, type PureFunctionData, type AnyFn, } from './runtypes/types.ts';
4
+ export { buildFactoryFromCode, buildPureFnFactoryFromCode, entryCode } from './runtypes/rtUtils.ts';
3
5
  export { type RunType } from './runtypes/types.ts';
4
6
  export { getRunType } from './getRunType.ts';
5
7
  export { type DataOnly } from './runtypes/dataOnly.ts';
@@ -18,11 +20,13 @@ export { type FormatAnnotation } from './runtypes/formatAnnotation.ts';
18
20
  export { registerMockingFunction, type MockFormatFn } from './mocking/mockRegistry.ts';
19
21
  export { registerFormatPattern, type FormatPattern, type StringPatternArgs } from './runtypes/formatPattern.ts';
20
22
  export { RunTypeKind, type RunTypeKindName, type RunTypeKindValue, RunTypeSubKind, type RunTypeSubKindName, type RunTypeSubKindValue, } from './go-generated/runTypeKind.generated.ts';
21
- export { getRTFunction, type RTFunctionByKey, type RTFunctionKey, createValidate, type ValidateFn, type ValidateOptions, createGetValidationErrors, type GetValidationErrorsFn, type RTValidationError, type TypeFormatError, type RTValidationErrorPathSegment, type RTPathSegment, createHasUnknownKeys, type HasUnknownKeysFn, type HasUnknownKeysOptions, type HasUnknownKeysCompileOptions, createCloneExactShape, type CloneExactShapeFn, createUnknownKeyErrors, type UnknownKeyErrorsFn, createFormatTransform, type FormatTransformFn, createJsonEncoder, type JsonEncoderFn, type JsonEncoderOptions, createJsonDecoder, type JsonDecoderFn, type JsonDecoderOptions, type PrepareForJsonFn, type RestoreFromJsonFn, type StringifyJsonFn, } from './createRTFunctions.ts';
22
- export { createBinaryEncoder, type BinaryEncoderFn, type BinaryEncoderSizeFn, type BinaryEncoderIntoFn, type BinaryEncoderOptions, createBinarySizer, type BinarySizerFn, createBinaryDecoder, type BinaryDecoderFn, type BinaryDecoderOptions, type ToBinaryFn, type FromBinaryFn, } from './createRTFBinary.ts';
23
+ export { typeFormats, type FormatName, type TypeFormatMeta } from './go-generated/typeFormats.generated.ts';
24
+ export { getRTFunction, type RTFunctionByKey, type RTFunctionKey, createValidateFn, type ValidateFn, type ValidateOptions, createGetValidationErrorsFn, type GetValidationErrorsFn, type RTValidationError, type TypeFormatError, type RTValidationErrorPathSegment, type RTPathSegment, createHasUnknownKeysFn, type HasUnknownKeysFn, type HasUnknownKeysOptions, type HasUnknownKeysCompileOptions, createCloneExactShapeFn, type CloneExactShapeFn, createUnknownKeyErrorsFn, type UnknownKeyErrorsFn, createFormatTransformFn, type FormatTransformFn, createJsonEncoderFn, type JsonEncoderFn, type JsonEncoderOptions, createJsonDecoderFn, type JsonDecoderFn, type JsonDecoderOptions, type PrepareForJsonFn, type RestoreFromJsonFn, type StringifyJsonFn, } from './createRTFunctions.ts';
25
+ export { createBinaryEncoderFn, type BinaryEncoderFn, type BinaryEncoderSizeFn, type BinaryEncoderIntoFn, type BinaryEncoderOptions, createBinarySizerFn, type BinarySizerFn, createBinaryDecoderFn, type BinaryDecoderFn, type BinaryDecoderOptions, type ToBinaryFn, type FromBinaryFn, } from './createRTFBinary.ts';
23
26
  export { overrideValidate, overrideGetValidationErrors, overrideHasUnknownKeys, overrideCloneExactShape, overrideUnknownKeyErrors, overrideFormatTransform, overrideBinaryEncoder, overrideBinaryDecoder, overrideJsonEncoder, overrideJsonDecoder, } from './overrideRTFunctions.ts';
24
- export { createMockData } from './mocking/createMockData.ts';
27
+ export { createMockDataFn } from './mocking/createMockData.ts';
25
28
  export type { MockOptions, MockTypeFn, RunTypeMockOptions } from './mocking/mockTypes.ts';
29
+ export { MockRandom } from './mocking/mockRandom.ts';
26
30
  export { createStandardSchema, type RTStandardSchemaV1, type RTValidationResult, type RTValidationFailureResult, } from './standard/createStandardSchema.ts';
27
31
  export { runTypeErrorsToIssues, type IssueMappingOptions, type RTValidationIssue } from './standard/issueMapping.ts';
28
32
  export { type StandardSchemaV1, type StandardSchemaProps, type StandardSchemaResult, type StandardSchemaSuccessResult, type StandardSchemaFailureResult, type StandardSchemaIssue, type StandardSchemaPathSegment, type StandardSchemaTypes, type StandardSchemaInferInput, type StandardSchemaInferOutput, } from './standard/spec.ts';