Comparing version 2.0.0-rc.1 to 2.0.0-rc.2
@@ -155,3 +155,5 @@ import { GenericRoot, type arkKind, type GenericAst, type GenericParamAst, type GenericParamDef, type genericParamNames, type LazyGenericBody } from "@ark/schema"; | ||
]; | ||
export type GenericParser<$ = {}> = <const paramsDef extends array<GenericParamDef>>(...params: paramsDef) => GenericBodyParser<genericParamDefsToAst<paramsDef, $>, $>; | ||
export type GenericParser<$ = {}> = <const paramsDef extends array<GenericParamDef>>(...params: { | ||
[i in keyof paramsDef]: paramsDef[i] extends (readonly [infer name, infer def]) ? readonly [name, validateTypeRoot<def, $>] : paramsDef[i]; | ||
}) => GenericBodyParser<genericParamDefsToAst<paramsDef, $>, $>; | ||
interface GenericBodyParser<params extends array<GenericParamAst>, $> { | ||
@@ -158,0 +160,0 @@ <const body>(body: validateDefinition<body, $, baseGenericConstraints<params>>): Generic<params, body, $, $>; |
import { ArkErrors, BaseRoot, type MetaSchema, type Morph, type Predicate } from "@ark/schema"; | ||
import { Callable, type Constructor, type array, type conform } from "@ark/util"; | ||
import { type Generic, type ParameterString, type baseGenericConstraints, type parseValidGenericParams, type validateParameterString } from "./generic.ts"; | ||
import { type Generic, type GenericParser, type ParameterString, type baseGenericConstraints, type parseValidGenericParams, type validateParameterString } from "./generic.ts"; | ||
import type { Ark, ark } from "./keywords/ark.ts"; | ||
@@ -21,2 +21,3 @@ import type { distillIn, distillOut } from "./keywords/ast.ts"; | ||
scope: ScopeParser; | ||
generic: GenericParser<$>; | ||
ark: typeof ark; | ||
@@ -23,0 +24,0 @@ } |
@@ -11,2 +11,3 @@ import { ArkErrors, BaseRoot, GenericRoot } from "@ark/schema"; | ||
scope: $.constructor.scope, | ||
generic: $.generic, | ||
// this won't be defined during bootstrapping, but externally always will be | ||
@@ -13,0 +14,0 @@ ark: $.ambient |
{ | ||
"name": "arktype", | ||
"description": "TypeScript's 1:1 validator, optimized from editor to runtime", | ||
"version": "2.0.0-rc.1", | ||
"version": "2.0.0-rc.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
222170
4314