mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
add types for bull-board (#41719)
* add types for bull-board * version bull-board definition
This commit is contained in:
committed by
Eli Barzilay
parent
0e6efc8134
commit
b8a774d584
@@ -0,0 +1,14 @@
|
||||
import BullBoard from 'bull-board';
|
||||
import express from 'express';
|
||||
import Queue from 'bull';
|
||||
|
||||
const redis = 'redis://127.0.0.1:6379';
|
||||
|
||||
const queueList = [new Queue('video transcoding', redis), new Queue('audio transcoding', redis)];
|
||||
const queue = BullBoard.createQueues(redis);
|
||||
const app = express();
|
||||
|
||||
BullBoard.setQueues(queueList);
|
||||
|
||||
app.use('/queues', BullBoard.UI);
|
||||
queue.add('pdf transcoding', { redis: { host: redis } });
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for bull-board 0.6
|
||||
// Project: https://github.com/vcapretz/bull-board
|
||||
// Definitions by: Keven Leone <https://github.com/kevenleone>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Express } from 'express';
|
||||
import { Queue, QueueOptions } from 'bull';
|
||||
|
||||
declare const BullBoard: BullBoard.Options;
|
||||
|
||||
declare namespace BullBoard {
|
||||
interface CreateQueue {
|
||||
add(name: string, opts: QueueOptions): Queue;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
UI(): Express;
|
||||
setQueues(bullQueues: Queue | Queue[]): Queue;
|
||||
createQueues(redisURL: string): CreateQueue;
|
||||
}
|
||||
}
|
||||
|
||||
export = BullBoard;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"esModuleInterop": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bull-board-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user