import { CommandSegment, ArgumentSegment, NullSegment } from './command-registry'; interface StackObserver { update: () => void; } /** * A stack used to store command segments as they are (or were) entered by a user. */ export declare class SegmentStack { private segments; readonly nullSegment: NullSegment; private observers; subscribe(observer: StackObserver): void; unsubscribe(observer: StackObserver): void; private notifyObservers; /** * Clears all segments from the stack */ clear(): void; /** * Pushes a new segment onto the stack */ push(segment: CommandSegment): void; /** * Pushes an array of segments onto the stack */ pushAll(segments: CommandSegment[]): void; /** * Removes and returns the top segment from the stack * Returns NullSegment if stack is empty */ pop(): CommandSegment; /** * Returns the top segment without removing it * Returns NullSegment if stack is empty */ peek(): CommandSegment; /** * Returns the number of segments in the stack */ size(): number; /** * Returns true if the stack has no segments */ isEmpty(): boolean; /** * Returns true if any segment in the stack is an argument */ get hasArguments(): boolean; /** * Returns all argument segments in the stack */ get arguments(): ArgumentSegment[]; /** * Returns the command path as an array of segment names */ path(): string[]; /** * Returns a copy of the internal segments array */ toArray(): CommandSegment[]; } export {};