Installation
npm install --save @types/react-codemirror
Summary
This package contains type definitions for React Codemirror (https://github.com/JedWatson/react-codemirror).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-codemirror.
declare namespace ReactCodeMirror {
interface ReactCodeMirrorProps {
children?: React.ReactNode;
autoFocus?: boolean | undefined;
autoSave?: boolean | undefined;
className?: string | undefined;
codeMirrorInstance?: ((host: any, options?: CodeMirror.EditorConfiguration) => CodeMirror.Editor) | undefined;
defaultValue?: string | undefined;
name?: string | undefined;
onChange?: ((newValue: string, change: CodeMirror.EditorChange) => any) | undefined;
onCursorActivity?: ((codemirror: CodeMirror.Editor) => any) | undefined;
onFocusChange?: ((focused: boolean) => any) | undefined;
onScroll?: ((scrollInfo: CodeMirror.ScrollInfo) => any) | undefined;
options?: CodeMirror.EditorConfiguration | undefined;
path?: string | undefined;
preserveScrollPosition?: boolean | undefined;
value?: string | undefined;
}
}
declare module "react-codemirror" {
class RCM extends React.Component<ReactCodeMirror.ReactCodeMirrorProps> {
focus(): void;
getCodeMirror(): CodeMirror.Editor;
}
export = RCM;
}
Additional Details
Credits
These definitions were written by Vicky Lai, and Rudi Chen.