@types/pager__jackrabbit
TypeScript icon, indicating that this package has built-in type declarations

4.8.6 • Public • Published

Installation

npm install --save @types/pager__jackrabbit

Summary

This package contains type definitions for @pager/jackrabbit (https://github.com/pagerinc/jackrabbit).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pager__jackrabbit.

index.d.ts

import * as amqplib from "amqplib";

export = jackrabbit;
declare function jackrabbit(url: string): jackrabbit.JackRabbit;

declare namespace jackrabbit {
    type Message = amqplib.Message;

    type ExchangeOptions = amqplib.Options.AssertExchange & {
        noReply?: boolean | undefined;
    };

    interface JackRabbit extends NodeJS.EventEmitter {
        default(): Exchange;
        direct(name?: string, options?: ExchangeOptions): Exchange;
        fanout(name?: string, options?: ExchangeOptions): Exchange;
        topic(name?: string, options?: ExchangeOptions): Exchange;
        close(callback?: (e: Error) => any): void;
        getInternals: () => {
            amqp: any;
            connection: amqplib.Connection;
        };
    }

    enum exchangeType {
        direct = "direct",
        fanout = "fanout",
        topic = "topic",
    }

    interface Exchange extends NodeJS.EventEmitter {
        name: string;
        type: exchangeType;
        options: amqplib.Options.AssertExchange;
        queue(options: QueueOptions): Queue;
        connect(con: amqplib.Connection): Exchange;
        publish(message: any, options?: PublishOptions): Exchange;
    }

    type PublishOptions = amqplib.Options.Publish & {
        key: string;
        reply?: AckCallback | undefined;
    };

    type QueueOptions = amqplib.Options.AssertQueue & {
        name?: string | undefined;
        key?: string | undefined;
        keys?: readonly string[] | undefined;
        prefetch?: number | undefined;
    };

    type AckCallback = (data?: any) => void;

    interface Queue extends NodeJS.EventEmitter {
        name: string;
        options: QueueOptions;
        connect(con: amqplib.Connection): void;
        consume: (
            callback: (
                data: any,
                ack: AckCallback,
                nack: () => void,
                msg: Message,
            ) => void,
            options?: amqplib.Options.Consume,
        ) => void;
        cancel(done: any): void;
        purge(done: any): void;
    }
}

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: @types/amqplib

Credits

These definitions were written by Benjamin Schuster-Boeckler.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/pager__jackrabbit

Weekly Downloads

565

Version

4.8.6

License

MIT

Unpacked Size

6.82 kB

Total Files

5

Last publish

Collaborators

  • types