# @types/mongodb-queue

> TypeScript definitions for mongodb-queue

Latest version **4.0.12** (published 2024-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/mongodb-queue
pnpm add @types/mongodb-queue
yarn add @types/mongodb-queue
bun add @types/mongodb-queue
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.12 |
| Published | 2024-09-18 |
| First published | 2020-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51414 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/mongodb-queue
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongodb-queue
- npm.io page: https://npm.io/package/@types/mongodb-queue

## Dependencies (2)

- [mongodb](https://npm.io/package/mongodb.md) *
- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 4.0.12 (latest) — 2024-09-18
- 4.0.11 (ts4.7) — 2024-01-22
- 4.0.10 (ts4.5) — 2023-11-07
- 4.0.7 (ts4.1) — 2022-04-24
- 4.0.6 (ts3.9) — 2021-07-26
- 4.0.4 (ts3.5) — 2021-01-10
- 4.0.2 (ts3.4) — 2020-04-24
- 4.0.1 (ts3.1) — 2020-03-27
- 4.0.9 — 2023-10-18
- 4.0.8 — 2023-09-27
- 4.0.5 — 2021-07-08
- 4.0.3 — 2020-11-20
- 4.0.0 — 2020-03-15

## README

# Installation
> `npm install --save @types/mongodb-queue`

# Summary
This package contains type definitions for mongodb-queue (https://github.com/chilts/mongodb-queue).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongodb-queue.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongodb-queue/index.d.ts)
````ts
/// <reference types="node" />

import { Db, MongoError } from "mongodb";

declare function mongodbQueue(db: Db, name: string, opts?: mongodbQueue.QueueOptions): mongodbQueue.Queue;

declare namespace mongodbQueue {
    class Queue {
        constructor(db: Db, name: string, opts?: QueueOptions);

        createIndexes(callback: QueueCallback<string>): void;
        add(payload: Payload, callback: QueueCallback<string>): void;
        add(payload: ArrayPayload, callback: QueueCallback<string[]>): void;
        add(payload: Payload, opts: QueueOptions, callback: QueueCallback<string>): void;
        add(payload: ArrayPayload, opts: QueueOptions, callback: QueueCallback<string[]>): void;
        get(callback: QueueCallback<QueueMessage | undefined>): void;
        get(opts: QueueOptions, callback: QueueCallback<QueueMessage | undefined>): void;
        ping(ack: string, callback: QueueCallback<string>): void;
        ping(ack: string, opts: QueueOptions, callback: QueueCallback<string>): void;
        ack(ack: string, callback: QueueCallback<string>): void;
        clean(callback: QueueCallback<any>): void;
        total(callback: QueueCallback<number>): void;
        size(callback: QueueCallback<number>): void;
        inFlight(callback: QueueCallback<number>): void;
        done(callback: QueueCallback<number>): void;
    }

    type Payload = string | Record<string, unknown>;
    type ArrayPayload = Array<string | Record<string, unknown>>;

    interface QueueOptions {
        deadQueue?: Queue | undefined;
        delay?: number | undefined;
        maxRetries?: number | undefined;
        visibility?: number | undefined;
    }

    interface QueueMessage {
        ack: string;
        id: string;
        payload: Payload | ArrayPayload;
        tries: number;
    }

    interface QueueCallback<T> {
        (err: MongoError | Error, result: T): void;
    }
}

export = mongodbQueue;

````

### Additional Details
 * Last updated: Wed, 18 Sep 2024 22:07:23 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [mongodb](https://npmjs.com/package/mongodb)

# Credits
These definitions were written by [FiveOFive](https://github.com/FiveOFive), and [codejockie](https://github.com/codejockie).

---
_Source: https://npm.io/package/@types/mongodb-queue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
