You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
Currently, the typescript/es6-declarations format assigns string tokens the type string, and number tokens the type number. As a result, tokens are un-assignable to stricter types, such as string literal unions, without type assertion. The assignment of type string to tokens with string values does not align with Typescript's built-in type inference, which assigns string-literal types to string variables.
Proposed Solution:
Add feature flag options.outputLiteralTypes to the typescript/es6-declarations format's interface. If this boolean option is set to true, tokens with string or number values will be assigned literal types in the outputted files.
Problem:
Currently, the typescript/es6-declarations format assigns string tokens the type
string
, and number tokens the typenumber
. As a result, tokens are un-assignable to stricter types, such as string literal unions, without type assertion. The assignment of typestring
to tokens with string values does not align with Typescript's built-in type inference, which assigns string-literal types to string variables.Proposed Solution:
Add feature flag options.outputLiteralTypes to the typescript/es6-declarations format's interface. If this boolean option is set to
true
, tokens with string or number values will be assigned literal types in the outputted files.PR: #857
The text was updated successfully, but these errors were encountered: