arktype 2.0.0-dev.22 → 2.0.0-dev.23
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/api.d.ts +1 -1
- package/out/ark.d.ts +8 -1
- package/out/type.d.ts +3 -0
- package/package.json +2 -2
package/out/api.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export type { Ark, ArkConfig, Out } from "@arktype/schema";
|
|
|
3
3
|
export { ambient, ark, declare, define, match, type } from "./ark.js";
|
|
4
4
|
export { Module } from "./module.js";
|
|
5
5
|
export { scope, type Scope, type inferScope, type validateScope } from "./scope.js";
|
|
6
|
-
export { Type, type inferTypeRoot, type validateTypeRoot } from "./type.js";
|
|
6
|
+
export { Type, type AnyType, type inferTypeRoot, type validateTypeRoot } from "./type.js";
|
package/out/ark.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type Ark, type ArkErrors, type inferred } from "@arktype/schema";
|
|
2
|
+
import type { CastableBase } from "@arktype/util";
|
|
2
3
|
import type { Generic } from "./generic.js";
|
|
3
4
|
import type { MatchParser } from "./match.js";
|
|
4
5
|
import type { Module } from "./module.js";
|
|
5
6
|
import { type Scope } from "./scope.js";
|
|
6
|
-
import type { DeclarationParser, DefinitionParser, TypeParser } from "./type.js";
|
|
7
|
+
import type { DeclarationParser, DefinitionParser, Type, TypeParser } from "./type.js";
|
|
7
8
|
type TsGenericsExports<$ = Ark> = {
|
|
8
9
|
Record: Generic<[
|
|
9
10
|
"K",
|
|
@@ -21,6 +22,12 @@ export declare namespace type {
|
|
|
21
22
|
[inferred]?: t;
|
|
22
23
|
};
|
|
23
24
|
type errors = ArkErrors;
|
|
25
|
+
interface of<t, $ = {}> extends Type<t, $> {
|
|
26
|
+
}
|
|
27
|
+
interface infer<t extends Type<object>> extends CastableBase<t["infer"]> {
|
|
28
|
+
}
|
|
29
|
+
interface inferIn<t extends Type<object>> extends CastableBase<t["inferIn"]> {
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
export declare const match: MatchParser<{}>;
|
|
26
33
|
export declare const define: DefinitionParser<{}>;
|
package/out/type.d.ts
CHANGED
|
@@ -69,6 +69,9 @@ export interface Type<
|
|
|
69
69
|
out t = unknown, $ = {}> extends _Type<t, $> {
|
|
70
70
|
}
|
|
71
71
|
export type TypeConstructor<t = unknown, $ = {}> = new (def: unknown, $: Scope<$>) => Type<t, $>;
|
|
72
|
+
export type AnyType<
|
|
73
|
+
/** @ts-expect-error allow instantiation assignment to the base type */
|
|
74
|
+
out t = unknown, $ = any> = Type<t, $>;
|
|
72
75
|
export declare const Type: TypeConstructor;
|
|
73
76
|
export type DefinitionParser<$> = <def>(def: validateTypeRoot<def, $>) => def;
|
|
74
77
|
export type validateTypeRoot<def, $ = {}> = validateDefinition<def, $, bindThis<def>>;
|
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.0.0-dev.
|
|
4
|
+
"version": "2.0.0-dev.23",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "David Blass",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@arktype/util": "0.0.48",
|
|
28
|
-
"@arktype/schema": "0.1.
|
|
28
|
+
"@arktype/schema": "0.1.15"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "tsx ../repo/build.ts",
|