Struct
Index
Constructor
Other
Constructor
Module
__call__
Callable property
__inspect__
When defined, returns a custom string representation. To be useful, it should be bound to a prototype (ex: Struct)
readonlytypeName
The factory type constant
__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.
create
Construct a new model
hasInstance
Return
true
if the given value is an instance of the class.
Other
DefineParameters
Type parameters
- Model: Struct<{ _: string }>
optional__inspect__
When defined, returns a custom string representation. To be useful, it should be bound to a prototype (ex: Struct)
optionalhasInstance
typeName
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.
Parameters
Extract all parameters to create a new Struct
Type parameters
- Model
type
consttype
The type property discriminator
create
Return a new Struct from
properties
. Struct adds debugging / inspecting abilitiesType parameters
- Properties
define
Return a new
Struct
default factory See Module for additional properties added to the constructorType parameters
- Model: Readonly<{ _: string }>
Construct a new model