import * as utils from '../../utils'; declare class CircularBuffer { private list; private sz; private capacity; private readIndex; private writeIndex; private equalsF; constructor(capacity: number, equalsFunction?: utils.EqualsFunction); /***************************************************************************** INSPECTION *****************************************************************************/ /** * Returns size of circular buffer - O(1) */ size(): number; /** * Returns true if buffer is empty, false otherwise - O(1) */ isEmpty(): boolean; /** * Deletes all elements in buffer - O(capacity) */ clear(): void; /***************************************************************************** INSERTION/DELETION *****************************************************************************/ /** * Enqueues element into queue - O(1) * @param {T} element - element to be enqueued */ enqueue(element: T): void; /** * Dequeues element from queue - O(1) * @returns {T} */ dequeue(): T | null; /***************************************************************************** ACCESSING *****************************************************************************/ /** * Peeks the element at the front of the buffer - O(1) * @returns {T} - Frontmost element */ peekFront(): T | null; /** * Peeks the element at the back of the buffer - O(1) * @returns {T} - Backmost element */ peekBack(): T | null; /***************************************************************************** SEARCHING *****************************************************************************/ /** * Checks if element is in buffer - O(n) * @param {T} element - element to search for * @returns {boolean} */ contains(element: T): boolean; } export default CircularBuffer; //# sourceMappingURL=circular-buffer.d.ts.map