-
Notifications
You must be signed in to change notification settings - Fork 86
[WIP] Add typescript type definition #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks great, just had discussion about having type-definitions last week! Is it easy to add a test testing at least some of those definitions as part of the test-suite, i.e. having type-script test-suite as well? |
|
I updated |
|
Yes, you can write a normal test file in typescript and check if it compiles |
|
The problem I have here is with the vararg fubctiobs, as typescriot only allows the vararg to be the last parameter. So some of the functions I cant type at all |
|
Will they be typeable if we provide a versions with varargs as the the last parameters? |
|
Yes, the vararg has to be the last one and there shouldnt be an optional argument too |
|
Thats the problem with forall too, the optional parameter is not the last one |
|
can typescript express dependencies, like We could add |
|
Sadly not yet. I can only type it: But typescript allows polymorphic type declarations, so you can just copy & paste this until 10 params (most people use less) and have the any vararg declaration for the rare occasions you use more |
|
Ok, I think I got it mostly
|
|
I think we dont need extra typescript functions. The way this is here now should be sufficient |
|
|
|
yeah, but the function that is generated, what does it accept? |
|
The noteable thing here, is that |
|
function accepts values of function const(x) {
return function (y) { return x; }
} |
|
Ahh, ok. And what is the difference between |
|
I think that most of the use cases are now covered, the either stuff can be added later on if there is demand for it |
|
Merged as a part of #202 |
No description provided.