declare class Stack { private _stack; constructor(); /** * Push a value onto the stack and return the new size of the stack * * O(1) * @param value the value to add to the stack. * @returns the new size of the stack. */ push(value: T): number; /** * Pop a value from the stack and return it. Returns undefined if empty. * * O(1) * @returns the top value from the stack or undefined if the stack is empty. */ pop(): T | undefined; /** * Return the top value from the stack without removing it. Returns undefined * if the stack is empty. * * O(1) * @returns the top value from the stack or undefined if the stack is empty. */ peek(): T | undefined; /** * Remove all elements from the stack. * * O(1) */ clear(): void; /** * Return the current number of elements in the stack. * * O(1). */ get length(): number; } export default Stack;