@cute-dw/core
Version:
This TypeScript library is the main part of a more powerfull package designed for the fast WEB software development. The cornerstone of the library is the **DataStore** class, which might be useful when you need a full control of the data, but do not need
27 lines (26 loc) • 913 B
TypeScript
import { Element } from "./Collection";
import { Vector } from "./Vector";
/**
* The LIFO stack
*/
export declare class Stack<T> extends Vector<T> {
/**
* Pushes an item onto the top of this stack
*/
push(value: Element<T>): boolean;
/**
* Removes the object at the top of this stack and returns that object as the value of this function
*/
pop(): Element<T> | undefined;
/**
* Looks at the object at the top of this stack without removing it from the stack
* @returns
*/
peek(): Element<T> | undefined;
/**
* Returns the 1-based position where an object is on this stack
* @param value The desired value
* @returns The 1-based position from the top of the stack where the object is located; the return value -1 indicates that the object is not on the stack
*/
search(value: Element<T>): number;
}