arktype 2.0.0-rc.1 → 2.0.0-rc.2
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/out/generic.d.ts +3 -1
- package/out/type.d.ts +2 -1
- package/out/type.js +1 -0
- package/package.json +1 -1
package/out/generic.d.ts
CHANGED
|
@@ -152,7 +152,9 @@ export type genericParamDefsToAst<defs extends array<GenericParamDef>, $> = [
|
|
|
152
152
|
[i in keyof defs]: genericParamDefToAst<defs[i], $>;
|
|
153
153
|
}
|
|
154
154
|
];
|
|
155
|
-
export type GenericParser<$ = {}> = <const paramsDef extends array<GenericParamDef>>(...params:
|
|
155
|
+
export type GenericParser<$ = {}> = <const paramsDef extends array<GenericParamDef>>(...params: {
|
|
156
|
+
[i in keyof paramsDef]: paramsDef[i] extends (readonly [infer name, infer def]) ? readonly [name, validateTypeRoot<def, $>] : paramsDef[i];
|
|
157
|
+
}) => GenericBodyParser<genericParamDefsToAst<paramsDef, $>, $>;
|
|
156
158
|
interface GenericBodyParser<params extends array<GenericParamAst>, $> {
|
|
157
159
|
<const body>(body: validateDefinition<body, $, baseGenericConstraints<params>>): Generic<params, body, $, $>;
|
|
158
160
|
<hkt extends Hkt.constructor>(instantiateDef: LazyGenericBody<baseGenericResolutions<params, $>>, hkt: hkt): Generic<params, InstanceType<hkt>, $, $>;
|
package/out/type.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArkErrors, BaseRoot, type MetaSchema, type Morph, type Predicate } from "@ark/schema";
|
|
2
2
|
import { Callable, type Constructor, type array, type conform } from "@ark/util";
|
|
3
|
-
import { type Generic, type ParameterString, type baseGenericConstraints, type parseValidGenericParams, type validateParameterString } from "./generic.ts";
|
|
3
|
+
import { type Generic, type GenericParser, type ParameterString, type baseGenericConstraints, type parseValidGenericParams, type validateParameterString } from "./generic.ts";
|
|
4
4
|
import type { Ark, ark } from "./keywords/ark.ts";
|
|
5
5
|
import type { distillIn, distillOut } from "./keywords/ast.ts";
|
|
6
6
|
import type { inferDefinition, validateDeclared, validateDefinition } from "./parser/definition.ts";
|
|
@@ -18,6 +18,7 @@ export interface TypeParser<$ = {}> extends Ark.boundTypeAttachments<$> {
|
|
|
18
18
|
errors: typeof ArkErrors;
|
|
19
19
|
module: ModuleParser;
|
|
20
20
|
scope: ScopeParser;
|
|
21
|
+
generic: GenericParser<$>;
|
|
21
22
|
ark: typeof ark;
|
|
22
23
|
}
|
|
23
24
|
export declare class InternalTypeParser extends Callable<(...args: unknown[]) => BaseRoot | Generic, TypeParserAttachments> {
|
package/out/type.js
CHANGED