Type
Index
Interfaces
Module
Type parameters
- T
typeName
__inspect__
When defined, returns a custom string representation. To be useful, it should be bound to a prototype (ex: Struct)
__decode__
Returns the decoded
input
,Result.Ok
orResult.Error()
__encode__
Returns the encoded
input
__schema__
Returns the JSONSchema corresponding to the decoded type
asInstance
Try to convert anyValue to enum value or else returns
Option.None
asString
Converts the given value to a String.
hasInstance
Return
true
if the given value is an instance of the class.
Parameters
Type module constructor parameters
Type parameters
- T
optional__inspect__
When defined, returns a custom string representation. To be useful, it should be bound to a prototype (ex: Struct)
hasInstance
typeName
Type string representation
optional__decode__
Returns the decoded
input
,Result.Ok
orResult.Error()
optional__encode__
Returns the encoded
input
optional__schema__
Returns the JSONSchema corresponding to the decoded type
optionalasInstance
Try to convert anyValue to enum value or else returns
Option.None
optionalasString
Converts the given value to a String.
Type Aliases
TypeOf
Extract the type of object from its module
Type parameters
- V
Variables
Ordering
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__
__decode__
__encode__
__inspect__
__schema__
asInstance
asString
hasInstance
typeName
unwrap
wrap
Int
Convert an underlying type to a tagged type Alias to
wrap(value)
__call__
__decode__
__encode__
__inspect__
__schema__
asInstance
asString
hasInstance
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. To be useful, it should be bound to a prototype (ex: Struct)
__decode__
Returns the decoded
input
,Result.Ok
orResult.Error()
__encode__
Returns the encoded
input
__schema__
Returns the JSONSchema corresponding to the decoded type
asInstance
Try to convert anyValue to enum value or else returns
Option.None
asString
Converts the given value to a String.
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. To be useful, it should be bound to a prototype (ex: Struct)
__decode__
Returns the decoded
input
,Result.Ok
orResult.Error()
__encode__
Returns the encoded
input
__schema__
Returns the JSONSchema corresponding to the decoded type
asInstance
Try to convert anyValue to enum value or else returns
Option.None
asString
Converts the given value to a String.
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