@types/amqplib

  • Version 0.8.0
  • Published
  • 17 kB
  • 2 dependencies
  • MIT license

Install

npm i @types/amqplib
yarn add @types/amqplib
pnpm add @types/amqplib

Overview

TypeScript definitions for amqplib

Index

Variables

variable credentials

const credentials: {
amqplain(
username: string,
password: string
): { mechanism: string; response(): any; username: string; password: string };
external(): { mechanism: string; response(): Buffer };
plain(
username: string,
password: string
): { mechanism: string; response(): any; username: string; password: string };
};

    Functions

    function connect

    connect: (url: string | Options.Connect, socketOptions?: any) => any;

      Interfaces

      interface Channel

      interface Channel extends events.EventEmitter {}

        method ack

        ack: (message: Message, allUpTo?: boolean) => void;

          method ackAll

          ackAll: () => void;

            method assertExchange

            assertExchange: (
            exchange: string,
            type: 'direct' | 'topic' | 'headers' | 'fanout' | 'match' | string,
            options?: Options.AssertExchange
            ) => any;

              method assertQueue

              assertQueue: (queue: string, options?: Options.AssertQueue) => any;

                method bindExchange

                bindExchange: (
                destination: string,
                source: string,
                pattern: string,
                args?: any
                ) => any;

                  method bindQueue

                  bindQueue: (queue: string, source: string, pattern: string, args?: any) => any;

                    method cancel

                    cancel: (consumerTag: string) => any;

                      method checkExchange

                      checkExchange: (exchange: string) => any;

                        method checkQueue

                        checkQueue: (queue: string) => any;

                          method close

                          close: () => any;

                            method consume

                            consume: (
                            queue: string,
                            onMessage: (msg: ConsumeMessage | null) => void,
                            options?: Options.Consume
                            ) => any;

                              method deleteExchange

                              deleteExchange: (exchange: string, options?: Options.DeleteExchange) => any;

                                method deleteQueue

                                deleteQueue: (queue: string, options?: Options.DeleteQueue) => any;

                                  method get

                                  get: (queue: string, options?: Options.Get) => any;

                                    method nack

                                    nack: (message: Message, allUpTo?: boolean, requeue?: boolean) => void;

                                      method nackAll

                                      nackAll: (requeue?: boolean) => void;

                                        method prefetch

                                        prefetch: (count: number, global?: boolean) => any;

                                          method publish

                                          publish: (
                                          exchange: string,
                                          routingKey: string,
                                          content: any,
                                          options?: Options.Publish
                                          ) => boolean;

                                            method purgeQueue

                                            purgeQueue: (queue: string) => any;

                                              method recover

                                              recover: () => any;

                                                method reject

                                                reject: (message: Message, requeue?: boolean) => void;

                                                  method sendToQueue

                                                  sendToQueue: (queue: string, content: any, options?: Options.Publish) => boolean;

                                                    method unbindExchange

                                                    unbindExchange: (
                                                    destination: string,
                                                    source: string,
                                                    pattern: string,
                                                    args?: any
                                                    ) => any;

                                                      method unbindQueue

                                                      unbindQueue: (queue: string, source: string, pattern: string, args?: any) => any;

                                                        interface CommonMessageFields

                                                        interface CommonMessageFields {}

                                                          property deliveryTag

                                                          deliveryTag: number;

                                                            property exchange

                                                            exchange: string;

                                                              property redelivered

                                                              redelivered: boolean;

                                                                property routingKey

                                                                routingKey: string;

                                                                  interface ConfirmChannel

                                                                  interface ConfirmChannel extends Channel {}

                                                                    method publish

                                                                    publish: (
                                                                    exchange: string,
                                                                    routingKey: string,
                                                                    content: any,
                                                                    options?: Options.Publish,
                                                                    callback?: (err: any, ok: Replies.Empty) => void
                                                                    ) => boolean;

                                                                      method sendToQueue

                                                                      sendToQueue: (
                                                                      queue: string,
                                                                      content: any,
                                                                      options?: Options.Publish,
                                                                      callback?: (err: any, ok: Replies.Empty) => void
                                                                      ) => boolean;

                                                                        method waitForConfirms

                                                                        waitForConfirms: () => any;

                                                                          interface Connection

                                                                          interface Connection extends events.EventEmitter {}

                                                                            property connection

                                                                            connection: {
                                                                            serverProperties: ServerProperties;
                                                                            };

                                                                              method close

                                                                              close: () => any;

                                                                                method createChannel

                                                                                createChannel: () => any;

                                                                                  method createConfirmChannel

                                                                                  createConfirmChannel: () => any;

                                                                                    interface ConsumeMessage

                                                                                    interface ConsumeMessage extends Message {}

                                                                                      property fields

                                                                                      fields: ConsumeMessageFields;

                                                                                        interface ConsumeMessageFields

                                                                                        interface ConsumeMessageFields extends CommonMessageFields {}

                                                                                          property deliveryTag

                                                                                          deliveryTag: number;

                                                                                            interface GetMessage

                                                                                            interface GetMessage extends Message {}

                                                                                              property fields

                                                                                              fields: GetMessageFields;

                                                                                                interface GetMessageFields

                                                                                                interface GetMessageFields extends CommonMessageFields {}

                                                                                                  property messageCount

                                                                                                  messageCount: number;

                                                                                                    interface Message

                                                                                                    interface Message {}

                                                                                                      property content

                                                                                                      content: Buffer;

                                                                                                        property fields

                                                                                                        fields: MessageFields;

                                                                                                          property properties

                                                                                                          properties: MessageProperties;

                                                                                                            interface MessageFields

                                                                                                            interface MessageFields extends CommonMessageFields {}

                                                                                                              property consumerTag

                                                                                                              consumerTag?: string;

                                                                                                                property messageCount

                                                                                                                messageCount?: number;

                                                                                                                  interface MessageProperties

                                                                                                                  interface MessageProperties {}

                                                                                                                    property appId

                                                                                                                    appId: any | undefined;

                                                                                                                      property clusterId

                                                                                                                      clusterId: any | undefined;

                                                                                                                        property contentEncoding

                                                                                                                        contentEncoding: any | undefined;

                                                                                                                          property contentType

                                                                                                                          contentType: any | undefined;

                                                                                                                            property correlationId

                                                                                                                            correlationId: any | undefined;

                                                                                                                              property deliveryMode

                                                                                                                              deliveryMode: any | undefined;

                                                                                                                                property expiration

                                                                                                                                expiration: any | undefined;

                                                                                                                                  property headers

                                                                                                                                  headers: MessagePropertyHeaders;

                                                                                                                                    property messageId

                                                                                                                                    messageId: any | undefined;

                                                                                                                                      property priority

                                                                                                                                      priority: any | undefined;

                                                                                                                                        property replyTo

                                                                                                                                        replyTo: any | undefined;

                                                                                                                                          property timestamp

                                                                                                                                          timestamp: any | undefined;

                                                                                                                                            property type

                                                                                                                                            type: any | undefined;

                                                                                                                                              property userId

                                                                                                                                              userId: any | undefined;

                                                                                                                                                interface MessagePropertyHeaders

                                                                                                                                                interface MessagePropertyHeaders {}

                                                                                                                                                  property "x-death"

                                                                                                                                                  'x-death'?: XDeath[];

                                                                                                                                                    property "x-first-death-exchange"

                                                                                                                                                    'x-first-death-exchange'?: string;

                                                                                                                                                      property "x-first-death-queue"

                                                                                                                                                      'x-first-death-queue'?: string;

                                                                                                                                                        property "x-first-death-reason"

                                                                                                                                                        'x-first-death-reason'?: string;

                                                                                                                                                          index signature

                                                                                                                                                          [key: string]: any;

                                                                                                                                                            interface ServerProperties

                                                                                                                                                            interface ServerProperties {}

                                                                                                                                                              property copyright

                                                                                                                                                              copyright?: string;

                                                                                                                                                                property host

                                                                                                                                                                host: string;

                                                                                                                                                                  property information

                                                                                                                                                                  information: string;

                                                                                                                                                                    property platform

                                                                                                                                                                    platform: string;

                                                                                                                                                                      property product

                                                                                                                                                                      product: string;

                                                                                                                                                                        property version

                                                                                                                                                                        version: string;

                                                                                                                                                                          index signature

                                                                                                                                                                          [key: string]: string | undefined;

                                                                                                                                                                            interface XDeath

                                                                                                                                                                            interface XDeath {}

                                                                                                                                                                              property "original-expiration"

                                                                                                                                                                              'original-expiration'?: any;

                                                                                                                                                                                property "routing-keys"

                                                                                                                                                                                'routing-keys': string[];

                                                                                                                                                                                  property count

                                                                                                                                                                                  count: number;

                                                                                                                                                                                    property exchange

                                                                                                                                                                                    exchange: string;

                                                                                                                                                                                      property queue

                                                                                                                                                                                      queue: string;

                                                                                                                                                                                        property reason

                                                                                                                                                                                        reason: 'rejected' | 'expired' | 'maxlen';

                                                                                                                                                                                          property time

                                                                                                                                                                                          time: {
                                                                                                                                                                                          '!': 'timestamp';
                                                                                                                                                                                          value: number;
                                                                                                                                                                                          };

                                                                                                                                                                                            Namespaces

                                                                                                                                                                                            namespace Options

                                                                                                                                                                                            namespace Options {}

                                                                                                                                                                                              interface AssertExchange

                                                                                                                                                                                              interface AssertExchange {}

                                                                                                                                                                                                property alternateExchange

                                                                                                                                                                                                alternateExchange?: string;

                                                                                                                                                                                                  property arguments

                                                                                                                                                                                                  arguments?: any;

                                                                                                                                                                                                    property autoDelete

                                                                                                                                                                                                    autoDelete?: boolean;

                                                                                                                                                                                                      property durable

                                                                                                                                                                                                      durable?: boolean;

                                                                                                                                                                                                        property internal

                                                                                                                                                                                                        internal?: boolean;

                                                                                                                                                                                                          interface AssertQueue

                                                                                                                                                                                                          interface AssertQueue {}

                                                                                                                                                                                                            property arguments

                                                                                                                                                                                                            arguments?: any;

                                                                                                                                                                                                              property autoDelete

                                                                                                                                                                                                              autoDelete?: boolean;

                                                                                                                                                                                                                property deadLetterExchange

                                                                                                                                                                                                                deadLetterExchange?: string;

                                                                                                                                                                                                                  property deadLetterRoutingKey

                                                                                                                                                                                                                  deadLetterRoutingKey?: string;

                                                                                                                                                                                                                    property durable

                                                                                                                                                                                                                    durable?: boolean;

                                                                                                                                                                                                                      property exclusive

                                                                                                                                                                                                                      exclusive?: boolean;

                                                                                                                                                                                                                        property expires

                                                                                                                                                                                                                        expires?: number;

                                                                                                                                                                                                                          property maxLength

                                                                                                                                                                                                                          maxLength?: number;

                                                                                                                                                                                                                            property maxPriority

                                                                                                                                                                                                                            maxPriority?: number;

                                                                                                                                                                                                                              property messageTtl

                                                                                                                                                                                                                              messageTtl?: number;

                                                                                                                                                                                                                                interface Connect

                                                                                                                                                                                                                                interface Connect {}

                                                                                                                                                                                                                                  property frameMax

                                                                                                                                                                                                                                  frameMax?: number;
                                                                                                                                                                                                                                  • The size in bytes of the maximum frame allowed over the connection. 0 means no limit (but since frames have a size field which is an unsigned 32 bit integer, it’s perforce 2^32 - 1).

                                                                                                                                                                                                                                    Default value: 0x1000 (4kb) - That's the allowed minimum, it will fit many purposes

                                                                                                                                                                                                                                  property heartbeat

                                                                                                                                                                                                                                  heartbeat?: number;
                                                                                                                                                                                                                                  • The period of the connection heartbeat in seconds.

                                                                                                                                                                                                                                    Default value: 0

                                                                                                                                                                                                                                  property hostname

                                                                                                                                                                                                                                  hostname?: string;
                                                                                                                                                                                                                                  • Hostname used for connecting to the server.

                                                                                                                                                                                                                                    Default value: 'localhost'

                                                                                                                                                                                                                                  property locale

                                                                                                                                                                                                                                  locale?: string;
                                                                                                                                                                                                                                  • The desired locale for error messages. RabbitMQ only ever uses en_US

                                                                                                                                                                                                                                    Default value: 'en_US'

                                                                                                                                                                                                                                  property password

                                                                                                                                                                                                                                  password?: string;
                                                                                                                                                                                                                                  • Password used for authenticating against the server.

                                                                                                                                                                                                                                    Default value: 'guest'

                                                                                                                                                                                                                                  property port

                                                                                                                                                                                                                                  port?: number;
                                                                                                                                                                                                                                  • Port used for connecting to the server.

                                                                                                                                                                                                                                    Default value: 5672

                                                                                                                                                                                                                                  property protocol

                                                                                                                                                                                                                                  protocol?: string;
                                                                                                                                                                                                                                  • The to be used protocol

                                                                                                                                                                                                                                    Default value: 'amqp'

                                                                                                                                                                                                                                  property username

                                                                                                                                                                                                                                  username?: string;
                                                                                                                                                                                                                                  • Username used for authenticating against the server.

                                                                                                                                                                                                                                    Default value: 'guest'

                                                                                                                                                                                                                                  property vhost

                                                                                                                                                                                                                                  vhost?: string;
                                                                                                                                                                                                                                  • What VHost shall be used.

                                                                                                                                                                                                                                    Default value: '/'

                                                                                                                                                                                                                                  interface Consume

                                                                                                                                                                                                                                  interface Consume {}

                                                                                                                                                                                                                                    property arguments

                                                                                                                                                                                                                                    arguments?: any;

                                                                                                                                                                                                                                      property consumerTag

                                                                                                                                                                                                                                      consumerTag?: string;

                                                                                                                                                                                                                                        property exclusive

                                                                                                                                                                                                                                        exclusive?: boolean;

                                                                                                                                                                                                                                          property noAck

                                                                                                                                                                                                                                          noAck?: boolean;

                                                                                                                                                                                                                                            property noLocal

                                                                                                                                                                                                                                            noLocal?: boolean;

                                                                                                                                                                                                                                              property priority

                                                                                                                                                                                                                                              priority?: number;

                                                                                                                                                                                                                                                interface DeleteExchange

                                                                                                                                                                                                                                                interface DeleteExchange {}

                                                                                                                                                                                                                                                  property ifUnused

                                                                                                                                                                                                                                                  ifUnused?: boolean;

                                                                                                                                                                                                                                                    interface DeleteQueue

                                                                                                                                                                                                                                                    interface DeleteQueue {}

                                                                                                                                                                                                                                                      property ifEmpty

                                                                                                                                                                                                                                                      ifEmpty?: boolean;

                                                                                                                                                                                                                                                        property ifUnused

                                                                                                                                                                                                                                                        ifUnused?: boolean;

                                                                                                                                                                                                                                                          interface Get

                                                                                                                                                                                                                                                          interface Get {}

                                                                                                                                                                                                                                                            property noAck

                                                                                                                                                                                                                                                            noAck?: boolean;

                                                                                                                                                                                                                                                              interface Publish

                                                                                                                                                                                                                                                              interface Publish {}

                                                                                                                                                                                                                                                                property appId

                                                                                                                                                                                                                                                                appId?: string;

                                                                                                                                                                                                                                                                  property BCC

                                                                                                                                                                                                                                                                  BCC?: string | string[];

                                                                                                                                                                                                                                                                    property CC

                                                                                                                                                                                                                                                                    CC?: string | string[];

                                                                                                                                                                                                                                                                      property contentEncoding

                                                                                                                                                                                                                                                                      contentEncoding?: string;

                                                                                                                                                                                                                                                                        property contentType

                                                                                                                                                                                                                                                                        contentType?: string;

                                                                                                                                                                                                                                                                          property correlationId

                                                                                                                                                                                                                                                                          correlationId?: string;

                                                                                                                                                                                                                                                                            property deliveryMode

                                                                                                                                                                                                                                                                            deliveryMode?: boolean | number;

                                                                                                                                                                                                                                                                              property expiration

                                                                                                                                                                                                                                                                              expiration?: string | number;

                                                                                                                                                                                                                                                                                property headers

                                                                                                                                                                                                                                                                                headers?: any;

                                                                                                                                                                                                                                                                                  property mandatory

                                                                                                                                                                                                                                                                                  mandatory?: boolean;

                                                                                                                                                                                                                                                                                    property messageId

                                                                                                                                                                                                                                                                                    messageId?: string;

                                                                                                                                                                                                                                                                                      property persistent

                                                                                                                                                                                                                                                                                      persistent?: boolean;

                                                                                                                                                                                                                                                                                        property priority

                                                                                                                                                                                                                                                                                        priority?: number;

                                                                                                                                                                                                                                                                                          property replyTo

                                                                                                                                                                                                                                                                                          replyTo?: string;

                                                                                                                                                                                                                                                                                            property timestamp

                                                                                                                                                                                                                                                                                            timestamp?: number;

                                                                                                                                                                                                                                                                                              property type

                                                                                                                                                                                                                                                                                              type?: string;

                                                                                                                                                                                                                                                                                                property userId

                                                                                                                                                                                                                                                                                                userId?: string;

                                                                                                                                                                                                                                                                                                  namespace Replies

                                                                                                                                                                                                                                                                                                  namespace Replies {}

                                                                                                                                                                                                                                                                                                    interface AssertExchange

                                                                                                                                                                                                                                                                                                    interface AssertExchange {}

                                                                                                                                                                                                                                                                                                      property exchange

                                                                                                                                                                                                                                                                                                      exchange: string;

                                                                                                                                                                                                                                                                                                        interface AssertQueue

                                                                                                                                                                                                                                                                                                        interface AssertQueue {}

                                                                                                                                                                                                                                                                                                          property consumerCount

                                                                                                                                                                                                                                                                                                          consumerCount: number;

                                                                                                                                                                                                                                                                                                            property messageCount

                                                                                                                                                                                                                                                                                                            messageCount: number;

                                                                                                                                                                                                                                                                                                              property queue

                                                                                                                                                                                                                                                                                                              queue: string;

                                                                                                                                                                                                                                                                                                                interface Consume

                                                                                                                                                                                                                                                                                                                interface Consume {}

                                                                                                                                                                                                                                                                                                                  property consumerTag

                                                                                                                                                                                                                                                                                                                  consumerTag: string;

                                                                                                                                                                                                                                                                                                                    interface DeleteQueue

                                                                                                                                                                                                                                                                                                                    interface DeleteQueue {}

                                                                                                                                                                                                                                                                                                                      property messageCount

                                                                                                                                                                                                                                                                                                                      messageCount: number;

                                                                                                                                                                                                                                                                                                                        interface Empty

                                                                                                                                                                                                                                                                                                                        interface Empty {}

                                                                                                                                                                                                                                                                                                                          interface PurgeQueue

                                                                                                                                                                                                                                                                                                                          interface PurgeQueue {}

                                                                                                                                                                                                                                                                                                                            property messageCount

                                                                                                                                                                                                                                                                                                                            messageCount: number;

                                                                                                                                                                                                                                                                                                                              Package Files (2)

                                                                                                                                                                                                                                                                                                                              Dependencies (2)

                                                                                                                                                                                                                                                                                                                              Dev Dependencies (0)

                                                                                                                                                                                                                                                                                                                              No dev dependencies.

                                                                                                                                                                                                                                                                                                                              Peer Dependencies (0)

                                                                                                                                                                                                                                                                                                                              No peer dependencies.

                                                                                                                                                                                                                                                                                                                              Badge

                                                                                                                                                                                                                                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/amqplib.

                                                                                                                                                                                                                                                                                                                              • Markdown
                                                                                                                                                                                                                                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/amqplib)
                                                                                                                                                                                                                                                                                                                              • HTML
                                                                                                                                                                                                                                                                                                                                <a href="https://www.jsdocs.io/package/@types/amqplib"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>