2.0.5 • Published 6 months ago

@types/rabbitmq-schema v2.0.5

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

Installation

npm install --save @types/rabbitmq-schema

Summary

This package contains type definitions for rabbitmq-schema (https://github.com/tjmehta/rabbitmq-schema).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rabbitmq-schema.

index.d.ts

// Type definitions for rabbitmq-schema 2.0
// Project: https://github.com/tjmehta/rabbitmq-schema
// Definitions by: Alex Duka <https://github.com/rulezzz1987>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2

interface Binding {
    destination: Exchange | Queue;
    source: Exchange;
    args?: object | undefined;
    routingPattern?: string | undefined;
}

interface TopicBinding extends Binding {
    routingPattern: string;
}

interface DirectBinding extends Binding {
    routingPattern: string;
}

interface Topology {
    options?: object | undefined;
}

interface Exchange extends Topology {
    exchange: string;
    type: string;
    bindings: Binding[];
}

interface FanoutExchange extends Exchange {
    type: 'fanout';
}

interface TopicExchange extends Exchange {
    type: 'topic';
    bindings: TopicBinding[];
}

interface DirectExchange extends Exchange {
    type: 'direct';
    bindings: DirectBinding[];
}

interface Queue extends Topology {
    queue: string;
    messageSchema: object;
}

declare class RabbitMQSchema {
    constructor(schema: Topology | Topology[], parentPath?: string);

    getExchanges(): Exchange[];

    getBindings(): Binding[];

    getQueues(): Queue[];

    getDirectBindings(): DirectBinding[];

    validate(schema: Topology | Topology[], parentPath?: string): void;

    validateMessage<T>(exchangeName: string, routingPattern: string, message: T): T;

    getQueueByName(name: string): Queue | void;

    getExchangeByName(name: string): Exchange | void;
}

export = RabbitMQSchema;

Additional Details

  • Last updated: Thu, 08 Jul 2021 20:20:03 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Alex Duka.

2.0.3

7 months ago

2.0.2

8 months ago

2.0.5

6 months ago

2.0.4

6 months ago

2.0.1

3 years ago

2.0.0

5 years ago