import type { TokenContext } from '../QueryParser'; import { type Token, type TokenTypeValues } from '../QueryLexer'; export declare class TokenStream { private tokens; private position; constructor(tokens: Token[]); /** * Get the current token without advancing the position */ current(): Token | null; /** * Consume and return the current token, advancing the position */ consume(): Token | null; /** * Try & get (Consume) the current token and expect it to be of the specified type * Throws an error if the token type doesn't match. */ tryGetCurrent(expectedType: TokenTypeValues): Token; /** * Check if the current token matches the expected type */ isCurrentAMatchWith(expectedType: TokenTypeValues): boolean; /** * Check if any of the expected types match the current token */ matchAny(...expectedTypes: TokenTypeValues[]): boolean; /** * Count and skip whitespace tokens, returning the number of spaces. * You also need to provide context information, which classifies the whitespace. */ countAndSkipWhitespaces(context: TokenContext): number; /** * Advance the position by one without returning the token */ advance(): void; /** * Check if we've reached the end of the token stream */ isAtEnd(): boolean; }