@empathyco/x-components
Version:
Empathy X Components
23 lines (14 loc) • 1.15 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
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [pop](./x-components.xpriorityqueue.pop.md) | | () => [XPriorityQueueNode](./x-components.xpriorityqueuenode.md)<!-- --><SomeRecord, SomeData> \| undefined | Retrieves and removes the head [node](./x-components.xpriorityqueuenode.md) of the queue. |
| [push](./x-components.xpriorityqueue.push.md) | | (key: keyof SomeRecord, priority: number, data?: SomeData) => void | Inserts an element into the queue in the correct position based on its priority. |
| [size](./x-components.xpriorityqueue.size.md) | | () => number | Retrieves the number of elements stored in the queue. |