"when" on TypeScript types
See original GitHub issueI have a snippet for TypeScript which “promisifies” values, and it works great for custom types
- MyType.promisify
+ Promise<MyType>
However, I cannot target built-in types such as boolean
, void
, etc. in "when": [...]
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Handbook - Basic Types - TypeScript
Basic Types · Boolean · Number · String · Array · Tuple · Enum · Unknown · Any.
Read more >Documentation - Advanced Types - TypeScript
TypeScript has two special types, null and undefined , that have the values null and undefined respectively. We mentioned these briefly in the...
Read more >Documentation - Everyday Types - TypeScript
JavaScript has three very commonly used primitives: string , number , and boolean . Each has a corresponding type in TypeScript. As you...
Read more >Documentation - Type Compatibility - TypeScript
Type compatibility in TypeScript is based on structural subtyping. Structural typing is a way of relating types based solely on their members.
Read more >Documentation - Type Declarations - TypeScript
TypeScript includes declaration files for all of the standardized built-in APIs available in JavaScript runtimes. This includes things like methods and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, the release is out! Enjoy 😃
Added additional
when
option:type
which can be used for other custom templates like this but you should not need this forpromisify
as this is also a new built-in template 😃That will be a great addition! Looking forward to the next release 😋