/** * @license MIT * @copyright 2024 Thinh Trinh Duc * * @class */ export declare class Queue { #private; /** * Create a new queue */ constructor(...elements: T[]); /** * Creates a queue from the existing array * @public * @static * @param {Array} [elements] * @return {Stack} */ static fromArray(arr: T[]): Queue; /** * Queue's size * @readonly */ get size(): number; /** * Check if the queue is empty. */ isEmpty(): boolean; /** * Enqueue new elements, and returns the new size of the queue. */ enqueue(...values: T[]): void; /** * * Removes the frist element from a queue and returns it. * If the queue is empty, undefined is returned and the queue is not modified. */ dequeue(): T | undefined; /** * Returns the top element without removing it */ peek(): T | undefined; /** * Clear queue */ clear(): this; /** * Convert stack to array */ toArray(): T[]; [Symbol.iterator](): Generator; } //# sourceMappingURL=queue.d.ts.map