import * as react from 'react';
import { Extension } from '@codemirror/state';

/**
 * @author Ryan He
 * @description CodeEditor 组件的类型定义。
 */

type CodeEditorLanguage = 'javascript' | 'typescript' | 'python' | 'css' | 'html' | 'json';
type CodeEditorSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
type CodeEditorVariant = 'flat' | 'bordered' | 'faded';
interface AISuggestion {
    text: string;
    label?: string;
    detail?: string;
}
interface ToolbarConfig {
    showCopy?: boolean;
    showLineWrap?: boolean;
    showLanguageSelect?: boolean;
    showLineNumbers?: boolean;
    showFullscreen?: boolean;
}
interface ToolbarLabels {
    toolbarLabel: string;
    copy: string;
    copied: string;
    lineWrap: string;
    lineNumbers: string;
    fullscreen: string;
    exitFullscreen: string;
    language: string;
    aiSuggest: string;
}
interface CodeEditorProps {
    value?: string;
    defaultValue?: string;
    onChange?: (value: string) => void;
    language?: CodeEditorLanguage;
    onLanguageChange?: (language: CodeEditorLanguage) => void;
    size?: CodeEditorSize;
    variant?: CodeEditorVariant;
    placeholder?: string;
    isDisabled?: boolean;
    isReadOnly?: boolean;
    isInvalid?: boolean;
    showLineNumbers?: boolean;
    onShowLineNumbersChange?: (showLineNumbers: boolean) => void;
    lineWrap?: boolean;
    onLineWrapChange?: (lineWrap: boolean) => void;
    toolbar?: boolean | ToolbarConfig;
    minHeight?: string | number;
    maxHeight?: string | number;
    extensions?: Extension[];
    onAISuggest?: (code: string, position: number) => Promise<AISuggestion[]>;
    className?: string;
    'aria-label'?: string;
    'aria-labelledby'?: string;
    'aria-describedby'?: string;
}

declare const CodeEditor: react.ForwardRefExoticComponent<CodeEditorProps & react.RefAttributes<HTMLDivElement>>;

export { type AISuggestion, CodeEditor, type CodeEditorLanguage, type CodeEditorProps, type CodeEditorSize, type CodeEditorVariant, type ToolbarConfig, type ToolbarLabels };
