Skip to content
Discussion options

You must be logged in to vote

Solved this way:

export enum States {
  DASHBOARD = 'DASHBOARD',
  OVERVIEW = 'OVERVIEW'
}

type StatesMap<T> = {
  [K in keyof T]: {
    value: K,
    context: never
  }
}

export type TrainingStates = StatesMap<typeof States>[keyof StatesMap<typeof States>];

Added to https://gist.github.com/montogeek/dd51382ecc1d57a9ae9f6bad4c0b47df

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@montogeek
Comment options

Answer selected by montogeek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant