arktype 2.1.12 → 2.1.13

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.
@@ -1,5 +1,5 @@
1
1
  import type { ArkError, ArkErrors, Morph } from "@ark/schema";
2
- import { type anyOrNever, type array, type Brand, type equals, type Hkt, type intersectArrays, type isSafelyMappable, type Primitive, type show } from "@ark/util";
2
+ import { type anyOrNever, type array, type Brand, type equals, type Hkt, type intersectArrays, type isSafelyMappable, type merge, type Primitive, type show } from "@ark/util";
3
3
  import type { arkPrototypes } from "./keywords/constructors.ts";
4
4
  import type { type } from "./keywords/keywords.ts";
5
5
  import type { Type } from "./type.ts";
@@ -51,7 +51,12 @@ type BuiltinTerminalObjectKind = Exclude<keyof arkPrototypes.instances, "Array"
51
51
  /** Objects we don't want to expand during inference like Date or Promise */
52
52
  type TerminallyInferredObject = arkPrototypes.instanceOf<BuiltinTerminalObjectKind> | ArkEnv.prototypes;
53
53
  export type inferPredicate<t, predicate> = predicate extends (data: any, ...args: any[]) => data is infer narrowed ? narrowed : t;
54
- export type inferPipes<t, pipes extends Morph[]> = pipes extends [infer head extends Morph, ...infer tail extends Morph[]] ? inferPipes<head extends type.cast<infer tPipe> ? inferPipe<t, tPipe> : inferMorphOut<head> extends infer out ? (In: distill.In<t>) => Out<out> : never, tail> : t;
54
+ export type inferNaryPipe<morphs extends readonly Morph[]> = _inferNaryPipe<morphs, unknown>;
55
+ type _inferNaryPipe<remaining extends readonly unknown[], result> = remaining extends (readonly [infer head extends Morph, ...infer tail extends Morph[]]) ? _inferNaryPipe<tail, inferMorph<result, head>> : result;
56
+ export type inferNaryIntersection<types extends readonly unknown[]> = _inferNaryIntersection<types, unknown>;
57
+ type _inferNaryIntersection<remaining extends readonly unknown[], result> = remaining extends readonly [infer head, ...infer tail] ? _inferNaryIntersection<tail, inferIntersection<result, head>> : result;
58
+ export type inferNaryMerge<types extends readonly unknown[]> = _inferNaryMerge<types, {}>;
59
+ type _inferNaryMerge<remaining extends readonly unknown[], result> = remaining extends (readonly [infer head, ...infer tail extends readonly unknown[]]) ? _inferNaryMerge<tail, merge<result, head>> : result;
55
60
  export type inferMorphOut<morph extends Morph> = Exclude<ReturnType<morph>, ArkError | ArkErrors>;
56
61
  declare const isMorphOutKey: " isMorphOut";
