diff.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import * as PropTypes from "prop-types";
  2. import * as React from "react";
  3. import { IEditorProps } from "./types";
  4. export interface IDiffEditorProps {
  5. cursorStart?: number;
  6. editorProps?: object;
  7. enableBasicAutocompletion?: boolean | string[];
  8. enableLiveAutocompletion?: boolean | string[];
  9. focus?: boolean;
  10. fontSize?: number;
  11. height?: string;
  12. highlightActiveLine?: boolean;
  13. maxLines?: number;
  14. minLines?: number;
  15. mode?: string;
  16. name?: string;
  17. className?: string;
  18. onLoad?: (editor: IEditorProps) => void;
  19. onChange?: (value: string[], event?: any) => void;
  20. onPaste?: (value: string) => void;
  21. onScroll?: (editor: IEditorProps) => void;
  22. orientation?: string;
  23. readOnly?: boolean;
  24. scrollMargin?: number[];
  25. setOptions?: object;
  26. showGutter?: boolean;
  27. showPrintMargin?: boolean;
  28. splits?: number;
  29. style?: object;
  30. tabSize?: number;
  31. theme?: string;
  32. value?: string[];
  33. width?: string;
  34. wrapEnabled?: boolean;
  35. }
  36. export interface IDiffEditorState {
  37. value: string[];
  38. }
  39. export default class DiffComponent extends React.Component<IDiffEditorProps, IDiffEditorState> {
  40. static propTypes: PropTypes.ValidationMap<IDiffEditorProps>;
  41. static defaultProps: Partial<IDiffEditorProps>;
  42. constructor(props: IDiffEditorProps);
  43. componentDidUpdate(): void;
  44. onChange(value: any): void;
  45. diff(): any[][];
  46. generateDiffedLines(diff: any): {
  47. left: any[];
  48. right: any[];
  49. };
  50. setCodeMarkers(diffedLines?: any): any[][];
  51. render(): JSX.Element;
  52. }