-
Notifications
You must be signed in to change notification settings - Fork 10
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
Typescript declaration file #7
Comments
I thought it was working, but that was just a bug. It's still under revision... |
Hi, Thanks for taking the time to do this! Since you reminded me, I have opened a PR #8 and tried to complete the work. Currently, the declaration looks like this: /// <reference types="node" />
import { EventEmitter } from 'events';
declare type Status = 'running' | 'paused' | 'stopped';
declare class Timer extends EventEmitter {
private _interval;
private _stopwatch;
private _duration;
private _endTime;
private _pauseTime;
private _status;
private _timeoutID?;
constructor({ interval, stopwatch }?: {
interval?: number | undefined;
stopwatch?: boolean | undefined;
});
start(duration: number, interval?: number): void;
stop(): void;
pause(): void;
resume(): void;
private _changeStatus;
private tick;
readonly time: number;
readonly duration: number;
readonly status: Status;
}
export default Timer; I tried to compare with the file you've made, even though there are still some differences. Also, I like the doc comments you made in your file. If you have time it would be great if you could pull request them directly into the source code of |
I have merged the PR, so closing this for now. |
I've made a declaration file for typescript. There may need to be changes, but it seems pretty close to the source. Let me know what you think and I can make a pull request at some point.
https://gist.github.com/SKCrawford/9336481a7213875519a59f2487a83ce3
The text was updated successfully, but these errors were encountered: