-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.d.ts
42 lines (39 loc) · 1.15 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
declare module 'p-queue-ts' {
type Comparator<T> = (a: T, b: T) => boolean;
export class PriorityQueue<T> {
constructor(comparator?: Comparator<T>);
/**
* Inserts the specified element into this priority queue.
*/
push: (value: T) => void;
/**
* Returns true if this queue contains the specified element.
*/
contains: (value: T, comparator?: (item: T) => boolean) => boolean;
/**
* Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.
*/
top: () => T;
/**
* Retrieves and removes the head of this queue, or returns null if this queue is empty.
* Everytime pop element from queue, the queue is started "sift down" to rebuild the heap
*/
pop: () => T;
/**
* Returns the number of elements in this collection.
*/
size: () => number;
/**
* Checks whether the queue is empty.
*/
empty: () => boolean;
/**
* Removes all of the elements from this priority queue.
*/
clear: () => void;
/**
* Returns an array containing all of the elements in this queue.
*/
toArray: () => T[];
}
}