import { Extension } from '@codemirror/state';
import { Completion } from '@codemirror/autocomplete';
import { LRLanguage, HighlightStyle } from '@codemirror/language';

type DexprType = "String" | "Number" | "Boolean" | "NumberList" | "StringList" | "Object" | "List";
interface FunctionInfo {
    name: string;
    signature: string;
    doc?: string;
}
interface MethodInfo {
    name: string;
    signature: string;
    doc?: string;
}
interface FieldInfo {
    name: string;
    type: DexprType;
}
interface VariableInfo {
    name: string;
    type: DexprType;
    doc?: string;
    fields?: FieldInfo[];
}
/**
 * Language metadata — generated by Rust `LanguageInfo::to_json()`,
 * extended with host-registered functions/methods/variables.
 */
interface DexprLanguageInfo {
    functions: FunctionInfo[];
    methods: Partial<Record<DexprType, MethodInfo[]>>;
    variables?: VariableInfo[];
}
declare const KEYWORDS: Completion[];
declare function dexprCompletion(info: DexprLanguageInfo): Extension;

declare const dexprLanguage: LRLanguage;

declare const dexprHighlightStyle: HighlightStyle;
declare function dexprHighlighting(): Extension;

interface DexprConfig extends DexprLanguageInfo {
    /** Include default syntax highlighting theme (default: true) */
    highlighting?: boolean;
}
/**
 * All-in-one dexpr language support for CodeMirror 6.
 *
 * @example
 * ```ts
 * import { dexpr } from "codemirror-lang-dexpr";
 *
 * // languageInfo comes from Rust's LanguageInfo::to_json()
 * // extended with host-registered functions/methods/variables
 * const extensions = [basicSetup, dexpr(languageInfo)];
 * ```
 */
declare function dexpr(config: DexprConfig): Extension;

export { type DexprConfig, type DexprLanguageInfo, type DexprType, type FieldInfo, type FunctionInfo, KEYWORDS, type MethodInfo, type VariableInfo, dexpr, dexprCompletion, dexprHighlightStyle, dexprHighlighting, dexprLanguage };
