Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "types/ts-enum"

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

Diff

Diff: number

EnumObject

EnumObject<EO, E>: Record<keyof EO, E>

Type parameters

  • EO

  • E: number | string

Name

Name: "ts-enum"

TsEnum

TsEnum<EnumConstructor>: object

Represents an enum value defined in EnumConstructor

Type parameters

  • EnumConstructor

Type declaration

Variables

Const name

name: Name = "ts-enum"

Functions

getEnumMaps

  • getEnumMaps<K, E>(tsEnum: Record<K, E>, changeCase: CaseStyle | undefined, renameAll?: undefined | object): [Map<E, string>, Map<string, E>]
  • Converts a TS enum and rename options to two maps: from out names to values and from values to out names.

    Type parameters

    • K: string

    • E: string | number

    Parameters

    • tsEnum: Record<K, E>
    • changeCase: CaseStyle | undefined
    • Optional renameAll: undefined | object

    Returns [Map<E, string>, Map<string, E>]

isValidEnumMember

  • isValidEnumMember(key: string): boolean

tsEnumToMap

  • tsEnumToMap<K, E>(tsEnum: Record<K, E>): Map<K, E>
  • Builds a map from a TS enum by removing reverse-lookup keys.

    Type parameters

    • K: string

    • E: string | number

    Parameters

    • tsEnum: Record<K, E>

    Returns Map<K, E>

Generated using TypeDoc