Enum
Index
Interfaces
Module
Type parameters
- T: Record<string, any> = Record<string, unknown>
typeName
readonly[enumKeys]
An array of all keys
__inspect__
When defined, returns a custom string representation. To be useful, it should be bound to a prototype (ex: Struct)
indexType
Index type
__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.
at
Returns the value at the index
hasInstance
Return
true
if the given value is an instance of the class.
indexOf
Returns the integer index of a value
range
Returns an Iterable starting from
start
toend
. Ifstart
orend
is not in range then returns an empty iterable.
rangeSize
Returns the size of a range. If
start
orend
is not in range then returns 0.
Type Aliases
KeyOf
ValueOf
Variables
enumKeys
Symbol for the property holding enum keys
Functions
define
Define a new Enum Object
Type parameters
- T: Record<string, string | number | boolean>
keys
Returns an array of enum keys
Type parameters
- T: Enum<Record<string, any>>
values
Returns an array of enum values
Type parameters
- T: Enum<Record<string, any>>
Module containing methods for working with enum types