1

I am trying to implement TypeScript array to string literal type

I get a red underline error on PhpStorm with the error type name expected after as const

enter image description here

I also tried <const> but I get the same error near < and >

enter image description here

I user typescript 3.8.3

TSR
  • 17,242
  • 27
  • 93
  • 197

1 Answers1

1

Works fine for me:

enter image description here

What IDE version do you use? TypeScript 3.4 non-widening literal contexts ('as const') is supported since 2019.2.1

lena
  • 90,154
  • 11
  • 145
  • 150