API: expose IntrinsicType #22269
Labels
API
Relates to the public API for TypeScript
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
TypeScript Version: 2.7.2, 2.8.0-dev.20180228
Search Terms: IntrinsicType
There's currently no (official) way to distinguish the literal types
true
andfalse
.Although
ts.TypeFlags.BooleanLiteral
is included ints.TypeFlags.Literal
it's nots.LiteralType
. Therefore I cannot access the value of the literal. I need access to the internalts.IntrinsicType
for that.TSLint just declared the type in their project, which might break at any time...
My current workaround is
checker.typeToString(type) === 'false'
.If you expose
ts.IntrinsicType
, does it make sense to exposets.TypeFlags.Intrisic
too?The text was updated successfully, but these errors were encountered: