Keywords
TypeScript
All
*
builtin TypeScript keywords are directly available.*
any
and void
are misleading and unnecessary for runtime
validation and so are not included as keywords by default.
Subtype
Subtype keywords refine or transform their root type.
You can easily explore available subtypes via autocomplete by with a partial definition like "string."
.
All Keywords
This table includes all keywords available in default type
API. To define your own string-embeddable keywords, see scopes.
string
Alias | Description |
---|---|
string | a string |
string.alpha | a string and only letters |
string.alphanumeric | a string and only letters and digits 0-9 |
string.base64 | a string and base64-encoded |
string.base64.url | a string and base64url-encoded |
string.capitalize | a morph from a string to a string and capitalized |
string.capitalize.preformatted | a string and capitalized |
string.creditCard | a string and a credit card number and a credit card number |
string.date | a string and a parsable date |
string.date.epoch | an integer string representing a safe Unix timestamp |
string.date.epoch.parse | a morph from an integer string representing a safe Unix timestamp to a Date |
string.date.iso | a string and an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date |
string.date.iso.parse | a morph from a string and an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date to a Date |
string.date.parse | a morph from a string and a parsable date to a Date |
string.digits | a string and only digits 0-9 |
string.email | a string and an email address |
string.integer | a string and a well-formed integer string |
string.integer.parse | a morph from a string and a well-formed integer string to an integer |
string.ip | an IP address |
string.ip.v4 | a string and an IPv4 address |
string.ip.v6 | a string and an IPv6 address |
string.json | a string and a JSON string |
string.json.parse | a morph from a string to { [string]: $jsonObject | number | string | $jsonData[] | false | null | true } or $jsonData[] |
string.lower | a morph from a string to a string and only lowercase letters |
string.lower.preformatted | a string and only lowercase letters |
string.normalize | a morph from a string to NFC-normalized unicode |
string.normalize.NFC | a morph from a string to NFC-normalized unicode |
string.normalize.NFC.preformatted | NFC-normalized unicode |
string.normalize.NFD | a morph from a string to NFD-normalized unicode |
string.normalize.NFD.preformatted | NFD-normalized unicode |
string.normalize.NFKC | a morph from a string to NFKC-normalized unicode |
string.normalize.NFKC.preformatted | NFKC-normalized unicode |
string.normalize.NFKD | a morph from a string to NFKD-normalized unicode |
string.normalize.NFKD.preformatted | NFKD-normalized unicode |
string.numeric | a string and a well-formed numeric string |
string.numeric.parse | a morph from a string and a well-formed numeric string to a number |
string.semver | a string and a semantic version (see https://semver.org/) |
string.trim | a morph from a string to a string and trimmed |
string.trim.preformatted | a string and trimmed |
string.upper | a morph from a string to a string and only uppercase letters |
string.upper.preformatted | a string and only uppercase letters |
string.url | a string and a URL string |
string.url.parse | a morph from a string and a URL string to a URL instance |
string.uuid | a UUID |
string.uuid.v1 | a string and a UUIDv1 |
string.uuid.v2 | a string and a UUIDv2 |
string.uuid.v3 | a string and a UUIDv3 |
string.uuid.v4 | a string and a UUIDv4 |
string.uuid.v5 | a string and a UUIDv5 |
string.uuid.v6 | a string and a UUIDv6 |
string.uuid.v7 | a string and a UUIDv7 |
string.uuid.v8 | a string and a UUIDv8 |
number
Alias | Description |
---|---|
number | a number |
number.Infinity | Infinity |
number.NaN | NaN |
number.NegativeInfinity | -Infinity |
number.epoch | an integer representing a safe Unix timestamp |
number.integer | an integer |
number.safe | at least -9007199254740991 and at most 9007199254740991 |
other
Alias | Description |
---|---|
Key | a string or a symbol |
bigint | a bigint |
boolean | boolean |
false | false |
never | never |
null | null |
symbol | a symbol |
true | true |
undefined | undefined |
unknown | unknown |
unknown.any | unknown |
object
Alias | Description |
---|---|
object | an object |
object.json | { [string]: $jsonObject | number | string | $jsonData[] | false | null | true } or $jsonData[] |
object.json.stringify | a morph from { [string]: $jsonObject | number | string | $jsonData[] | false | null | true } or $jsonData[] to a string |
array
Alias | Description |
---|---|
Array | an array |
Array.index | a string and matched by ^(?:0|[1-9]\d*)$ |
Array.liftFrom | a generic type for Function |
Array.readonly | an array |
ArrayBuffer | an ArrayBuffer instance |
FormData
Alias | Description |
---|---|
FormData | a FormData instance |
FormData.parse | a morph from a FormData instance to an object representing parsed form data |
FormData.parsed | an object representing parsed form data |
FormData.value | a string or a File instance |
TypedArray
Alias | Description |
---|---|
TypedArray.BigInt64 | a BigInt64Array |
TypedArray.BigUint64 | a BigUint64Array |
TypedArray.Float32 | a Float32Array |
TypedArray.Float64 | a Float64Array |
TypedArray.Int16 | an Int16Array |
TypedArray.Int32 | an Int32Array |
TypedArray.Int8 | an Int8Array |
TypedArray.Uint16 | a Uint16Array |
TypedArray.Uint32 | a Uint32Array |
TypedArray.Uint8 | a Uint8Array |
TypedArray.Uint8Clamped | a Uint8ClampedArray |
instanceof
Alias | Description |
---|---|
Blob | a Blob instance |
Date | a Date |
Error | an Error |
File | a File instance |
Function | a function |
Headers | a Headers instance |
Map | a Map |
Promise | a Promise |
RegExp | a RegExp |
Request | a Request instance |
Response | a Response instance |
Set | a Set |
URL | a URL instance |
WeakMap | a WeakMap |
WeakSet | a WeakSet |
generic
Alias | Description |
---|---|
Exclude | a generic type for Function |
Extract | a generic type for Function |
Merge | a generic type for Function |
Omit | a generic type for Function |
Partial | a generic type for Function |
Pick | a generic type for Function |
Record | a generic type that instantiates an object from a single index signature and corresponding value type |
Required | a generic type for Function |