/** * Represents a token produced by the syntax highlighting tokenizer. * A token has a type (e.g. 'keyword', 'string', 'comment') and content * which can be a string, a single nested token, or an array of mixed strings and tokens. */ export interface SyntaxToken { type: string; content: string | SyntaxToken | (string | SyntaxToken)[]; } /** * A grammar rule pattern used for tokenizing source code. * Each pattern has a regex to match and an optional `inside` grammar for nested tokenization. */ export interface GrammarPattern { pattern: RegExp; lookbehind?: boolean; greedy?: boolean; inside?: Grammar; } /** * A grammar is a map of token type names to their pattern definitions. * Each entry can be a single pattern, an array of patterns, or a nested grammar reference. */ export declare type GrammarEntry = GrammarPattern | GrammarPattern[]; export declare type Grammar = Record;