import { Pos } from './position.js'; export declare enum TokenType { SPACE = 0, NEWLINE = 1, ATOM = 2, STRING = 3, OPEN = 4, CLOSE = 5 } export interface TokenBase { start: Pos; end: Pos; synthetic?: boolean; } export interface Token extends TokenBase { type: TokenType; text: string; } export interface Group extends TokenBase { open: Token; close: Token | null; items: Items; } export type Item = Token | Group; export type Items = Array; export type GroupInProgress = Omit; export declare function getRange(t: Item | Items): TokenBase; export declare function finishGroup(g: GroupInProgress, end: Pos): Group; export declare function makeGroup(open: Token, items: Array, close: Token): Group; export declare function isSpace(i: Item): i is Token; export declare function isGroup(i: Item): i is Group; export declare function isToken(i: Item): i is Token; export declare function isTokenType(i: Item, t: TokenType): i is Token; export type ItemTextOptions = { missing?: string; color?: boolean; }; export declare function foldItems(i: Items, fToken: (t: Token) => T, fGroup: (g: Group, t: T, k: (t: Token) => T) => T, fItems: (ts: T[]) => T): T; export declare function itemText(items: Items, options?: ItemTextOptions): string;