import * as _codemirror_language from '@codemirror/language'; import { LanguageSupport, LRLanguage } from '@codemirror/language'; import * as _codemirror_state from '@codemirror/state'; import { Extension, EditorState } from '@codemirror/state'; import { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete'; export { autocompletion, completionKeymap } from '@codemirror/autocomplete'; import { Diagnostic } from '@codemirror/lint'; import { EditorView, Tooltip } from '@codemirror/view'; declare const bibtexBracketMatching: Extension; declare const bibtexLanguage: _codemirror_language.LRLanguage; declare function bibtex(config?: { enableLinting?: boolean; enableTooltips?: boolean; enableAutocomplete?: boolean; autoCloseBrackets?: boolean; }): LanguageSupport; declare const entryTypes: readonly string[]; declare const fieldNames: readonly string[]; declare const snippets: readonly Completion[]; declare function bibtexCompletionSource(context: CompletionContext): CompletionResult | null; interface BibtexLinterOptions { checkRequiredFields?: boolean; checkUnknownFields?: boolean; checkDuplicateKeys?: boolean; checkFieldSyntax?: boolean; checkEntryTypes?: boolean; } declare function bibtexLinter(options?: BibtexLinterOptions): (view: EditorView) => Diagnostic[]; /** * Provides hover tooltips for BibTeX entry types and field names */ declare const bibtexHoverTooltip: _codemirror_state.Extension & { active: _codemirror_state.StateField; }; declare const parser: LRLanguage; declare function isEntryType(type: string): boolean; declare function getFieldType(fieldName: string): 'required' | 'optional' | 'unknown'; interface RootNode { type: 'root'; children: (TextNode | BlockNode)[]; } interface TextNode { type: 'text'; parent: RootNode; text: string; whitespacePrefix: string; } interface BlockNode { type: 'block'; command: string; block?: CommentNode | PreambleNode | StringNode | EntryNode; parent: RootNode; whitespacePrefix: string; } interface CommentNode { type: 'comment'; parent: BlockNode; raw: string; braces: number; parens: number; } interface PreambleNode { type: 'preamble'; parent: BlockNode; raw: string; braces: number; parens: number; } interface StringNode { type: 'string'; parent: BlockNode; raw: string; braces: number; parens: number; } interface EntryNode { type: 'entry'; parent: BlockNode; wrapType: '{' | '('; key?: string; keyEnded?: boolean; fields: FieldNode[]; } interface FieldNode { type: 'field'; parent: EntryNode; name: string; whitespacePrefix: string; value: ConcatNode; hasComma: boolean; } interface ConcatNode { type: 'concat'; parent: FieldNode; concat: (LiteralNode | BracedNode | QuotedNode)[]; canConsumeValue: boolean; whitespacePrefix: string; } interface LiteralNode { type: 'literal'; parent: ConcatNode; value: string; } interface BracedNode { type: 'braced'; parent: ConcatNode; value: string; depth: number; } interface QuotedNode { type: 'quoted'; parent: ConcatNode; value: string; depth: number; } type Node = RootNode | TextNode | BlockNode | EntryNode | CommentNode | PreambleNode | StringNode | FieldNode | ConcatNode | LiteralNode | BracedNode | QuotedNode; interface DocumentValues { authors: Set; editors: Set; journals: Set; publishers: Set; schools: Set; institutions: Set; organizations: Set; addresses: Set; years: Set; keys: Set; byField: Map>; } declare function collectDocumentValues(state: EditorState): DocumentValues; export { BlockNode, BracedNode, CommentNode, ConcatNode, EntryNode, FieldNode, LiteralNode, Node, PreambleNode, QuotedNode, RootNode, StringNode, TextNode, bibtex, bibtexBracketMatching, bibtexCompletionSource, bibtexHoverTooltip, bibtexLanguage, bibtexLinter, collectDocumentValues, entryTypes, fieldNames, getFieldType, isEntryType, parser, snippets };