3.0.10 • Published 2 years ago

@types/bull-arena v3.0.10

Weekly downloads
5,552
License
MIT
Repository
github
Last release
2 years ago

Installation

npm install --save @types/bull-arena

Summary

This package contains type definitions for bull-arena (https://github.com/bee-queue/arena/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bull-arena.

index.d.ts

// Type definitions for bull-arena 3.0
// Project: https://github.com/bee-queue/arena/
// Definitions by: Levi Bostian <https://github.com/levibostian>
//                 Gaurav Sharma <https://github.com/gtpan77>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 4.0

import { RequestHandler } from "express";
import { ClientOpts } from "redis";
import { Redis } from "ioredis";

declare function Arena(
    options: BullArena.MiddlewareOptions,
    listenOptions?: BullArena.MiddlewareListenOptions
): RequestHandler;

declare namespace BullArena {
    interface MiddlewareOptions {
        Bull?: QueueConstructor | undefined;
        Bee?: QueueConstructor | undefined;
        BullMQ?: QueueConstructor | undefined;
        queues: Array<QueueOptions & ConnectionOptions>;
    }

    interface QueueConstructor {
        new (queueName: string, opts?: QueueOptions): Queue;
    }

    interface Queue {
        // Interface of Queue is much larger and
        // inconsistent between different packages.
        // We are using an example method here
        // that is consistent across all providers.
        getJob(jobId: string): Promise<unknown>;
    }

    interface MiddlewareListenOptions {
        port?: number | undefined;
        host?: string | undefined;
        basePath?: string | undefined;
        disableListen?: boolean | undefined;
        useCdn?: boolean | undefined;
    }

    interface QueueOptions {
        name: string;
        hostId?: string | undefined;
        type?: "bull" | "bee" | "bullmq" | string | undefined;
        prefix?: "bull" | "bq" | string | undefined;
    }

    type ConnectionOptions =
        | PortHostConnectionOptions
        | RedisUrlConnectionOptions
        | RedisClientConnectionOptions;

    interface PortHostConnectionOptions {
        host: string;
        port?: number | undefined;
        password?: string | undefined;
        db?: string | undefined;
    }

    interface RedisUrlConnectionOptions {
        url: string;
    }

    interface RedisClientConnectionOptions {
        redis: ClientOpts | Redis;
    }
}

export = Arena;

Additional Details

Credits

These definitions were written by Levi Bostian, and Gaurav Sharma.

3.0.10

2 years ago

3.0.8

2 years ago

3.0.9

2 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.6.0

6 years ago