react-codemirror-merge
Version:
CodeMirror merge view for React.
27 lines (26 loc) • 1.14 kB
TypeScript
import React from 'react';
import { MergeConfig, DirectMergeConfig } from '@codemirror/merge';
import { Original } from './Original';
import { Modified } from './Modified';
import { InternalRef } from './Internal';
import { InitialState } from './store';
export interface CodeMirrorMergeRef extends InternalRef {
}
export interface CodeMirrorMergeProps extends React.HTMLAttributes<HTMLDivElement>, MergeConfig {
theme?: InitialState['theme'];
/**
* Default is `false`. If true, the editor will be destroyed and re-rendered every time the editor is updated.
*/
destroyRerender?: boolean;
/**
* An optional root. Only necessary if the view is mounted in a shadow root or a document other than the global `document` object.
*/
root?: DirectMergeConfig['root'];
}
declare const InternalCodeMirror: React.ForwardRefExoticComponent<CodeMirrorMergeProps & React.RefAttributes<CodeMirrorMergeRef>>;
type CodeMirrorComponent = typeof InternalCodeMirror & {
Original: typeof Original;
Modified: typeof Modified;
};
declare const CodeMirrorMerge: CodeMirrorComponent;
export default CodeMirrorMerge;