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