4.3.7 • Published 6 months ago

@types/jackrabbit v4.3.7

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

Installation

npm install --save @types/jackrabbit

Summary

This package contains type definitions for jackrabbit (https://github.com/hunterloftis/jackrabbit).

Details

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

index.d.ts

// Type definitions for jackrabbit 4.3
// Project: https://github.com/hunterloftis/jackrabbit
// Definitions by: Elvis Adomnica <https://github.com/elvisvoer>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.2

import { Connection, Options, Message } from 'amqplib';

declare namespace jackrabbit {
    function jackrabbit(url: string): JackRabbit;

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

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

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

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

    type QueueOptions = 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: Connection): void;
        consume: (
            callback: (data: any, ack: AckCallback, nack: () => void, msg: Message) => void,
            options?: Options.Consume
        ) => void;
        cancel(done: any): void;
        purge(done: any): void;
    }
}

export default jackrabbit.jackrabbit;

Additional Details

  • Last updated: Thu, 08 Jul 2021 14:23:22 GMT
  • Dependencies: @types/amqplib
  • Global values: none

Credits

These definitions were written by Elvis Adomnica.

4.3.4

8 months ago

4.3.6

6 months ago

4.3.5

7 months ago

4.3.7

6 months ago

4.3.3

3 years ago

4.3.2

5 years ago

4.3.1

6 years ago

4.3.0

6 years ago