UNPKG

2.32 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 editorWillMount: PropTypes.Requireable<(...args: any[]) => any>;
18 editorDidMount: PropTypes.Requireable<(...args: any[]) => any>;
19 editorWillUnmount: PropTypes.Requireable<(...args: any[]) => any>;
20 onChange: PropTypes.Requireable<(...args: any[]) => any>;
21 className: PropTypes.Requireable<string>;
22 };
23 static defaultProps: {
24 width: string;
25 height: string;
26 original: any;
27 value: any;
28 defaultValue: string;
29 language: string;
30 theme: any;
31 options: {};
32 overrideServices: {};
33 editorWillMount: typeof noop;
34 editorDidMount: typeof noop;
35 editorWillUnmount: typeof noop;
36 onChange: typeof noop;
37 className: any;
38 };
39 editor?: monaco.editor.IStandaloneDiffEditor;
40 private containerElement?;
41 private _subscription;
42 private __prevent_trigger_change_event?;
43 constructor(props: MonacoDiffEditorProps);
44 componentDidMount(): void;
45 componentDidUpdate(prevProps: MonacoDiffEditorProps): void;
46 componentWillUnmount(): void;
47 assignRef: (component: HTMLDivElement) => void;
48 editorWillMount(): monaco.editor.IStandaloneEditorConstructionOptions;
49 editorDidMount(editor: monaco.editor.IStandaloneDiffEditor): void;
50 editorWillUnmount(editor: monaco.editor.IStandaloneDiffEditor): void;
51 initModels(value: string, original: string): void;
52 initMonaco(): void;
53 destroyMonaco(): void;
54 render(): JSX.Element;
55}
56export default MonacoDiffEditor;