Skip to content

Commit

Permalink
export Message type, export underlaying ConfirmChannel, add "named" e…
Browse files Browse the repository at this point in the history
…xport for RabQ
  • Loading branch information
nmss committed Jun 28, 2023
1 parent e7d8c86 commit d44d518
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17,021 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
6 changes: 4 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import {MessageProperties} from 'amqplib';

export {ConfirmChannel} from 'amqplib';

type ACK = 'ACK';
type NACK = 'NACK';
type REJECT = 'REJECT';

type Result = ACK | NACK | REJECT;

type Message = {
export type Message = {
ACK: ACK;
NACK: NACK;
REJECT: REJECT;
Expand Down Expand Up @@ -69,7 +71,7 @@ interface Logger {
): void;
}

declare class RabQ {
export class RabQ {
start: () => Promise<boolean>;
stop: () => Promise<boolean>;
publish: (routingkey: string, content: Record<any, any>, properties?: Partial<MessageProperties>) => void;
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const EventEmitter = require('events');

const {ConfirmChannel} = require('amqplib/lib/channel_model.js');
const uuid = require('uuid');
const pWaitFor = require('p-wait-for');

Expand Down Expand Up @@ -256,3 +257,5 @@ class RabQ extends EventEmitter {
}

module.exports = RabQ;
module.exports.RabQ = RabQ;
module.exports.ConfirmChannel = ConfirmChannel;
Loading

0 comments on commit d44d518

Please sign in to comment.