57
62
  export interface Out<o = any> {
@@ -79,6 +84,7 @@ type normalizeMorphDistribution<t, undistributedIn = t extends InferredMorph<inf
79
84
  export type defaultFor<t = unknown> = (Primitive extends t ? Primitive : t extends Primitive ? t : never) | (() => t);
80
85
  export type termOrType<t> = t | Type<t, any>;
81
86
  export type inferIntersection<l, r> = normalizeMorphDistribution<_inferIntersection<l, r, false>>;
87
+ export type inferMorph<t, morph extends Morph> = morph extends type.cast<infer tMorph> ? inferPipe<t, tMorph> : inferMorphOut<morph> extends infer out ? (In: distill.In<t>) => Out<out> : never;
82
88
  export type inferPipe<l, r> = normalizeMorphDistribution<_inferIntersection<l, r, true>>;
83
89
  type _inferIntersection<l, r, piped extends boolean> = [
84
90
  l & r
@@ -1,8 +1,9 @@
1
- import type { BaseNode, BaseRoot, Disjoint, JsonSchema, Morph, NodeSelector, Predicate, StandardSchemaV1, TypeMeta, UndeclaredKeyBehavior } from "@ark/schema";
1
+ import type { BaseNode, BaseRoot, Disjoint, JsonSchema, NodeSelector, Predicate, StandardSchemaV1, TypeMeta, UndeclaredKeyBehavior } from "@ark/schema";
2
2
  import type { anyOrNever, array, Callable, ErrorMessage, inferred, JsonStructure, unset } from "@ark/util";
3
- import type { defaultFor, distill, inferIntersection, inferMorphOut, inferPipe, inferPipes, InferredMorph, Out, To } from "../attributes.ts";
3
+ import type { defaultFor, distill, inferIntersection, inferPipe, InferredMorph, Out, To } from "../attributes.ts";
4
4
  import type { ArkAmbient } from "../config.ts";
5
5
  import type { type } from "../keywords/keywords.ts";
6
+ import type { NaryPipeParser } from "../nary.ts";
6
7
  import type { Scope } from "../scope.ts";
7
8
  import type { ArrayType } from "./array.ts";
8
9
  import type { instantiateType } from "./instantiate.ts";
@@ -346,7 +347,7 @@ export interface Inferred<out t = unknown, $ = {}> {
346
347
  * // parse a string and validate that the result as a user
347
348
  * const parseUser = type("string").pipe(s => JSON.parse(s), user)
348
349
  */
349
- pipe: ChainedPipe<t, $>;
350
+ pipe: ChainedPipeParser<$, t>;
350
351
  /**
351
352
  * #### parse a definition as an output validator
352
353
  *
@@ -527,17 +528,8 @@ interface Type<out t = unknown, $ = {}> extends Callable<(data: unknown) => dist
527
528
  /** @deprecated */
528
529
  Symbol: never;
529
530
  }
530
- interface ChainedPipeSignature<t, $> {
531
- <a extends Morph<distill.Out<t>>, r = instantiateType<inferPipes<t, [a]>, $>>(a: a): r extends infer _ ? _ : never;
532
- <a extends Morph<distill.Out<t>>, b extends Morph<inferMorphOut<a>>, r = instantiateType<inferPipes<t, [a, b]>, $>>(a: a, b: b): r extends infer _ ? _ : never;
533
- <a extends Morph<distill.Out<t>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, r = instantiateType<inferPipes<t, [a, b, c]>, $>>(a: a, b: b, c: c): r extends infer _ ? _ : never;
534
- <a extends Morph<distill.Out<t>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, r = instantiateType<inferPipes<t, [a, b, c, d]>, $>>(a: a, b: b, c: c, d: d): r extends infer _ ? _ : never;
535
- <a extends Morph<distill.Out<t>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, r = instantiateType<inferPipes<t, [a, b, c, d, e]>, $>>(a: a, b: b, c: c, d: d, e: e): r extends infer _ ? _ : never;
536
- <a extends Morph<distill.Out<t>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, r = instantiateType<inferPipes<t, [a, b, c, d, e, f]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f): r extends infer _ ? _ : never;
537
- <a extends Morph<distill.Out<t>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, r = instantiateType<inferPipes<t, [a, b, c, d, e, f, g]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g): r extends infer _ ? _ : never;
538
- }
539
- export interface ChainedPipe<t, $> extends ChainedPipeSignature<t, $> {
540
- try: ChainedPipeSignature<t, $>;
531
+ export interface ChainedPipeParser<$, t> extends NaryPipeParser<$, t> {
532
+ try: NaryPipeParser<$, t>;
541
533
  }
542
534
  type validateChainedAsArgs<t> = [
543
535
  t
@@ -38,7 +38,7 @@ interface Type<out t extends object = object, $ = {}> extends BaseType<t, $> {
38
38
  * Merge another `Type` definition, overriding properties of this `Type` with the duplicate keys.
39
39
  * @example type({ a: "1", b: "2" }).merge({ b: "3", c: "4" }) // Type<{ a: 1, b: 3, c: 4 }>
40
40
  */
41
- merge<const def, inferredDef = type.infer<def, $>, r = Type<merge<t, inferredDef>, $>>(def: type.validate<def, $> & (inferredDef extends object ? unknown : ErrorType<"Merged type must be an object", [actual: inferredDef]>)): r extends infer _ ? _ : never;
41
+ merge<const def, inferredDef = type.infer<def, $>, r = Type<merge<t, inferredDef>, $>>(def: type.validate<def, $> & (inferredDef extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredDef]>)): r extends infer _ ? _ : never;
42
42
  /**
43
43
  * Create a copy of this `Type` with all properties required.
44
44
  * @example const T = type({ "foo?"": "string" }).required() // Type<{ foo: string }>
@@ -100,6 +100,7 @@ type fromTypeProps<t, props extends array<MappedTypeProp>> = show<{
100
100
  default: unknown;
101
101
  }>["key"]]: withDefault<prop["value"][inferred], prop["default" & keyof prop]>;
102
102
  }>;
103
+ export type NonObjectMergeErrorMessage = "Merged type must be an object";
103
104
  type applyHomomorphicOptionality<t, prop extends MappedTypeProp> = prop["kind"] extends string ? prop : prop & {
104
105
  kind: prop["key"] extends optionalKeyOf<t> ? "optional" : "required";
105
106
  };
package/out/nary.d.ts ADDED
@@ -0,0 +1,479 @@
1
+ import type { Morph } from "@ark/schema";
2
+ import type { ErrorType, merge } from "@ark/util";
3
+ import type { distill, inferIntersection, inferMorph, inferMorphOut, inferNaryIntersection, inferNaryMerge, inferNaryPipe } from "./attributes.ts";
4
+ import type { type } from "./keywords/keywords.ts";
5
+ import type { instantiateType } from "./methods/instantiate.ts";
6
+ import type { NonObjectMergeErrorMessage } from "./methods/object.ts";
7
+ import type { Type } from "./type.ts";
8
+ export type NaryUnionParser<$> = {
9
+ (): Type<never, $>;
10
+ <const a, r = Type<type.infer<a>, $>>(a: type.validate<a, $>): r extends infer _ ? _ : never;
11
+ <const a, const b, r = Type<type.infer<a> | type.infer<b>, $>>(a: type.validate<a, $>, b: type.validate<b, $>): r extends infer _ ? _ : never;
12
+ <const a, const b, const c, r = Type<type.infer<a> | type.infer<b> | type.infer<c>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>): r extends infer _ ? _ : never;
13
+ <const a, const b, const c, const d, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>): r extends infer _ ? _ : never;
14
+ <const a, const b, const c, const d, const e, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>): r extends infer _ ? _ : never;
15
+ <const a, const b, const c, const d, const e, const f, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>): r extends infer _ ? _ : never;
16
+ <const a, const b, const c, const d, const e, const f, const g, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>): r extends infer _ ? _ : never;
17
+ <const a, const b, const c, const d, const e, const f, const g, const h, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>): r extends infer _ ? _ : never;
18
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h> | type.infer<i>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>): r extends infer _ ? _ : never;
19
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h> | type.infer<i> | type.infer<j>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>): r extends infer _ ? _ : never;
20
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h> | type.infer<i> | type.infer<j> | type.infer<k>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>): r extends infer _ ? _ : never;
21
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h> | type.infer<i> | type.infer<j> | type.infer<k> | type.infer<l>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>): r extends infer _ ? _ : never;
22
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h> | type.infer<i> | type.infer<j> | type.infer<k> | type.infer<l> | type.infer<m>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>): r extends infer _ ? _ : never;
23
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h> | type.infer<i> | type.infer<j> | type.infer<k> | type.infer<l> | type.infer<m> | type.infer<n>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>): r extends infer _ ? _ : never;
24
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h> | type.infer<i> | type.infer<j> | type.infer<k> | type.infer<l> | type.infer<m> | type.infer<n> | type.infer<o>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>): r extends infer _ ? _ : never;
25
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h> | type.infer<i> | type.infer<j> | type.infer<k> | type.infer<l> | type.infer<m> | type.infer<n> | type.infer<o> | type.infer<p>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>, p: type.validate<p, $>): r extends infer _ ? _ : never;
26
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, const q, r = Type<type.infer<a> | type.infer<b> | type.infer<c> | type.infer<d> | type.infer<e> | type.infer<f> | type.infer<g> | type.infer<h> | type.infer<i> | type.infer<j> | type.infer<k> | type.infer<l> | type.infer<m> | type.infer<n> | type.infer<o> | type.infer<p> | type.infer<q>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>, p: type.validate<p, $>, q: type.validate<q, $>): r extends infer _ ? _ : never;
27
+ <const defs extends readonly unknown[], r = Type<type.infer<defs[number]>, $>>(...defs: {
28
+ [i in keyof defs]: type.validate<defs[i]>;
29
+ }): r extends infer _ ? _ : never;
30
+ };
31
+ export type NaryIntersectionParser<$> = {
32
+ (): Type<unknown, $>;
33
+ <const a, r = Type<type.infer<a>, $>>(a: type.validate<a, $>): r extends infer _ ? _ : never;
34
+ <const a, const b, r = Type<inferIntersection<type.infer<a>, type.infer<b>>, $>>(a: type.validate<a, $>, b: type.validate<b, $>): r extends infer _ ? _ : never;
35
+ <const a, const b, const c, r = Type<inferNaryIntersection<[type.infer<a>, type.infer<b>, type.infer<c>]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>): r extends infer _ ? _ : never;
36
+ <const a, const b, const c, const d, r = Type<inferNaryIntersection<[
37
+ type.infer<a>,
38
+ type.infer<b>,
39
+ type.infer<c>,
40
+ type.infer<d>
41
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>): r extends infer _ ? _ : never;
42
+ <const a, const b, const c, const d, const e, r = Type<inferNaryIntersection<[
43
+ type.infer<a>,
44
+ type.infer<b>,
45
+ type.infer<c>,
46
+ type.infer<d>,
47
+ type.infer<e>
48
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>): r extends infer _ ? _ : never;
49
+ <const a, const b, const c, const d, const e, const f, r = Type<inferNaryIntersection<[
50
+ type.infer<a>,
51
+ type.infer<b>,
52
+ type.infer<c>,
53
+ type.infer<d>,
54
+ type.infer<e>,
55
+ type.infer<f>
56
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>): r extends infer _ ? _ : never;
57
+ <const a, const b, const c, const d, const e, const f, const g, r = Type<inferNaryIntersection<[
58
+ type.infer<a>,
59
+ type.infer<b>,
60
+ type.infer<c>,
61
+ type.infer<d>,
62
+ type.infer<e>,
63
+ type.infer<f>,
64
+ type.infer<g>
65
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>): r extends infer _ ? _ : never;
66
+ <const a, const b, const c, const d, const e, const f, const g, const h, r = Type<inferNaryIntersection<[
67
+ type.infer<a>,
68
+ type.infer<b>,
69
+ type.infer<c>,
70
+ type.infer<d>,
71
+ type.infer<e>,
72
+ type.infer<f>,
73
+ type.infer<g>,
74
+ type.infer<h>
75
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>): r extends infer _ ? _ : never;
76
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, r = Type<inferNaryIntersection<[
77
+ type.infer<a>,
78
+ type.infer<b>,
79
+ type.infer<c>,
80
+ type.infer<d>,
81
+ type.infer<e>,
82
+ type.infer<f>,
83
+ type.infer<g>,
84
+ type.infer<h>,
85
+ type.infer<i>
86
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>): r extends infer _ ? _ : never;
87
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, r = Type<inferNaryIntersection<[
88
+ type.infer<a>,
89
+ type.infer<b>,
90
+ type.infer<c>,
91
+ type.infer<d>,
92
+ type.infer<e>,
93
+ type.infer<f>,
94
+ type.infer<g>,
95
+ type.infer<h>,
96
+ type.infer<i>,
97
+ type.infer<j>
98
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>): r extends infer _ ? _ : never;
99
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, r = Type<inferNaryIntersection<[
100
+ type.infer<a>,
101
+ type.infer<b>,
102
+ type.infer<c>,
103
+ type.infer<d>,
104
+ type.infer<e>,
105
+ type.infer<f>,
106
+ type.infer<g>,
107
+ type.infer<h>,
108
+ type.infer<i>,
109
+ type.infer<j>,
110
+ type.infer<k>
111
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>): r extends infer _ ? _ : never;
112
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, r = Type<inferNaryIntersection<[
113
+ type.infer<a>,
114
+ type.infer<b>,
115
+ type.infer<c>,
116
+ type.infer<d>,
117
+ type.infer<e>,
118
+ type.infer<f>,
119
+ type.infer<g>,
120
+ type.infer<h>,
121
+ type.infer<i>,
122
+ type.infer<j>,
123
+ type.infer<k>,
124
+ type.infer<l>
125
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>): r extends infer _ ? _ : never;
126
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, r = Type<inferNaryIntersection<[
127
+ type.infer<a>,
128
+ type.infer<b>,
129
+ type.infer<c>,
130
+ type.infer<d>,
131
+ type.infer<e>,
132
+ type.infer<f>,
133
+ type.infer<g>,
134
+ type.infer<h>,
135
+ type.infer<i>,
136
+ type.infer<j>,
137
+ type.infer<k>,
138
+ type.infer<l>,
139
+ type.infer<m>
140
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>): r extends infer _ ? _ : never;
141
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, r = Type<inferNaryIntersection<[
142
+ type.infer<a>,
143
+ type.infer<b>,
144
+ type.infer<c>,
145
+ type.infer<d>,
146
+ type.infer<e>,
147
+ type.infer<f>,
148
+ type.infer<g>,
149
+ type.infer<h>,
150
+ type.infer<i>,
151
+ type.infer<j>,
152
+ type.infer<k>,
153
+ type.infer<l>,
154
+ type.infer<m>,
155
+ type.infer<n>
156
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>): r extends infer _ ? _ : never;
157
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, r = Type<inferNaryIntersection<[
158
+ type.infer<a>,
159
+ type.infer<b>,
160
+ type.infer<c>,
161
+ type.infer<d>,
162
+ type.infer<e>,
163
+ type.infer<f>,
164
+ type.infer<g>,
165
+ type.infer<h>,
166
+ type.infer<i>,
167
+ type.infer<j>,
168
+ type.infer<k>,
169
+ type.infer<l>,
170
+ type.infer<m>,
171
+ type.infer<n>,
172
+ type.infer<o>
173
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>): r extends infer _ ? _ : never;
174
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, r = Type<inferNaryIntersection<[
175
+ type.infer<a>,
176
+ type.infer<b>,
177
+ type.infer<c>,
178
+ type.infer<d>,
179
+ type.infer<e>,
180
+ type.infer<f>,
181
+ type.infer<g>,
182
+ type.infer<h>,
183
+ type.infer<i>,
184
+ type.infer<j>,
185
+ type.infer<k>,
186
+ type.infer<l>,
187
+ type.infer<m>,
188
+ type.infer<n>,
189
+ type.infer<o>,
190
+ type.infer<p>
191
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>, p: type.validate<p, $>): r extends infer _ ? _ : never;
192
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, const q, r = Type<inferNaryIntersection<[
193
+ type.infer<a>,
194
+ type.infer<b>,
195
+ type.infer<c>,
196
+ type.infer<d>,
197
+ type.infer<e>,
198
+ type.infer<f>,
199
+ type.infer<g>,
200
+ type.infer<h>,
201
+ type.infer<i>,
202
+ type.infer<j>,
203
+ type.infer<k>,
204
+ type.infer<l>,
205
+ type.infer<m>,
206
+ type.infer<n>,
207
+ type.infer<o>,
208
+ type.infer<p>,
209
+ type.infer<q>
210
+ ]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>, p: type.validate<p, $>, q: type.validate<q, $>): r extends infer _ ? _ : never;
211
+ <const defs extends readonly unknown[], r = Type<inferNaryIntersection<{
212
+ [i in keyof defs]: type.infer<defs[i]>;
213
+ }>, $>>(...defs: {
214
+ [i in keyof defs]: type.validate<defs[i]>;
215
+ }): r extends infer _ ? _ : never;
216
+ };
217
+ export type NaryMergeParser<$> = {
218
+ (): Type<object, $>;
219
+ <const a, inferredA = type.infer<a, $>, r = Type<inferredA, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>)): r extends infer _ ? _ : never;
220
+ <const a, const b, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, r = Type<merge<inferredA, inferredB>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<"Merged type must be an object", [actual: inferredB]>)): r extends infer _ ? _ : never;
221
+ <const a, const b, const c, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, r = Type<inferNaryMerge<[type.infer<a>, type.infer<b>, type.infer<c>]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>)): r extends infer _ ? _ : never;
222
+ <const a, const b, const c, const d, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, r = Type<inferNaryMerge<[
223
+ type.infer<a>,
224
+ type.infer<b>,
225
+ type.infer<c>,
226
+ type.infer<d>
227
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>)): r extends infer _ ? _ : never;
228
+ <const a, const b, const c, const d, const e, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, r = Type<inferNaryMerge<[
229
+ type.infer<a>,
230
+ type.infer<b>,
231
+ type.infer<c>,
232
+ type.infer<d>,
233
+ type.infer<e>
234
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>)): r extends infer _ ? _ : never;
235
+ <const a, const b, const c, const d, const e, const f, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, r = Type<inferNaryMerge<[
236
+ type.infer<a>,
237
+ type.infer<b>,
238
+ type.infer<c>,
239
+ type.infer<d>,
240
+ type.infer<e>,
241
+ type.infer<f>
242
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>)): r extends infer _ ? _ : never;
243
+ <const a, const b, const c, const d, const e, const f, const g, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, r = Type<inferNaryMerge<[
244
+ type.infer<a>,
245
+ type.infer<b>,
246
+ type.infer<c>,
247
+ type.infer<d>,
248
+ type.infer<e>,
249
+ type.infer<f>,
250
+ type.infer<g>
251
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>)): r extends infer _ ? _ : never;
252
+ <const a, const b, const c, const d, const e, const f, const g, const h, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, r = Type<inferNaryMerge<[
253
+ type.infer<a>,
254
+ type.infer<b>,
255
+ type.infer<c>,
256
+ type.infer<d>,
257
+ type.infer<e>,
258
+ type.infer<f>,
259
+ type.infer<g>,
260
+ type.infer<h>
261
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>)): r extends infer _ ? _ : never;
262
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, r = Type<inferNaryMerge<[
263
+ type.infer<a>,
264
+ type.infer<b>,
265
+ type.infer<c>,
266
+ type.infer<d>,
267
+ type.infer<e>,
268
+ type.infer<f>,
269
+ type.infer<g>,
270
+ type.infer<h>,
271
+ type.infer<i>
272
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>)): r extends infer _ ? _ : never;
273
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, r = Type<inferNaryMerge<[
274
+ type.infer<a>,
275
+ type.infer<b>,
276
+ type.infer<c>,
277
+ type.infer<d>,
278
+ type.infer<e>,
279
+ type.infer<f>,
280
+ type.infer<g>,
281
+ type.infer<h>,
282
+ type.infer<i>,
283
+ type.infer<j>
284
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>)): r extends infer _ ? _ : never;
285
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, r = Type<inferNaryMerge<[
286
+ type.infer<a>,
287
+ type.infer<b>,
288
+ type.infer<c>,
289
+ type.infer<d>,
290
+ type.infer<e>,
291
+ type.infer<f>,
292
+ type.infer<g>,
293
+ type.infer<h>,
294
+ type.infer<i>,
295
+ type.infer<j>,
296
+ type.infer<k>
297
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>)): r extends infer _ ? _ : never;
298
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, r = Type<inferNaryMerge<[
299
+ type.infer<a>,
300
+ type.infer<b>,
301
+ type.infer<c>,
302
+ type.infer<d>,
303
+ type.infer<e>,
304
+ type.infer<f>,
305
+ type.infer<g>,
306
+ type.infer<h>,
307
+ type.infer<i>,
308
+ type.infer<j>,
309
+ type.infer<k>,
310
+ type.infer<l>
311
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>)): r extends infer _ ? _ : never;
312
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, r = Type<inferNaryMerge<[
313
+ type.infer<a>,
314
+ type.infer<b>,
315
+ type.infer<c>,
316
+ type.infer<d>,
317
+ type.infer<e>,
318
+ type.infer<f>,
319
+ type.infer<g>,
320
+ type.infer<h>,
321
+ type.infer<i>,
322
+ type.infer<j>,
323
+ type.infer<k>,
324
+ type.infer<l>,
325
+ type.infer<m>
326
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>)): r extends infer _ ? _ : never;
327
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, inferredN = type.infer<n, $>, r = Type<inferNaryMerge<[
328
+ type.infer<a>,
329
+ type.infer<b>,
330
+ type.infer<c>,
331
+ type.infer<d>,
332
+ type.infer<e>,
333
+ type.infer<f>,
334
+ type.infer<g>,
335
+ type.infer<h>,
336
+ type.infer<i>,
337
+ type.infer<j>,
338
+ type.infer<k>,
339
+ type.infer<l>,
340
+ type.infer<m>,
341
+ type.infer<n>
342
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>), n: type.validate<n, $> & (inferredN extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredN]>)): r extends infer _ ? _ : never;
343
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, inferredN = type.infer<n, $>, inferredO = type.infer<o, $>, r = Type<inferNaryMerge<[
344
+ type.infer<a>,
345
+ type.infer<b>,
346
+ type.infer<c>,
347
+ type.infer<d>,
348
+ type.infer<e>,
349
+ type.infer<f>,
350
+ type.infer<g>,
351
+ type.infer<h>,
352
+ type.infer<i>,
353
+ type.infer<j>,
354
+ type.infer<k>,
355
+ type.infer<l>,
356
+ type.infer<m>,
357
+ type.infer<n>,
358
+ type.infer<o>
359
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>), n: type.validate<n, $> & (inferredN extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredN]>), o: type.validate<o, $> & (inferredO extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredO]>)): r extends infer _ ? _ : never;
360
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, inferredN = type.infer<n, $>, inferredO = type.infer<o, $>, inferredP = type.infer<p, $>, r = Type<inferNaryMerge<[
361
+ type.infer<a>,
362
+ type.infer<b>,
363
+ type.infer<c>,
364
+ type.infer<d>,
365
+ type.infer<e>,
366
+ type.infer<f>,
367
+ type.infer<g>,
368
+ type.infer<h>,
369
+ type.infer<i>,
370
+ type.infer<j>,
371
+ type.infer<k>,
372
+ type.infer<l>,
373
+ type.infer<m>,
374
+ type.infer<n>,
375
+ type.infer<o>,
376
+ type.infer<p>
377
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>), n: type.validate<n, $> & (inferredN extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredN]>), o: type.validate<o, $> & (inferredO extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredO]>), p: type.validate<p, $> & (inferredP extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredP]>)): r extends infer _ ? _ : never;
378
+ <const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, const q, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, inferredN = type.infer<n, $>, inferredO = type.infer<o, $>, inferredP = type.infer<p, $>, inferredQ = type.infer<q, $>, r = Type<inferNaryMerge<[
379
+ type.infer<a>,
380
+ type.infer<b>,
381
+ type.infer<c>,
382
+ type.infer<d>,
383
+ type.infer<e>,
384
+ type.infer<f>,
385
+ type.infer<g>,
386
+ type.infer<h>,
387
+ type.infer<i>,
388
+ type.infer<j>,
389
+ type.infer<k>,
390
+ type.infer<l>,
391
+ type.infer<m>,
392
+ type.infer<n>,
393
+ type.infer<o>,
394
+ type.infer<p>,
395
+ type.infer<q>
396
+ ]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>), n: type.validate<n, $> & (inferredN extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredN]>), o: type.validate<o, $> & (inferredO extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredO]>), p: type.validate<p, $> & (inferredP extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredP]>), q: type.validate<q, $> & (inferredQ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredQ]>)): r extends infer _ ? _ : never;
397
+ <const defs extends readonly unknown[], r = Type<inferNaryMerge<{
398
+ [i in keyof defs]: type.infer<defs[i]>;
399
+ }>, $>>(...defs: {
400
+ [i in keyof defs]: type.validate<defs[i]> & (type.infer<defs[i], $> extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [
401
+ actual: type.infer<defs[i], $>
402
+ ]>);
403
+ }): r extends infer _ ? _ : never;
404
+ };
405
+ export type NaryPipeParser<$, initial = unknown> = {
406
+ (): Type<initial, $>;
407
+ <a extends Morph<distill.Out<initial>>, r = instantiateType<inferMorph<initial, a>, $>>(a: a): r extends infer _ ? _ : never;
408
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b]>, $>>(a: a, b: b): r extends infer _ ? _ : never;
409
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c]>, $>>(a: a, b: b, c: c): r extends infer _ ? _ : never;
410
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d]>, $>>(a: a, b: b, c: c, d: d): r extends infer _ ? _ : never;
411
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e]>, $>>(a: a, b: b, c: c, d: d, e: e): r extends infer _ ? _ : never;
412
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e, f]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f): r extends infer _ ? _ : never;
413
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e, f, g]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g): r extends infer _ ? _ : never;
414
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e, f, g, h]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h): r extends infer _ ? _ : never;
415
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, i extends Morph<inferMorphOut<h>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e, f, g, h, i]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i): r extends infer _ ? _ : never;
416
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, i extends Morph<inferMorphOut<h>>, j extends Morph<inferMorphOut<i>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e, f, g, h, i, j]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j): r extends infer _ ? _ : never;
417
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, i extends Morph<inferMorphOut<h>>, j extends Morph<inferMorphOut<i>>, k extends Morph<inferMorphOut<j>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e, f, g, h, i, j, k]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k): r extends infer _ ? _ : never;
418
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, i extends Morph<inferMorphOut<h>>, j extends Morph<inferMorphOut<i>>, k extends Morph<inferMorphOut<j>>, l extends Morph<inferMorphOut<k>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e, f, g, h, i, j, k, l]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l): r extends infer _ ? _ : never;
419
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, i extends Morph<inferMorphOut<h>>, j extends Morph<inferMorphOut<i>>, k extends Morph<inferMorphOut<j>>, l extends Morph<inferMorphOut<k>>, m extends Morph<inferMorphOut<l>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e, f, g, h, i, j, k, l, m]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m): r extends infer _ ? _ : never;
420
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, i extends Morph<inferMorphOut<h>>, j extends Morph<inferMorphOut<i>>, k extends Morph<inferMorphOut<j>>, l extends Morph<inferMorphOut<k>>, m extends Morph<inferMorphOut<l>>, n extends Morph<inferMorphOut<m>>, r = instantiateType<inferNaryPipe<[Type<initial>, a, b, c, d, e, f, g, h, i, j, k, l, m, n]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n): r extends infer _ ? _ : never;
421
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, i extends Morph<inferMorphOut<h>>, j extends Morph<inferMorphOut<i>>, k extends Morph<inferMorphOut<j>>, l extends Morph<inferMorphOut<k>>, m extends Morph<inferMorphOut<l>>, n extends Morph<inferMorphOut<m>>, o extends Morph<inferMorphOut<n>>, r = instantiateType<inferNaryPipe<[
422
+ Type<initial>,
423
+ a,
424
+ b,
425
+ c,
426
+ d,
427
+ e,
428
+ f,
429
+ g,
430
+ h,
431
+ i,
432
+ j,
433
+ k,
434
+ l,
435
+ m,
436
+ n,
437
+ o
438
+ ]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o): r extends infer _ ? _ : never;
439
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, i extends Morph<inferMorphOut<h>>, j extends Morph<inferMorphOut<i>>, k extends Morph<inferMorphOut<j>>, l extends Morph<inferMorphOut<k>>, m extends Morph<inferMorphOut<l>>, n extends Morph<inferMorphOut<m>>, o extends Morph<inferMorphOut<n>>, p extends Morph<inferMorphOut<o>>, r = instantiateType<inferNaryPipe<[
440
+ Type<initial>,
441
+ a,
442
+ b,
443
+ c,
444
+ d,
445
+ e,
446
+ f,
447
+ g,
448
+ h,
449
+ i,
450
+ j,
451
+ k,
452
+ l,
453
+ m,
454
+ n,
455
+ o,
456
+ p
457
+ ]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o, p: p): r extends infer _ ? _ : never;
458
+ <a extends Morph<distill.Out<initial>>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>, f extends Morph<inferMorphOut<e>>, g extends Morph<inferMorphOut<f>>, h extends Morph<inferMorphOut<g>>, i extends Morph<inferMorphOut<h>>, j extends Morph<inferMorphOut<i>>, k extends Morph<inferMorphOut<j>>, l extends Morph<inferMorphOut<k>>, m extends Morph<inferMorphOut<l>>, n extends Morph<inferMorphOut<m>>, o extends Morph<inferMorphOut<n>>, p extends Morph<inferMorphOut<o>>, q extends Morph<inferMorphOut<p>>, r = instantiateType<inferNaryPipe<[
459
+ Type<initial>,
460
+ a,
461
+ b,
462
+ c,
463
+ d,
464
+ e,
465
+ f,
466
+ g,
467
+ h,
468
+ i,
469
+ j,
470
+ k,
471
+ l,
472
+ m,
473
+ n,
474
+ o,
475
+ p,
476
+ q
477
+ ]>, $>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k, l: l, m: m, n: n, o: o, p: p, q: q): r extends infer _ ? _ : never;
478
+ <const morphs extends readonly Morph[], r = Type<inferNaryPipe<morphs>, $>>(...defs: morphs): r extends infer _ ? _ : never;
479
+ };
package/out/nary.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/out/scope.d.ts CHANGED
@@ -4,6 +4,7 @@ import { type GenericDeclaration, type GenericParser, type ParameterString, type
4
4
  import type { Ark, type } from "./keywords/keywords.ts";
5
5
  import { InternalMatchParser, type MatchParser } from "./match.ts";
6
6
  import type { BoundModule, Module, Submodule, exportScope, instantiateExport } from "./module.ts";
7
+ import type { NaryIntersectionParser, NaryMergeParser, NaryPipeParser, NaryUnionParser } from "./nary.ts";
7
8
  import type { DefAst, InferredAst } from "./parser/ast/infer.ts";
8
9
  import { type inferDefinition } from "./parser/definition.ts";
9
10
  import type { ParsedOptionalProperty } from "./parser/property.ts";
@@ -78,6 +79,10 @@ export declare class InternalScope<$ extends {} = {}> extends BaseScope<$> {
78
79
  valueOf: ValueOfTypeParser<$>;
79
80
  enumerated: EnumeratedTypeParser<$>;
80
81
  instanceOf: InstanceOfTypeParser<$>;
82
+ or: NaryUnionParser<$>;
83
+ and: NaryIntersectionParser<$>;
84
+ merge: NaryMergeParser<$>;
85
+ pipe: NaryPipeParser<$>;
81
86
  match: InternalMatchParser;
82
87
  declare: () => {
83
88
  type: InternalTypeParser;
package/out/scope.js CHANGED
@@ -84,6 +84,10 @@ export class InternalScope extends BaseScope {
84
84
  valueOf = tsEnum => this.units(enumValues(tsEnum));
85
85
  enumerated = (...values) => this.units(values);
86
86
  instanceOf = ctor => this.node("proto", { proto: ctor }, { prereduced: true });
87
+ or = (...defs) => this.schema(defs.map(def => this.parse(def)));
88
+ and = (...defs) => defs.reduce((node, def) => node.and(this.parse(def)), this.intrinsic.unknown);
89
+ merge = (...defs) => defs.reduce((node, def) => node.merge(this.parse(def)), this.intrinsic.object);
90
+ pipe = (...morphs) => this.intrinsic.unknown.pipe(...morphs);
87
91
  match = new InternalMatchParser(this);
88
92
  declare = () => ({
89
93
  type: this.type
package/out/type.d.ts CHANGED
@@ -6,6 +6,7 @@ import type { Ark, keywords, type } from "./keywords/keywords.ts";
6
6
  import type { MatchParser } from "./match.ts";
7
7
  import type { BaseType } from "./methods/base.ts";
8
8
  import type { instantiateType } from "./methods/instantiate.ts";
9
+ import type { NaryIntersectionParser, NaryMergeParser, NaryPipeParser, NaryUnionParser } from "./nary.ts";
9
10
  import type { validateDeclared } from "./parser/definition.ts";
10
11
  import type { ArgTwoOperator, IndexZeroOperator, TupleInfixOperator } from "./parser/tupleExpressions.ts";
11
12
  import type { InternalScope, ModuleParser, Scope, ScopeParser, bindThis } from "./scope.ts";
@@ -92,6 +93,31 @@ export interface TypeParser<$ = {}> extends Ark.boundTypeAttachments<$> {
92
93
  * @example const array = type.instanceOf(Array)
93
94
  */
94
95
  instanceOf: InstanceOfTypeParser<$>;
96
+ /**
97
+ * Create a {@link Type} from a union of definitions
98
+ * @example const t = type.or("string", "number")
99
+ */
100
+ or: NaryUnionParser<$>;
101
+ /**
102
+ * Create a {@link Type} from an intersection of definitions
103
+ * @example const t = type.and({ a: "1" }, { b: "2" })
104
+ */
105
+ and: NaryIntersectionParser<$>;
106
+ /**
107
+ * Create a {@link Type} by merging object definitions, with later
108
+ * definitions having precedence for overlapping keys
109
+ * @example
110
+ * // Type<{ a: "3", b: "2", c: "4" }>
111
+ * const t = type.merge({ a: "1", b: "2" }, { a: "3", c: "4" })
112
+ */
113
+ merge: NaryMergeParser<$>;
114
+ /**
115
+ * Create a {@link Type} from a set of morphs (including Types)
116
+ * @example
117
+ * // Type<(In: string) => To<object>>
118
+ * const t = type.pipe(type.string, s => JSON.parse(s), type.object)
119
+ */
120
+ pipe: NaryPipeParser<$>;
95
121
  }
96
122
  export declare class InternalTypeParser extends Callable<(...args: unknown[]) => BaseRoot | Generic, TypeParserAttachments> {
97
123
  constructor($: InternalScope);
package/out/type.js CHANGED
@@ -18,7 +18,11 @@ export class InternalTypeParser extends Callable {
18
18
  unit: $.unit,
19
19
  enumerated: $.enumerated,
20
20
  instanceOf: $.instanceOf,
21
- valueOf: $.valueOf
21
+ valueOf: $.valueOf,
22
+ or: $.or,
23
+ and: $.and,
24
+ merge: $.merge,
25
+ pipe: $.pipe
22
26
  },
23
27
  // also won't be defined during bootstrapping
24
28
  $.ambientAttachments);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arktype",
3
3
  "description": "TypeScript's 1:1 validator, optimized from editor to runtime",
4
- "version": "2.1.12",
4
+ "version": "2.1.13",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -34,8 +34,8 @@
34
34
  "out"
35
35
  ],
36
36
  "dependencies": {
37
- "@ark/util": "0.45.2",
38
- "@ark/schema": "0.45.2"
37
+ "@ark/util": "0.45.3",
38
+ "@ark/schema": "0.45.3"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"