-
Notifications
You must be signed in to change notification settings - Fork 5
main: add types declaration file #2
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
|
In |
|
I copied |
|
I think removing is better to keep type file simple. But I want to wait maintener's comment about this. |
wolfram77
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to specify type for:
compare functionmap function
all in one pace and reuse it everywhere?
|
If we remove the I also have made a few mistakes in the jsdoc, and have a few new methods in mind: |
|
I'm proposing to remove only type information in jsdoc comment. Because there is typescript base type information. ex.) /**
* Binary searches leftmost value in sorted array.
* @param x an array (sorted)
* @param v search value
* @param fn compare function (a, b)
* @returns first index of value | ~(index of closest value)
*/
export function bsearch<T>(x: T[], v: T, fn?: (a: T, b: T) => number): number; |
|
That is indeed better than having additional type information. Good suggestion. |
|
@wolfram77 I've made two commits, one with no alteration to the jsdoc blocks and the other which removes the type statements as @yumetodo showed in an example. Let me know if there are any further issues. |
|
@geopic Indeed type information looks much simpler now. This was indeed a much bigger effort than the other one. I have a few more ideas which i will put together on the todo list. I learnt a bit of typescript declaration from both of you. Thanks. |
wolfram77
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like test function can be merged too.


Resolves #1. Let me know if there are any issues.