<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [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>

() =&gt; [XPriorityQueueNode](./x-components.xpriorityqueuenode.md)<!-- -->&lt;SomeRecord, SomeData&gt; \| 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) =&gt; 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>

() =&gt; number


</td><td>

Retrieves the number of elements stored in the queue.


</td></tr>
</tbody></table>

