Skip to content

Commit

Permalink
fix(types): Export PublishOptions type.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwalton committed Apr 13, 2022
1 parent 890497d commit 6d20252
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ChannelWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ interface SendToQueueMessage {
isTimedout: boolean;
}

interface PublishOptions extends Options.Publish {
export interface PublishOptions extends Options.Publish {
/** Message will be rejected after timeout ms */
timeout?: number;
}
Expand Down
15 changes: 15 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* eslint-disable @typescript-eslint/no-namespace */
import AmqpConnectionManager, {
AmqpConnectionManagerOptions,
ConnectionUrl,
IAmqpConnectionManager,
} from './AmqpConnectionManager.js';
import { PublishOptions } from './ChannelWrapper.js';

export type {
AmqpConnectionManagerOptions,
Expand All @@ -16,6 +18,19 @@ export type {
Channel,
} from './ChannelWrapper.js';

import { Options as AmqpLibOptions } from 'amqplib';

export namespace Options {
export type Connect = AmqpLibOptions.Connect;
export type AssertQueue = AmqpLibOptions.AssertQueue;
export type DeleteQueue = AmqpLibOptions.DeleteQueue;
export type AssertExchange = AmqpLibOptions.AssertExchange;
export type DeleteExchange = AmqpLibOptions.DeleteExchange;
export type Publish = PublishOptions;
export type Consume = AmqpLibOptions.Consume;
export type Get = AmqpLibOptions.Get;
}

export function connect(
urls: ConnectionUrl | ConnectionUrl[] | undefined | null,
options?: AmqpConnectionManagerOptions
Expand Down

0 comments on commit 6d20252

Please sign in to comment.