import { Element } from "./Collection";
import { ImmutableQueue, Queue } from "./Queue";
/**
 * A linear immutable collection that supports element inspection and extraction at the both ends of the `Queue`
 */
export interface ImmutableDeque<T> extends ImmutableQueue<T> {
    /** Retrieves, but does not remove, the first element of this list, or returns _undefined_ if this collection is empty */
    peekFirst(): Element<T> | undefined;
    /** Retrieves, but does not remove, the last element of this list, or returns _undefined_ if this collection is empty */
    peekLast(): Element<T> | undefined;
}
/**
 * A linear mutable collection that supports element insertion and removal at the both ends of the `Queue`
 */
export interface Deque<T> extends ImmutableDeque<T>, Queue<T> {
    /** Inserts the specified element at the front of this deque */
    offerFirst(value: Element<T>): boolean;
    /** Inserts the specified element at the end of this deque */
    offerLast(value: Element<T>): boolean;
    /** Retrieves and removes the first element of this deque, or returns `undefined` if this deque is empty */
    pollFirst(): Element<T> | undefined;
    /** Retrieves and removes the last element of this deque, or returns `undefined` if this deque is empty */
    pollLast(): Element<T> | undefined;
}
