Skip to content

Commit

Permalink
fix(types): Allow passing object to connect() in addition to strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwalton committed Aug 26, 2021
1 parent b31c08c commit 516fd9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/AmqpConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { wait } from './helpers.js';
// Default heartbeat time.
const HEARTBEAT_IN_SECONDS = 5;

type ConnectionUrl =
export type ConnectionUrl =
| string
| amqp.Options.Connect
| { url: string; connectionOptions?: AmpqConnectionOptions };
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import AmqpConnectionManager, {
AmqpConnectionManagerOptions,
ConnectionUrl,
IAmqpConnectionManager,
} from './AmqpConnectionManager.js';

export type {
AmqpConnectionManagerOptions,
ConnectionUrl,
IAmqpConnectionManager as AmqpConnectionManager,
} from './AmqpConnectionManager.js';

export type { SetupFunc, CreateChannelOpts, default as ChannelWrapper } from './ChannelWrapper.js';
export type { CreateChannelOpts, default as ChannelWrapper, SetupFunc } from './ChannelWrapper.js';

export function connect(
urls: string[],
urls: ConnectionUrl | ConnectionUrl[] | undefined | null,
options?: AmqpConnectionManagerOptions
): IAmqpConnectionManager {
return new AmqpConnectionManager(urls, options);
Expand Down

0 comments on commit 516fd9f

Please sign in to comment.