diff --git a/src/lease-manager.ts b/src/lease-manager.ts index 084f4b759..d31c7111f 100644 --- a/src/lease-manager.ts +++ b/src/lease-manager.ts @@ -64,7 +64,7 @@ export class LeaseManager extends EventEmitter { private _options!: FlowControlOptions; private _pending: Message[]; private _subscriber: Subscriber; - private _timer?: NodeJS.Timer; + private _timer?: NodeJS.Timeout; constructor(sub: Subscriber, options = {}) { super(); diff --git a/src/message-queues.ts b/src/message-queues.ts index 77da36bd9..e40be2265 100644 --- a/src/message-queues.ts +++ b/src/message-queues.ts @@ -112,7 +112,7 @@ export abstract class MessageQueue { protected _options!: BatchOptions; protected _requests: QueuedMessages; protected _subscriber: Subscriber; - protected _timer?: NodeJS.Timer; + protected _timer?: NodeJS.Timeout; protected _retrier: ExponentialRetry; protected _closed = false; protected abstract _sendBatch(batch: QueuedMessages): Promise; diff --git a/src/message-stream.ts b/src/message-stream.ts index 95df7e8aa..7ea275ee5 100644 --- a/src/message-stream.ts +++ b/src/message-stream.ts @@ -141,7 +141,7 @@ interface StreamTracked { * @param {MessageStreamOptions} [options] The message stream options. */ export class MessageStream extends PassThrough { - private _keepAliveHandle?: NodeJS.Timer; + private _keepAliveHandle?: NodeJS.Timeout; private _options: MessageStreamOptions; private _retrier: ExponentialRetry; diff --git a/src/publisher/message-queues.ts b/src/publisher/message-queues.ts index 3ff88be25..be5742cbf 100644 --- a/src/publisher/message-queues.ts +++ b/src/publisher/message-queues.ts @@ -34,7 +34,7 @@ import {promisify} from 'util'; export abstract class MessageQueue extends EventEmitter { batchOptions: BatchPublishOptions; publisher: Publisher; - pending?: NodeJS.Timer; + pending?: NodeJS.Timeout; constructor(publisher: Publisher) { super(); diff --git a/test/publisher/message-queues.ts b/test/publisher/message-queues.ts index 4c62917e7..a74b60f53 100644 --- a/test/publisher/message-queues.ts +++ b/test/publisher/message-queues.ts @@ -290,7 +290,7 @@ describe('Message Queues', () => { const maxMilliseconds = 1234; queue.batchOptions = {maxMilliseconds}; - queue.pending = 1234 as unknown as NodeJS.Timer; + queue.pending = 1234 as unknown as NodeJS.Timeout; queue.add(fakeMessage, spy); clock.tick(maxMilliseconds); @@ -560,7 +560,7 @@ describe('Message Queues', () => { it('should noop after adding if a publish is already pending', () => { const stub = sandbox.stub(queue, 'beginNextPublish'); - queue.pending = 1234 as unknown as NodeJS.Timer; + queue.pending = 1234 as unknown as NodeJS.Timeout; queue.add(fakeMessage, spy); assert.strictEqual(stub.callCount, 0); @@ -657,7 +657,7 @@ describe('Message Queues', () => { }); it('should cancel any pending publishes', () => { - const fakeHandle = 1234 as unknown as NodeJS.Timer; + const fakeHandle = 1234 as unknown as NodeJS.Timeout; const stub = sandbox.stub(global, 'clearTimeout'); queue.pending = fakeHandle;