Noiseless Party Machine

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

    4.3.3 • Public • Published

    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.

    Keywords

    none

    Install

    npm i @types/jackrabbit

    DownloadsWeekly Downloads

    27

    Version

    4.3.3

    License

    MIT

    Unpacked Size

    6.61 kB

    Total Files

    4

    Last publish

    Collaborators

    • types