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.
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 {
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.