@sinclair/typebox 0.32.0-dev-15 → 0.32.0-dev-17
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/build/import/compiler/compiler.d.mts +9 -0
- package/build/import/compiler/compiler.mjs +87 -6
- package/build/import/compiler/index.mjs +27 -0
- package/build/import/errors/errors.d.mts +3 -0
- package/build/import/errors/errors.mjs +55 -3
- package/build/import/errors/function.d.mts +3 -0
- package/build/import/errors/function.mjs +31 -0
- package/build/import/errors/index.mjs +27 -0
- package/build/import/index.d.mts +2 -2
- package/build/import/index.mjs +38 -2
- package/build/import/system/index.mjs +27 -0
- package/build/import/system/policy.d.mts +10 -0
- package/build/import/system/policy.mjs +40 -0
- package/build/import/system/system.d.mts +3 -0
- package/build/import/system/system.mjs +36 -0
- package/build/import/type/any/any.d.mts +1 -0
- package/build/import/type/any/any.mjs +28 -0
- package/build/import/type/any/index.mjs +27 -0
- package/build/import/type/array/array.d.mts +8 -1
- package/build/import/type/array/array.mjs +28 -0
- package/build/import/type/array/index.mjs +27 -0
- package/build/import/type/async-iterator/async-iterator.d.mts +1 -0
- package/build/import/type/async-iterator/async-iterator.mjs +28 -0
- package/build/import/type/async-iterator/index.mjs +27 -0
- package/build/import/type/awaited/awaited.d.mts +1 -0
- package/build/import/type/awaited/awaited.mjs +37 -0
- package/build/import/type/awaited/index.mjs +27 -0
- package/build/import/type/bigint/bigint.d.mts +1 -0
- package/build/import/type/bigint/bigint.mjs +28 -0
- package/build/import/type/bigint/index.mjs +27 -0
- package/build/import/type/boolean/boolean.d.mts +1 -0
- package/build/import/type/boolean/boolean.mjs +28 -0
- package/build/import/type/boolean/index.mjs +27 -0
- package/build/import/type/clone/index.mjs +27 -0
- package/build/import/type/clone/type.d.mts +2 -0
- package/build/import/type/clone/type.mjs +29 -0
- package/build/import/type/clone/value.d.mts +1 -0
- package/build/import/type/clone/value.mjs +29 -0
- package/build/import/type/composite/composite.d.mts +1 -0
- package/build/import/type/composite/composite.mjs +28 -0
- package/build/import/type/composite/index.mjs +27 -0
- package/build/import/type/const/const.d.mts +2 -1
- package/build/import/type/const/const.mjs +32 -1
- package/build/import/type/const/index.mjs +27 -0
- package/build/import/type/constructor/constructor.d.mts +5 -4
- package/build/import/type/constructor/constructor.mjs +28 -0
- package/build/import/type/constructor/index.mjs +27 -0
- package/build/import/type/constructor-parameters/constructor-parameters.d.mts +1 -0
- package/build/import/type/constructor-parameters/constructor-parameters.mjs +28 -0
- package/build/import/type/constructor-parameters/index.mjs +27 -0
- package/build/import/type/date/date.d.mts +6 -0
- package/build/import/type/date/date.mjs +28 -0
- package/build/import/type/date/index.mjs +27 -0
- package/build/import/type/deref/deref.d.mts +1 -0
- package/build/import/type/deref/deref.mjs +45 -0
- package/build/import/type/deref/index.mjs +27 -0
- package/build/import/type/discard/discard.mjs +27 -0
- package/build/import/type/discard/index.mjs +27 -0
- package/build/import/type/enum/enum.d.mts +1 -0
- package/build/import/type/enum/enum.mjs +28 -0
- package/build/import/type/enum/index.mjs +27 -0
- package/build/import/type/exclude/exclude-from-mapped-result.mjs +30 -0
- package/build/import/type/exclude/exclude.d.mts +5 -3
- package/build/import/type/exclude/exclude.mjs +30 -0
- package/build/import/type/exclude/index.mjs +27 -0
- package/build/import/type/extends/extends-check.mjs +200 -1
- package/build/import/type/extends/extends-from-mapped-key.mjs +31 -0
- package/build/import/type/extends/extends-from-mapped-result.mjs +30 -0
- package/build/import/type/extends/extends-undefined.d.mts +1 -0
- package/build/import/type/extends/extends-undefined.mjs +30 -0
- package/build/import/type/extends/extends.d.mts +3 -0
- package/build/import/type/extends/extends.mjs +35 -1
- package/build/import/type/extends/index.mjs +27 -0
- package/build/import/type/extract/extract-from-mapped-result.mjs +30 -0
- package/build/import/type/extract/extract.d.mts +5 -3
- package/build/import/type/extract/extract.mjs +30 -0
- package/build/import/type/extract/index.mjs +27 -0
- package/build/import/type/function/function.d.mts +5 -4
- package/build/import/type/function/function.mjs +28 -0
- package/build/import/type/function/index.mjs +27 -0
- package/build/import/type/guard/index.mjs +27 -0
- package/build/import/type/guard/type.d.mts +46 -0
- package/build/import/type/guard/type.mjs +111 -1
- package/build/import/type/guard/value.d.mts +14 -0
- package/build/import/type/guard/value.mjs +41 -0
- package/build/import/type/helpers/helpers.d.mts +1 -0
- package/build/import/type/helpers/helpers.mjs +28 -0
- package/build/import/type/helpers/index.mjs +27 -0
- package/build/import/type/index.mjs +27 -0
- package/build/import/type/indexed/index.mjs +27 -0
- package/build/import/type/indexed/indexed-from-mapped-key.mjs +35 -1
- package/build/import/type/indexed/indexed-property-keys.d.mts +1 -0
- package/build/import/type/indexed/indexed-property-keys.mjs +36 -0
- package/build/import/type/indexed/indexed-result.d.mts +6 -6
- package/build/import/type/indexed/indexed-result.mjs +49 -7
- package/build/import/type/indexed/indexed.d.mts +3 -0
- package/build/import/type/indexed/indexed.mjs +34 -1
- package/build/import/type/instance-type/index.mjs +27 -0
- package/build/import/type/instance-type/instance-type.d.mts +1 -0
- package/build/import/type/instance-type/instance-type.mjs +28 -0
- package/build/import/type/integer/index.mjs +27 -0
- package/build/import/type/integer/integer.d.mts +1 -0
- package/build/import/type/integer/integer.mjs +28 -0
- package/build/import/type/intersect/index.d.mts +2 -0
- package/build/import/type/intersect/index.mjs +29 -0
- package/build/import/type/intersect/intersect-create.d.mts +3 -0
- package/build/import/type/intersect/intersect-create.mjs +47 -0
- package/build/import/type/intersect/intersect-evaluated.d.mts +17 -0
- package/build/import/type/intersect/intersect-evaluated.mjs +71 -0
- package/build/import/type/intersect/intersect-type.d.mts +15 -0
- package/build/import/type/intersect/intersect-type.mjs +28 -0
- package/build/import/type/intersect/intersect.d.mts +5 -20
- package/build/import/type/intersect/intersect.mjs +37 -17
- package/build/import/type/intrinsic/capitalize.d.mts +1 -0
- package/build/import/type/intrinsic/capitalize.mjs +28 -0
- package/build/import/type/intrinsic/index.mjs +27 -0
- package/build/import/type/intrinsic/intrinsic-from-mapped-key.mjs +31 -0
- package/build/import/type/intrinsic/intrinsic.d.mts +2 -0
- package/build/import/type/intrinsic/intrinsic.mjs +43 -1
- package/build/import/type/intrinsic/lowercase.d.mts +1 -0
- package/build/import/type/intrinsic/lowercase.mjs +28 -0
- package/build/import/type/intrinsic/uncapitalize.d.mts +1 -0
- package/build/import/type/intrinsic/uncapitalize.mjs +28 -0
- package/build/import/type/intrinsic/uppercase.d.mts +1 -0
- package/build/import/type/intrinsic/uppercase.mjs +28 -0
- package/build/import/type/iterator/index.mjs +27 -0
- package/build/import/type/iterator/iterator.d.mts +1 -0
- package/build/import/type/iterator/iterator.mjs +28 -0
- package/build/import/type/keyof/index.mjs +27 -0
- package/build/import/type/keyof/keyof-from-mapped-result.mjs +30 -0
- package/build/import/type/keyof/keyof-property-keys.d.mts +2 -0
- package/build/import/type/keyof/keyof-property-keys.mjs +47 -0
- package/build/import/type/keyof/keyof.d.mts +4 -2
- package/build/import/type/keyof/keyof.mjs +35 -2
- package/build/import/type/literal/index.mjs +27 -0
- package/build/import/type/literal/literal.d.mts +1 -0
- package/build/import/type/literal/literal.mjs +28 -0
- package/build/import/type/mapped/index.mjs +27 -0
- package/build/import/type/mapped/mapped-key.mjs +28 -0
- package/build/import/type/mapped/mapped-result.mjs +28 -0
- package/build/import/type/mapped/mapped.d.mts +2 -0
- package/build/import/type/mapped/mapped.mjs +47 -3
- package/build/import/type/modifiers/index.mjs +27 -0
- package/build/import/type/modifiers/modifiers.mjs +37 -0
- package/build/import/type/never/index.mjs +27 -0
- package/build/import/type/never/never.d.mts +1 -0
- package/build/import/type/never/never.mjs +28 -0
- package/build/import/type/not/index.mjs +27 -0
- package/build/import/type/not/not.d.mts +1 -0
- package/build/import/type/not/not.mjs +28 -0
- package/build/import/type/null/index.mjs +27 -0
- package/build/import/type/null/null.d.mts +1 -0
- package/build/import/type/null/null.mjs +28 -0
- package/build/import/type/number/index.mjs +27 -0
- package/build/import/type/number/number.d.mts +1 -0
- package/build/import/type/number/number.mjs +28 -0
- package/build/import/type/object/index.mjs +27 -0
- package/build/import/type/object/object.d.mts +10 -5
- package/build/import/type/object/object.mjs +33 -0
- package/build/import/type/omit/index.mjs +27 -0
- package/build/import/type/omit/omit-from-mapped-key.mjs +31 -0
- package/build/import/type/omit/omit.d.mts +3 -0
- package/build/import/type/omit/omit.mjs +39 -0
- package/build/import/type/operators/index.mjs +27 -0
- package/build/import/type/operators/operators.d.mts +8 -0
- package/build/import/type/operators/operators.mjs +42 -0
- package/build/import/type/optional/index.mjs +27 -0
- package/build/import/type/optional/optional.d.mts +1 -0
- package/build/import/type/optional/optional.mjs +28 -0
- package/build/import/type/parameters/index.mjs +27 -0
- package/build/import/type/parameters/parameters.d.mts +1 -0
- package/build/import/type/parameters/parameters.mjs +28 -0
- package/build/import/type/partial/index.mjs +27 -0
- package/build/import/type/partial/partial-from-mapped-result.mjs +30 -0
- package/build/import/type/partial/partial.d.mts +2 -0
- package/build/import/type/partial/partial.mjs +36 -0
- package/build/import/type/patterns/index.mjs +27 -0
- package/build/import/type/patterns/patterns.mjs +27 -0
- package/build/import/type/pick/index.mjs +27 -0
- package/build/import/type/pick/pick-from-mapped-key.mjs +31 -0
- package/build/import/type/pick/pick.d.mts +3 -0
- package/build/import/type/pick/pick.mjs +34 -0
- package/build/import/type/promise/index.mjs +27 -0
- package/build/import/type/promise/promise.d.mts +1 -0
- package/build/import/type/promise/promise.mjs +28 -0
- package/build/import/type/readonly/index.mjs +27 -0
- package/build/import/type/readonly/readonly.d.mts +1 -0
- package/build/import/type/readonly/readonly.mjs +28 -0
- package/build/import/type/readonly-optional/index.mjs +27 -0
- package/build/import/type/readonly-optional/readonly-optional.d.mts +1 -0
- package/build/import/type/readonly-optional/readonly-optional.mjs +28 -0
- package/build/import/type/record/index.mjs +27 -0
- package/build/import/type/record/record.d.mts +1 -1
- package/build/import/type/record/record.mjs +49 -1
- package/build/import/type/recursive/index.mjs +27 -0
- package/build/import/type/recursive/recursive.d.mts +4 -2
- package/build/import/type/recursive/recursive.mjs +31 -5
- package/build/import/type/ref/index.mjs +27 -0
- package/build/import/type/ref/ref.d.mts +2 -0
- package/build/import/type/ref/ref.mjs +28 -0
- package/build/import/type/regexp/index.mjs +27 -0
- package/build/import/type/regexp/regexp.d.mts +2 -0
- package/build/import/type/regexp/regexp.mjs +28 -0
- package/build/import/type/registry/format.d.mts +6 -0
- package/build/import/type/registry/format.mjs +34 -0
- package/build/import/type/registry/index.mjs +27 -0
- package/build/import/type/registry/type.d.mts +6 -0
- package/build/import/type/registry/type.mjs +34 -0
- package/build/import/type/required/index.mjs +27 -0
- package/build/import/type/required/required-from-mapped-result.mjs +30 -0
- package/build/import/type/required/required.d.mts +2 -0
- package/build/import/type/required/required.mjs +36 -0
- package/build/import/type/rest/index.mjs +27 -0
- package/build/import/type/rest/rest.d.mts +1 -0
- package/build/import/type/rest/rest.mjs +32 -0
- package/build/import/type/return-type/index.mjs +27 -0
- package/build/import/type/return-type/return-type.d.mts +1 -0
- package/build/import/type/return-type/return-type.mjs +28 -0
- package/build/import/type/schema/anyschema.mjs +27 -0
- package/build/import/type/schema/index.mjs +27 -0
- package/build/import/type/schema/schema.d.mts +7 -0
- package/build/import/type/schema/schema.mjs +27 -0
- package/build/import/type/static/index.mjs +27 -0
- package/build/import/type/static/static.d.mts +3 -0
- package/build/import/type/static/static.mjs +27 -0
- package/build/import/type/strict/index.mjs +27 -0
- package/build/import/type/strict/strict.d.mts +1 -0
- package/build/import/type/strict/strict.mjs +28 -0
- package/build/import/type/string/index.mjs +27 -0
- package/build/import/type/string/string.d.mts +7 -0
- package/build/import/type/string/string.mjs +28 -0
- package/build/import/type/symbol/index.mjs +27 -0
- package/build/import/type/symbol/symbol.d.mts +1 -0
- package/build/import/type/symbol/symbol.mjs +28 -0
- package/build/import/type/symbols/index.mjs +27 -0
- package/build/import/type/symbols/symbols.d.mts +5 -0
- package/build/import/type/symbols/symbols.mjs +32 -0
- package/build/import/type/template-literal/finite.mjs +37 -0
- package/build/import/type/template-literal/generate.mjs +37 -0
- package/build/import/type/template-literal/index.mjs +27 -0
- package/build/import/type/template-literal/parser.d.mts +2 -0
- package/build/import/type/template-literal/parser.mjs +44 -0
- package/build/import/type/template-literal/pattern.mjs +38 -0
- package/build/import/type/template-literal/syntax.d.mts +5 -4
- package/build/import/type/template-literal/syntax.mjs +35 -0
- package/build/import/type/template-literal/template-literal.d.mts +6 -4
- package/build/import/type/template-literal/template-literal.mjs +29 -0
- package/build/import/type/template-literal/union.d.mts +1 -0
- package/build/import/type/template-literal/union.mjs +31 -0
- package/build/import/type/transform/index.mjs +27 -0
- package/build/import/type/transform/transform.d.mts +4 -2
- package/build/import/type/transform/transform.mjs +37 -1
- package/build/import/type/tuple/index.mjs +27 -0
- package/build/import/type/tuple/tuple.d.mts +4 -3
- package/build/import/type/tuple/tuple.mjs +30 -0
- package/build/import/type/type/index.d.mts +1 -0
- package/build/import/type/type/index.mjs +34 -0
- package/build/import/type/type/javascript.d.mts +19 -0
- package/build/import/type/type/javascript.mjs +45 -0
- package/build/import/type/type/json.d.mts +66 -5
- package/build/import/type/type/json.mjs +82 -1
- package/build/import/type/type/type.mjs +30 -0
- package/build/import/type/uint8array/index.mjs +27 -0
- package/build/import/type/uint8array/uint8array.d.mts +1 -0
- package/build/import/type/uint8array/uint8array.mjs +28 -0
- package/build/import/type/undefined/index.mjs +27 -0
- package/build/import/type/undefined/undefined.d.mts +1 -0
- package/build/import/type/undefined/undefined.mjs +28 -0
- package/build/import/type/union/index.d.mts +2 -0
- package/build/import/type/union/index.mjs +29 -0
- package/build/import/type/union/union-create.d.mts +3 -0
- package/build/import/type/union/union-create.mjs +32 -0
- package/build/import/type/union/union-evaluated.d.mts +17 -0
- package/build/import/type/union/union-evaluated.mjs +68 -0
- package/build/import/type/union/union-type.d.mts +12 -0
- package/build/import/type/union/union-type.mjs +28 -0
- package/build/import/type/union/union.d.mts +4 -13
- package/build/import/type/union/union.mjs +32 -10
- package/build/import/type/unknown/index.mjs +27 -0
- package/build/import/type/unknown/unknown.d.mts +1 -0
- package/build/import/type/unknown/unknown.mjs +28 -0
- package/build/import/type/unsafe/index.mjs +27 -0
- package/build/import/type/unsafe/unsafe.d.mts +1 -0
- package/build/import/type/unsafe/unsafe.mjs +28 -0
- package/build/import/type/void/index.mjs +27 -0
- package/build/import/type/void/void.d.mts +1 -0
- package/build/import/type/void/void.mjs +28 -0
- package/build/import/value/cast/cast.d.mts +2 -0
- package/build/import/value/cast/cast.mjs +55 -0
- package/build/import/value/cast/index.mjs +27 -0
- package/build/import/value/check/check.d.mts +2 -0
- package/build/import/value/check/check.mjs +46 -1
- package/build/import/value/check/index.mjs +27 -0
- package/build/import/value/clean/clean.d.mts +2 -0
- package/build/import/value/clean/clean.mjs +39 -1
- package/build/import/value/clean/index.mjs +27 -0
- package/build/import/value/clone/clone.d.mts +1 -0
- package/build/import/value/clone/clone.mjs +34 -0
- package/build/import/value/clone/index.mjs +27 -0
- package/build/import/value/convert/convert.d.mts +2 -0
- package/build/import/value/convert/convert.mjs +57 -1
- package/build/import/value/convert/index.mjs +27 -0
- package/build/import/value/create/create.d.mts +2 -0
- package/build/import/value/create/create.mjs +44 -0
- package/build/import/value/create/index.mjs +27 -0
- package/build/import/value/default/default.d.mts +2 -0
- package/build/import/value/default/default.mjs +46 -0
- package/build/import/value/default/index.mjs +27 -0
- package/build/import/value/delta/delta.d.mts +1 -1
- package/build/import/value/delta/delta.mjs +42 -0
- package/build/import/value/delta/index.mjs +27 -0
- package/build/import/value/deref/deref.d.mts +1 -0
- package/build/import/value/deref/deref.mjs +28 -0
- package/build/import/value/deref/index.mjs +27 -0
- package/build/import/value/equal/equal.d.mts +1 -0
- package/build/import/value/equal/equal.mjs +34 -0
- package/build/import/value/equal/index.mjs +27 -0
- package/build/import/value/guard/guard.d.mts +20 -0
- package/build/import/value/guard/guard.mjs +57 -0
- package/build/import/value/guard/index.mjs +27 -0
- package/build/import/value/hash/hash.d.mts +1 -0
- package/build/import/value/hash/hash.mjs +46 -0
- package/build/import/value/hash/index.mjs +27 -0
- package/build/import/value/index.mjs +39 -0
- package/build/import/value/mutate/index.mjs +27 -0
- package/build/import/value/mutate/mutate.d.mts +1 -0
- package/build/import/value/mutate/mutate.mjs +38 -0
- package/build/import/value/pointer/index.mjs +27 -0
- package/build/import/value/pointer/pointer.d.mts +5 -0
- package/build/import/value/pointer/pointer.mjs +45 -0
- package/build/import/value/transform/decode.d.mts +5 -0
- package/build/import/value/transform/decode.mjs +50 -0
- package/build/import/value/transform/encode.d.mts +6 -0
- package/build/import/value/transform/encode.mjs +52 -0
- package/build/import/value/transform/has.d.mts +1 -0
- package/build/import/value/transform/has.mjs +43 -0
- package/build/import/value/transform/index.mjs +27 -0
- package/build/import/value/value/index.mjs +27 -0
- package/build/import/value/value/value.d.mts +24 -0
- package/build/import/value/value/value.mjs +42 -0
- package/build/require/compiler/compiler.d.ts +9 -0
- package/build/require/compiler/compiler.js +87 -6
- package/build/require/compiler/index.js +27 -0
- package/build/require/errors/errors.d.ts +3 -0
- package/build/require/errors/errors.js +55 -3
- package/build/require/errors/function.d.ts +3 -0
- package/build/require/errors/function.js +31 -0
- package/build/require/errors/index.js +27 -0
- package/build/require/index.d.ts +2 -2
- package/build/require/index.js +41 -2
- package/build/require/system/index.js +27 -0
- package/build/require/system/policy.d.ts +10 -0
- package/build/require/system/policy.js +40 -0
- package/build/require/system/system.d.ts +3 -0
- package/build/require/system/system.js +36 -0
- package/build/require/type/any/any.d.ts +1 -0
- package/build/require/type/any/any.js +28 -0
- package/build/require/type/any/index.js +27 -0
- package/build/require/type/array/array.d.ts +8 -1
- package/build/require/type/array/array.js +28 -0
- package/build/require/type/array/index.js +27 -0
- package/build/require/type/async-iterator/async-iterator.d.ts +1 -0
- package/build/require/type/async-iterator/async-iterator.js +28 -0
- package/build/require/type/async-iterator/index.js +27 -0
- package/build/require/type/awaited/awaited.d.ts +1 -0
- package/build/require/type/awaited/awaited.js +37 -0
- package/build/require/type/awaited/index.js +27 -0
- package/build/require/type/bigint/bigint.d.ts +1 -0
- package/build/require/type/bigint/bigint.js +28 -0
- package/build/require/type/bigint/index.js +27 -0
- package/build/require/type/boolean/boolean.d.ts +1 -0
- package/build/require/type/boolean/boolean.js +28 -0
- package/build/require/type/boolean/index.js +27 -0
- package/build/require/type/clone/index.js +27 -0
- package/build/require/type/clone/type.d.ts +2 -0
- package/build/require/type/clone/type.js +29 -0
- package/build/require/type/clone/value.d.ts +1 -0
- package/build/require/type/clone/value.js +29 -0
- package/build/require/type/composite/composite.d.ts +1 -0
- package/build/require/type/composite/composite.js +28 -0
- package/build/require/type/composite/index.js +27 -0
- package/build/require/type/const/const.d.ts +2 -1
- package/build/require/type/const/const.js +32 -1
- package/build/require/type/const/index.js +27 -0
- package/build/require/type/constructor/constructor.d.ts +5 -4
- package/build/require/type/constructor/constructor.js +28 -0
- package/build/require/type/constructor/index.js +27 -0
- package/build/require/type/constructor-parameters/constructor-parameters.d.ts +1 -0
- package/build/require/type/constructor-parameters/constructor-parameters.js +28 -0
- package/build/require/type/constructor-parameters/index.js +27 -0
- package/build/require/type/date/date.d.ts +6 -0
- package/build/require/type/date/date.js +28 -0
- package/build/require/type/date/index.js +27 -0
- package/build/require/type/deref/deref.d.ts +1 -0
- package/build/require/type/deref/deref.js +45 -0
- package/build/require/type/deref/index.js +27 -0
- package/build/require/type/discard/discard.js +27 -0
- package/build/require/type/discard/index.js +27 -0
- package/build/require/type/enum/enum.d.ts +1 -0
- package/build/require/type/enum/enum.js +28 -0
- package/build/require/type/enum/index.js +27 -0
- package/build/require/type/exclude/exclude-from-mapped-result.js +30 -0
- package/build/require/type/exclude/exclude.d.ts +5 -3
- package/build/require/type/exclude/exclude.js +30 -0
- package/build/require/type/exclude/index.js +27 -0
- package/build/require/type/extends/extends-check.js +200 -1
- package/build/require/type/extends/extends-from-mapped-key.js +31 -0
- package/build/require/type/extends/extends-from-mapped-result.js +30 -0
- package/build/require/type/extends/extends-undefined.d.ts +1 -0
- package/build/require/type/extends/extends-undefined.js +30 -0
- package/build/require/type/extends/extends.d.ts +3 -0
- package/build/require/type/extends/extends.js +39 -5
- package/build/require/type/extends/index.js +27 -0
- package/build/require/type/extract/extract-from-mapped-result.js +30 -0
- package/build/require/type/extract/extract.d.ts +5 -3
- package/build/require/type/extract/extract.js +30 -0
- package/build/require/type/extract/index.js +27 -0
- package/build/require/type/function/function.d.ts +5 -4
- package/build/require/type/function/function.js +28 -0
- package/build/require/type/function/index.js +27 -0
- package/build/require/type/guard/index.js +27 -0
- package/build/require/type/guard/type.d.ts +46 -0
- package/build/require/type/guard/type.js +111 -1
- package/build/require/type/guard/value.d.ts +14 -0
- package/build/require/type/guard/value.js +41 -0
- package/build/require/type/helpers/helpers.d.ts +1 -0
- package/build/require/type/helpers/helpers.js +28 -0
- package/build/require/type/helpers/index.js +27 -0
- package/build/require/type/index.js +27 -0
- package/build/require/type/indexed/index.js +27 -0
- package/build/require/type/indexed/indexed-from-mapped-key.js +35 -1
- package/build/require/type/indexed/indexed-property-keys.d.ts +1 -0
- package/build/require/type/indexed/indexed-property-keys.js +36 -0
- package/build/require/type/indexed/indexed-result.d.ts +6 -6
- package/build/require/type/indexed/indexed-result.js +46 -4
- package/build/require/type/indexed/indexed.d.ts +3 -0
- package/build/require/type/indexed/indexed.js +37 -4
- package/build/require/type/instance-type/index.js +27 -0
- package/build/require/type/instance-type/instance-type.d.ts +1 -0
- package/build/require/type/instance-type/instance-type.js +28 -0
- package/build/require/type/integer/index.js +27 -0
- package/build/require/type/integer/integer.d.ts +1 -0
- package/build/require/type/integer/integer.js +28 -0
- package/build/require/type/intersect/index.d.ts +2 -0
- package/build/require/type/intersect/index.js +29 -0
- package/build/require/type/intersect/intersect-create.d.ts +3 -0
- package/build/require/type/intersect/intersect-create.js +51 -0
- package/build/require/type/intersect/intersect-evaluated.d.ts +17 -0
- package/build/require/type/intersect/intersect-evaluated.js +75 -0
- package/build/require/type/intersect/intersect-type.d.ts +15 -0
- package/build/require/type/intersect/intersect-type.js +30 -0
- package/build/require/type/intersect/intersect.d.ts +5 -20
- package/build/require/type/intersect/intersect.js +37 -18
- package/build/require/type/intrinsic/capitalize.d.ts +1 -0
- package/build/require/type/intrinsic/capitalize.js +28 -0
- package/build/require/type/intrinsic/index.js +27 -0
- package/build/require/type/intrinsic/intrinsic-from-mapped-key.js +31 -0
- package/build/require/type/intrinsic/intrinsic.d.ts +2 -0
- package/build/require/type/intrinsic/intrinsic.js +43 -1
- package/build/require/type/intrinsic/lowercase.d.ts +1 -0
- package/build/require/type/intrinsic/lowercase.js +28 -0
- package/build/require/type/intrinsic/uncapitalize.d.ts +1 -0
- package/build/require/type/intrinsic/uncapitalize.js +28 -0
- package/build/require/type/intrinsic/uppercase.d.ts +1 -0
- package/build/require/type/intrinsic/uppercase.js +28 -0
- package/build/require/type/iterator/index.js +27 -0
- package/build/require/type/iterator/iterator.d.ts +1 -0
- package/build/require/type/iterator/iterator.js +28 -0
- package/build/require/type/keyof/index.js +27 -0
- package/build/require/type/keyof/keyof-from-mapped-result.js +30 -0
- package/build/require/type/keyof/keyof-property-keys.d.ts +2 -0
- package/build/require/type/keyof/keyof-property-keys.js +47 -0
- package/build/require/type/keyof/keyof.d.ts +4 -2
- package/build/require/type/keyof/keyof.js +34 -1
- package/build/require/type/literal/index.js +27 -0
- package/build/require/type/literal/literal.d.ts +1 -0
- package/build/require/type/literal/literal.js +28 -0
- package/build/require/type/mapped/index.js +27 -0
- package/build/require/type/mapped/mapped-key.js +28 -0
- package/build/require/type/mapped/mapped-result.js +28 -0
- package/build/require/type/mapped/mapped.d.ts +2 -0
- package/build/require/type/mapped/mapped.js +63 -19
- package/build/require/type/modifiers/index.js +27 -0
- package/build/require/type/modifiers/modifiers.js +37 -0
- package/build/require/type/never/index.js +27 -0
- package/build/require/type/never/never.d.ts +1 -0
- package/build/require/type/never/never.js +28 -0
- package/build/require/type/not/index.js +27 -0
- package/build/require/type/not/not.d.ts +1 -0
- package/build/require/type/not/not.js +28 -0
- package/build/require/type/null/index.js +27 -0
- package/build/require/type/null/null.d.ts +1 -0
- package/build/require/type/null/null.js +28 -0
- package/build/require/type/number/index.js +27 -0
- package/build/require/type/number/number.d.ts +1 -0
- package/build/require/type/number/number.js +28 -0
- package/build/require/type/object/index.js +27 -0
- package/build/require/type/object/object.d.ts +10 -5
- package/build/require/type/object/object.js +33 -0
- package/build/require/type/omit/index.js +27 -0
- package/build/require/type/omit/omit-from-mapped-key.js +31 -0
- package/build/require/type/omit/omit.d.ts +3 -0
- package/build/require/type/omit/omit.js +39 -0
- package/build/require/type/operators/index.js +27 -0
- package/build/require/type/operators/operators.d.ts +8 -0
- package/build/require/type/operators/operators.js +42 -0
- package/build/require/type/optional/index.js +27 -0
- package/build/require/type/optional/optional.d.ts +1 -0
- package/build/require/type/optional/optional.js +28 -0
- package/build/require/type/parameters/index.js +27 -0
- package/build/require/type/parameters/parameters.d.ts +1 -0
- package/build/require/type/parameters/parameters.js +28 -0
- package/build/require/type/partial/index.js +27 -0
- package/build/require/type/partial/partial-from-mapped-result.js +30 -0
- package/build/require/type/partial/partial.d.ts +2 -0
- package/build/require/type/partial/partial.js +36 -0
- package/build/require/type/patterns/index.js +27 -0
- package/build/require/type/patterns/patterns.js +27 -0
- package/build/require/type/pick/index.js +27 -0
- package/build/require/type/pick/pick-from-mapped-key.js +31 -0
- package/build/require/type/pick/pick.d.ts +3 -0
- package/build/require/type/pick/pick.js +34 -0
- package/build/require/type/promise/index.js +27 -0
- package/build/require/type/promise/promise.d.ts +1 -0
- package/build/require/type/promise/promise.js +28 -0
- package/build/require/type/readonly/index.js +27 -0
- package/build/require/type/readonly/readonly.d.ts +1 -0
- package/build/require/type/readonly/readonly.js +28 -0
- package/build/require/type/readonly-optional/index.js +27 -0
- package/build/require/type/readonly-optional/readonly-optional.d.ts +1 -0
- package/build/require/type/readonly-optional/readonly-optional.js +28 -0
- package/build/require/type/record/index.js +27 -0
- package/build/require/type/record/record.d.ts +1 -1
- package/build/require/type/record/record.js +49 -2
- package/build/require/type/recursive/index.js +27 -0
- package/build/require/type/recursive/recursive.d.ts +4 -2
- package/build/require/type/recursive/recursive.js +31 -5
- package/build/require/type/ref/index.js +27 -0
- package/build/require/type/ref/ref.d.ts +2 -0
- package/build/require/type/ref/ref.js +28 -0
- package/build/require/type/regexp/index.js +27 -0
- package/build/require/type/regexp/regexp.d.ts +2 -0
- package/build/require/type/regexp/regexp.js +28 -0
- package/build/require/type/registry/format.d.ts +6 -0
- package/build/require/type/registry/format.js +34 -0
- package/build/require/type/registry/index.js +27 -0
- package/build/require/type/registry/type.d.ts +6 -0
- package/build/require/type/registry/type.js +34 -0
- package/build/require/type/required/index.js +27 -0
- package/build/require/type/required/required-from-mapped-result.js +30 -0
- package/build/require/type/required/required.d.ts +2 -0
- package/build/require/type/required/required.js +36 -0
- package/build/require/type/rest/index.js +27 -0
- package/build/require/type/rest/rest.d.ts +1 -0
- package/build/require/type/rest/rest.js +32 -0
- package/build/require/type/return-type/index.js +27 -0
- package/build/require/type/return-type/return-type.d.ts +1 -0
- package/build/require/type/return-type/return-type.js +28 -0
- package/build/require/type/schema/anyschema.js +27 -0
- package/build/require/type/schema/index.js +27 -0
- package/build/require/type/schema/schema.d.ts +7 -0
- package/build/require/type/schema/schema.js +27 -0
- package/build/require/type/static/index.js +27 -0
- package/build/require/type/static/static.d.ts +3 -0
- package/build/require/type/static/static.js +27 -0
- package/build/require/type/strict/index.js +27 -0
- package/build/require/type/strict/strict.d.ts +1 -0
- package/build/require/type/strict/strict.js +28 -0
- package/build/require/type/string/index.js +27 -0
- package/build/require/type/string/string.d.ts +7 -0
- package/build/require/type/string/string.js +28 -0
- package/build/require/type/symbol/index.js +27 -0
- package/build/require/type/symbol/symbol.d.ts +1 -0
- package/build/require/type/symbol/symbol.js +28 -0
- package/build/require/type/symbols/index.js +27 -0
- package/build/require/type/symbols/symbols.d.ts +5 -0
- package/build/require/type/symbols/symbols.js +32 -0
- package/build/require/type/template-literal/finite.js +37 -0
- package/build/require/type/template-literal/generate.js +37 -0
- package/build/require/type/template-literal/index.js +27 -0
- package/build/require/type/template-literal/parser.d.ts +2 -0
- package/build/require/type/template-literal/parser.js +44 -0
- package/build/require/type/template-literal/pattern.js +38 -0
- package/build/require/type/template-literal/syntax.d.ts +5 -4
- package/build/require/type/template-literal/syntax.js +35 -0
- package/build/require/type/template-literal/template-literal.d.ts +6 -4
- package/build/require/type/template-literal/template-literal.js +29 -0
- package/build/require/type/template-literal/union.d.ts +1 -0
- package/build/require/type/template-literal/union.js +31 -0
- package/build/require/type/transform/index.js +27 -0
- package/build/require/type/transform/transform.d.ts +4 -2
- package/build/require/type/transform/transform.js +40 -4
- package/build/require/type/tuple/index.js +27 -0
- package/build/require/type/tuple/tuple.d.ts +4 -3
- package/build/require/type/tuple/tuple.js +30 -0
- package/build/require/type/type/index.d.ts +1 -0
- package/build/require/type/type/index.js +34 -0
- package/build/require/type/type/javascript.d.ts +19 -0
- package/build/require/type/type/javascript.js +45 -0
- package/build/require/type/type/json.d.ts +66 -5
- package/build/require/type/type/json.js +82 -1
- package/build/require/type/type/type.js +30 -0
- package/build/require/type/uint8array/index.js +27 -0
- package/build/require/type/uint8array/uint8array.d.ts +1 -0
- package/build/require/type/uint8array/uint8array.js +28 -0
- package/build/require/type/undefined/index.js +27 -0
- package/build/require/type/undefined/undefined.d.ts +1 -0
- package/build/require/type/undefined/undefined.js +28 -0
- package/build/require/type/union/index.d.ts +2 -0
- package/build/require/type/union/index.js +29 -0
- package/build/require/type/union/union-create.d.ts +3 -0
- package/build/require/type/union/union-create.js +36 -0
- package/build/require/type/union/union-evaluated.d.ts +17 -0
- package/build/require/type/union/union-evaluated.js +72 -0
- package/build/require/type/union/union-type.d.ts +12 -0
- package/build/require/type/union/union-type.js +30 -0
- package/build/require/type/union/union.d.ts +4 -13
- package/build/require/type/union/union.js +32 -11
- package/build/require/type/unknown/index.js +27 -0
- package/build/require/type/unknown/unknown.d.ts +1 -0
- package/build/require/type/unknown/unknown.js +28 -0
- package/build/require/type/unsafe/index.js +27 -0
- package/build/require/type/unsafe/unsafe.d.ts +1 -0
- package/build/require/type/unsafe/unsafe.js +28 -0
- package/build/require/type/void/index.js +27 -0
- package/build/require/type/void/void.d.ts +1 -0
- package/build/require/type/void/void.js +28 -0
- package/build/require/value/cast/cast.d.ts +2 -0
- package/build/require/value/cast/cast.js +55 -0
- package/build/require/value/cast/index.js +27 -0
- package/build/require/value/check/check.d.ts +2 -0
- package/build/require/value/check/check.js +46 -1
- package/build/require/value/check/index.js +27 -0
- package/build/require/value/clean/clean.d.ts +2 -0
- package/build/require/value/clean/clean.js +39 -1
- package/build/require/value/clean/index.js +27 -0
- package/build/require/value/clone/clone.d.ts +1 -0
- package/build/require/value/clone/clone.js +34 -0
- package/build/require/value/clone/index.js +27 -0
- package/build/require/value/convert/convert.d.ts +2 -0
- package/build/require/value/convert/convert.js +57 -1
- package/build/require/value/convert/index.js +27 -0
- package/build/require/value/create/create.d.ts +2 -0
- package/build/require/value/create/create.js +44 -0
- package/build/require/value/create/index.js +27 -0
- package/build/require/value/default/default.d.ts +2 -0
- package/build/require/value/default/default.js +46 -0
- package/build/require/value/default/index.js +27 -0
- package/build/require/value/delta/delta.d.ts +1 -1
- package/build/require/value/delta/delta.js +42 -0
- package/build/require/value/delta/index.js +27 -0
- package/build/require/value/deref/deref.d.ts +1 -0
- package/build/require/value/deref/deref.js +28 -0
- package/build/require/value/deref/index.js +27 -0
- package/build/require/value/equal/equal.d.ts +1 -0
- package/build/require/value/equal/equal.js +34 -0
- package/build/require/value/equal/index.js +27 -0
- package/build/require/value/guard/guard.d.ts +20 -0
- package/build/require/value/guard/guard.js +57 -0
- package/build/require/value/guard/index.js +27 -0
- package/build/require/value/hash/hash.d.ts +1 -0
- package/build/require/value/hash/hash.js +46 -0
- package/build/require/value/hash/index.js +27 -0
- package/build/require/value/index.js +39 -0
- package/build/require/value/mutate/index.js +27 -0
- package/build/require/value/mutate/mutate.d.ts +1 -0
- package/build/require/value/mutate/mutate.js +38 -0
- package/build/require/value/pointer/index.js +27 -0
- package/build/require/value/pointer/pointer.d.ts +5 -0
- package/build/require/value/pointer/pointer.js +45 -0
- package/build/require/value/transform/decode.d.ts +5 -0
- package/build/require/value/transform/decode.js +50 -0
- package/build/require/value/transform/encode.d.ts +6 -0
- package/build/require/value/transform/encode.js +52 -0
- package/build/require/value/transform/has.d.ts +1 -0
- package/build/require/value/transform/has.js +43 -0
- package/build/require/value/transform/index.js +27 -0
- package/build/require/value/value/index.js +27 -0
- package/build/require/value/value/value.d.ts +24 -0
- package/build/require/value/value/value.js +42 -0
- package/package.json +1 -1
- package/readme.md +27 -20
|
@@ -17,23 +17,42 @@ import { type TSymbol } from '../symbol/index';
|
|
|
17
17
|
import { type TUint8Array, type Uint8ArrayOptions } from '../uint8array/index';
|
|
18
18
|
import { type TUndefined } from '../undefined/index';
|
|
19
19
|
import { type TVoid } from '../void/index';
|
|
20
|
+
/** JavaScript Type Builder with Static Resolution for TypeScript */
|
|
20
21
|
export declare class JavaScriptTypeBuilder extends JsonTypeBuilder {
|
|
22
|
+
/** `[JavaScript]` Creates a AsyncIterator type */
|
|
21
23
|
AsyncIterator<T extends TSchema>(items: T, options?: SchemaOptions): TAsyncIterator<T>;
|
|
24
|
+
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
|
|
22
25
|
Awaited<T extends TSchema>(schema: T, options?: SchemaOptions): TAwaited<T>;
|
|
26
|
+
/** `[JavaScript]` Creates a BigInt type */
|
|
23
27
|
BigInt(options?: BigIntOptions): TBigInt;
|
|
28
|
+
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
|
|
24
29
|
ConstructorParameters<T extends TConstructor<TSchema[], TSchema>>(schema: T, options?: SchemaOptions): TConstructorParameters<T>;
|
|
30
|
+
/** `[JavaScript]` Creates a Constructor type */
|
|
25
31
|
Constructor<T extends TSchema[], U extends TSchema>(parameters: [...T], returns: U, options?: SchemaOptions): TConstructor<T, U>;
|
|
32
|
+
/** `[JavaScript]` Creates a Date type */
|
|
26
33
|
Date(options?: DateOptions): TDate;
|
|
34
|
+
/** `[JavaScript]` Creates a Function type */
|
|
27
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 */
|
|
28
37
|
InstanceType<T extends TConstructor<any[], any>>(schema: T, options?: SchemaOptions): TInstanceType<T>;
|
|
38
|
+
/** `[JavaScript]` Creates an Iterator type */
|
|
29
39
|
Iterator<T extends TSchema>(items: T, options?: SchemaOptions): TIterator<T>;
|
|
40
|
+
/** `[JavaScript]` Extracts the Parameters from the given Function type */
|
|
30
41
|
Parameters<T extends TFunction<TSchema[], TSchema>>(schema: T, options?: SchemaOptions): TParameters<T>;
|
|
42
|
+
/** `[JavaScript]` Creates a Promise type */
|
|
31
43
|
Promise<T extends TSchema>(item: T, options?: SchemaOptions): TPromise<T>;
|
|
44
|
+
/** `[JavaScript]` Creates a String type from a Regular Expression pattern */
|
|
32
45
|
RegExp(pattern: string, options?: SchemaOptions): TRegExp;
|
|
46
|
+
/** `[JavaScript]` Creates a String type from a Regular Expression */
|
|
33
47
|
RegExp(regex: RegExp, options?: SchemaOptions): TRegExp;
|
|
48
|
+
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
|
|
34
49
|
ReturnType<T extends TFunction<any[], any>>(schema: T, options?: SchemaOptions): TReturnType<T>;
|
|
50
|
+
/** `[JavaScript]` Creates a Symbol type */
|
|
35
51
|
Symbol(options?: SchemaOptions): TSymbol;
|
|
52
|
+
/** `[JavaScript]` Creates a Undefined type */
|
|
36
53
|
Undefined(options?: SchemaOptions): TUndefined;
|
|
54
|
+
/** `[JavaScript]` Creates a Uint8Array type */
|
|
37
55
|
Uint8Array(options?: Uint8ArrayOptions): TUint8Array;
|
|
56
|
+
/** `[JavaScript]` Creates a Void type */
|
|
38
57
|
Void(options?: SchemaOptions): TVoid;
|
|
39
58
|
}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.JavaScriptTypeBuilder = void 0;
|
|
4
31
|
const json_1 = require("./json");
|
|
@@ -19,55 +46,73 @@ const index_14 = require("../symbol/index");
|
|
|
19
46
|
const index_15 = require("../uint8array/index");
|
|
20
47
|
const index_16 = require("../undefined/index");
|
|
21
48
|
const index_17 = require("../void/index");
|
|
49
|
+
/** JavaScript Type Builder with Static Resolution for TypeScript */
|
|
22
50
|
class JavaScriptTypeBuilder extends json_1.JsonTypeBuilder {
|
|
51
|
+
/** `[JavaScript]` Creates a AsyncIterator type */
|
|
23
52
|
AsyncIterator(items, options = {}) {
|
|
24
53
|
return (0, index_1.AsyncIterator)(items, options);
|
|
25
54
|
}
|
|
55
|
+
/** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
|
|
26
56
|
Awaited(schema, options = {}) {
|
|
27
57
|
return (0, index_2.Awaited)(schema, options);
|
|
28
58
|
}
|
|
59
|
+
/** `[JavaScript]` Creates a BigInt type */
|
|
29
60
|
BigInt(options = {}) {
|
|
30
61
|
return (0, index_3.BigInt)(options);
|
|
31
62
|
}
|
|
63
|
+
/** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
|
|
32
64
|
ConstructorParameters(schema, options = {}) {
|
|
33
65
|
return (0, index_5.ConstructorParameters)(schema, options);
|
|
34
66
|
}
|
|
67
|
+
/** `[JavaScript]` Creates a Constructor type */
|
|
35
68
|
Constructor(parameters, returns, options) {
|
|
36
69
|
return (0, index_4.Constructor)(parameters, returns, options);
|
|
37
70
|
}
|
|
71
|
+
/** `[JavaScript]` Creates a Date type */
|
|
38
72
|
Date(options = {}) {
|
|
39
73
|
return (0, index_6.Date)(options);
|
|
40
74
|
}
|
|
75
|
+
/** `[JavaScript]` Creates a Function type */
|
|
41
76
|
Function(parameters, returns, options) {
|
|
42
77
|
return (0, index_7.Function)(parameters, returns, options);
|
|
43
78
|
}
|
|
79
|
+
/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */
|
|
44
80
|
InstanceType(schema, options = {}) {
|
|
45
81
|
return (0, index_8.InstanceType)(schema, options);
|
|
46
82
|
}
|
|
83
|
+
/** `[JavaScript]` Creates an Iterator type */
|
|
47
84
|
Iterator(items, options = {}) {
|
|
48
85
|
return (0, index_9.Iterator)(items, options);
|
|
49
86
|
}
|
|
87
|
+
/** `[JavaScript]` Extracts the Parameters from the given Function type */
|
|
50
88
|
Parameters(schema, options = {}) {
|
|
51
89
|
return (0, index_10.Parameters)(schema, options);
|
|
52
90
|
}
|
|
91
|
+
/** `[JavaScript]` Creates a Promise type */
|
|
53
92
|
Promise(item, options = {}) {
|
|
54
93
|
return (0, index_11.Promise)(item, options);
|
|
55
94
|
}
|
|
95
|
+
/** `[JavaScript]` Creates a String type */
|
|
56
96
|
RegExp(unresolved, options = {}) {
|
|
57
97
|
return (0, index_12.RegExp)(unresolved, options);
|
|
58
98
|
}
|
|
99
|
+
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
|
|
59
100
|
ReturnType(schema, options = {}) {
|
|
60
101
|
return (0, index_13.ReturnType)(schema, options);
|
|
61
102
|
}
|
|
103
|
+
/** `[JavaScript]` Creates a Symbol type */
|
|
62
104
|
Symbol(options) {
|
|
63
105
|
return (0, index_14.Symbol)(options);
|
|
64
106
|
}
|
|
107
|
+
/** `[JavaScript]` Creates a Undefined type */
|
|
65
108
|
Undefined(options = {}) {
|
|
66
109
|
return (0, index_16.Undefined)(options);
|
|
67
110
|
}
|
|
111
|
+
/** `[JavaScript]` Creates a Uint8Array type */
|
|
68
112
|
Uint8Array(options = {}) {
|
|
69
113
|
return (0, index_15.Uint8Array)(options);
|
|
70
114
|
}
|
|
115
|
+
/** `[JavaScript]` Creates a Void type */
|
|
71
116
|
Void(options = {}) {
|
|
72
117
|
return (0, index_17.Void)(options);
|
|
73
118
|
}
|
|
@@ -10,7 +10,7 @@ import { type TExtends, type TExtendsFromMappedKey, type TExtendsFromMappedResul
|
|
|
10
10
|
import { type TExtract, type TExtractFromMappedResult } from '../extract/index';
|
|
11
11
|
import { TIndex, type TIndexPropertyKeys, type TIndexFromMappedKey } from '../indexed/index';
|
|
12
12
|
import { type IntegerOptions, type TInteger } from '../integer/index';
|
|
13
|
-
import {
|
|
13
|
+
import { Intersect, type IntersectOptions } from '../intersect/index';
|
|
14
14
|
import { type TCapitalize, type TUncapitalize, type TLowercase, type TUppercase } from '../intrinsic/index';
|
|
15
15
|
import { type TKeyOf, type TKeyOfFromMappedResult } from '../keyof/index';
|
|
16
16
|
import { type TLiteral, type TLiteralValue } from '../literal/index';
|
|
@@ -37,68 +37,129 @@ import { type TString, type StringOptions } from '../string/index';
|
|
|
37
37
|
import { type TTemplateLiteral, type TTemplateLiteralKind, type TemplateLiteralSyntax } from '../template-literal/index';
|
|
38
38
|
import { TransformDecodeBuilder } from '../transform/index';
|
|
39
39
|
import { type TTuple } from '../tuple/index';
|
|
40
|
-
import {
|
|
40
|
+
import { Union } from '../union/index';
|
|
41
41
|
import { type TUnknown } from '../unknown/index';
|
|
42
42
|
import { type TUnsafe, type UnsafeOptions } from '../unsafe/index';
|
|
43
|
+
/** Json Type Builder with Static Resolution for TypeScript */
|
|
43
44
|
export declare class JsonTypeBuilder {
|
|
45
|
+
/** `[Json]` Omits compositing symbols from this schema */
|
|
44
46
|
Strict<T extends TSchema>(schema: T): T;
|
|
47
|
+
/** `[Json]` Creates a Readonly and Optional property */
|
|
45
48
|
ReadonlyOptional<T extends TSchema>(schema: T): TReadonlyOptional<T>;
|
|
49
|
+
/** `[Json]` Creates a Readonly property */
|
|
46
50
|
Readonly<T extends TSchema>(schema: T): TReadonly<T>;
|
|
51
|
+
/** `[Json]` Creates an Optional property */
|
|
47
52
|
Optional<T extends TSchema>(schema: T): TOptional<T>;
|
|
53
|
+
/** `[Json]` Creates an Any type */
|
|
48
54
|
Any(options?: SchemaOptions): TAny;
|
|
55
|
+
/** `[Json]` Creates an Array type */
|
|
49
56
|
Array<T extends TSchema>(schema: T, options?: ArrayOptions): TArray<T>;
|
|
57
|
+
/** `[Json]` Creates a Boolean type */
|
|
50
58
|
Boolean(options?: SchemaOptions): TBoolean;
|
|
59
|
+
/** `[Json]` Intrinsic function to Capitalize LiteralString types */
|
|
51
60
|
Capitalize<T extends TSchema>(schema: T, options?: SchemaOptions): TCapitalize<T>;
|
|
61
|
+
/** `[Json]` Creates a Composite object type */
|
|
52
62
|
Composite<T extends TObject[]>(objects: [...T], options?: ObjectOptions): TComposite<T>;
|
|
53
|
-
|
|
63
|
+
/** `[JavaScript]` Creates a readonly const type from the given value. */
|
|
64
|
+
Const</* const (not supported in 4.0) */ T>(value: T, options?: SchemaOptions): TConst<T>;
|
|
65
|
+
/** `[Json]` Creates a dereferenced type */
|
|
54
66
|
Deref<T extends TSchema>(schema: T, references: TSchema[]): TDeref<T>;
|
|
67
|
+
/** `[Json]` Creates a Enum type */
|
|
55
68
|
Enum<V extends TEnumValue, T extends Record<TEnumKey, V>>(item: T, options?: SchemaOptions): TEnum<T>;
|
|
69
|
+
/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
|
|
56
70
|
Exclude<L extends TMappedResult, R extends TSchema>(unionType: L, excludedMembers: R, options?: SchemaOptions): TExcludeFromMappedResult<L, R>;
|
|
71
|
+
/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
|
|
57
72
|
Exclude<L extends TSchema, R extends TSchema>(unionType: L, excludedMembers: R, options?: SchemaOptions): TExclude<L, R>;
|
|
73
|
+
/** `[Json]` Creates a Conditional type */
|
|
58
74
|
Extends<L extends TMappedResult, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedResult<L, R, T, F>;
|
|
75
|
+
/** `[Json]` Creates a Conditional type */
|
|
59
76
|
Extends<L extends TMappedKey, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedKey<L, R, T, F>;
|
|
77
|
+
/** `[Json]` Creates a Conditional type */
|
|
60
78
|
Extends<L extends TSchema, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtends<L, R, T, F>;
|
|
79
|
+
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
|
|
61
80
|
Extract<L extends TMappedResult, R extends TSchema>(type: L, union: R, options?: SchemaOptions): TExtractFromMappedResult<L, R>;
|
|
81
|
+
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
|
|
62
82
|
Extract<L extends TSchema, R extends TSchema>(type: L, union: R, options?: SchemaOptions): TExtract<L, R>;
|
|
83
|
+
/** `[Json]` Returns an Indexed property type for the given keys */
|
|
63
84
|
Index<T extends TSchema, K extends TMappedKey>(T: T, K: K, options?: SchemaOptions): TIndexFromMappedKey<T, K>;
|
|
85
|
+
/** `[Json]` Returns an Indexed property type for the given keys */
|
|
64
86
|
Index<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TIndex<T, I>;
|
|
87
|
+
/** `[Json]` Returns an Indexed property type for the given keys */
|
|
65
88
|
Index<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TIndex<T, K>;
|
|
89
|
+
/** `[Json]` Creates an Integer type */
|
|
66
90
|
Integer(options?: IntegerOptions): TInteger;
|
|
67
|
-
|
|
91
|
+
/** `[Json]` Creates an Intersect type */
|
|
92
|
+
Intersect<T extends TSchema[]>(T: [...T], options?: IntersectOptions): Intersect<T>;
|
|
93
|
+
/** `[Json]` Creates a KeyOf type */
|
|
68
94
|
KeyOf<T extends TMappedResult>(schema: T, options?: SchemaOptions): TKeyOfFromMappedResult<T>;
|
|
95
|
+
/** `[Json]` Creates a KeyOf type */
|
|
69
96
|
KeyOf<T extends TSchema>(schema: T, options?: SchemaOptions): TKeyOf<T>;
|
|
97
|
+
/** `[Json]` Creates a Literal type */
|
|
70
98
|
Literal<T extends TLiteralValue>(value: T, options?: SchemaOptions): TLiteral<T>;
|
|
99
|
+
/** `[Json]` Intrinsic function to Lowercase LiteralString types */
|
|
71
100
|
Lowercase<T extends TSchema>(schema: T, options?: SchemaOptions): TLowercase<T>;
|
|
101
|
+
/** `[Json]` Creates a Mapped object type */
|
|
72
102
|
Mapped<K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>, F extends TMappedFunction<I> = TMappedFunction<I>, R extends TMapped<I, F> = TMapped<I, F>>(key: K, map: F, options?: ObjectOptions): R;
|
|
103
|
+
/** `[Json]` Creates a Mapped object type */
|
|
73
104
|
Mapped<K extends PropertyKey[], F extends TMappedFunction<K> = TMappedFunction<K>, R extends TMapped<K, F> = TMapped<K, F>>(key: [...K], map: F, options?: ObjectOptions): R;
|
|
105
|
+
/** `[Json]` Creates a Never type */
|
|
74
106
|
Never(options?: SchemaOptions): TNever;
|
|
107
|
+
/** `[Json]` Creates a Not type */
|
|
75
108
|
Not<T extends TSchema>(schema: T, options?: SchemaOptions): TNot<T>;
|
|
109
|
+
/** `[Json]` Creates a Null type */
|
|
76
110
|
Null(options?: SchemaOptions): TNull;
|
|
111
|
+
/** `[Json]` Creates a Number type */
|
|
77
112
|
Number(options?: NumberOptions): TNumber;
|
|
113
|
+
/** `[Json]` Creates an Object type */
|
|
78
114
|
Object<T extends TProperties>(properties: T, options?: ObjectOptions): TObject<T>;
|
|
115
|
+
/** `[Json]` Constructs a type whose keys are omitted from the given type */
|
|
79
116
|
Omit<T extends TSchema, K extends TMappedKey>(T: T, K: K): TOmitFromMappedKey<T, K>;
|
|
117
|
+
/** `[Json]` Constructs a type whose keys are omitted from the given type */
|
|
80
118
|
Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
|
|
119
|
+
/** `[Json]` Constructs a type whose keys are omitted from the given type */
|
|
81
120
|
Omit<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TOmit<T, K>;
|
|
121
|
+
/** `[Json]` Constructs a type where all properties are optional */
|
|
82
122
|
Partial<T extends TMappedResult>(T: T, options?: ObjectOptions): TPartialFromMappedResult<T>;
|
|
123
|
+
/** `[Json]` Constructs a type where all properties are optional */
|
|
83
124
|
Partial<T extends TSchema>(schema: T, options?: ObjectOptions): TPartial<T>;
|
|
125
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
84
126
|
Pick<T extends TSchema, K extends TMappedKey>(T: T, K: K): TPickFromMappedKey<T, K>;
|
|
127
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
85
128
|
Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
|
|
129
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
86
130
|
Pick<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TPick<T, K>;
|
|
131
|
+
/** `[Json]` Creates a Record type */
|
|
87
132
|
Record<K extends TSchema, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordResolve<K, T>;
|
|
133
|
+
/** `[Json]` Creates a Recursive type */
|
|
88
134
|
Recursive<T extends TSchema>(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive<T>;
|
|
135
|
+
/** `[Json]` Creates a Ref type. The referenced type must contain a $id */
|
|
89
136
|
Ref<T extends TSchema>(schema: T, options?: SchemaOptions): TRef<T>;
|
|
137
|
+
/** `[Json]` Creates a Ref type. */
|
|
90
138
|
Ref<T extends TSchema>($ref: string, options?: SchemaOptions): TRef<T>;
|
|
139
|
+
/** `[Json]` Constructs a type where all properties are required */
|
|
91
140
|
Required<T extends TMappedResult>(T: T, options?: ObjectOptions): TRequiredFromMappedResult<T>;
|
|
141
|
+
/** `[Json]` Constructs a type where all properties are required */
|
|
92
142
|
Required<T extends TSchema>(schema: T, options?: ObjectOptions): TRequired<T>;
|
|
143
|
+
/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
|
|
93
144
|
Rest<T extends TSchema>(schema: T): TRest<T>;
|
|
145
|
+
/** `[Json]` Creates a String type */
|
|
94
146
|
String(options?: StringOptions): TString;
|
|
147
|
+
/** `[Json]` Creates a TemplateLiteral type from template dsl string */
|
|
95
148
|
TemplateLiteral<T extends string>(syntax: T, options?: SchemaOptions): TemplateLiteralSyntax<T>;
|
|
149
|
+
/** `[Json]` Creates a TemplateLiteral type */
|
|
96
150
|
TemplateLiteral<T extends TTemplateLiteralKind[]>(kinds: [...T], options?: SchemaOptions): TTemplateLiteral<T>;
|
|
151
|
+
/** `[Json]` Creates a Transform type */
|
|
97
152
|
Transform<I extends TSchema>(schema: I): TransformDecodeBuilder<I>;
|
|
153
|
+
/** `[Json]` Creates a Tuple type */
|
|
98
154
|
Tuple<T extends TSchema[]>(items: [...T], options?: SchemaOptions): TTuple<T>;
|
|
155
|
+
/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
|
|
99
156
|
Uncapitalize<T extends TSchema>(schema: T, options?: SchemaOptions): TUncapitalize<T>;
|
|
100
|
-
|
|
157
|
+
/** `[Json]` Creates a Union type */
|
|
158
|
+
Union<T extends TSchema[]>(schemas: [...T], options?: SchemaOptions): Union<T>;
|
|
159
|
+
/** `[Json]` Creates an Unknown type */
|
|
101
160
|
Unknown(options?: SchemaOptions): TUnknown;
|
|
161
|
+
/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
|
|
102
162
|
Unsafe<T>(options?: UnsafeOptions): TUnsafe<T>;
|
|
163
|
+
/** `[Json]` Intrinsic function to Uppercase LiteralString types */
|
|
103
164
|
Uppercase<T extends TSchema>(schema: T, options?: SchemaOptions): TUppercase<T>;
|
|
104
165
|
}
|
|
@@ -1,4 +1,31 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.JsonTypeBuilder = void 0;
|
|
4
31
|
const index_1 = require("../any/index");
|
|
@@ -42,136 +69,190 @@ const index_38 = require("../tuple/index");
|
|
|
42
69
|
const index_39 = require("../union/index");
|
|
43
70
|
const index_40 = require("../unknown/index");
|
|
44
71
|
const index_41 = require("../unsafe/index");
|
|
72
|
+
/** Json Type Builder with Static Resolution for TypeScript */
|
|
45
73
|
class JsonTypeBuilder {
|
|
74
|
+
// ------------------------------------------------------------------------
|
|
75
|
+
// Strict
|
|
76
|
+
// ------------------------------------------------------------------------
|
|
77
|
+
/** `[Json]` Omits compositing symbols from this schema */
|
|
46
78
|
Strict(schema) {
|
|
47
79
|
return (0, index_34.Strict)(schema);
|
|
48
80
|
}
|
|
81
|
+
// ------------------------------------------------------------------------
|
|
82
|
+
// Modifiers
|
|
83
|
+
// ------------------------------------------------------------------------
|
|
84
|
+
/** `[Json]` Creates a Readonly and Optional property */
|
|
49
85
|
ReadonlyOptional(schema) {
|
|
50
86
|
return (0, index_28.ReadonlyOptional)(schema);
|
|
51
87
|
}
|
|
88
|
+
/** `[Json]` Creates a Readonly property */
|
|
52
89
|
Readonly(schema) {
|
|
53
90
|
return (0, index_27.Readonly)(schema);
|
|
54
91
|
}
|
|
92
|
+
/** `[Json]` Creates an Optional property */
|
|
55
93
|
Optional(schema) {
|
|
56
94
|
return (0, index_24.Optional)(schema);
|
|
57
95
|
}
|
|
96
|
+
// ------------------------------------------------------------------------
|
|
97
|
+
// Types
|
|
98
|
+
// ------------------------------------------------------------------------
|
|
99
|
+
/** `[Json]` Creates an Any type */
|
|
58
100
|
Any(options = {}) {
|
|
59
101
|
return (0, index_1.Any)(options);
|
|
60
102
|
}
|
|
103
|
+
/** `[Json]` Creates an Array type */
|
|
61
104
|
Array(schema, options = {}) {
|
|
62
105
|
return (0, index_2.Array)(schema, options);
|
|
63
106
|
}
|
|
107
|
+
/** `[Json]` Creates a Boolean type */
|
|
64
108
|
Boolean(options = {}) {
|
|
65
109
|
return (0, index_3.Boolean)(options);
|
|
66
110
|
}
|
|
111
|
+
/** `[Json]` Intrinsic function to Capitalize LiteralString types */
|
|
67
112
|
Capitalize(schema, options = {}) {
|
|
68
113
|
return (0, index_14.Capitalize)(schema, options);
|
|
69
114
|
}
|
|
115
|
+
/** `[Json]` Creates a Composite object type */
|
|
70
116
|
Composite(objects, options) {
|
|
71
|
-
return (0, index_4.Composite)(objects, options);
|
|
117
|
+
return (0, index_4.Composite)(objects, options); // (error) TS 5.4.0-dev - review TComposite implementation
|
|
72
118
|
}
|
|
119
|
+
/** `[JavaScript]` Creates a readonly const type from the given value. */
|
|
73
120
|
Const(value, options = {}) {
|
|
74
121
|
return (0, index_5.Const)(value, options);
|
|
75
122
|
}
|
|
123
|
+
/** `[Json]` Creates a dereferenced type */
|
|
76
124
|
Deref(schema, references) {
|
|
77
125
|
return (0, index_6.Deref)(schema, references);
|
|
78
126
|
}
|
|
127
|
+
/** `[Json]` Creates a Enum type */
|
|
79
128
|
Enum(item, options = {}) {
|
|
80
129
|
return (0, index_7.Enum)(item, options);
|
|
81
130
|
}
|
|
131
|
+
/** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
|
|
82
132
|
Exclude(unionType, excludedMembers, options = {}) {
|
|
83
133
|
return (0, index_8.Exclude)(unionType, excludedMembers, options);
|
|
84
134
|
}
|
|
135
|
+
/** `[Json]` Creates a Conditional type */
|
|
85
136
|
Extends(L, R, T, F, options = {}) {
|
|
86
137
|
return (0, index_9.Extends)(L, R, T, F, options);
|
|
87
138
|
}
|
|
139
|
+
/** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
|
|
88
140
|
Extract(type, union, options = {}) {
|
|
89
141
|
return (0, index_10.Extract)(type, union, options);
|
|
90
142
|
}
|
|
143
|
+
/** `[Json]` Returns an Indexed property type for the given keys */
|
|
91
144
|
Index(schema, unresolved, options = {}) {
|
|
92
145
|
return (0, index_11.Index)(schema, unresolved, options);
|
|
93
146
|
}
|
|
147
|
+
/** `[Json]` Creates an Integer type */
|
|
94
148
|
Integer(options = {}) {
|
|
95
149
|
return (0, index_12.Integer)(options);
|
|
96
150
|
}
|
|
151
|
+
/** `[Json]` Creates an Intersect type */
|
|
97
152
|
Intersect(T, options = {}) {
|
|
98
153
|
return (0, index_13.Intersect)(T, options);
|
|
99
154
|
}
|
|
155
|
+
/** `[Json]` Creates a KeyOf type */
|
|
100
156
|
KeyOf(schema, options = {}) {
|
|
101
157
|
return (0, index_15.KeyOf)(schema, options);
|
|
102
158
|
}
|
|
159
|
+
/** `[Json]` Creates a Literal type */
|
|
103
160
|
Literal(value, options = {}) {
|
|
104
161
|
return (0, index_16.Literal)(value, options);
|
|
105
162
|
}
|
|
163
|
+
/** `[Json]` Intrinsic function to Lowercase LiteralString types */
|
|
106
164
|
Lowercase(schema, options = {}) {
|
|
107
165
|
return (0, index_14.Lowercase)(schema, options);
|
|
108
166
|
}
|
|
167
|
+
/** `[Json]` Creates a Mapped object type */
|
|
109
168
|
Mapped(key, map, options = {}) {
|
|
110
169
|
return (0, index_17.Mapped)(key, map, options);
|
|
111
170
|
}
|
|
171
|
+
/** `[Json]` Creates a Never type */
|
|
112
172
|
Never(options = {}) {
|
|
113
173
|
return (0, index_18.Never)(options);
|
|
114
174
|
}
|
|
175
|
+
/** `[Json]` Creates a Not type */
|
|
115
176
|
Not(schema, options) {
|
|
116
177
|
return (0, index_19.Not)(schema, options);
|
|
117
178
|
}
|
|
179
|
+
/** `[Json]` Creates a Null type */
|
|
118
180
|
Null(options = {}) {
|
|
119
181
|
return (0, index_20.Null)(options);
|
|
120
182
|
}
|
|
183
|
+
/** `[Json]` Creates a Number type */
|
|
121
184
|
Number(options = {}) {
|
|
122
185
|
return (0, index_21.Number)(options);
|
|
123
186
|
}
|
|
187
|
+
/** `[Json]` Creates an Object type */
|
|
124
188
|
Object(properties, options = {}) {
|
|
125
189
|
return (0, index_22.Object)(properties, options);
|
|
126
190
|
}
|
|
191
|
+
/** `[Json]` Constructs a type whose keys are omitted from the given type */
|
|
127
192
|
Omit(schema, unresolved, options = {}) {
|
|
128
193
|
return (0, index_23.Omit)(schema, unresolved, options);
|
|
129
194
|
}
|
|
195
|
+
/** `[Json]` Constructs a type where all properties are optional */
|
|
130
196
|
Partial(schema, options = {}) {
|
|
131
197
|
return (0, index_25.Partial)(schema, options);
|
|
132
198
|
}
|
|
199
|
+
/** `[Json]` Constructs a type whose keys are picked from the given type */
|
|
133
200
|
Pick(schema, unresolved, options = {}) {
|
|
134
201
|
return (0, index_26.Pick)(schema, unresolved, options);
|
|
135
202
|
}
|
|
203
|
+
/** `[Json]` Creates a Record type */
|
|
136
204
|
Record(key, schema, options = {}) {
|
|
137
205
|
return (0, index_29.Record)(key, schema);
|
|
138
206
|
}
|
|
207
|
+
/** `[Json]` Creates a Recursive type */
|
|
139
208
|
Recursive(callback, options = {}) {
|
|
140
209
|
return (0, index_30.Recursive)(callback, options);
|
|
141
210
|
}
|
|
211
|
+
/** `[Json]` Creates a Ref type. */
|
|
142
212
|
Ref(unresolved, options = {}) {
|
|
143
213
|
return (0, index_31.Ref)(unresolved, options);
|
|
144
214
|
}
|
|
215
|
+
/** `[Json]` Constructs a type where all properties are required */
|
|
145
216
|
Required(schema, options = {}) {
|
|
146
217
|
return (0, index_32.Required)(schema, options);
|
|
147
218
|
}
|
|
219
|
+
/** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
|
|
148
220
|
Rest(schema) {
|
|
149
221
|
return (0, index_33.Rest)(schema);
|
|
150
222
|
}
|
|
223
|
+
/** `[Json]` Creates a String type */
|
|
151
224
|
String(options = {}) {
|
|
152
225
|
return (0, index_35.String)(options);
|
|
153
226
|
}
|
|
227
|
+
/** `[Json]` Creates a TemplateLiteral type */
|
|
154
228
|
TemplateLiteral(unresolved, options = {}) {
|
|
155
229
|
return (0, index_36.TemplateLiteral)(unresolved, options);
|
|
156
230
|
}
|
|
231
|
+
/** `[Json]` Creates a Transform type */
|
|
157
232
|
Transform(schema) {
|
|
158
233
|
return (0, index_37.Transform)(schema);
|
|
159
234
|
}
|
|
235
|
+
/** `[Json]` Creates a Tuple type */
|
|
160
236
|
Tuple(items, options = {}) {
|
|
161
237
|
return (0, index_38.Tuple)(items, options);
|
|
162
238
|
}
|
|
239
|
+
/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
|
|
163
240
|
Uncapitalize(schema, options = {}) {
|
|
164
241
|
return (0, index_14.Uncapitalize)(schema, options);
|
|
165
242
|
}
|
|
243
|
+
/** `[Json]` Creates a Union type */
|
|
166
244
|
Union(schemas, options = {}) {
|
|
167
245
|
return (0, index_39.Union)(schemas, options);
|
|
168
246
|
}
|
|
247
|
+
/** `[Json]` Creates an Unknown type */
|
|
169
248
|
Unknown(options = {}) {
|
|
170
249
|
return (0, index_40.Unknown)(options);
|
|
171
250
|
}
|
|
251
|
+
/** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
|
|
172
252
|
Unsafe(options = {}) {
|
|
173
253
|
return (0, index_41.Unsafe)(options);
|
|
174
254
|
}
|
|
255
|
+
/** `[Json]` Intrinsic function to Uppercase LiteralString types */
|
|
175
256
|
Uppercase(schema, options = {}) {
|
|
176
257
|
return (0, index_14.Uppercase)(schema, options);
|
|
177
258
|
}
|
|
@@ -1,7 +1,37 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.Strict = exports.ReturnType = exports.Rest = exports.Required = exports.RegExp = exports.Ref = exports.Recursive = exports.Record = exports.ReadonlyOptional = exports.Readonly = exports.Promise = exports.Pick = exports.Partial = exports.Parameters = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.Mapped = exports.Literal = exports.KeyOf = exports.Iterator = exports.Uppercase = exports.Lowercase = exports.Uncapitalize = exports.Capitalize = exports.Intersect = exports.Integer = exports.InstanceType = exports.Index = exports.Function = exports.Extract = exports.Extends = exports.Exclude = exports.Enum = exports.Deref = exports.Date = exports.ConstructorParameters = exports.Constructor = exports.Const = exports.Composite = exports.Boolean = exports.BigInt = exports.Awaited = exports.AsyncIterator = exports.Array = exports.Any = void 0;
|
|
4
31
|
exports.Void = exports.Unsafe = exports.Unknown = exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.Transform = exports.TemplateLiteral = exports.Symbol = exports.String = void 0;
|
|
32
|
+
// ------------------------------------------------------------------
|
|
33
|
+
// Type: Module
|
|
34
|
+
// ------------------------------------------------------------------
|
|
5
35
|
var index_1 = require("../any/index");
|
|
6
36
|
Object.defineProperty(exports, "Any", { enumerable: true, get: function () { return index_1.Any; } });
|
|
7
37
|
var index_2 = require("../array/index");
|
|
@@ -1,4 +1,31 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
30
|
if (k2 === undefined) k2 = k;
|
|
4
31
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -1,7 +1,35 @@
|
|
|
1
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
|
+
---------------------------------------------------------------------------*/
|
|
2
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
30
|
exports.Uint8Array = void 0;
|
|
4
31
|
const index_1 = require("../symbols/index");
|
|
32
|
+
/** `[JavaScript]` Creates a Uint8Array type */
|
|
5
33
|
function Uint8Array(options = {}) {
|
|
6
34
|
return { ...options, [index_1.Kind]: 'Uint8Array', type: 'Uint8Array' };
|
|
7
35
|
}
|