Typescript: interfaces properties to string literal types?

Viewed 376

So this is a question to all Typescript wizards.

If I have an interface, e.g

interface A {
  value: string
  child : {
     nestedValue: number
  }
}

is it possible to derive a type that contains all properties of that interface A as string literal types? Like this:

type WhatIWant = 'value' | 'child.nestedValue'

Thanks!

0 Answers
Related