Skip to content

Commit

Permalink
fix: Upgrade promise-breaker to 6.0.0 to fix typescript imports.
Browse files Browse the repository at this point in the history
fix #234
  • Loading branch information
jwalton committed Aug 11, 2022
1 parent 64c1864 commit c9aff08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dist/**/*"
],
"dependencies": {
"promise-breaker": "^5.0.0"
"promise-breaker": "^6.0.0"
},
"peerDependencies": {
"amqplib": "*"
Expand Down
10 changes: 5 additions & 5 deletions src/AmqpConnectionManager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import amqp, { Connection } from 'amqplib';
import * as amqp from 'amqplib';
import { EventEmitter, once } from 'events';
import { TcpSocketConnectOpts } from 'net';
import pb from 'promise-breaker';
Expand All @@ -16,7 +16,7 @@ export type ConnectionUrl =
| { url: string; connectionOptions?: AmpqConnectionOptions };

export interface ConnectListener {
(arg: { connection: Connection; url: string | amqp.Options.Connect }): void;
(arg: { connection: amqp.Connection; url: string | amqp.Options.Connect }): void;
}

export interface ConnectFailedListener {
Expand Down Expand Up @@ -131,7 +131,7 @@ export interface IAmqpConnectionManager {
isConnected(): boolean;

/** The current connection. */
readonly connection: Connection | undefined;
readonly connection: amqp.Connection | undefined;

/** Returns the number of registered channels. */
readonly channelCount: number;
Expand All @@ -151,7 +151,7 @@ export default class AmqpConnectionManager extends EventEmitter implements IAmqp
private _closed = false;
private _cancelRetriesHandler?: () => void;
private _connectPromise?: Promise<null>;
private _currentConnection?: Connection;
private _currentConnection?: amqp.Connection;
private _findServers:
| ((callback: (urls: ConnectionUrl | ConnectionUrl[]) => void) => void)
| (() => Promise<ConnectionUrl | ConnectionUrl[]>);
Expand Down Expand Up @@ -322,7 +322,7 @@ export default class AmqpConnectionManager extends EventEmitter implements IAmqp
}

/** The current connection. */
get connection(): Connection | undefined {
get connection(): amqp.Connection | undefined {
return this._currentConnection;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ChannelWrapper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type * as amqplib from 'amqplib';
import { Options } from 'amqplib';
import crypto from 'crypto';
import * as crypto from 'crypto';
import { EventEmitter } from 'events';
import pb from 'promise-breaker';
import { promisify } from 'util';
Expand Down

0 comments on commit c9aff08

Please sign in to comment.