TypeScript typings
See original GitHub issueI created a pull request in the DefinitelyTyped repository: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/31953
It’s basically working, but some things could be nicer (or better typed):
- Generics for
Spec
andResult
- Typings if
SpecValue
is a function
Especially point 2 is hard for me to figure out…
Example(s):
const spec = {
a: [[ values => R.all((val) => false, values), 'msg']],
b: R.map(R.always([[(val) => false, 'msg']])),
c: R.map(() => [[(val) => false, 'msg']])
}
I have no clue what those function signatures for a
, b
and c
are. I know from your source code, that those functions have a single argument (= value
). But I have no clue about the return types.
I’m no Ramda / Functional Programming export. Though some help would be appreciated 😄 Especially when it comes to currying I’m lost 😆
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:31
Top Results From Across the Web
typings/typings: *DEPRECATED* The TypeScript Definition ...
Typings is the simple way to manage and install TypeScript definitions. It uses typings.json , which can resolve to the Typings Registry, GitHub,...
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 >Typescript Typings: The Complete Guide: @types Compiler ...
Typescript Typings - The Complete Guide To Type Definitions: @types, Compiler Opt-In Types: When To Use Each and Why?
Read more >Types of TypeScript typings - Medium
A brief overview of the different approaches TypeScript offers to make our code type safe, in the context of React.
Read more >Dynamic Static Typing In TypeScript - Smashing Magazine
In this article, we look at some of the more advanced features of TypeScript, like union types, conditional types, template literal types, ...
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
Thanks to jack-williams we now have working booleans! https://github.com/Microsoft/TypeScript/issues/29477
I didn’t know about this “distributive conditional types” in TypeScript. Really weird stuff 😆
Yes this works. But again there are problems with type inference for tuples 😦
And the other problem is, that you are allowed to write
(val) => (val) => (val) => ......