-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
π¨βπ» Add types declaration file #18
base: master
Are you sure you want to change the base?
Conversation
* @param {string} uid - Unique function (task) identification as a string | ||
* @returns {Promise<string>} - Timer ID | ||
*/ | ||
setInterval(func: Function, delay: number, uid: string): Promise<string>; |
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.
I see some improvement can be done.
For example the cronjob function, task structure that added to database, etc
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.
it can be strings like in case of Redis, or what do you mean exactly?
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.
For what I means is that the Function
can be more specific in TypeScript.
The task: object
can also be standardize to a proper struct.
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.
@climba03003 function<any|Promise<any>>
?
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.
It would be something like
(
ready: (
(next: Date) => void) |
((callback: (err: Error, success: boolean) => void) => void)
)
) => Promise<void> | void
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.
- Callback is gone
- Should include only
ready
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.
@climba03003 lmk if it's good to go or we still want to change something
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.
lmk if it's good to go or we still want to change something
Sorry for that late reply. A bit busy.
The current one is good to go.
Closes #17
It should be good for the initial types.
I do not change the
package.json
since this package provide bothcjs
andesm
.Having the
types
field may get things weird in types resolving..d.cts
should match.cjs
and.d.ts
should match.js
automatically.