- WebStorm, Rider
- Partial support, not enough intelli hints
- Toggle on TypeScript language service
- VSCode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* These are some types I found useful during some tricky TypeScript programming. | |
* Many of them are not too common or intuitive to come up with, this is why I'm writing them down here for future lookup. | |
* | |
* Note: Be careful when copy-pasting, some of these types depend on others. | |
*/ | |
/** | |
* Various utilities for working with classes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const endpointToPromiseMap = { | |
[ApiEndpoint.FetchAllGoals]: fetchUserGoals, | |
[ApiEndpoint.CurrentUser]: currentUser, | |
}; | |
type PromiseValue<T extends Promise<any>> = T extends Promise<infer U> | |
? U | |
: never; | |
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// String utils | |
// | |
// resources: | |
// -- mout, https://github.com/mout/mout/tree/master/src/string | |
/** | |
* "Safer" String.toLowerCase() | |
*/ | |
function lowerCase(str) { | |
return str.toLowerCase(); |
OlderNewer