Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TsEnumType<E, EO>

Represents a TS-style enum value.

A TS enum value is defined in an object ("enum object"). It contains "forward"properties from non-numeric strings to strings or numbers and "reversed" properties from numeric strings to keys of forward properties with constant numeric values.

Type parameters

  • E: string | number

  • EO: any

Hierarchy

  • TsEnumType

Implements

Index

Constructors

constructor

Properties

Private _jsToOut

_jsToOut: Map<E, string> | undefined

Private _options

_options: Lazy<TsEnumTypeOptions<E>>

Private _outToJs

_outToJs: Map<string, E> | undefined

Optional changeCase

changeCase: CaseStyle

enum

enum: Record<keyof EO, E>

name

name: Name = name

Optional rename

rename: undefined | object

Accessors

Private jsToOut

  • get jsToOut(): Map<E, string>

Private outToJs

  • get outToJs(): Map<string, E>

Methods

Private _applyOptions

  • _applyOptions(): void

clone

  • clone(val: E): E

equals

  • equals(val1: E, val2: E): boolean

read

  • read<R>(reader: Reader<R>, raw: R): E

test

  • test(value: E): boolean

testError

  • testError(value: E): Error | undefined

write

  • write<W>(writer: Writer<W>, value: E): W

Static fromJSON

Generated using TypeDoc