UNPKG

2.13 kBTypeScriptView Raw
1import * as monaco from "monaco-editor/esm/vs/editor/editor.api";
2import * as PropTypes from "prop-types";
3import * as React from "react";
4import { MonacoDiffEditorProps } from "./types";
5import { noop } from "./utils";
6declare class MonacoDiffEditor extends React.Component<MonacoDiffEditorProps> {
7 static propTypes: {
8 width: PropTypes.Requireable<string | number>;
9 height: PropTypes.Requireable<string | number>;
10 original: PropTypes.Requireable<string>;
11 value: PropTypes.Requireable<string>;
12 defaultValue: PropTypes.Requireable<string>;
13 language: PropTypes.Requireable<string>;
14 theme: PropTypes.Requireable<string>;
15 options: PropTypes.Requireable<object>;
16 overrideServices: PropTypes.Requireable<object>;
17 editorDidMount: PropTypes.Requireable<(...args: any[]) => any>;
18 editorWillMount: PropTypes.Requireable<(...args: any[]) => any>;
19 onChange: PropTypes.Requireable<(...args: any[]) => any>;
20 className: PropTypes.Requireable<string>;
21 };
22 static defaultProps: {
23 width: string;
24 height: string;
25 original: any;
26 value: any;
27 defaultValue: string;
28 language: string;
29 theme: any;
30 options: {};
31 overrideServices: {};
32 editorDidMount: typeof noop;
33 editorWillMount: typeof noop;
34 onChange: typeof noop;
35 className: any;
36 };
37 editor?: monaco.editor.IStandaloneDiffEditor;
38 private containerElement?;
39 private _subscription;
40 private __prevent_trigger_change_event?;
41 constructor(props: MonacoDiffEditorProps);
42 componentDidMount(): void;
43 componentDidUpdate(prevProps: MonacoDiffEditorProps): void;
44 componentWillUnmount(): void;
45 assignRef: (component: HTMLDivElement) => void;
46 editorWillMount(): monaco.editor.IStandaloneEditorConstructionOptions;
47 editorDidMount(editor: monaco.editor.IStandaloneDiffEditor): void;
48 initModels(value: string, original: string): void;
49 initMonaco(): void;
50 destroyMonaco(): void;
51 render(): JSX.Element;
52}
53export default MonacoDiffEditor;