4.8.6 • Published 6 months ago

@types/pager__jackrabbit v4.8.6

Weekly downloads
26
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for @pager/jackrabbit 4.8
// Project: https://github.com/pagerinc/jackrabbit
// Definitions by: Benjamin Schuster-Boeckler <https://github.com/dagams>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.5

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?: ReadonlyArray<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: Thu, 08 Jul 2021 20:19:15 GMT
  • Dependencies: @types/amqplib
  • Global values: none

Credits

These definitions were written by Benjamin Schuster-Boeckler.

4.8.5

6 months ago

4.8.4

7 months ago

4.8.6

6 months ago

4.8.3

8 months ago

4.8.2

3 years ago

4.8.1

4 years ago

4.8.0

4 years ago