@empathyco/x-components
Version:
Empathy X Components
97 lines (43 loc) • 1.44 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [XPriorityQueue](./x-components.xpriorityqueue.md)
## XPriorityQueue interface
Data structure to store a list of entries ordered by their priority.
**Signature:**
```typescript
export interface XPriorityQueue<SomeRecord extends Dictionary, SomeData extends Dictionary>
```
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[pop](./x-components.xpriorityqueue.pop.md)
</td><td>
</td><td>
() => [XPriorityQueueNode](./x-components.xpriorityqueuenode.md)<!-- --><SomeRecord, SomeData> \| undefined
</td><td>
Retrieves and removes the head [node](./x-components.xpriorityqueuenode.md) of the queue.
</td></tr>
<tr><td>
[push](./x-components.xpriorityqueue.push.md)
</td><td>
</td><td>
(key: keyof SomeRecord, priority: number, data?: SomeData) => void
</td><td>
Inserts an element into the queue in the correct position based on its priority.
</td></tr>
<tr><td>
[size](./x-components.xpriorityqueue.size.md)
</td><td>
</td><td>
() => number
</td><td>
Retrieves the number of elements stored in the queue.
</td></tr>
</tbody></table>