UNPKG

@empathyco/x-components

Version:
23 lines (14 loc) 1.15 kB
<!-- 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 | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [pop](./x-components.xpriorityqueue.pop.md) | | () =&gt; [XPriorityQueueNode](./x-components.xpriorityqueuenode.md)<!-- -->&lt;SomeRecord, SomeData&gt; \| 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) =&gt; void | Inserts an element into the queue in the correct position based on its priority. | | [size](./x-components.xpriorityqueue.size.md) | | () =&gt; number | Retrieves the number of elements stored in the queue. |