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

3.0.10 • Public • Published

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

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

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/bull-arena

Weekly Downloads

16,037

Version

3.0.10

License

MIT

Unpacked Size

6.85 kB

Total Files

5

Last publish

Collaborators

  • types