import { LRLanguage } from '@codemirror/language'; export interface BibtexParseState { inEntry: boolean; entryType: string; braceDepth: number; inField: boolean; inValue: boolean; valueType: 'quoted' | 'braced' | 'literal' | null; inMath: boolean; mathDelimiter: '$$' | '$' | null; } export declare const parser: LRLanguage; export declare function isEntryType(type: string): boolean; export declare function getFieldType(fieldName: string): 'required' | 'optional' | 'unknown'; export interface RootNode { type: 'root'; children: (TextNode | BlockNode)[]; } export interface TextNode { type: 'text'; parent: RootNode; text: string; whitespacePrefix: string; } export interface BlockNode { type: 'block'; command: string; block?: CommentNode | PreambleNode | StringNode | EntryNode; parent: RootNode; whitespacePrefix: string; } export interface CommentNode { type: 'comment'; parent: BlockNode; raw: string; braces: number; parens: number; } export interface PreambleNode { type: 'preamble'; parent: BlockNode; raw: string; braces: number; parens: number; } export interface StringNode { type: 'string'; parent: BlockNode; raw: string; braces: number; parens: number; } export interface EntryNode { type: 'entry'; parent: BlockNode; wrapType: '{' | '('; key?: string; keyEnded?: boolean; fields: FieldNode[]; } export interface FieldNode { type: 'field'; parent: EntryNode; name: string; whitespacePrefix: string; value: ConcatNode; hasComma: boolean; } export interface ConcatNode { type: 'concat'; parent: FieldNode; concat: (LiteralNode | BracedNode | QuotedNode)[]; canConsumeValue: boolean; whitespacePrefix: string; } export interface LiteralNode { type: 'literal'; parent: ConcatNode; value: string; } export interface BracedNode { type: 'braced'; parent: ConcatNode; value: string; depth: number; } export interface QuotedNode { type: 'quoted'; parent: ConcatNode; value: string; depth: number; } export type Node = RootNode | TextNode | BlockNode | EntryNode | CommentNode | PreambleNode | StringNode | FieldNode | ConcatNode | LiteralNode | BracedNode | QuotedNode;