import { AbortOptions, MaybePromise } from '@mithic/commons'; /** A stack data structure. */ export interface Stack { /** Returns the top element of this {@link Stack}, or undefined if empty. */ back?(options?: AbortOptions): MaybePromise; /** Adds an element to this {@link Stack}. */ push(item: T, options?: AbortOptions): MaybePromise; /** Removes and returns the top element of this {@link Stack}, or undefined if empty. */ pop(options?: AbortOptions): MaybePromise; } /** A {@link Stack} that supports peeking the back (top) element. */ export interface PeekableStack extends Stack { back(options?: AbortOptions): MaybePromise; } /** A {@link Stack} with synchronous operations. */ export interface SyncStack extends Stack { back?(): T | undefined; push(item: T): void; pop(): T | undefined; } //# sourceMappingURL=stack.d.ts.map