Skip to content

Commit

Permalink
chore: update for new Node typings
Browse files Browse the repository at this point in the history
  • Loading branch information
feywind committed Oct 12, 2023
1 parent 9776fab commit dd928b4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lease-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/message-queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<QueuedMessage>;
protected _closed = false;
protected abstract _sendBatch(batch: QueuedMessages): Promise<QueuedMessages>;
Expand Down
2 changes: 1 addition & 1 deletion src/message-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<StreamTracked>;

Expand Down
2 changes: 1 addition & 1 deletion src/publisher/message-queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions test/publisher/message-queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dd928b4

Please sign in to comment.