Better typing for Timers.

This commit is contained in:
Richard Moore 2020-02-04 00:50:27 -05:00
parent edb7c5da91
commit 5622f703d9
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
1 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ export function fetchJson(connection: string | ConnectionInfo, json?: string, pr
options.headers = flatHeaders;
const runningTimeout = (function() {
let timer: any = null;
let timer: NodeJS.Timer = null;
const promise = new Promise(function(resolve, reject) {
if (timeout) {
timer = setTimeout(() => {
@ -232,7 +232,7 @@ export function poll(func: () => Promise<any>, options?: PollOptions): Promise<a
return new Promise(function(resolve, reject) {
let timer: any = null;
let timer: NodeJS.Timer = null;
let done: boolean = false;
// Returns true if cancel was successful. Unsuccessful cancel means we're already done.