arktype 2.0.0-dev.2 → 2.0.0-dev.20
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.
- package/LICENSE +7 -0
- package/out/api.d.ts +6 -0
- package/out/api.js +5 -0
- package/out/ark.d.ts +15 -39
- package/out/ark.js +9 -18
- package/out/config.d.ts +1 -0
- package/out/config.js +2 -0
- package/out/generic.d.ts +21 -0
- package/out/generic.js +24 -0
- package/out/match.d.ts +18 -24
- package/out/match.js +50 -60
- package/out/module.d.ts +11 -0
- package/out/module.js +2 -0
- package/out/parser/definition.d.ts +13 -15
- package/out/parser/definition.js +10 -13
- package/out/parser/generic.d.ts +5 -7
- package/out/parser/generic.js +7 -11
- package/out/parser/objectLiteral.d.ts +57 -18
- package/out/parser/objectLiteral.js +93 -52
- package/out/parser/semantic/bounds.d.ts +10 -8
- package/out/parser/semantic/bounds.js +0 -1
- package/out/parser/semantic/divisor.d.ts +5 -7
- package/out/parser/semantic/divisor.js +0 -1
- package/out/parser/semantic/infer.d.ts +24 -0
- package/out/parser/semantic/infer.js +1 -0
- package/out/parser/semantic/utils.d.ts +3 -7
- package/out/parser/semantic/utils.js +0 -1
- package/out/parser/semantic/validate.d.ts +16 -13
- package/out/parser/semantic/validate.js +1 -1
- package/out/parser/string/reduce/dynamic.d.ts +13 -13
- package/out/parser/string/reduce/dynamic.js +31 -26
- package/out/parser/string/reduce/shared.d.ts +14 -28
- package/out/parser/string/reduce/shared.js +4 -3
- package/out/parser/string/reduce/static.d.ts +26 -23
- package/out/parser/string/reduce/static.js +0 -1
- package/out/parser/string/shift/operand/date.d.ts +2 -2
- package/out/parser/string/shift/operand/date.js +4 -7
- package/out/parser/string/shift/operand/enclosed.d.ts +3 -4
- package/out/parser/string/shift/operand/enclosed.js +14 -14
- package/out/parser/string/shift/operand/genericArgs.d.ts +9 -10
- package/out/parser/string/shift/operand/genericArgs.js +6 -10
- package/out/parser/string/shift/operand/operand.d.ts +3 -4
- package/out/parser/string/shift/operand/operand.js +9 -13
- package/out/parser/string/shift/operand/unenclosed.d.ts +15 -20
- package/out/parser/string/shift/operand/unenclosed.js +24 -36
- package/out/parser/string/shift/operator/bounds.d.ts +8 -12
- package/out/parser/string/shift/operator/bounds.js +45 -56
- package/out/parser/string/shift/operator/divisor.d.ts +1 -3
- package/out/parser/string/shift/operator/divisor.js +1 -3
- package/out/parser/string/shift/operator/operator.d.ts +1 -2
- package/out/parser/string/shift/operator/operator.js +12 -19
- package/out/parser/string/shift/scanner.d.ts +8 -7
- package/out/parser/string/shift/scanner.js +17 -16
- package/out/parser/string/string.d.ts +9 -7
- package/out/parser/string/string.js +1 -3
- package/out/parser/tuple.d.ts +101 -42
- package/out/parser/tuple.js +107 -86
- package/out/scope.d.ts +44 -115
- package/out/scope.js +39 -188
- package/out/type.d.ts +63 -61
- package/out/type.js +30 -135
- package/package.json +33 -39
- package/__tests__/array.test.ts +0 -310
- package/__tests__/astUtils.test.ts +0 -17
- package/__tests__/badDefinitionType.test.ts +0 -51
- package/__tests__/basis.test.ts +0 -46
- package/__tests__/bounds.test.ts +0 -388
- package/__tests__/cast.test.ts +0 -32
- package/__tests__/completions.test.ts +0 -46
- package/__tests__/config.test.ts +0 -77
- package/__tests__/cyclic.test.ts +0 -144
- package/__tests__/dateLiteral.test.ts +0 -32
- package/__tests__/declared.test.ts +0 -124
- package/__tests__/discrimination.test.ts +0 -74
- package/__tests__/divisor.test.ts +0 -90
- package/__tests__/enclosed.test.ts +0 -93
- package/__tests__/examples.test.ts +0 -56
- package/__tests__/expressions.test.ts +0 -138
- package/__tests__/generateBenchData.ts +0 -89
- package/__tests__/generated/cyclic.ts +0 -3058
- package/__tests__/generic.test.ts +0 -294
- package/__tests__/group.test.ts +0 -72
- package/__tests__/hkt.test.ts +0 -22
- package/__tests__/imports.test.ts +0 -113
- package/__tests__/instanceof.test.ts +0 -102
- package/__tests__/intersection.test.ts +0 -104
- package/__tests__/jsdoc.test.ts +0 -64
- package/__tests__/keyTraversal.test.ts +0 -74
- package/__tests__/keyof.test.ts +0 -134
- package/__tests__/keywords.test.ts +0 -188
- package/__tests__/literal.test.ts +0 -51
- package/__tests__/match.bench.ts +0 -31
- package/__tests__/match.test.ts +0 -224
- package/__tests__/methods.bench.ts +0 -22
- package/__tests__/morph.test.ts +0 -409
- package/__tests__/narrow.test.ts +0 -102
- package/__tests__/nodeDefinitions.test.ts +0 -190
- package/__tests__/object.bench.ts +0 -28
- package/__tests__/objectLiteral.test.ts +0 -301
- package/__tests__/operand.bench.ts +0 -45
- package/__tests__/operator.bench.ts +0 -130
- package/__tests__/regex.test.ts +0 -58
- package/__tests__/scope.bench.ts +0 -39
- package/__tests__/scope.test.ts +0 -140
- package/__tests__/string.test.ts +0 -48
- package/__tests__/submodule.test.ts +0 -99
- package/__tests__/this.test.ts +0 -57
- package/__tests__/thunk.test.ts +0 -80
- package/__tests__/traverse.test.ts +0 -119
- package/__tests__/tsGenerics.test.ts +0 -12
- package/__tests__/typeMethods.test.ts +0 -69
- package/__tests__/typeReference.test.ts +0 -39
- package/__tests__/unenclosed.test.ts +0 -120
- package/__tests__/union.test.ts +0 -147
- package/ark.ts +0 -91
- package/main.ts +0 -18
- package/match.ts +0 -243
- package/out/ark.d.ts.map +0 -1
- package/out/ark.js.map +0 -1
- package/out/arkConfig.d.ts +0 -2
- package/out/arkConfig.d.ts.map +0 -1
- package/out/arkConfig.js +0 -10
- package/out/arkConfig.js.map +0 -1
- package/out/main.d.ts +0 -7
- package/out/main.d.ts.map +0 -1
- package/out/main.js +0 -4
- package/out/main.js.map +0 -1
- package/out/match.d.ts.map +0 -1
- package/out/match.js.map +0 -1
- package/out/parser/definition.d.ts.map +0 -1
- package/out/parser/definition.js.map +0 -1
- package/out/parser/generic.d.ts.map +0 -1
- package/out/parser/generic.js.map +0 -1
- package/out/parser/objectLiteral.d.ts.map +0 -1
- package/out/parser/objectLiteral.js.map +0 -1
- package/out/parser/semantic/bounds.d.ts.map +0 -1
- package/out/parser/semantic/bounds.js.map +0 -1
- package/out/parser/semantic/divisor.d.ts.map +0 -1
- package/out/parser/semantic/divisor.js.map +0 -1
- package/out/parser/semantic/intersections.d.ts +0 -14
- package/out/parser/semantic/intersections.d.ts.map +0 -1
- package/out/parser/semantic/intersections.js +0 -2
- package/out/parser/semantic/intersections.js.map +0 -1
- package/out/parser/semantic/semantic.d.ts +0 -33
- package/out/parser/semantic/semantic.d.ts.map +0 -1
- package/out/parser/semantic/semantic.js +0 -2
- package/out/parser/semantic/semantic.js.map +0 -1
- package/out/parser/semantic/utils.d.ts.map +0 -1
- package/out/parser/semantic/utils.js.map +0 -1
- package/out/parser/semantic/validate.d.ts.map +0 -1
- package/out/parser/semantic/validate.js.map +0 -1
- package/out/parser/shared.d.ts +0 -56
- package/out/parser/shared.d.ts.map +0 -1
- package/out/parser/shared.js +0 -55
- package/out/parser/shared.js.map +0 -1
- package/out/parser/string/reduce/dynamic.d.ts.map +0 -1
- package/out/parser/string/reduce/dynamic.js.map +0 -1
- package/out/parser/string/reduce/shared.d.ts.map +0 -1
- package/out/parser/string/reduce/shared.js.map +0 -1
- package/out/parser/string/reduce/static.d.ts.map +0 -1
- package/out/parser/string/reduce/static.js.map +0 -1
- package/out/parser/string/shift/operand/date.d.ts.map +0 -1
- package/out/parser/string/shift/operand/date.js.map +0 -1
- package/out/parser/string/shift/operand/enclosed.d.ts.map +0 -1
- package/out/parser/string/shift/operand/enclosed.js.map +0 -1
- package/out/parser/string/shift/operand/genericArgs.d.ts.map +0 -1
- package/out/parser/string/shift/operand/genericArgs.js.map +0 -1
- package/out/parser/string/shift/operand/operand.d.ts.map +0 -1
- package/out/parser/string/shift/operand/operand.js.map +0 -1
- package/out/parser/string/shift/operand/unenclosed.d.ts.map +0 -1
- package/out/parser/string/shift/operand/unenclosed.js.map +0 -1
- package/out/parser/string/shift/operator/bounds.d.ts.map +0 -1
- package/out/parser/string/shift/operator/bounds.js.map +0 -1
- package/out/parser/string/shift/operator/divisor.d.ts.map +0 -1
- package/out/parser/string/shift/operator/divisor.js.map +0 -1
- package/out/parser/string/shift/operator/operator.d.ts.map +0 -1
- package/out/parser/string/shift/operator/operator.js.map +0 -1
- package/out/parser/string/shift/scanner.d.ts.map +0 -1
- package/out/parser/string/shift/scanner.js.map +0 -1
- package/out/parser/string/string.d.ts.map +0 -1
- package/out/parser/string/string.js.map +0 -1
- package/out/parser/tuple.d.ts.map +0 -1
- package/out/parser/tuple.js.map +0 -1
- package/out/scope.d.ts.map +0 -1
- package/out/scope.js.map +0 -1
- package/out/test.d.ts +0 -2
- package/out/test.d.ts.map +0 -1
- package/out/test.js +0 -7
- package/out/test.js.map +0 -1
- package/out/tsconfig.build.tsbuildinfo +0 -1
- package/out/type.d.ts.map +0 -1
- package/out/type.js.map +0 -1
- package/out/util.d.ts +0 -19
- package/out/util.d.ts.map +0 -1
- package/out/util.js +0 -7
- package/out/util.js.map +0 -1
- package/parser/definition.ts +0 -159
- package/parser/generic.ts +0 -68
- package/parser/objectLiteral.ts +0 -197
- package/parser/semantic/bounds.ts +0 -61
- package/parser/semantic/divisor.ts +0 -13
- package/parser/semantic/intersections.ts +0 -46
- package/parser/semantic/semantic.ts +0 -143
- package/parser/semantic/utils.ts +0 -26
- package/parser/semantic/validate.ts +0 -109
- package/parser/shared.ts +0 -167
- package/parser/string/reduce/dynamic.ts +0 -196
- package/parser/string/reduce/shared.ts +0 -101
- package/parser/string/reduce/static.ts +0 -298
- package/parser/string/shift/operand/date.ts +0 -54
- package/parser/string/shift/operand/enclosed.ts +0 -118
- package/parser/string/shift/operand/genericArgs.ts +0 -127
- package/parser/string/shift/operand/operand.ts +0 -48
- package/parser/string/shift/operand/unenclosed.ts +0 -268
- package/parser/string/shift/operator/bounds.ts +0 -264
- package/parser/string/shift/operator/divisor.ts +0 -36
- package/parser/string/shift/operator/operator.ts +0 -82
- package/parser/string/shift/scanner.ts +0 -209
- package/parser/string/string.ts +0 -90
- package/parser/tuple.ts +0 -475
- package/scope.ts +0 -548
- package/type.ts +0 -349
- package/util.ts +0 -36
package/out/scope.js
CHANGED
|
@@ -1,222 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { domainOf, hasDomain, isThunk,
|
|
1
|
+
import { RawRootScope, hasArkKind } from "@arktype/schema";
|
|
2
|
+
import { domainOf, hasDomain, isThunk, throwParseError } from "@arktype/util";
|
|
3
|
+
import { Generic } from "./generic.js";
|
|
3
4
|
import { createMatchParser } from "./match.js";
|
|
4
5
|
import { parseObject, writeBadDefinitionTypeMessage } from "./parser/definition.js";
|
|
5
6
|
import { parseGenericParams } from "./parser/generic.js";
|
|
6
7
|
import { DynamicState } from "./parser/string/reduce/dynamic.js";
|
|
7
|
-
import { writeMissingSubmoduleAccessMessage, writeNonSubmoduleDotMessage, writeUnresolvableMessage } from "./parser/string/shift/operand/unenclosed.js";
|
|
8
8
|
import { fullStringParse } from "./parser/string/string.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
export class
|
|
12
|
-
config;
|
|
9
|
+
import { RawTypeParser } from "./type.js";
|
|
10
|
+
export const scope = ((def, config = {}) => new RawScope(def, config));
|
|
11
|
+
export class RawScope extends RawRootScope {
|
|
13
12
|
parseCache = {};
|
|
14
|
-
resolutions;
|
|
15
|
-
/** The set of names defined at the root-level of the scope mapped to their
|
|
16
|
-
* corresponding definitions.**/
|
|
17
|
-
aliases = {};
|
|
18
|
-
exportedNames = [];
|
|
19
|
-
ambient;
|
|
20
13
|
constructor(def, config) {
|
|
14
|
+
const aliases = {};
|
|
21
15
|
for (const k in def) {
|
|
22
16
|
const parsedKey = parseScopeKey(k);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
this.ambient = config.ambient ?? null;
|
|
31
|
-
if (this.ambient) {
|
|
32
|
-
// ensure exportedResolutions is populated
|
|
33
|
-
this.ambient.export();
|
|
34
|
-
this.resolutions = { ...this.ambient.exportedResolutions };
|
|
17
|
+
aliases[parsedKey.name] =
|
|
18
|
+
parsedKey.params.length ?
|
|
19
|
+
// TODO: this
|
|
20
|
+
new Generic(parsedKey.params, def[k], {})
|
|
21
|
+
: def[k];
|
|
35
22
|
}
|
|
36
|
-
|
|
37
|
-
this.resolutions = {};
|
|
38
|
-
}
|
|
39
|
-
this.config = config;
|
|
23
|
+
super(aliases, config);
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
return new Scope(aliases, {});
|
|
43
|
-
};
|
|
44
|
-
type = createTypeParser(this);
|
|
25
|
+
type = new RawTypeParser(this);
|
|
45
26
|
match = createMatchParser(this);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// TODO: name?
|
|
64
|
-
get(name) {
|
|
65
|
-
return this.export()[name];
|
|
66
|
-
}
|
|
67
|
-
createRootContext(input) {
|
|
68
|
-
return {
|
|
69
|
-
path: [],
|
|
70
|
-
scope: this,
|
|
71
|
-
...input
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
parseDefinition(def, input) {
|
|
75
|
-
return this.parse(def, this.createRootContext(input));
|
|
27
|
+
declare = (() => ({
|
|
28
|
+
type: this.type
|
|
29
|
+
})).bind(this);
|
|
30
|
+
define = ((def) => def).bind(this);
|
|
31
|
+
preparseRoot(def) {
|
|
32
|
+
if (isThunk(def) && !hasArkKind(def, "generic"))
|
|
33
|
+
return def();
|
|
34
|
+
return def;
|
|
35
|
+
}
|
|
36
|
+
parseRoot(def) {
|
|
37
|
+
// args: { this: {} as RawRoot },
|
|
38
|
+
return this.parse(def, {
|
|
39
|
+
$: this,
|
|
40
|
+
args: {}
|
|
41
|
+
// type parsing can bypass nodes if it hits the cache,
|
|
42
|
+
// so bind it directly (could be optimized)
|
|
43
|
+
}).bindScope(this);
|
|
76
44
|
}
|
|
77
45
|
parse(def, ctx) {
|
|
78
46
|
if (typeof def === "string") {
|
|
79
|
-
if (ctx.args
|
|
47
|
+
if (ctx.args && Object.keys(ctx.args).every(k => !def.includes(k))) {
|
|
80
48
|
// we can only rely on the cache if there are no contextual
|
|
81
49
|
// resolutions like "this" or generic args
|
|
82
50
|
return this.parseString(def, ctx);
|
|
83
51
|
}
|
|
84
|
-
if (!this.parseCache[def])
|
|
52
|
+
if (!this.parseCache[def])
|
|
85
53
|
this.parseCache[def] = this.parseString(def, ctx);
|
|
86
|
-
}
|
|
87
54
|
return this.parseCache[def];
|
|
88
55
|
}
|
|
89
|
-
return hasDomain(def, "object")
|
|
90
|
-
|
|
56
|
+
return hasDomain(def, "object") ?
|
|
57
|
+
parseObject(def, ctx)
|
|
91
58
|
: throwParseError(writeBadDefinitionTypeMessage(domainOf(def)));
|
|
92
59
|
}
|
|
93
60
|
parseString(def, ctx) {
|
|
94
|
-
return (this.
|
|
61
|
+
return (this.maybeResolveRoot(def) ??
|
|
95
62
|
((def.endsWith("[]") &&
|
|
96
|
-
this.
|
|
63
|
+
this.maybeResolveRoot(def.slice(0, -2))?.array()) ||
|
|
97
64
|
fullStringParse(new DynamicState(def, ctx))));
|
|
98
65
|
}
|
|
99
|
-
maybeResolve(name) {
|
|
100
|
-
const cached = this.resolutions[name];
|
|
101
|
-
if (cached) {
|
|
102
|
-
return cached;
|
|
103
|
-
}
|
|
104
|
-
let def = this.aliases[name];
|
|
105
|
-
if (!def) {
|
|
106
|
-
return this.maybeResolveSubalias(name);
|
|
107
|
-
}
|
|
108
|
-
if (isThunk(def) && !hasArkKind(def, "generic")) {
|
|
109
|
-
def = def();
|
|
110
|
-
}
|
|
111
|
-
// TODO: initialize here?
|
|
112
|
-
const resolution = hasArkKind(def, "generic")
|
|
113
|
-
? validateUninstantiatedGeneric(def)
|
|
114
|
-
: hasArkKind(def, "module")
|
|
115
|
-
? throwParseError(writeMissingSubmoduleAccessMessage(name))
|
|
116
|
-
: this.parseDefinition(def, this.createRootContext({ baseName: name, args: {} }));
|
|
117
|
-
this.resolutions[name] = resolution;
|
|
118
|
-
return resolution;
|
|
119
|
-
}
|
|
120
|
-
/** If name is a valid reference to a submodule alias, return its resolution */
|
|
121
|
-
maybeResolveSubalias(name) {
|
|
122
|
-
const dotIndex = name.indexOf(".");
|
|
123
|
-
if (dotIndex === -1) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const dotPrefix = name.slice(0, dotIndex);
|
|
127
|
-
const prefixDef = this.aliases[dotPrefix];
|
|
128
|
-
if (hasArkKind(prefixDef, "module")) {
|
|
129
|
-
const resolution = prefixDef[name.slice(dotIndex + 1)]?.root;
|
|
130
|
-
// if the first part of name is a submodule but the suffix is
|
|
131
|
-
// unresolvable, we can throw immediately
|
|
132
|
-
if (!resolution) {
|
|
133
|
-
return throwParseError(writeUnresolvableMessage(name));
|
|
134
|
-
}
|
|
135
|
-
this.resolutions[name] = resolution;
|
|
136
|
-
return resolution;
|
|
137
|
-
}
|
|
138
|
-
if (prefixDef !== undefined) {
|
|
139
|
-
return throwParseError(writeNonSubmoduleDotMessage(dotPrefix));
|
|
140
|
-
}
|
|
141
|
-
// if the name includes ".", but the prefix is not an alias, it
|
|
142
|
-
// might be something like a decimal literal, so just fall through to return
|
|
143
|
-
}
|
|
144
|
-
maybeResolveNode(name) {
|
|
145
|
-
const result = this.maybeResolve(name);
|
|
146
|
-
return result instanceof BaseType ? result : undefined;
|
|
147
|
-
}
|
|
148
|
-
import(...names) {
|
|
149
|
-
return addArkKind(map(this.export(...names), (alias, value) => [
|
|
150
|
-
`#${alias}`,
|
|
151
|
-
value
|
|
152
|
-
]), "module");
|
|
153
|
-
}
|
|
154
|
-
bindThis() {
|
|
155
|
-
// TODO: fix
|
|
156
|
-
return { this: keywords.unknown };
|
|
157
|
-
}
|
|
158
|
-
exportedResolutions;
|
|
159
|
-
exportCache;
|
|
160
|
-
export(...names) {
|
|
161
|
-
if (!this.exportCache) {
|
|
162
|
-
this.exportCache = {};
|
|
163
|
-
for (const name of this.exportedNames) {
|
|
164
|
-
let def = this.aliases[name];
|
|
165
|
-
if (hasArkKind(def, "generic")) {
|
|
166
|
-
this.exportCache[name] = def;
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
// TODO: thunk generics?
|
|
170
|
-
// handle generics before invoking thunks, since they use
|
|
171
|
-
// varargs they will incorrectly be considered thunks
|
|
172
|
-
if (isThunk(def)) {
|
|
173
|
-
def = def();
|
|
174
|
-
}
|
|
175
|
-
if (hasArkKind(def, "module")) {
|
|
176
|
-
this.exportCache[name] = def;
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
this.exportCache[name] = new Type(this.maybeResolve(name), this);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
this.exportedResolutions = resolutionsOfModule(this.exportCache);
|
|
183
|
-
Object.assign(this.resolutions, this.exportedResolutions);
|
|
184
|
-
}
|
|
185
|
-
const namesToExport = names.length ? names : this.exportedNames;
|
|
186
|
-
return addArkKind(map(namesToExport, (_, name) => [name, this.exportCache[name]]), "module");
|
|
187
|
-
}
|
|
188
66
|
}
|
|
189
|
-
const resolutionsOfModule = (typeSet) => {
|
|
190
|
-
const result = {};
|
|
191
|
-
for (const k in typeSet) {
|
|
192
|
-
const v = typeSet[k];
|
|
193
|
-
if (hasArkKind(v, "module")) {
|
|
194
|
-
const innerResolutions = resolutionsOfModule(v);
|
|
195
|
-
const prefixedResolutions = map(innerResolutions, (innerK, innerV) => [
|
|
196
|
-
`${k}.${innerK}`,
|
|
197
|
-
innerV
|
|
198
|
-
]);
|
|
199
|
-
Object.assign(result, prefixedResolutions);
|
|
200
|
-
}
|
|
201
|
-
else if (hasArkKind(v, "generic")) {
|
|
202
|
-
result[k] = v;
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
result[k] = v.root;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return result;
|
|
209
|
-
};
|
|
210
67
|
export const writeShallowCycleErrorMessage = (name, seen) => `Alias '${name}' has a shallow resolution cycle: ${[...seen, name].join(":")}`;
|
|
211
|
-
export const writeDuplicateNameMessage = (name) => `Duplicate name '${name}'`;
|
|
212
68
|
export const parseScopeKey = (k) => {
|
|
213
|
-
const isLocal = k[0] === "#";
|
|
214
|
-
const name = isLocal ? k.slice(1) : k;
|
|
215
69
|
const firstParamIndex = k.indexOf("<");
|
|
216
70
|
if (firstParamIndex === -1) {
|
|
217
71
|
return {
|
|
218
|
-
|
|
219
|
-
name,
|
|
72
|
+
name: k,
|
|
220
73
|
params: []
|
|
221
74
|
};
|
|
222
75
|
}
|
|
@@ -224,9 +77,7 @@ export const parseScopeKey = (k) => {
|
|
|
224
77
|
throwParseError(`'>' must be the last character of a generic declaration in a scope`);
|
|
225
78
|
}
|
|
226
79
|
return {
|
|
227
|
-
|
|
228
|
-
name: name.slice(0, firstParamIndex),
|
|
80
|
+
name: k.slice(0, firstParamIndex),
|
|
229
81
|
params: parseGenericParams(k.slice(firstParamIndex + 1, -1))
|
|
230
82
|
};
|
|
231
83
|
};
|
|
232
|
-
//# sourceMappingURL=scope.js.map
|
package/out/type.d.ts
CHANGED
|
@@ -1,74 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Callable, type Constructor, type
|
|
1
|
+
import { ArkErrors, BaseRoot, type BaseMeta, type ConstraintKind, type Disjoint, type DivisorSchema, type ExactLengthSchema, type ExclusiveDateRangeSchema, type ExclusiveNumericRangeSchema, type InclusiveDateRangeSchema, type InclusiveNumericRangeSchema, type InnerRoot, type Morph, type MorphAst, type NodeSchema, type Out, type Predicate, type Prerequisite, type PrimitiveConstraintKind, type RegexSchema, type Root, type ambient, type constrain, type constraintKindOf, type distillIn, type distillOut, type exclusivizeRangeSchema, type inferIntersection, type inferMorphOut, type inferPipes, type inferPredicate, type writeInvalidOperandMessage } from "@arktype/schema";
|
|
2
|
+
import { Callable, type Constructor, type ErrorMessage, type array, type conform } from "@arktype/util";
|
|
3
|
+
import { Generic, type validateParameterString } from "./generic.js";
|
|
3
4
|
import type { inferDefinition, validateDeclared, validateDefinition } from "./parser/definition.js";
|
|
4
|
-
import { parseGenericParams
|
|
5
|
-
import type { inferIntersection } from "./parser/semantic/intersections.js";
|
|
5
|
+
import { parseGenericParams } from "./parser/generic.js";
|
|
6
6
|
import type { IndexOneOperator, IndexZeroOperator, TupleInfixOperator } from "./parser/tuple.js";
|
|
7
|
-
import type { Scope, bindThis } from "./scope.js";
|
|
8
|
-
|
|
9
|
-
export type
|
|
7
|
+
import type { RawScope, Scope, bindThis } from "./scope.js";
|
|
8
|
+
/** The convenience properties attached to `type` */
|
|
9
|
+
export type TypeParserAttachments = Omit<TypeParser, never>;
|
|
10
|
+
export interface TypeParser<$ = {}> {
|
|
10
11
|
<const def>(def: validateTypeRoot<def, $>): Type<inferTypeRoot<def, $>, $>;
|
|
11
|
-
<const zero, const one, const rest extends
|
|
12
|
-
Morph<extractOut<inferTypeRoot<zero, $>>, unknown>
|
|
13
|
-
] : one extends "@" ? [string | BaseMeta] : [validateTypeRoot<rest[0], $>] : []): Type<inferTypeRoot<[zero, one, ...rest], $>, $>;
|
|
12
|
+
<const zero, const one, const rest extends array>(_0: zero extends IndexZeroOperator ? zero : validateTypeRoot<zero, $>, _1: zero extends "keyof" ? validateTypeRoot<one, $> : zero extends "instanceof" ? conform<one, Constructor> : zero extends "===" ? conform<one, unknown> : conform<one, IndexOneOperator>, ..._2: zero extends "===" ? rest : zero extends "instanceof" ? conform<rest, readonly Constructor[]> : one extends TupleInfixOperator ? one extends ":" ? [Predicate<distillIn<inferTypeRoot<zero, $>>>] : one extends "=>" ? [Morph<distillOut<inferTypeRoot<zero, $>>, unknown>] : one extends "@" ? [string | BaseMeta] : [validateTypeRoot<rest[0], $>] : []): Type<inferTypeRoot<[zero, one, ...rest], $>, $>;
|
|
14
13
|
<params extends string, const def>(params: `<${validateParameterString<params>}>`, def: validateDefinition<def, $, {
|
|
15
14
|
[param in parseGenericParams<params>[number]]: unknown;
|
|
16
15
|
}>): Generic<parseGenericParams<params>, def, $>;
|
|
17
|
-
|
|
16
|
+
errors: typeof ArkErrors;
|
|
17
|
+
}
|
|
18
|
+
export declare class RawTypeParser extends Callable<(...args: unknown[]) => BaseRoot | Generic, TypeParserAttachments> {
|
|
19
|
+
constructor($: RawScope);
|
|
20
|
+
}
|
|
18
21
|
export type DeclarationParser<$> = <preinferred>() => {
|
|
19
|
-
type: <def>(def: validateDeclared<preinferred, def,
|
|
22
|
+
type: <def>(def: validateDeclared<preinferred, def, $ & ambient, bindThis<def>>) => Type<preinferred, $>;
|
|
20
23
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
allows: this["root"]["allows"];
|
|
30
|
-
description: string;
|
|
31
|
-
json: Json;
|
|
32
|
-
constructor(definition: unknown, scope: Scope);
|
|
33
|
-
configure(configOrDescription: BaseMeta | string): this;
|
|
34
|
-
describe(description: string): this;
|
|
35
|
-
from(literal: this["in"]["infer"]): this["in"]["infer"];
|
|
24
|
+
type validateChainedConstraint<kind extends ConstraintKind, t extends {
|
|
25
|
+
inferIn: unknown;
|
|
26
|
+
}> = t["inferIn"] extends Prerequisite<kind> ? t : ErrorMessage<writeInvalidOperandMessage<kind, Root<t["inferIn"]>>>;
|
|
27
|
+
declare class _Type<t = unknown, $ = any> extends InnerRoot<t, $> {
|
|
28
|
+
$: Scope<$>;
|
|
29
|
+
get in(): Type<this["tIn"], $>;
|
|
30
|
+
get out(): Type<this["tOut"], $>;
|
|
31
|
+
intersect<def>(def: validateTypeRoot<def, $>): Type<inferIntersection<t, inferTypeRoot<def, $>>> | Disjoint;
|
|
36
32
|
and<def>(def: validateTypeRoot<def, $>): Type<inferIntersection<t, inferTypeRoot<def, $>>, $>;
|
|
37
33
|
or<def>(def: validateTypeRoot<def, $>): Type<t | inferTypeRoot<def, $>, $>;
|
|
38
|
-
morph<morph extends Morph<this["infer"]>>(morph: morph): Type<(In: this["in"]["infer"]) => Out<inferMorphOut<ReturnType<morph>>>, $>;
|
|
39
|
-
morph<morph extends Morph<this["infer"]>, def>(morph: morph, outValidator: validateTypeRoot<def, $>): Type<(In: this["in"]["infer"]) => Out<extractOut<inferTypeRoot<def, $>>>, $>;
|
|
40
|
-
narrow<def extends Predicate<extractOut<t>>>(def: def): Type<includesMorphs<t> extends true ? (In: this["in"]["infer"]) => Out<inferNarrow<this["infer"], def>> : inferNarrow<this["infer"], def>, $>;
|
|
41
34
|
array(): Type<t[], $>;
|
|
42
|
-
keyof(): Type<keyof this["
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
extends<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
keyof(): Type<keyof this["inferIn"], $>;
|
|
36
|
+
pipe<a extends Morph<this["infer"]>>(a: a): Type<inferPipes<t, [a]>, $>;
|
|
37
|
+
pipe<a extends Morph<this["infer"]>, b extends Morph<inferMorphOut<a>>>(a: a, b: b): Type<inferPipes<t, [a, b]>, $>;
|
|
38
|
+
pipe<a extends Morph<this["infer"]>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>>(a: a, b: b, c: c): Type<inferPipes<t, [a, b, c]>, $>;
|
|
39
|
+
pipe<a extends Morph<this["infer"]>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>>(a: a, b: b, c: c, d: d): Type<inferPipes<t, [a, b, c, d]>, $>;
|
|
40
|
+
pipe<a extends Morph<this["infer"]>, b extends Morph<inferMorphOut<a>>, c extends Morph<inferMorphOut<b>>, d extends Morph<inferMorphOut<c>>, e extends Morph<inferMorphOut<d>>>(a: a, b: b, c: c, d: d, e: e): Type<inferPipes<t, [a, b, c, d, e]>, $>;
|
|
41
|
+
pipe<a extends Morph<this["infer"]>, 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>>>(a: a, b: b, c: c, d: d, e: e, f: f): Type<inferPipes<t, [a, b, c, d, e, f]>, $>;
|
|
42
|
+
pipe<a extends Morph<this["infer"]>, 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>>>(a: a, b: b, c: c, d: d, e: e, f: f, g: g): Type<inferPipes<t, [a, b, c, d, e, f, g]>, $>;
|
|
43
|
+
narrow<const predicate extends Predicate<distillOut<t>>>(predicate: predicate): Type<t extends MorphAst ? (In: this["tIn"]) => Out<inferPredicate<this["tOut"], predicate>> : inferPredicate<t, predicate>, $>;
|
|
44
|
+
equals<def>(def: validateTypeRoot<def, $>): this is Type<inferTypeRoot<def>, $>;
|
|
45
|
+
extract<def>(r: validateTypeRoot<def, $>): Type<t, $>;
|
|
46
|
+
exclude<def>(r: validateTypeRoot<def, $>): Type<t, $>;
|
|
47
|
+
extends<def>(other: validateTypeRoot<def, $>): this is Type<inferTypeRoot<def>, $>;
|
|
48
|
+
overlaps<def>(r: validateTypeRoot<def, $>): boolean;
|
|
49
|
+
constrain<kind extends PrimitiveConstraintKind, const def extends NodeSchema<kind>>(kind: conform<kind, constraintKindOf<this["inferIn"]>>, def: def): Type<constrain<t, kind, def>, $>;
|
|
50
|
+
satisfying<predicate extends Predicate<distillIn<t>>>(predicate: predicate): Type<t extends MorphAst ? (In: inferPredicate<this["tIn"], predicate>) => Out<this["tOut"]> : inferPredicate<t, predicate>, $>;
|
|
51
|
+
divisibleBy<const schema extends DivisorSchema>(this: validateChainedConstraint<"divisor", this>, schema: schema): Type<constrain<t, "divisor", schema>, $>;
|
|
52
|
+
matching<const schema extends RegexSchema>(this: validateChainedConstraint<"regex", this>, schema: schema): Type<constrain<t, "regex", schema>, $>;
|
|
53
|
+
atLeast<const schema extends InclusiveNumericRangeSchema>(this: validateChainedConstraint<"min", this>, schema: schema): Type<constrain<t, "min", schema>, $>;
|
|
54
|
+
atMost<const schema extends InclusiveNumericRangeSchema>(this: validateChainedConstraint<"max", this>, schema: schema): Type<constrain<t, "max", schema>, $>;
|
|
55
|
+
moreThan<const schema extends ExclusiveNumericRangeSchema>(this: validateChainedConstraint<"min", this>, schema: schema): Type<constrain<t, "min", exclusivizeRangeSchema<schema>>, $>;
|
|
56
|
+
lessThan<const schema extends ExclusiveNumericRangeSchema>(this: validateChainedConstraint<"max", this>, schema: schema): Type<constrain<t, "max", exclusivizeRangeSchema<schema>>, $>;
|
|
57
|
+
atLeastLength<const schema extends InclusiveNumericRangeSchema>(this: validateChainedConstraint<"minLength", this>, schema: schema): Type<constrain<t, "minLength", schema>, $>;
|
|
58
|
+
atMostLength<const schema extends InclusiveNumericRangeSchema>(this: validateChainedConstraint<"maxLength", this>, schema: schema): Type<constrain<t, "maxLength", schema>, $>;
|
|
59
|
+
moreThanLength<const schema extends ExclusiveNumericRangeSchema>(this: validateChainedConstraint<"minLength", this>, schema: schema): Type<constrain<t, "minLength", exclusivizeRangeSchema<schema>>, $>;
|
|
60
|
+
lessThanLength<const schema extends ExclusiveNumericRangeSchema>(this: validateChainedConstraint<"maxLength", this>, schema: schema): Type<constrain<t, "maxLength", exclusivizeRangeSchema<schema>>, $>;
|
|
61
|
+
exactlyLength<const schema extends ExactLengthSchema>(this: validateChainedConstraint<"exactLength", this>, schema: schema): Type<constrain<t, "exactLength", schema>, $>;
|
|
62
|
+
atOrAfter<const schema extends InclusiveDateRangeSchema>(this: validateChainedConstraint<"after", this>, schema: schema): Type<constrain<t, "after", schema>, $>;
|
|
63
|
+
atOrBefore<const schema extends InclusiveDateRangeSchema>(this: validateChainedConstraint<"before", this>, schema: schema): Type<constrain<t, "before", schema>, $>;
|
|
64
|
+
laterThan<const schema extends ExclusiveDateRangeSchema>(this: validateChainedConstraint<"after", this>, schema: schema): Type<constrain<t, "after", exclusivizeRangeSchema<schema>>, $>;
|
|
65
|
+
earlierThan<const schema extends ExclusiveDateRangeSchema>(this: validateChainedConstraint<"before", this>, schema: schema): Type<constrain<t, "before", exclusivizeRangeSchema<schema>>, $>;
|
|
51
66
|
}
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export
|
|
57
|
-
export
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
definition: def;
|
|
62
|
-
scope: Scope;
|
|
63
|
-
};
|
|
64
|
-
export type BoundArgs = Record<string, TypeNode>;
|
|
65
|
-
export type Generic<params extends string[] = string[], def = unknown, $ = any> = {
|
|
66
|
-
<args>(...args: conform<args, {
|
|
67
|
-
[i in keyof params]: validateTypeRoot<args[i & keyof args], $>;
|
|
68
|
-
}>): Type<inferDefinition<def, $, bindGenericInstantiation<params, $, args>>, $>;
|
|
69
|
-
} & GenericProps<params, def, $>;
|
|
70
|
-
type bindGenericInstantiation<params extends string[], $, args> = {
|
|
71
|
-
[i in keyof params & `${number}` as params[i]]: inferTypeRoot<args[i & keyof args], $>;
|
|
72
|
-
};
|
|
67
|
+
export interface Type<
|
|
68
|
+
/** @ts-expect-error allow instantiation assignment to the base type */
|
|
69
|
+
out t = unknown, $ = {}> extends _Type<t, $> {
|
|
70
|
+
}
|
|
71
|
+
export type TypeConstructor<t = unknown, $ = {}> = new (def: unknown, $: Scope<$>) => Type<t, $>;
|
|
72
|
+
export declare const Type: TypeConstructor;
|
|
73
|
+
export type DefinitionParser<$> = <def>(def: validateTypeRoot<def, $>) => def;
|
|
74
|
+
export type validateTypeRoot<def, $ = {}> = validateDefinition<def, $ & ambient, bindThis<def>>;
|
|
75
|
+
export type inferTypeRoot<def, $ = {}> = inferDefinition<def, $ & ambient, bindThis<def>>;
|
|
73
76
|
export {};
|
|
74
|
-
//# sourceMappingURL=type.d.ts.map
|
package/out/type.js
CHANGED
|
@@ -1,138 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Callable
|
|
1
|
+
import { ArkErrors, BaseRoot } from "@arktype/schema";
|
|
2
|
+
import { Callable } from "@arktype/util";
|
|
3
|
+
import { Generic } from "./generic.js";
|
|
3
4
|
import { parseGenericParams } from "./parser/generic.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
args
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
definition;
|
|
31
|
-
scope;
|
|
32
|
-
root;
|
|
33
|
-
allows;
|
|
34
|
-
description;
|
|
35
|
-
json;
|
|
36
|
-
constructor(definition, scope) {
|
|
37
|
-
const root = parseTypeRoot(definition, scope);
|
|
38
|
-
super(root.apply, root);
|
|
39
|
-
this.definition = definition;
|
|
40
|
-
this.scope = scope;
|
|
41
|
-
this.root = root;
|
|
42
|
-
this.allows = root.allows;
|
|
43
|
-
this.json = root.json;
|
|
44
|
-
this.description = this.root.description;
|
|
45
|
-
}
|
|
46
|
-
configure(configOrDescription) {
|
|
47
|
-
return new Type(configureShallowDescendants(this.root, configOrDescription), this.scope);
|
|
48
|
-
}
|
|
49
|
-
describe(description) {
|
|
50
|
-
return this.configure(description);
|
|
51
|
-
}
|
|
52
|
-
// TODO: should return out
|
|
53
|
-
from(literal) {
|
|
54
|
-
return literal;
|
|
55
|
-
}
|
|
56
|
-
// TODO: Morph intersections, ordering
|
|
57
|
-
and(def) {
|
|
58
|
-
return new Type(this.root.and(parseTypeRoot(def, this.scope)), this.scope);
|
|
59
|
-
}
|
|
60
|
-
or(def) {
|
|
61
|
-
return new Type(this.root.or(parseTypeRoot(def, this.scope)), this.scope);
|
|
62
|
-
}
|
|
63
|
-
morph(morph, outValidator) {
|
|
64
|
-
// TODO: tuple expression for out validator
|
|
65
|
-
outValidator;
|
|
66
|
-
return this;
|
|
67
|
-
// return new Type(
|
|
68
|
-
// this.root.constrain("morph", morph),
|
|
69
|
-
// this.scope
|
|
70
|
-
// ) as never
|
|
71
|
-
}
|
|
72
|
-
// TODO: based on below, should maybe narrow morph output if used after
|
|
73
|
-
narrow(def) {
|
|
74
|
-
return new Type(this.root.constrain("predicate", def), this.scope);
|
|
75
|
-
}
|
|
76
|
-
array() {
|
|
77
|
-
return new Type(this.root.array(), this.scope);
|
|
78
|
-
}
|
|
79
|
-
keyof() {
|
|
80
|
-
return new Type(this.root.keyof(), this.scope);
|
|
81
|
-
}
|
|
82
|
-
assert(data) {
|
|
83
|
-
const result = this.call(null, data);
|
|
84
|
-
return result.errors ? result.errors.throw() : result.out;
|
|
85
|
-
}
|
|
86
|
-
equals(other) {
|
|
87
|
-
return this.root.equals(parseTypeRoot(other, this.scope));
|
|
88
|
-
}
|
|
89
|
-
extends(other) {
|
|
90
|
-
return this.root.extends(parseTypeRoot(other, this.scope));
|
|
91
|
-
}
|
|
92
|
-
inCache;
|
|
93
|
-
get in() {
|
|
94
|
-
this.inCache ??= new Type(this.root.in, this.scope);
|
|
95
|
-
return this.inCache;
|
|
96
|
-
}
|
|
97
|
-
outCache;
|
|
98
|
-
get out() {
|
|
99
|
-
this.outCache ??= new Type(this.root.out, this.scope);
|
|
100
|
-
return this.outCache;
|
|
101
|
-
}
|
|
102
|
-
toString() {
|
|
103
|
-
return this.description;
|
|
5
|
+
const typeParserAttachments = Object.freeze({
|
|
6
|
+
errors: ArkErrors
|
|
7
|
+
});
|
|
8
|
+
export class RawTypeParser extends Callable {
|
|
9
|
+
constructor($) {
|
|
10
|
+
super((...args) => {
|
|
11
|
+
if (args.length === 1) {
|
|
12
|
+
// treat as a simple definition
|
|
13
|
+
return $.parseRoot(args[0]);
|
|
14
|
+
}
|
|
15
|
+
if (args.length === 2 &&
|
|
16
|
+
typeof args[0] === "string" &&
|
|
17
|
+
args[0][0] === "<" &&
|
|
18
|
+
args[0].at(-1) === ">") {
|
|
19
|
+
// if there are exactly two args, the first of which looks like <${string}>,
|
|
20
|
+
// treat as a generic
|
|
21
|
+
const params = parseGenericParams(args[0].slice(1, -1));
|
|
22
|
+
const def = args[1];
|
|
23
|
+
// TODO: validateUninstantiatedGeneric, remove this cast
|
|
24
|
+
return new Generic(params, def, $);
|
|
25
|
+
}
|
|
26
|
+
// otherwise, treat as a tuple expression. technically, this also allows
|
|
27
|
+
// non-expression tuple definitions to be parsed, but it's not a supported
|
|
28
|
+
// part of the API as specified by the associated types
|
|
29
|
+
return $.parseRoot(args);
|
|
30
|
+
}, { bind: $, attach: typeParserAttachments });
|
|
104
31
|
}
|
|
105
32
|
}
|
|
106
|
-
const
|
|
107
|
-
args: args ?? scope.bindThis(),
|
|
108
|
-
baseName: "type"
|
|
109
|
-
});
|
|
110
|
-
export const validateUninstantiatedGeneric = (g) => {
|
|
111
|
-
// the unconstrained instantiation of the generic is not used for now
|
|
112
|
-
// other than to eagerly validate that the def does not contain any errors
|
|
113
|
-
g.scope.parseDefinition(g.definition,
|
|
114
|
-
// once we support constraints on generic parameters, we'd use
|
|
115
|
-
// the base type here: https://github.com/arktypeio/arktype/issues/796
|
|
116
|
-
{
|
|
117
|
-
baseName: "generic",
|
|
118
|
-
args: map(g.parameters, (_, name) => [name, keywords.unknown])
|
|
119
|
-
});
|
|
120
|
-
return g;
|
|
121
|
-
};
|
|
122
|
-
export const generic = (parameters, definition, scope) => {
|
|
123
|
-
return Object.assign((...args) => {
|
|
124
|
-
const argNodes = map(parameters, (i, param) => [
|
|
125
|
-
param,
|
|
126
|
-
parseTypeRoot(args[i], scope)
|
|
127
|
-
]);
|
|
128
|
-
const root = parseTypeRoot(definition, scope, argNodes);
|
|
129
|
-
return new Type(root, scope);
|
|
130
|
-
}, {
|
|
131
|
-
[arkKind]: "generic",
|
|
132
|
-
parameters,
|
|
133
|
-
definition,
|
|
134
|
-
scope
|
|
135
|
-
// $ is only needed at compile-time
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
//# sourceMappingURL=type.js.map
|
|
33
|
+
export const Type = BaseRoot;
|