import * as React from 'react'; import * as monaco from '@vscode-alt/monaco-editor/esm/vs/editor/editor.api'; import { DiffEditorWillMount, DiffEditorDidMount, IMonacoDiffEditorTextProps, IMonacoEditorTextExtensionProps } from '../interfaces'; import { IThemeState } from '../../themes'; import { URI } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri'; type IMonacoEditorTextComponentProps = IMonacoDiffEditorTextProps & { originalUri: URI; modifiedUri: URI; }; export interface DefaultMonacoDiffEditorProps extends IMonacoDiffEditorTextProps, IMonacoEditorTextExtensionProps { width: string | number; height: string | number; value: string; original: string; defaultValue: string; language: string; theme: IThemeState; options: monaco.editor.IDiffEditorOptions; editorDidMount: DiffEditorDidMount; editorWillMount: DiffEditorWillMount; onChange: (event: any) => void; doUpdateValue: boolean; updateEditorState: (resource: URI, state: monaco.editor.ICodeEditorViewState) => void; } declare class MonacoDiffEditor extends React.Component { private containerElement; context: any; private __current_value; private __current_original; private editor; private __prevent_trigger_change_event; private __version_id; /** * Explicit ModelService to manage models. * * @private * @type {(typeof monaco.editor | any)} * @memberof MonacoEditorComponent */ private registeredProviders; private modelService; private disposables; private subscriptions; static defaultProps: Partial; constructor(props: IMonacoEditorTextComponentProps); componentDidMount(): void; shouldComponentUpdate(nextProps: Readonly): boolean; componentDidUpdate(prevProps: IMonacoEditorTextComponentProps): void; componentWillUnmount(): void; editorWillMount(): void; /** * Inorder to support backward compatiblity onChange function will have `event` although it was removed in * react-monaco-editor. * @param editor */ editorDidMount(editor: any): void; /** * Added custom method for adding additional options. * This method not present in the react-monaco-editor. * @param options * @param override */ protected create(options: any, override?: monaco.editor.IEditorOverrideServices): monaco.editor.IStandaloneDiffEditor; updateModel(value: any, original: any): void; initMonaco(): void; private createOrGetModel; destroyMonaco(): void; assignRef: (component: any) => void; render(): React.JSX.Element; } export default MonacoDiffEditor;