split.d.ts 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import { Ace } from "ace-builds";
  2. import Editor = Ace.Editor;
  3. import * as PropTypes from "prop-types";
  4. import * as React from "react";
  5. import { IAceOptions, IAnnotation, ICommand, IEditorProps, IMarker } from "./types";
  6. interface IAceEditorClass extends Editor {
  7. [index: string]: any;
  8. $options?: any;
  9. }
  10. export interface ISplitEditorProps {
  11. [index: string]: any;
  12. name?: string;
  13. style?: object;
  14. /** For available modes see https://github.com/thlorenz/brace/tree/master/mode */
  15. mode?: string;
  16. /** For available themes see https://github.com/thlorenz/brace/tree/master/theme */
  17. theme?: string;
  18. height?: string;
  19. width?: string;
  20. className?: string;
  21. fontSize?: number | string;
  22. showGutter?: boolean;
  23. showPrintMargin?: boolean;
  24. highlightActiveLine?: boolean;
  25. focus?: boolean;
  26. splits: number;
  27. debounceChangePeriod?: number;
  28. cursorStart?: number;
  29. wrapEnabled?: boolean;
  30. readOnly?: boolean;
  31. minLines?: number;
  32. maxLines?: number;
  33. enableBasicAutocompletion?: boolean | string[];
  34. enableLiveAutocompletion?: boolean | string[];
  35. tabSize?: number;
  36. value?: string[];
  37. defaultValue?: string[];
  38. scrollMargin?: number[];
  39. orientation?: string;
  40. onSelectionChange?: (value: any, event?: any) => void;
  41. onCursorChange?: (value: any, event?: any) => void;
  42. onInput?: (event?: any) => void;
  43. onLoad?: (editor: IEditorProps) => void;
  44. onBeforeLoad?: (ace: any) => void;
  45. onChange?: (value: string[], event?: any) => void;
  46. onSelection?: (selectedText: string, event?: any) => void;
  47. onCopy?: (value: string) => void;
  48. onPaste?: (value: string) => void;
  49. onFocus?: (value: Event) => void;
  50. onBlur?: (value: Event) => void;
  51. onScroll?: (editor: IEditorProps) => void;
  52. editorProps?: IEditorProps;
  53. setOptions?: IAceOptions;
  54. keyboardHandler?: string;
  55. commands?: ICommand[];
  56. annotations?: IAnnotation[][];
  57. markers?: IMarker[][];
  58. }
  59. export default class SplitComponent extends React.Component<ISplitEditorProps, undefined> {
  60. [index: string]: any;
  61. static propTypes: PropTypes.ValidationMap<ISplitEditorProps>;
  62. static defaultProps: Partial<ISplitEditorProps>;
  63. editor: IAceEditorClass;
  64. refEditor: HTMLElement;
  65. silent: boolean;
  66. split: IAceEditorClass;
  67. splitEditor: IAceEditorClass;
  68. debounce: (fn: any, delay: number) => (...args: any) => void;
  69. constructor(props: ISplitEditorProps);
  70. isInShadow(node: HTMLElement): boolean;
  71. componentDidMount(): void;
  72. componentDidUpdate(prevProps: ISplitEditorProps): void;
  73. componentWillUnmount(): void;
  74. onChange(event: any): void;
  75. onSelectionChange(event: any): void;
  76. onCursorChange(event: any): void;
  77. onFocus(event: any): void;
  78. onInput(event: any): void;
  79. onBlur(event: any): void;
  80. onCopy(text: string): void;
  81. onPaste(text: string): void;
  82. onScroll(): void;
  83. handleOptions(props: ISplitEditorProps, editor: IAceEditorClass): void;
  84. handleMarkers(markers: IMarker[], editor: IAceEditorClass): void;
  85. updateRef(item: HTMLElement): void;
  86. render(): JSX.Element;
  87. }
  88. export {};