import { Component } from 'react'; import codemirror from 'codemirror'; import 'codemirror/mode/jsx/jsx'; import 'codemirror/mode/shell/shell'; import 'codemirror/mode/css/css'; import 'codemirror/mode/htmlmixed/htmlmixed'; import 'codemirror/mode/markdown/markdown'; import 'codemirror/mode/yaml/yaml'; declare class Controlled extends Component { /** @internal */ private appliedNext; /** @internal */ private deferred; /** @internal */ private editor; /** @internal */ private emulating; /** @internal */ private hydrated; /** @internal */ private initCb; /** @internal */ private mirror; /** @internal */ private mounted; /** @internal */ private ref; /** @internal */ private shared; /** @internal */ constructor(props: IControlledCodeMirror); /** @internal */ private hydrate; /** @internal */ private initChange; /** @internal */ private resolveChange; /** @internal */ private mirrorChange; /** @internal */ componentDidMount(): void; /** @internal */ componentDidUpdate(prevProps: IControlledCodeMirror): void; /** @internal */ componentWillUnmount(): void; /** @internal */ shouldComponentUpdate(): boolean; /** @internal */ render(): import("@emotion/react/jsx-runtime").JSX.Element; } export interface IDefineModeOptions { fn: () => codemirror.Mode; name: string; } export interface ISetScrollOptions { x?: number | null; y?: number | null; } export interface ISetSelectionOptions { anchor: codemirror.Position; head: codemirror.Position; } export interface DomEvent { (editor: codemirror.Editor, event?: any): void; } export interface KeyHandledEvent { (editor: codemirror.Editor, name: string, event: any): void; } export interface EditorChangeEvent { (editor: codemirror.Editor, changeObj: codemirror.EditorChange): void; } export interface ICodeMirror { autoCursor?: boolean; autoScroll?: boolean; className?: string; cursor?: codemirror.Position; defineMode?: IDefineModeOptions; editorDidConfigure?: (editor: codemirror.Editor) => void; editorDidMount?: (editor: codemirror.Editor, value: string, cb: () => void) => void; editorWillUnmount?: (lib: any) => void; onBlur?: DomEvent; onChange?: (editor: codemirror.Editor, data: codemirror.EditorChange, value: string) => void; onContextMenu?: DomEvent; onCopy?: DomEvent; onCursor?: (editor: codemirror.Editor, data: codemirror.Position) => void; onCut?: DomEvent; onCursorActivity?: (editor: codemirror.Editor) => void; onDblClick?: DomEvent; onDragEnter?: DomEvent; onDragLeave?: DomEvent; onDragOver?: DomEvent; onDragStart?: DomEvent; onDrop?: DomEvent; onFocus?: DomEvent; onGutterClick?: (editor: codemirror.Editor, lineNumber: number, gutter: string, event: Event) => void; onInputRead?: EditorChangeEvent; onKeyDown?: DomEvent; onKeyHandled?: KeyHandledEvent; onKeyPress?: DomEvent; onKeyUp?: DomEvent; onMouseDown?: DomEvent; onPaste?: DomEvent; onRenderLine?: (editor: codemirror.Editor, line: codemirror.LineHandle, element: HTMLElement) => void; onScroll?: (editor: codemirror.Editor, data: codemirror.ScrollInfo) => void; onSelection?: (editor: codemirror.Editor, data: any) => void; onTouchStart?: DomEvent; onUpdate?: (editor: codemirror.Editor) => void; onViewportChange?: (editor: codemirror.Editor, start: number, end: number) => void; options?: codemirror.EditorConfiguration; selection?: { ranges: Array; focus?: boolean; }; scroll?: ISetScrollOptions; } export interface IControlledCodeMirror extends ICodeMirror { onBeforeChange: (editor: codemirror.Editor, data: codemirror.EditorChange, value: string) => void; value: string; } export interface IUnControlledCodeMirror extends ICodeMirror { detach?: boolean; editorDidAttach?: (editor: codemirror.Editor) => void; editorDidDetach?: (editor: codemirror.Editor) => void; onBeforeChange?: (editor: codemirror.Editor, data: codemirror.EditorChange, value: string, next: () => void) => void; value?: string; } declare interface ICommon { wire: (props: IControlledCodeMirror | IUnControlledCodeMirror) => void; apply: (props: IControlledCodeMirror | IUnControlledCodeMirror) => void; applyNext: (props: IControlledCodeMirror | IUnControlledCodeMirror, next?: IControlledCodeMirror | IUnControlledCodeMirror, preserved?: IPreservedOptions) => void; applyUserDefined: (props: IControlledCodeMirror | IUnControlledCodeMirror, preserved?: IPreservedOptions) => void; } declare interface IPreservedOptions { cursor?: codemirror.Position; } export declare class Shared implements ICommon { private readonly editor; private props; constructor(editor: codemirror.Editor, props: IControlledCodeMirror); delegateCursor(position: codemirror.Position, scroll?: boolean, focus?: boolean): void; delegateScroll(coordinates: ISetScrollOptions): void; delegateSelection(ranges: Array, focus?: boolean): void; apply(props: IControlledCodeMirror | IUnControlledCodeMirror): void; applyNext(props: IControlledCodeMirror | IUnControlledCodeMirror, next?: IControlledCodeMirror | IUnControlledCodeMirror, preserved?: any): void; applyUserDefined(props: IControlledCodeMirror | IUnControlledCodeMirror, preserved?: any): void; wire(props: IControlledCodeMirror | IUnControlledCodeMirror): void; } export default Controlled; //# sourceMappingURL=index.d.ts.map