Closed ahrjarrett closed 8 months ago
any.scalar
string | number | boolean | null
never.uninhabited
never
(internal)
any.object
any_object
Kind.constraintsOf
Kind
string.delimitedCase
string.snake
string.kebab
check
is
non
check.is.stringLiteral
declare function fn<T extends check.is.stringLiteral<t>>(t: t): t // ^ raises a TypeError if `T` is not a string literal
check.is.numberLiteral
declare function fn<T extends check.is.numberLiteral<t>>(t: t): t // ^ raises a TypeError if `T` is not a number literal
check.is.booleanLiteral
declare function fn<T extends check.is.numberLiteral<t>>(t: t): t // ^ raises a TypeError if `T` is not a boolean literal
check.is.literal
declare function fn<T extends check.is.literal<t>>(t: t): t // ^ raises a TypeError if `T` is not a literal
check.is.union
declare function fn<T extends check.is.union<t>>(t: t): t // ^ raises a TypeError if `T` is not a union
check.non.array
declare function fn<T extends check.non.array<t>>(t: t): t // ^ raises a TypeError if `T` is an array (must be an object)
check.non.union
declare function fn<T extends check.non.union<t>>(t: t): t // ^ raises a TypeError if `T` is a union
check.non.finiteBoolean
declare function fn<T extends check.non.finiteBoolean<t>>(t: t): t // ^ raises a TypeError if `T` is `true` or `false` (must be `boolean`)
check.non.finiteString
declare function fn<T extends check.non.finiteString<t>>(t: t): t // ^ raises a TypeError if `T` is a literal string (must be `string`)
check.non.finiteNumber
declare function fn<T extends check.non.finiteNumber<t>>(t: t): t // ^ raises a TypeError if `T` is a literal number (must be a `number`)
changelog
fixes
61
62
new features
any.scalar
: addsany.scalar
: describe any non-composite JSON value (string | number | boolean | null
)never.uninhabited
: free semantics for default arguments that are typed asnever
(internal)
: implementation ofany.object
now points to a new name,any_object
(so users will always seeany.object
orany_object
)Kind.constraintsOf
: infer aKind
's constraintsstring.delimitedCase
,string.snake
,string.kebab
, etc.check
: adds ambient namespacesis
andnon
, which expose the following type constructors:check.is.stringLiteral
:check.is.numberLiteral
:check.is.booleanLiteral
:check.is.literal
:check.is.union
:check.non.array
:check.non.union
:check.non.finiteBoolean
:check.non.finiteString
:check.non.finiteNumber
:deprecations