# @types/priorityqueuejs

> TypeScript definitions for priorityqueuejs

Latest version **1.0.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/priorityqueuejs
pnpm add @types/priorityqueuejs
yarn add @types/priorityqueuejs
bun add @types/priorityqueuejs
```

## Health

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

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-11-07 |
| First published | 2016-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51444 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.0.4 (latest) — 2023-11-07
- 1.0.1 (ts2.0) — 2016-10-05
- 1.0.3 — 2023-10-18
- 1.0.2 — 2023-09-24

## README

# Installation
> `npm install --save @types/priorityqueuejs`

# Summary
This package contains type definitions for priorityqueuejs (https://github.com/janogonzalez/priorityqueuejs).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/priorityqueuejs.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/priorityqueuejs/index.d.ts)
````ts
declare class PriorityQueue<T> {
    /**
     * Compares two Number or String objects.
     */
    static DEFAULT_COMPARATOR: PriorityQueue.Comparator<number | string>;

    /**
     * Initializes a new empty PriorityQueue wich uses .DEFAULT_COMPARATOR() as the comparator function for its elements.
     */
    constructor();

    /**
     * Initializes a new empty PriorityQueue with uses the given comparator(a, b) function as the comparator for its elements.
     * The comparator function must return a positive number when a > b, 0 when a == b and a negative number when a < b.
     */
    constructor(comparator: PriorityQueue.Comparator<T>);

    /**
     * Dequeues the top element of the priority queue.
     * Throws an Error when the queue is empty.
     */
    deq(): T;

    /**
     * Enqueues the element at the priority queue and returns its new size.
     * @param element The element to add
     */
    enq(element: T): number;

    /**
     * Executes fn on each element.
     * Just be careful to not modify the priorities, since the queue won't reorder itself.
     * @param fn The value to pass to an Array.forEach call
     */
    forEach(fn: (value: T, index: number, array: T[]) => void): void;

    /**
     * Returns whether the priority queue is empty or not.
     */
    isEmpty(): boolean;

    /**
     * Peeks at the top element of the priority queue.
     * Throws an Error when the queue is empty.
     */
    peek(): T;

    /**
     * Returns the size of the priority queue.
     */
    size(): number;
}

declare namespace PriorityQueue {
    export interface Comparator<T> {
        (a: T, b: T): number;
    }
}

export = PriorityQueue;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Joshua DeVinney](https://github.com/geoffreak).

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