/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Basic] /src/libs/data_structures/KavenStack.ts * @create: 2019-03-21 16:20:59.274 * @modify: 2025-07-01 13:13:47.371 * @version: 6.0.0 * @times: 30 * @lines: 121 * @copyright: Copyright © 2019-2025 Kaven. All Rights Reserved. * @description: [description] * @license: * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ********************************************************************/ import { IKavenStack } from "../interface/IKavenStack"; /** * Represents a variable size last-in-first-out (LIFO) collection of instances of the same specified type. * @since 1.1.19 * @version 2021-12-14 */ export declare class KavenStack implements IKavenStack { protected maxSize?: number; protected array: T[]; constructor(); constructor(maxSize: number); get MaxSize(): number | undefined; /** * Gets the number of elements contained in the KavenStack. * @returns The number of elements contained in the KavenStack. */ get Count(): number; /** * Removes all objects from the KavenStack. */ Clear(): void; /** * Determines whether an element is in the KavenStack. * @param item The object to locate in the KavenStack. The value can be undefined. */ Contains(item: T): boolean; /** * Returns the object at the top of the KavenStack without removing it. * @returns The object at the top of the KavenStack. */ Peek(): T | undefined; /** * Removes and returns the object at the top of the KavenStack. * @returns The object removed from the top of the KavenStack. */ Pop(): T | undefined; /** * Inserts an object at the top of the KavenStack. * @param item The object to push onto the KavenStack. The value can be undefined. */ Push(item: T): void; /** * Copies the KavenStack to a new array. * @returns A new array containing copies of the elements of the KavenStack. */ ToArray(): T[]; } //# sourceMappingURL=KavenStack.d.ts.map