@sinclair/typebox 0.31.27 → 0.32.0-dev-1
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/compiler/compiler.d.ts +25 -18
- package/compiler/compiler.js +118 -107
- package/errors/errors.d.ts +7 -7
- package/errors/errors.js +48 -44
- package/index.d.ts +71 -0
- package/index.js +205 -0
- package/package.json +8 -19
- package/readme.md +188 -160
- package/system/errors.d.ts +14 -0
- package/system/errors.js +192 -0
- package/system/index.d.ts +3 -1
- package/system/index.js +10 -16
- package/system/policy.d.ts +21 -0
- package/system/policy.js +74 -0
- package/system/system.d.ts +3 -38
- package/system/system.js +15 -218
- package/type/any/any.d.ts +8 -0
- package/type/any/any.js +36 -0
- package/type/any/index.d.ts +1 -0
- package/type/any/index.js +44 -0
- package/type/array/array.d.ts +25 -0
- package/type/array/array.js +42 -0
- package/type/array/index.d.ts +1 -0
- package/type/array/index.js +44 -0
- package/type/async-iterator/async-iterator.d.ts +11 -0
- package/type/async-iterator/async-iterator.js +42 -0
- package/type/async-iterator/index.d.ts +1 -0
- package/type/async-iterator/index.js +44 -0
- package/type/awaited/awaited.d.ts +12 -0
- package/type/awaited/awaited.js +66 -0
- package/type/awaited/index.d.ts +1 -0
- package/type/awaited/index.js +44 -0
- package/type/bigint/bigint.d.ts +16 -0
- package/type/bigint/bigint.js +40 -0
- package/type/bigint/index.d.ts +1 -0
- package/type/bigint/index.js +44 -0
- package/type/boolean/boolean.d.ts +9 -0
- package/type/boolean/boolean.js +40 -0
- package/type/boolean/index.d.ts +1 -0
- package/type/boolean/index.js +44 -0
- package/type/clone/index.d.ts +2 -0
- package/type/clone/index.js +32 -0
- package/type/clone/type.d.ts +5 -0
- package/type/clone/type.js +41 -0
- package/type/clone/value.d.ts +2 -0
- package/type/clone/value.js +58 -0
- package/type/composite/composite.d.ts +15 -0
- package/type/composite/composite.js +47 -0
- package/type/composite/index.d.ts +1 -0
- package/type/composite/index.js +44 -0
- package/type/const/const.d.ts +30 -0
- package/type/const/const.js +84 -0
- package/type/const/index.d.ts +1 -0
- package/type/const/index.js +44 -0
- package/type/constructor/constructor.d.ts +17 -0
- package/type/constructor/constructor.js +43 -0
- package/type/constructor/index.d.ts +1 -0
- package/type/constructor/index.js +44 -0
- package/type/constructor-parameters/constructor-parameters.d.ts +7 -0
- package/type/constructor-parameters/constructor-parameters.js +37 -0
- package/type/constructor-parameters/index.d.ts +1 -0
- package/type/constructor-parameters/index.js +44 -0
- package/type/date/date.d.ts +21 -0
- package/type/date/date.js +40 -0
- package/type/date/index.d.ts +1 -0
- package/type/date/index.js +44 -0
- package/type/deref/deref.d.ts +24 -0
- package/type/deref/deref.js +136 -0
- package/type/deref/index.d.ts +1 -0
- package/type/deref/index.js +44 -0
- package/type/discard/discard.d.ts +1 -0
- package/type/discard/discard.js +38 -0
- package/type/discard/index.d.ts +1 -0
- package/type/discard/index.js +44 -0
- package/type/enum/enum.d.ts +14 -0
- package/type/enum/enum.js +46 -0
- package/type/enum/index.d.ts +1 -0
- package/type/enum/index.js +44 -0
- package/type/exclude/exclude.d.ts +21 -0
- package/type/exclude/exclude.js +54 -0
- package/type/exclude/index.d.ts +1 -0
- package/type/exclude/index.js +44 -0
- package/type/extends/extends-check.d.ts +9 -0
- package/type/extends/extends-check.js +654 -0
- package/type/extends/extends-undefined.d.ts +3 -0
- package/type/extends/extends-undefined.js +51 -0
- package/type/extends/extends.d.ts +9 -0
- package/type/extends/extends.js +47 -0
- package/type/extends/index.d.ts +3 -0
- package/type/extends/index.js +46 -0
- package/type/extract/extract.d.ts +20 -0
- package/type/extract/extract.js +54 -0
- package/type/extract/index.d.ts +1 -0
- package/type/extract/index.js +44 -0
- package/type/function/function.d.ts +17 -0
- package/type/function/function.js +43 -0
- package/type/function/index.d.ts +1 -0
- package/type/function/index.js +44 -0
- package/type/guard/index.d.ts +2 -0
- package/type/guard/index.js +32 -0
- package/type/guard/type.d.ts +130 -0
- package/type/guard/type.js +515 -0
- package/type/guard/value.d.ts +28 -0
- package/type/guard/value.js +100 -0
- package/type/helpers/helpers.d.ts +42 -0
- package/type/helpers/helpers.js +35 -0
- package/type/helpers/index.d.ts +1 -0
- package/type/helpers/index.js +44 -0
- package/type/index.d.ts +70 -0
- package/type/index.js +113 -0
- package/type/indexed/index.d.ts +3 -0
- package/type/indexed/index.js +46 -0
- package/type/indexed/indexed-key.d.ts +17 -0
- package/type/indexed/indexed-key.js +65 -0
- package/type/indexed/indexed-type.d.ts +33 -0
- package/type/indexed/indexed-type.js +106 -0
- package/type/indexed/indexed.d.ts +8 -0
- package/type/indexed/indexed.js +41 -0
- package/type/instance-type/index.d.ts +1 -0
- package/type/instance-type/index.js +44 -0
- package/type/instance-type/instance-type.d.ts +5 -0
- package/type/instance-type/instance-type.js +36 -0
- package/type/integer/index.d.ts +1 -0
- package/type/integer/index.js +44 -0
- package/type/integer/integer.d.ts +16 -0
- package/type/integer/integer.js +40 -0
- package/type/intersect/index.d.ts +1 -0
- package/type/intersect/index.js +44 -0
- package/type/intersect/intersect.d.ts +22 -0
- package/type/intersect/intersect.js +59 -0
- package/type/intrinsic/index.d.ts +1 -0
- package/type/intrinsic/index.js +44 -0
- package/type/intrinsic/intrinsic.d.ts +27 -0
- package/type/intrinsic/intrinsic.js +106 -0
- package/type/iterator/index.d.ts +1 -0
- package/type/iterator/index.js +44 -0
- package/type/iterator/iterator.d.ts +11 -0
- package/type/iterator/iterator.js +42 -0
- package/type/keyof/index.d.ts +3 -0
- package/type/keyof/index.js +46 -0
- package/type/keyof/keyof-string.d.ts +30 -0
- package/type/keyof/keyof-string.js +103 -0
- package/type/keyof/keyof-type.d.ts +11 -0
- package/type/keyof/keyof-type.js +48 -0
- package/type/keyof/keyof.d.ts +5 -0
- package/type/keyof/keyof.js +38 -0
- package/type/literal/index.d.ts +1 -0
- package/type/literal/index.js +44 -0
- package/type/literal/literal.d.ts +10 -0
- package/type/literal/literal.js +41 -0
- package/type/mapped/index.d.ts +1 -0
- package/type/mapped/index.js +44 -0
- package/type/mapped/mapped.d.ts +26 -0
- package/type/mapped/mapped.js +47 -0
- package/type/modifiers/index.d.ts +1 -0
- package/type/modifiers/index.js +44 -0
- package/type/modifiers/modifiers.d.ts +18 -0
- package/type/modifiers/modifiers.js +78 -0
- package/type/never/index.d.ts +1 -0
- package/type/never/index.js +44 -0
- package/type/never/never.d.ts +9 -0
- package/type/never/never.js +40 -0
- package/type/not/index.d.ts +1 -0
- package/type/not/index.js +44 -0
- package/type/not/not.d.ts +10 -0
- package/type/not/not.js +41 -0
- package/type/null/index.d.ts +1 -0
- package/type/null/index.js +44 -0
- package/type/null/null.d.ts +9 -0
- package/type/null/null.js +40 -0
- package/type/number/index.d.ts +1 -0
- package/type/number/index.js +44 -0
- package/type/number/number.d.ts +16 -0
- package/type/number/number.js +40 -0
- package/type/object/index.d.ts +1 -0
- package/type/object/index.js +44 -0
- package/type/object/object.d.ts +44 -0
- package/type/object/object.js +47 -0
- package/type/omit/index.d.ts +1 -0
- package/type/omit/index.js +44 -0
- package/type/omit/omit.d.ts +21 -0
- package/type/omit/omit.js +75 -0
- package/type/operators/index.d.ts +1 -0
- package/type/operators/index.js +44 -0
- package/type/operators/operators.d.ts +24 -0
- package/type/operators/operators.js +119 -0
- package/type/optional/index.d.ts +1 -0
- package/type/optional/index.js +44 -0
- package/type/optional/optional.d.ts +7 -0
- package/type/optional/optional.js +37 -0
- package/type/parameters/index.d.ts +1 -0
- package/type/parameters/index.js +44 -0
- package/type/parameters/parameters.d.ts +7 -0
- package/type/parameters/parameters.js +37 -0
- package/type/partial/index.d.ts +1 -0
- package/type/partial/index.js +44 -0
- package/type/partial/partial.d.ts +23 -0
- package/type/partial/partial.js +73 -0
- package/type/patterns/index.d.ts +1 -0
- package/type/patterns/index.js +44 -0
- package/type/patterns/patterns.d.ts +6 -0
- package/type/patterns/patterns.js +36 -0
- package/type/pick/index.d.ts +1 -0
- package/type/pick/index.js +44 -0
- package/type/pick/pick.d.ts +21 -0
- package/type/pick/pick.js +66 -0
- package/type/promise/index.d.ts +1 -0
- package/type/promise/index.js +44 -0
- package/type/promise/promise.d.ts +11 -0
- package/type/promise/promise.js +42 -0
- package/type/readonly/index.d.ts +1 -0
- package/type/readonly/index.js +44 -0
- package/type/readonly/readonly.d.ts +7 -0
- package/type/readonly/readonly.js +37 -0
- package/type/readonly-optional/index.d.ts +1 -0
- package/type/readonly-optional/index.js +44 -0
- package/type/readonly-optional/readonly-optional.d.ts +6 -0
- package/type/readonly-optional/readonly-optional.js +37 -0
- package/type/record/index.d.ts +1 -0
- package/type/record/index.js +44 -0
- package/type/record/record.d.ts +55 -0
- package/type/record/record.js +97 -0
- package/type/recursive/index.d.ts +1 -0
- package/type/recursive/index.js +44 -0
- package/type/recursive/recursive.d.ts +15 -0
- package/type/recursive/recursive.js +48 -0
- package/type/ref/index.d.ts +1 -0
- package/type/ref/index.js +44 -0
- package/type/ref/ref.d.ts +12 -0
- package/type/ref/ref.js +45 -0
- package/type/regexp/index.d.ts +1 -0
- package/type/regexp/index.js +44 -0
- package/type/regexp/regexp.d.ts +7 -0
- package/type/regexp/regexp.js +38 -0
- package/type/registry/format.d.ts +13 -0
- package/type/registry/format.js +62 -0
- package/type/registry/index.d.ts +2 -0
- package/type/registry/index.js +32 -0
- package/type/registry/type.d.ts +13 -0
- package/type/registry/type.js +62 -0
- package/type/required/index.d.ts +1 -0
- package/type/required/index.js +44 -0
- package/type/required/required.d.ts +23 -0
- package/type/required/required.js +72 -0
- package/type/rest/index.d.ts +1 -0
- package/type/rest/index.js +44 -0
- package/type/rest/rest.d.ts +10 -0
- package/type/rest/rest.js +41 -0
- package/type/return-type/index.d.ts +1 -0
- package/type/return-type/index.js +44 -0
- package/type/return-type/return-type.d.ts +5 -0
- package/type/return-type/return-type.js +36 -0
- package/type/schema/anyschema.d.ts +32 -0
- package/type/schema/anyschema.js +29 -0
- package/type/schema/index.d.ts +2 -0
- package/type/schema/index.js +45 -0
- package/type/schema/schema.d.ts +29 -0
- package/type/schema/schema.js +30 -0
- package/type/static/index.d.ts +1 -0
- package/type/static/index.js +44 -0
- package/type/static/static.d.ts +34 -0
- package/type/static/static.js +29 -0
- package/type/strict/index.d.ts +1 -0
- package/type/strict/index.js +44 -0
- package/type/strict/strict.d.ts +3 -0
- package/type/strict/strict.js +35 -0
- package/type/string/index.d.ts +1 -0
- package/type/string/index.js +44 -0
- package/type/string/string.d.ts +25 -0
- package/type/string/string.js +36 -0
- package/type/symbol/index.d.ts +1 -0
- package/type/symbol/index.js +44 -0
- package/type/symbol/symbol.d.ts +10 -0
- package/type/symbol/symbol.js +36 -0
- package/type/symbols/index.d.ts +1 -0
- package/type/symbols/index.js +44 -0
- package/type/symbols/symbols.d.ts +10 -0
- package/type/symbols/symbols.js +40 -0
- package/type/template-literal/finite.d.ts +16 -0
- package/type/template-literal/finite.js +71 -0
- package/type/template-literal/generate.d.ts +15 -0
- package/type/template-literal/generate.js +74 -0
- package/type/template-literal/index.d.ts +7 -0
- package/type/template-literal/index.js +50 -0
- package/type/template-literal/parser.d.ts +19 -0
- package/type/template-literal/parser.js +175 -0
- package/type/template-literal/pattern.d.ts +4 -0
- package/type/template-literal/pattern.js +61 -0
- package/type/template-literal/syntax.d.ts +20 -0
- package/type/template-literal/syntax.js +87 -0
- package/type/template-literal/template-literal.d.ts +30 -0
- package/type/template-literal/template-literal.js +43 -0
- package/type/template-literal/union.d.ts +7 -0
- package/type/template-literal/union.js +48 -0
- package/type/transform/index.d.ts +1 -0
- package/type/transform/index.js +44 -0
- package/type/transform/transform.d.ts +29 -0
- package/type/transform/transform.js +72 -0
- package/type/tuple/index.d.ts +1 -0
- package/type/tuple/index.js +44 -0
- package/type/tuple/tuple.d.ts +15 -0
- package/type/tuple/tuple.js +42 -0
- package/type/type/index.d.ts +6 -0
- package/type/type/index.js +44 -0
- package/type/type/javascript.d.ts +58 -0
- package/type/type/javascript.js +120 -0
- package/type/type/json.d.ts +139 -0
- package/type/type/json.js +255 -0
- package/type/type/type.d.ts +58 -0
- package/type/type/type.js +153 -0
- package/type/uint8array/index.d.ts +1 -0
- package/type/uint8array/index.js +44 -0
- package/type/uint8array/uint8array.d.ts +13 -0
- package/type/uint8array/uint8array.js +36 -0
- package/type/undefined/index.d.ts +1 -0
- package/type/undefined/index.js +44 -0
- package/type/undefined/undefined.d.ts +9 -0
- package/type/undefined/undefined.js +36 -0
- package/type/union/index.d.ts +1 -0
- package/type/union/index.js +44 -0
- package/type/union/union.d.ts +16 -0
- package/type/union/union.js +50 -0
- package/type/unknown/index.d.ts +1 -0
- package/type/unknown/index.js +44 -0
- package/type/unknown/unknown.d.ts +8 -0
- package/type/unknown/unknown.js +39 -0
- package/type/unsafe/index.d.ts +1 -0
- package/type/unsafe/index.js +44 -0
- package/type/unsafe/unsafe.d.ts +11 -0
- package/type/unsafe/unsafe.js +39 -0
- package/type/void/index.d.ts +1 -0
- package/type/void/index.js +44 -0
- package/type/void/void.d.ts +9 -0
- package/type/void/void.js +40 -0
- package/value/cast/cast.d.ts +23 -0
- package/value/{cast.js → cast/cast.js} +62 -83
- package/value/cast/index.d.ts +1 -0
- package/value/cast/index.js +44 -0
- package/value/check/check.d.ts +10 -0
- package/value/{check.js → check/check.js} +50 -45
- package/value/check/index.d.ts +1 -0
- package/value/check/index.js +44 -0
- package/value/clean/clean.d.ts +5 -0
- package/value/clean/clean.js +167 -0
- package/value/clean/index.d.ts +1 -0
- package/value/clean/index.js +44 -0
- package/value/{clone.js → clone/clone.js} +6 -6
- package/value/clone/index.d.ts +1 -0
- package/value/clone/index.js +44 -0
- package/value/convert/convert.d.ts +9 -0
- package/value/{convert.js → convert/convert.js} +93 -116
- package/value/convert/index.d.ts +1 -0
- package/value/convert/index.js +44 -0
- package/value/create/create.d.ts +31 -0
- package/value/{create.js → create/create.js} +69 -62
- package/value/create/index.d.ts +1 -0
- package/value/create/index.js +44 -0
- package/value/default/default.d.ts +5 -0
- package/value/default/default.js +175 -0
- package/value/default/index.d.ts +1 -0
- package/value/default/index.js +44 -0
- package/value/delta/delta.d.ts +41 -0
- package/value/{delta.js → delta/delta.js} +57 -53
- package/value/delta/index.d.ts +1 -0
- package/value/delta/index.js +44 -0
- package/value/{deref.d.ts → deref/deref.d.ts} +4 -2
- package/value/{deref.js → deref/deref.js} +1 -2
- package/value/deref/index.d.ts +1 -0
- package/value/deref/index.js +44 -0
- package/value/{equal.js → equal/equal.js} +14 -14
- package/value/equal/index.d.ts +1 -0
- package/value/equal/index.js +44 -0
- package/value/guard/index.d.ts +1 -0
- package/value/guard/index.js +44 -0
- package/value/{hash.d.ts → hash/hash.d.ts} +0 -13
- package/value/{hash.js → hash/hash.js} +26 -26
- package/value/hash/index.d.ts +1 -0
- package/value/hash/index.js +44 -0
- package/value/index.d.ts +17 -4
- package/value/index.js +91 -10
- package/value/mutate/index.d.ts +1 -0
- package/value/mutate/index.js +44 -0
- package/value/{mutate.d.ts → mutate/mutate.d.ts} +1 -1
- package/value/{mutate.js → mutate/mutate.js} +25 -25
- package/value/pointer/index.d.ts +1 -0
- package/value/pointer/index.js +31 -0
- package/value/pointer/pointer.d.ts +21 -0
- package/value/pointer/pointer.js +151 -0
- package/value/transform/decode.d.ts +19 -0
- package/value/transform/decode.js +211 -0
- package/value/transform/encode.d.ts +20 -0
- package/value/transform/encode.js +219 -0
- package/value/transform/has.d.ts +3 -0
- package/value/transform/has.js +146 -0
- package/value/transform/index.d.ts +3 -0
- package/value/transform/index.js +46 -0
- package/value/value/index.d.ts +1 -0
- package/value/value/index.js +31 -0
- package/value/value/value.d.ts +53 -0
- package/value/value/value.js +125 -0
- package/typebox.d.ts +0 -962
- package/typebox.js +0 -2364
- package/value/cast.d.ts +0 -24
- package/value/check.d.ts +0 -9
- package/value/convert.d.ts +0 -10
- package/value/create.d.ts +0 -30
- package/value/delta.d.ts +0 -41
- package/value/pointer.d.ts +0 -24
- package/value/pointer.js +0 -148
- package/value/transform.d.ts +0 -42
- package/value/transform.js +0 -517
- package/value/value.d.ts +0 -47
- package/value/value.js +0 -117
- /package/value/{clone.d.ts → clone/clone.d.ts} +0 -0
- /package/value/{equal.d.ts → equal/equal.d.ts} +0 -0
- /package/value/{guard.d.ts → guard/guard.d.ts} +0 -0
- /package/value/{guard.js → guard/guard.js} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/type
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
32
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
33
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
34
|
+
}
|
|
35
|
+
Object.defineProperty(o, k2, desc);
|
|
36
|
+
}) : (function(o, m, k, k2) {
|
|
37
|
+
if (k2 === undefined) k2 = k;
|
|
38
|
+
o[k2] = m[k];
|
|
39
|
+
}));
|
|
40
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
41
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
__exportStar(require("./tuple"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TSchema, SchemaOptions } from '../schema/index';
|
|
2
|
+
import type { Static } from '../static/index';
|
|
3
|
+
import { Kind } from '../symbols/index';
|
|
4
|
+
export type TupleResolve<T extends TSchema[], P extends unknown[]> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [Static<L, P>, ...TupleResolve<R, P>] : [];
|
|
5
|
+
export interface TTuple<T extends TSchema[] = TSchema[]> extends TSchema {
|
|
6
|
+
[Kind]: 'Tuple';
|
|
7
|
+
static: TupleResolve<T, this['params']>;
|
|
8
|
+
type: 'array';
|
|
9
|
+
items?: T;
|
|
10
|
+
additionalItems?: false;
|
|
11
|
+
minItems: number;
|
|
12
|
+
maxItems: number;
|
|
13
|
+
}
|
|
14
|
+
/** `[Json]` Creates a Tuple type */
|
|
15
|
+
export declare function Tuple<T extends TSchema[]>(items: [...T], options?: SchemaOptions): TTuple<T>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/type
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.Tuple = void 0;
|
|
31
|
+
const type_1 = require("../clone/type");
|
|
32
|
+
const index_1 = require("../symbols/index");
|
|
33
|
+
/** `[Json]` Creates a Tuple type */
|
|
34
|
+
function Tuple(items, options = {}) {
|
|
35
|
+
// return TupleResolver.Resolve(T)
|
|
36
|
+
const [additionalItems, minItems, maxItems] = [false, items.length, items.length];
|
|
37
|
+
// prettier-ignore
|
|
38
|
+
return (items.length > 0 ?
|
|
39
|
+
{ ...options, [index_1.Kind]: 'Tuple', type: 'array', items: (0, type_1.CloneRest)(items), additionalItems, minItems, maxItems } :
|
|
40
|
+
{ ...options, [index_1.Kind]: 'Tuple', type: 'array', minItems, maxItems });
|
|
41
|
+
}
|
|
42
|
+
exports.Tuple = Tuple;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/type
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.Type = exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = void 0;
|
|
31
|
+
// ------------------------------------------------------------------
|
|
32
|
+
// JsonTypeBuilder
|
|
33
|
+
// ------------------------------------------------------------------
|
|
34
|
+
var json_1 = require("./json");
|
|
35
|
+
Object.defineProperty(exports, "JsonTypeBuilder", { enumerable: true, get: function () { return json_1.JsonTypeBuilder; } });
|
|
36
|
+
// ------------------------------------------------------------------
|
|
37
|
+
// JavaScriptTypeBuilder
|
|
38
|
+
// ------------------------------------------------------------------
|
|
39
|
+
const TypeBuilder = require("./type");
|
|
40
|
+
const javascript_1 = require("./javascript");
|
|
41
|
+
Object.defineProperty(exports, "JavaScriptTypeBuilder", { enumerable: true, get: function () { return javascript_1.JavaScriptTypeBuilder; } });
|
|
42
|
+
/** JavaScript Type Builder with Static Resolution for TypeScript */
|
|
43
|
+
const Type = TypeBuilder;
|
|
44
|
+
exports.Type = Type;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { JsonTypeBuilder } from './json';
|
|
2
|
+
import { type TAsyncIterator } from '../async-iterator/index';
|
|
3
|
+
import { type TAwaited } from '../awaited/index';
|
|
4
|
+
import { type TBigInt, type BigIntOptions } from '../bigint/index';
|
|
5
|
+
import { type TConstructor } from '../constructor/index';
|
|
6
|
+
import { type TConstructorParameters } from '../constructor-parameters/index';
|
|
7
|
+
import { type TDate, type DateOptions } from '../date/index';
|
|
8
|
+
import { type TFunction } from '../function/index';
|
|
9
|
+
import { type TInstanceType } from '../instance-type/index';
|
|
10
|
+
import { type TIterator } from '../iterator/index';
|
|
11
|
+
import { type TParameters } from '../parameters/index';
|
|
12
|
+
import { type TPromise } from '../promise/index';
|
|
13
|
+
import { type TRegExp } from '../regexp/index';
|
|
14
|
+
import { type TReturnType } from '../return-type/index';
|
|
15
|
+
import { type TSchema, type SchemaOptions } from '../schema/index';
|
|
16
|
+
import { type TSymbol } from '../symbol/index';
|
|
17
|
+
import { type TUint8Array, type Uint8ArrayOptions } from '../uint8array/index';
|
|
18
|
+
import { type TUndefined } from '../undefined/index';
|
|
19
|
+
import { type TVoid } from '../void/index';
|
|
20
|
+
/** JavaScript Type Builder with Static Resolution for TypeScript */
|
|
21
|
+
export declare class JavaScriptTypeBuilder extends JsonTypeBuilder {
|
|
22
|
+
/** `[JavaScript]` Creates a AsyncIterator type */
|
|
23
|
+
AsyncIterator<T extends TSchema>(items: T, options?: SchemaOptions): TAsyncIterator<T>;
|
|
24
|
+
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
|
|
25
|
+
Awaited<T extends TSchema>(schema: T, options?: SchemaOptions): TAwaited<T>;
|
|
26
|
+
/** `[JavaScript]` Creates a BigInt type */
|
|
27
|
+
BigInt(options?: BigIntOptions): TBigInt;
|
|
28
|
+
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
|
|
29
|
+
ConstructorParameters<T extends TConstructor<TSchema[], TSchema>>(schema: T, options?: SchemaOptions): TConstructorParameters<T>;
|
|
30
|
+
/** `[JavaScript]` Creates a Constructor type */
|
|
31
|
+
Constructor<T extends TSchema[], U extends TSchema>(parameters: [...T], returns: U, options?: SchemaOptions): TConstructor<T, U>;
|
|
32
|
+
/** `[JavaScript]` Creates a Date type */
|
|
33
|
+
Date(options?: DateOptions): TDate;
|
|
34
|
+
/** `[JavaScript]` Creates a Function type */
|
|
35
|
+
Function<T extends TSchema[], U extends TSchema>(parameters: [...T], returns: U, options?: SchemaOptions): TFunction<T, U>;
|
|
36
|
+
/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */
|
|
37
|
+
InstanceType<T extends TConstructor<any[], any>>(schema: T, options?: SchemaOptions): TInstanceType<T>;
|
|
38
|
+
/** `[JavaScript]` Creates an Iterator type */
|
|
39
|
+
Iterator<T extends TSchema>(items: T, options?: SchemaOptions): TIterator<T>;
|
|
40
|
+
/** `[JavaScript]` Extracts the Parameters from the given Function type */
|
|
41
|
+
Parameters<T extends TFunction<TSchema[], TSchema>>(schema: T, options?: SchemaOptions): TParameters<T>;
|
|
42
|
+
/** `[JavaScript]` Creates a Promise type */
|
|
43
|
+
Promise<T extends TSchema>(item: T, options?: SchemaOptions): TPromise<T>;
|
|
44
|
+
/** `[JavaScript]` Creates a String type from a Regular Expression pattern */
|
|
45
|
+
RegExp(pattern: string, options?: SchemaOptions): TRegExp;
|
|
46
|
+
/** `[JavaScript]` Creates a String type from a Regular Expression */
|
|
47
|
+
RegExp(regex: RegExp, options?: SchemaOptions): TRegExp;
|
|
48
|
+
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
|
|
49
|
+
ReturnType<T extends TFunction<any[], any>>(schema: T, options?: SchemaOptions): TReturnType<T>;
|
|
50
|
+
/** `[JavaScript]` Creates a Symbol type */
|
|
51
|
+
Symbol(options?: SchemaOptions): TSymbol;
|
|
52
|
+
/** `[JavaScript]` Creates a Undefined type */
|
|
53
|
+
Undefined(options?: SchemaOptions): TUndefined;
|
|
54
|
+
/** `[JavaScript]` Creates a Uint8Array type */
|
|
55
|
+
Uint8Array(options?: Uint8ArrayOptions): TUint8Array;
|
|
56
|
+
/** `[JavaScript]` Creates a Void type */
|
|
57
|
+
Void(options?: SchemaOptions): TVoid;
|
|
58
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
@sinclair/typebox/type
|
|
5
|
+
|
|
6
|
+
The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017-2023 Haydn Paterson (sinclair) <haydn.developer@gmail.com>
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in
|
|
18
|
+
all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
26
|
+
THE SOFTWARE.
|
|
27
|
+
|
|
28
|
+
---------------------------------------------------------------------------*/
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.JavaScriptTypeBuilder = void 0;
|
|
31
|
+
const json_1 = require("./json");
|
|
32
|
+
const index_1 = require("../async-iterator/index");
|
|
33
|
+
const index_2 = require("../awaited/index");
|
|
34
|
+
const index_3 = require("../bigint/index");
|
|
35
|
+
const index_4 = require("../constructor/index");
|
|
36
|
+
const index_5 = require("../constructor-parameters/index");
|
|
37
|
+
const index_6 = require("../date/index");
|
|
38
|
+
const index_7 = require("../function/index");
|
|
39
|
+
const index_8 = require("../instance-type/index");
|
|
40
|
+
const index_9 = require("../iterator/index");
|
|
41
|
+
const index_10 = require("../parameters/index");
|
|
42
|
+
const index_11 = require("../promise/index");
|
|
43
|
+
const index_12 = require("../regexp/index");
|
|
44
|
+
const index_13 = require("../return-type/index");
|
|
45
|
+
const index_14 = require("../symbol/index");
|
|
46
|
+
const index_15 = require("../uint8array/index");
|
|
47
|
+
const index_16 = require("../undefined/index");
|
|
48
|
+
const index_17 = require("../void/index");
|
|
49
|
+
/** JavaScript Type Builder with Static Resolution for TypeScript */
|
|
50
|
+
class JavaScriptTypeBuilder extends json_1.JsonTypeBuilder {
|
|
51
|
+
/** `[JavaScript]` Creates a AsyncIterator type */
|
|
52
|
+
AsyncIterator(items, options = {}) {
|
|
53
|
+
return (0, index_1.AsyncIterator)(items, options);
|
|
54
|
+
}
|
|
55
|
+
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
|
|
56
|
+
Awaited(schema, options = {}) {
|
|
57
|
+
return (0, index_2.Awaited)(schema, options);
|
|
58
|
+
}
|
|
59
|
+
/** `[JavaScript]` Creates a BigInt type */
|
|
60
|
+
BigInt(options = {}) {
|
|
61
|
+
return (0, index_3.BigInt)(options);
|
|
62
|
+
}
|
|
63
|
+
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
|
|
64
|
+
ConstructorParameters(schema, options = {}) {
|
|
65
|
+
return (0, index_5.ConstructorParameters)(schema, options);
|
|
66
|
+
}
|
|
67
|
+
/** `[JavaScript]` Creates a Constructor type */
|
|
68
|
+
Constructor(parameters, returns, options) {
|
|
69
|
+
return (0, index_4.Constructor)(parameters, returns, options);
|
|
70
|
+
}
|
|
71
|
+
/** `[JavaScript]` Creates a Date type */
|
|
72
|
+
Date(options = {}) {
|
|
73
|
+
return (0, index_6.Date)(options);
|
|
74
|
+
}
|
|
75
|
+
/** `[JavaScript]` Creates a Function type */
|
|
76
|
+
Function(parameters, returns, options) {
|
|
77
|
+
return (0, index_7.Function)(parameters, returns, options);
|
|
78
|
+
}
|
|
79
|
+
/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */
|
|
80
|
+
InstanceType(schema, options = {}) {
|
|
81
|
+
return (0, index_8.InstanceType)(schema, options);
|
|
82
|
+
}
|
|
83
|
+
/** `[JavaScript]` Creates an Iterator type */
|
|
84
|
+
Iterator(items, options = {}) {
|
|
85
|
+
return (0, index_9.Iterator)(items, options);
|
|
86
|
+
}
|
|
87
|
+
/** `[JavaScript]` Extracts the Parameters from the given Function type */
|
|
88
|
+
Parameters(schema, options = {}) {
|
|
89
|
+
return (0, index_10.Parameters)(schema, options);
|
|
90
|
+
}
|
|
91
|
+
/** `[JavaScript]` Creates a Promise type */
|
|
92
|
+
Promise(item, options = {}) {
|
|
93
|
+
return (0, index_11.Promise)(item, options);
|
|
94
|
+
}
|
|
95
|
+
/** `[JavaScript]` Creates a String type */
|
|
96
|
+
RegExp(unresolved, options = {}) {
|
|
97
|
+
return (0, index_12.RegExp)(unresolved, options);
|
|
98
|
+
}
|
|
99
|
+
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
|
|
100
|
+
ReturnType(schema, options = {}) {
|
|
101
|
+
return (0, index_13.ReturnType)(schema, options);
|
|
102
|
+
}
|
|
103
|
+
/** `[JavaScript]` Creates a Symbol type */
|
|
104
|
+
Symbol(options) {
|
|
105
|
+
return (0, index_14.Symbol)(options);
|
|
106
|
+
}
|
|
107
|
+
/** `[JavaScript]` Creates a Undefined type */
|
|
108
|
+
Undefined(options = {}) {
|
|
109
|
+
return (0, index_16.Undefined)(options);
|
|
110
|
+
}
|
|
111
|
+
/** `[JavaScript]` Creates a Uint8Array type */
|
|
112
|
+
Uint8Array(options = {}) {
|
|
113
|
+
return (0, index_15.Uint8Array)(options);
|
|
114
|
+
}
|
|
115
|
+
/** `[JavaScript]` Creates a Void type */
|
|
116
|
+
Void(options = {}) {
|
|
117
|
+
return (0, index_17.Void)(options);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.JavaScriptTypeBuilder = JavaScriptTypeBuilder;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { type TAny } from '../any/index';
|
|
2
|
+
import { type TArray, type ArrayOptions } from '../array/index';
|
|
3
|
+
import { type TBoolean } from '../boolean/index';
|
|
4
|
+
import { type TComposite } from '../composite/index';
|
|
5
|
+
import { type TConst } from '../const/index';
|
|
6
|
+
import { type TDeref } from '../deref/index';
|
|
7
|
+
import { type TEnum, type TEnumKey, type TEnumValue } from '../enum/index';
|
|
8
|
+
import { type TExclude } from '../exclude/index';
|
|
9
|
+
import { type TExtends } from '../extends/index';
|
|
10
|
+
import { type TExtract } from '../extract/index';
|
|
11
|
+
import { TIndex, type IndexedKeyResolve } from '../indexed/index';
|
|
12
|
+
import { type IntegerOptions, type TInteger } from '../integer/index';
|
|
13
|
+
import { type IntersectOptions, type IntersectResolve } from '../intersect/index';
|
|
14
|
+
import { type TCapitalize, type TUncapitalize, type TLowercase, type TUppercase } from '../intrinsic/index';
|
|
15
|
+
import { type TKeyOf } from '../keyof/index';
|
|
16
|
+
import { type TLiteral, type TLiteralValue } from '../literal/index';
|
|
17
|
+
import { type TNever } from '../never/index';
|
|
18
|
+
import { type TNot } from '../not/index';
|
|
19
|
+
import { type TNull } from '../null/index';
|
|
20
|
+
import { type TNumber, type NumberOptions } from '../number/index';
|
|
21
|
+
import { type TObject, type TProperties, type ObjectOptions } from '../object/index';
|
|
22
|
+
import { type TOmit } from '../omit/index';
|
|
23
|
+
import { type TOptional } from '../optional/index';
|
|
24
|
+
import { type TPartial } from '../partial/index';
|
|
25
|
+
import { type TPick } from '../pick/index';
|
|
26
|
+
import { type TReadonly } from '../readonly/index';
|
|
27
|
+
import { type TReadonlyOptional } from '../readonly-optional/index';
|
|
28
|
+
import { type RecordResolve } from '../record/index';
|
|
29
|
+
import { type TRecursive, type TThis } from '../recursive/index';
|
|
30
|
+
import { type TRef } from '../ref/index';
|
|
31
|
+
import { type TRequired } from '../required/index';
|
|
32
|
+
import { type TRest } from '../rest/index';
|
|
33
|
+
import { type TSchema, type SchemaOptions } from '../schema/index';
|
|
34
|
+
import { type TString, type StringOptions } from '../string/index';
|
|
35
|
+
import { type TTemplateLiteral, type TTemplateLiteralKind, type TemplateLiteralSyntax } from '../template-literal/index';
|
|
36
|
+
import { TransformDecodeBuilder } from '../transform/index';
|
|
37
|
+
import { type TTuple } from '../tuple/index';
|
|
38
|
+
import { type UnionResolve } from '../union/index';
|
|
39
|
+
import { type TUnknown } from '../unknown/index';
|
|
40
|
+
import { type TUnsafe, type UnsafeOptions } from '../unsafe/index';
|
|
41
|
+
/** Json Type Builder with Static Resolution for TypeScript */
|
|
42
|
+
export declare class JsonTypeBuilder {
|
|
43
|
+
/** `[Json]` Omits compositing symbols from this schema */
|
|
44
|
+
Strict<T extends TSchema>(schema: T): T;
|
|
45
|
+
/** `[Json]` Creates a Readonly and Optional property */
|
|
46
|
+
ReadonlyOptional<T extends TSchema>(schema: T): TReadonlyOptional<T>;
|
|
47
|
+
/** `[Json]` Creates a Readonly property */
|
|
48
|
+
Readonly<T extends TSchema>(schema: T): TReadonly<T>;
|
|
49
|
+
/** `[Json]` Creates an Optional property */
|
|
50
|
+
Optional<T extends TSchema>(schema: T): TOptional<T>;
|
|
51
|
+
/** `[Json]` Creates an Any type */
|
|
52
|
+
Any(options?: SchemaOptions): TAny;
|
|
53
|
+
/** `[Json]` Creates an Array type */
|
|
54
|
+
Array<T extends TSchema>(schema: T, options?: ArrayOptions): TArray<T>;
|
|
55
|
+
/** `[Json]` Creates a Boolean type */
|
|
56
|
+
Boolean(options?: SchemaOptions): TBoolean;
|
|
57
|
+
/** `[Json]` Intrinsic function to Capitalize LiteralString types */
|
|
58
|
+
Capitalize<T extends TSchema>(schema: T, options?: SchemaOptions): TCapitalize<T>;
|
|
59
|
+
/** `[Json]` Creates a Composite object type */
|
|
60
|
+
Composite<T extends TObject[]>(objects: [...T], options?: ObjectOptions): TComposite<T>;
|
|
61
|
+
/** `[JavaScript]` Creates a readonly const type from the given value. */
|
|
62
|
+
Const</* const (not supported in 4.0) */ T>(value: T, options?: SchemaOptions): TConst<T>;
|
|
63
|
+
/** `[Json]` Creates a dereferenced type */
|
|
64
|
+
Deref<T extends TSchema>(schema: T, references: TSchema[]): TDeref<T>;
|
|
65
|
+
/** `[Json]` Creates a Enum type */
|
|
66
|
+
Enum<V extends TEnumValue, T extends Record<TEnumKey, V>>(item: T, options?: SchemaOptions): TEnum<T>;
|
|
67
|
+
/** `[Json]` Creates a Conditional type */
|
|
68
|
+
Extends<L extends TSchema, R extends TSchema, T extends TSchema, U extends TSchema>(left: L, right: R, trueType: T, falseType: U, options?: SchemaOptions): TExtends<L, R, T, U>;
|
|
69
|
+
/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
|
|
70
|
+
Exclude<L extends TSchema, R extends TSchema>(unionType: L, excludedMembers: R, options?: SchemaOptions): TExclude<L, R>;
|
|
71
|
+
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
|
|
72
|
+
Extract<L extends TSchema, R extends TSchema>(type: L, union: R, options?: SchemaOptions): TExtract<L, R>;
|
|
73
|
+
/** `[Json]` Returns an Indexed property type for the given keys */
|
|
74
|
+
Index<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedKeyResolve<K>>(T: T, K: K, options?: SchemaOptions): TIndex<T, I>;
|
|
75
|
+
/** `[Json]` Returns an Indexed property type for the given keys */
|
|
76
|
+
Index<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TIndex<T, K>;
|
|
77
|
+
/** `[Json]` Creates an Integer type */
|
|
78
|
+
Integer(options?: IntegerOptions): TInteger;
|
|
79
|
+
/** `[Json]` Creates an Intersect type */
|
|
80
|
+
Intersect<T extends TSchema[]>(T: [...T], options?: IntersectOptions): IntersectResolve<T>;
|
|
81
|
+
/** `[Json]` Creates a KeyOf type */
|
|
82
|
+
KeyOf<T extends TSchema>(schema: T, options?: SchemaOptions): TKeyOf<T>;
|
|
83
|
+
/** `[Json]` Creates a Literal type */
|
|
84
|
+
Literal<T extends TLiteralValue>(value: T, options?: SchemaOptions): TLiteral<T>;
|
|
85
|
+
/** `[Json]` Intrinsic function to Lowercase LiteralString types */
|
|
86
|
+
Lowercase<T extends TSchema>(schema: T, options?: SchemaOptions): TLowercase<T>;
|
|
87
|
+
/** `[Json]` Creates a Never type */
|
|
88
|
+
Never(options?: SchemaOptions): TNever;
|
|
89
|
+
/** `[Json]` Creates a Not type */
|
|
90
|
+
Not<T extends TSchema>(schema: T, options?: SchemaOptions): TNot<T>;
|
|
91
|
+
/** `[Json]` Creates a Null type */
|
|
92
|
+
Null(options?: SchemaOptions): TNull;
|
|
93
|
+
/** `[Json]` Creates a Number type */
|
|
94
|
+
Number(options?: NumberOptions): TNumber;
|
|
95
|
+
/** `[Json]` Creates an Object type */
|
|
96
|
+
Object<T extends TProperties>(properties: T, options?: ObjectOptions): TObject<T>;
|
|
97
|
+
/** `[Json]` Constructs a type whose keys are omitted from the given type */
|
|
98
|
+
Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedKeyResolve<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
|
|
99
|
+
/** `[Json]` Constructs a type whose keys are omitted from the given type */
|
|
100
|
+
Omit<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TOmit<T, K>;
|
|
101
|
+
/** `[Json]` Constructs a type where all properties are optional */
|
|
102
|
+
Partial<T extends TSchema>(schema: T, options?: ObjectOptions): TPartial<T>;
|
|
103
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
104
|
+
Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedKeyResolve<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
|
|
105
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
106
|
+
Pick<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TPick<T, K>;
|
|
107
|
+
/** `[Json]` Creates a Record type */
|
|
108
|
+
Record<K extends TSchema, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordResolve<K, T>;
|
|
109
|
+
/** `[Json]` Creates a Recursive type */
|
|
110
|
+
Recursive<T extends TSchema>(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive<T>;
|
|
111
|
+
/** `[Json]` Creates a Ref type. The referenced type must contain a $id */
|
|
112
|
+
Ref<T extends TSchema>(schema: T, options?: SchemaOptions): TRef<T>;
|
|
113
|
+
/** `[Json]` Creates a Ref type. */
|
|
114
|
+
Ref<T extends TSchema>($ref: string, options?: SchemaOptions): TRef<T>;
|
|
115
|
+
/** `[Json]` Constructs a type where all properties are required */
|
|
116
|
+
Required<T extends TSchema>(schema: T, options?: SchemaOptions): TRequired<T>;
|
|
117
|
+
/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
|
|
118
|
+
Rest<T extends TSchema>(schema: T): TRest<T>;
|
|
119
|
+
/** `[Json]` Creates a String type */
|
|
120
|
+
String(options?: StringOptions): TString;
|
|
121
|
+
/** `[Json]` Creates a TemplateLiteral type from template dsl string */
|
|
122
|
+
TemplateLiteral<T extends string>(syntax: T, options?: SchemaOptions): TemplateLiteralSyntax<T>;
|
|
123
|
+
/** `[Json]` Creates a TemplateLiteral type */
|
|
124
|
+
TemplateLiteral<T extends TTemplateLiteralKind[]>(kinds: [...T], options?: SchemaOptions): TTemplateLiteral<T>;
|
|
125
|
+
/** `[Json]` Creates a Transform type */
|
|
126
|
+
Transform<I extends TSchema>(schema: I): TransformDecodeBuilder<I>;
|
|
127
|
+
/** `[Json]` Creates a Tuple type */
|
|
128
|
+
Tuple<T extends TSchema[]>(items: [...T], options?: SchemaOptions): TTuple<T>;
|
|
129
|
+
/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
|
|
130
|
+
Uncapitalize<T extends TSchema>(schema: T, options?: SchemaOptions): TUncapitalize<T>;
|
|
131
|
+
/** `[Json]` Creates a Union type */
|
|
132
|
+
Union<T extends TSchema[]>(schemas: [...T], options?: SchemaOptions): UnionResolve<T>;
|
|
133
|
+
/** `[Json]` Creates an Unknown type */
|
|
134
|
+
Unknown(options?: SchemaOptions): TUnknown;
|
|
135
|
+
/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
|
|
136
|
+
Unsafe<T>(options?: UnsafeOptions): TUnsafe<T>;
|
|
137
|
+
/** `[Json]` Intrinsic function to Uppercase LiteralString types */
|
|
138
|
+
Uppercase<T extends TSchema>(schema: T, options?: SchemaOptions): TUppercase<T>;
|
|
139
|
+
}
|