@types/amqplib

  • Version 0.10.6
  • Published
  • 17.8 kB
  • 1 dependency
  • 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(): Buffer; username: string; password: string };
external(): { mechanism: string; response(): Buffer };
plain(
username: string,
password: string
): { mechanism: string; response(): Buffer; username: string; password: string };
};

    Functions

    function connect

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

      Interfaces

      interface Channel

      interface Channel extends events.EventEmitter {}

        property connection

        connection: Connection;

          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
              ) => Promise<Replies.AssertExchange>;

                method assertQueue

                assertQueue: (
                queue: string,
                options?: Options.AssertQueue
                ) => Promise<Replies.AssertQueue>;

                  method bindExchange

                  bindExchange: (
                  destination: string,
                  source: string,
                  pattern: string,
                  args?: any
                  ) => Promise<Replies.Empty>;

                    method bindQueue

                    bindQueue: (
                    queue: string,
                    source: string,
                    pattern: string,
                    args?: any
                    ) => Promise<Replies.Empty>;

                      method cancel

                      cancel: (consumerTag: string) => Promise<Replies.Empty>;

                        method checkExchange

                        checkExchange: (exchange: string) => Promise<Replies.Empty>;

                          method checkQueue

                          checkQueue: (queue: string) => Promise<Replies.AssertQueue>;

                            method close

                            close: () => Promise<void>;

                              method consume

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

                                method deleteExchange

                                deleteExchange: (
                                exchange: string,
                                options?: Options.DeleteExchange
                                ) => Promise<Replies.Empty>;

                                  method deleteQueue

                                  deleteQueue: (
                                  queue: string,
                                  options?: Options.DeleteQueue
                                  ) => Promise<Replies.DeleteQueue>;

                                    method get

                                    get: (queue: string, options?: Options.Get) => Promise<GetMessage | false>;

                                      method nack

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

                                        method nackAll

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

                                          method prefetch

                                          prefetch: (count: number, global?: boolean) => Promise<Replies.Empty>;

                                            method publish

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

                                              method purgeQueue

                                              purgeQueue: (queue: string) => Promise<Replies.PurgeQueue>;

                                                method recover

                                                recover: () => Promise<Replies.Empty>;

                                                  method reject

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

                                                    method sendToQueue

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

                                                      method unbindExchange

                                                      unbindExchange: (
                                                      destination: string,
                                                      source: string,
                                                      pattern: string,
                                                      args?: any
                                                      ) => Promise<Replies.Empty>;

                                                        method unbindQueue

                                                        unbindQueue: (
                                                        queue: string,
                                                        source: string,
                                                        pattern: string,
                                                        args?: any
                                                        ) => Promise<Replies.Empty>;

                                                          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: Buffer,
                                                                      options?: Options.Publish,
                                                                      callback?: (err: any, ok: Replies.Empty) => void
                                                                      ) => boolean;

                                                                        method sendToQueue

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

                                                                          method waitForConfirms

                                                                          waitForConfirms: () => Promise<void>;

                                                                            interface Connection

                                                                            interface Connection extends events.EventEmitter {}

                                                                              property connection

                                                                              connection: {
                                                                              serverProperties: ServerProperties;
                                                                              };

                                                                                method close

                                                                                close: () => Promise<void>;

                                                                                  method createChannel

                                                                                  createChannel: () => Promise<Channel>;

                                                                                    method createConfirmChannel

                                                                                    createConfirmChannel: () => Promise<ConfirmChannel>;

                                                                                      method updateSecret

                                                                                      updateSecret: (newSecret: Buffer, reason: string) => Promise<void>;

                                                                                        interface ConsumeMessage

                                                                                        interface ConsumeMessage extends Message {}

                                                                                          property fields

                                                                                          fields: ConsumeMessageFields;

                                                                                            interface ConsumeMessageFields

                                                                                            interface ConsumeMessageFields extends CommonMessageFields {}

                                                                                              property consumerTag

                                                                                              consumerTag: string;

                                                                                                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 | undefined;

                                                                                                                    property messageCount

                                                                                                                    messageCount?: number | undefined;

                                                                                                                      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 | undefined;

                                                                                                                                        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[] | undefined;

                                                                                                                                                        property "x-first-death-exchange"

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

                                                                                                                                                          property "x-first-death-queue"

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

                                                                                                                                                            property "x-first-death-reason"

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

                                                                                                                                                              index signature

                                                                                                                                                              [key: string]: any;

                                                                                                                                                                interface ServerProperties

                                                                                                                                                                interface ServerProperties {}

                                                                                                                                                                  property copyright

                                                                                                                                                                  copyright?: string | undefined;

                                                                                                                                                                    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 | undefined;

                                                                                                                                                                                                      property arguments

                                                                                                                                                                                                      arguments?: any;

                                                                                                                                                                                                        property autoDelete

                                                                                                                                                                                                        autoDelete?: boolean | undefined;

                                                                                                                                                                                                          property durable

                                                                                                                                                                                                          durable?: boolean | undefined;

                                                                                                                                                                                                            property internal

                                                                                                                                                                                                            internal?: boolean | undefined;

                                                                                                                                                                                                              interface AssertQueue

                                                                                                                                                                                                              interface AssertQueue {}

                                                                                                                                                                                                                property arguments

                                                                                                                                                                                                                arguments?: any;

                                                                                                                                                                                                                  property autoDelete

                                                                                                                                                                                                                  autoDelete?: boolean | undefined;

                                                                                                                                                                                                                    property deadLetterExchange

                                                                                                                                                                                                                    deadLetterExchange?: string | undefined;

                                                                                                                                                                                                                      property deadLetterRoutingKey

                                                                                                                                                                                                                      deadLetterRoutingKey?: string | undefined;

                                                                                                                                                                                                                        property durable

                                                                                                                                                                                                                        durable?: boolean | undefined;

                                                                                                                                                                                                                          property exclusive

                                                                                                                                                                                                                          exclusive?: boolean | undefined;

                                                                                                                                                                                                                            property expires

                                                                                                                                                                                                                            expires?: number | undefined;

                                                                                                                                                                                                                              property maxLength

                                                                                                                                                                                                                              maxLength?: number | undefined;

                                                                                                                                                                                                                                property maxPriority

                                                                                                                                                                                                                                maxPriority?: number | undefined;

                                                                                                                                                                                                                                  property messageTtl

                                                                                                                                                                                                                                  messageTtl?: number | undefined;

                                                                                                                                                                                                                                    interface Connect

                                                                                                                                                                                                                                    interface Connect {}

                                                                                                                                                                                                                                      property frameMax

                                                                                                                                                                                                                                      frameMax?: number | undefined;
                                                                                                                                                                                                                                      • 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 | undefined;
                                                                                                                                                                                                                                      • The period of the connection heartbeat in seconds.

                                                                                                                                                                                                                                        Default value: 0

                                                                                                                                                                                                                                      property hostname

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

                                                                                                                                                                                                                                        Default value: 'localhost'

                                                                                                                                                                                                                                      property locale

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

                                                                                                                                                                                                                                        Default value: 'en_US'

                                                                                                                                                                                                                                      property password

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

                                                                                                                                                                                                                                        Default value: 'guest'

                                                                                                                                                                                                                                      property port

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

                                                                                                                                                                                                                                        Default value: 5672

                                                                                                                                                                                                                                      property protocol

                                                                                                                                                                                                                                      protocol?: string | undefined;
                                                                                                                                                                                                                                      • The to be used protocol

                                                                                                                                                                                                                                        Default value: 'amqp'

                                                                                                                                                                                                                                      property username

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

                                                                                                                                                                                                                                        Default value: 'guest'

                                                                                                                                                                                                                                      property vhost

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

                                                                                                                                                                                                                                        Default value: '/'

                                                                                                                                                                                                                                      interface Consume

                                                                                                                                                                                                                                      interface Consume {}

                                                                                                                                                                                                                                        property arguments

                                                                                                                                                                                                                                        arguments?: any;

                                                                                                                                                                                                                                          property consumerTag

                                                                                                                                                                                                                                          consumerTag?: string | undefined;

                                                                                                                                                                                                                                            property exclusive

                                                                                                                                                                                                                                            exclusive?: boolean | undefined;

                                                                                                                                                                                                                                              property noAck

                                                                                                                                                                                                                                              noAck?: boolean | undefined;

                                                                                                                                                                                                                                                property noLocal

                                                                                                                                                                                                                                                noLocal?: boolean | undefined;

                                                                                                                                                                                                                                                  property priority

                                                                                                                                                                                                                                                  priority?: number | undefined;

                                                                                                                                                                                                                                                    interface DeleteExchange

                                                                                                                                                                                                                                                    interface DeleteExchange {}

                                                                                                                                                                                                                                                      property ifUnused

                                                                                                                                                                                                                                                      ifUnused?: boolean | undefined;

                                                                                                                                                                                                                                                        interface DeleteQueue

                                                                                                                                                                                                                                                        interface DeleteQueue {}

                                                                                                                                                                                                                                                          property ifEmpty

                                                                                                                                                                                                                                                          ifEmpty?: boolean | undefined;

                                                                                                                                                                                                                                                            property ifUnused

                                                                                                                                                                                                                                                            ifUnused?: boolean | undefined;

                                                                                                                                                                                                                                                              interface Get

                                                                                                                                                                                                                                                              interface Get {}

                                                                                                                                                                                                                                                                property noAck

                                                                                                                                                                                                                                                                noAck?: boolean | undefined;

                                                                                                                                                                                                                                                                  interface Publish

                                                                                                                                                                                                                                                                  interface Publish {}

                                                                                                                                                                                                                                                                    property appId

                                                                                                                                                                                                                                                                    appId?: string | undefined;

                                                                                                                                                                                                                                                                      property BCC

                                                                                                                                                                                                                                                                      BCC?: string | string[] | undefined;

                                                                                                                                                                                                                                                                        property CC

                                                                                                                                                                                                                                                                        CC?: string | string[] | undefined;

                                                                                                                                                                                                                                                                          property contentEncoding

                                                                                                                                                                                                                                                                          contentEncoding?: string | undefined;

                                                                                                                                                                                                                                                                            property contentType

                                                                                                                                                                                                                                                                            contentType?: string | undefined;

                                                                                                                                                                                                                                                                              property correlationId

                                                                                                                                                                                                                                                                              correlationId?: string | undefined;

                                                                                                                                                                                                                                                                                property deliveryMode

                                                                                                                                                                                                                                                                                deliveryMode?: boolean | number | undefined;

                                                                                                                                                                                                                                                                                  property expiration

                                                                                                                                                                                                                                                                                  expiration?: string | number | undefined;

                                                                                                                                                                                                                                                                                    property headers

                                                                                                                                                                                                                                                                                    headers?: any;

                                                                                                                                                                                                                                                                                      property mandatory

                                                                                                                                                                                                                                                                                      mandatory?: boolean | undefined;

                                                                                                                                                                                                                                                                                        property messageId

                                                                                                                                                                                                                                                                                        messageId?: string | undefined;

                                                                                                                                                                                                                                                                                          property persistent

                                                                                                                                                                                                                                                                                          persistent?: boolean | undefined;

                                                                                                                                                                                                                                                                                            property priority

                                                                                                                                                                                                                                                                                            priority?: number | undefined;

                                                                                                                                                                                                                                                                                              property replyTo

                                                                                                                                                                                                                                                                                              replyTo?: string | undefined;

                                                                                                                                                                                                                                                                                                property timestamp

                                                                                                                                                                                                                                                                                                timestamp?: number | undefined;

                                                                                                                                                                                                                                                                                                  property type

                                                                                                                                                                                                                                                                                                  type?: string | undefined;

                                                                                                                                                                                                                                                                                                    property userId

                                                                                                                                                                                                                                                                                                    userId?: string | undefined;

                                                                                                                                                                                                                                                                                                      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 (1)

                                                                                                                                                                                                                                                                                                                                  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>