Type
Index
Interfaces
Module
Type parameters
- T
typeName
inspect
When defined, returns a custom string representation
asInstance
Try to convert anyValue to enum value or else returns
Option.None
codecDecode
Returns the decoded
input
,Result.Ok
orResult.Error()
codecEncode
Returns the encoded
input
codecSchema
Returns the JSONSchema corresponding to the decoded type
hasInstance
Return
true
if the given value is an instance of the class.
Parameters
Type module constructor parameters
Type parameters
- T
optionalasInstance
hasInstance
optionalinspect
typeName
optionalcodecDecode
Returns the decoded
input
,Result.Ok
orResult.Error()
optionalcodecEncode
Returns the encoded
input
optionalcodecSchema
Returns the JSONSchema corresponding to the decoded type
Type Aliases
TypeOf
Extract the type of object from its module
Type parameters
- V
Variables
RegExp
bigint
boolean
number
string
unknown
Functions
Array
Returns a codec for
Array<V>
.Type parameters
- V
Char
Convert an underlying type to a tagged type Alias to
wrap(value)
__call__
asInstance
codecDecode
codecEncode
codecSchema
hasInstance
inspect
typeName
unwrap
wrap
Int
Convert an underlying type to a tagged type Alias to
wrap(value)
__call__
asInstance
codecDecode
codecEncode
codecSchema
hasInstance
inspect
typeName
unwrap
wrap
Object
Returns a new Type for
P
.Type parameters
- P
Option
Return a new optional type from
Value
Type parameters
- T
Record
Tuple
Type parameters
- C: readonly Module<any>[]
URL
Convert an underlying type to a tagged type Alias to
wrap(value)
typeName
__call__
Callable property
inspect
When defined, returns a custom string representation
asInstance
Try to convert anyValue to enum value or else returns
Option.None
codecDecode
Returns the decoded
input
,Result.Ok
orResult.Error()
codecEncode
Returns the encoded
input
codecSchema
Returns the JSONSchema corresponding to the decoded type
hasInstance
Return
true
if the given value is an instance of the class.
unwrap
Convert a tagged value to the underlying type
wrap
Convert an underlying type to a tagged type
UUID
Convert an underlying type to a tagged type Alias to
wrap(value)
typeName
__call__
Callable property
inspect
When defined, returns a custom string representation
asInstance
Try to convert anyValue to enum value or else returns
Option.None
codecDecode
Returns the decoded
input
,Result.Ok
orResult.Error()
codecEncode
Returns the encoded
input
codecSchema
Returns the JSONSchema corresponding to the decoded type
hasInstance
Return
true
if the given value is an instance of the class.
unwrap
Convert a tagged value to the underlying type
wrap
Convert an underlying type to a tagged type
constant
A type for constant
value
. An encoded value can be specified as second argument.Type parameters
- Value: null | string | number | boolean
define
Define a new Type module
Type parameters
- T
ensure
Ensure that
value
is a validT
. Throw a TypeError otherwise.Type parameters
- T
union
Return a union of all types
Type parameters
- Types: readonly Module<any>[]
Type module interface