/** * Queue Item */ export declare type TQueueItemType = { /** * Id of the item */ id?: string; }; /** * Queue implementation * * @template T */ declare class Queue { items: Record; head: number; tail: number; /** * Constructor * * @param {T[]} items default items to the queue */ constructor(items?: T[]); /** * Clears the queue */ clear(): void; /** * Check if the item exists in the queue * * @param {T} item check if item already exists in the queue * @returns {boolean} true if item exists */ has(item: T): boolean; /** * Adds item to queue * * @param {T} item item */ enqueue(item: T): void; /** * returns item from the queue * * @returns {T} item */ dequeue(): T; /** * Peaks into the head of the queue * * @returns {T} item */ peek(): T; /** * Length of the queue * * @returns {number} length of the queue */ get length(): number; /** * Check if the queue is empty * * @returns {boolean} is empty */ get isEmpty(): boolean; } export default Queue;