/** * @class Stack * @util */ declare class Stack { /** * The ordered collection of items held in the stack, where the last element is the top. */ items: unknown[]; /** * Initializes the stack with an optional pre-populated array of items. */ constructor(initial?: unknown[]); /** * Add new item or items at the back of the stack. * * @param {*} items An item to add. */ push(...items: unknown[]): void; /** * Remove the last element from the stack and returns it. * * @returns {*} */ pop(): unknown; /** * Return the last element from the stack (without modification stack). * * @returns {*} */ peek(): unknown; /** * Check if the stack is empty. * * @returns {boolean} */ isEmpty(): boolean; /** * Return number of elements in the stack. * * @returns {number} */ size(): number; } export default Stack;