/** * Simple queue in which the elements are always sorted */ export default class SortedQueue { queue: ItemType[]; compareFunc: (left: ItemType, right: ItemType) => number; /** * @constructs SortedQueue * @param {Function} compareFunc comparison function used for sorting the elements of the queue */ constructor(compareFunc: (left: ItemType, right: ItemType) => number); /** * Removes all of the elements from queue. * @returns {undefined} */ clear(): void; /** * Inserts the specified element into the queue. * @param {object} item * @returns {undefined} */ enqueue(item: ItemType): void; /** * Returns and removes the head of the queue. * Returns null if the queue is empty. * @returns {(object|null)} Queue item or null. */ dequeue(): ItemType; /** * Returns the number of items in queue. * @returns {number} */ size(): number; }