Added execCommand and isReadOnly CodeMirror.Editor functions.

This commit is contained in:
pr1st0n
2017-10-25 17:46:59 +03:00
parent 2bc5013ddc
commit ed43ece3e5
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/marijnh/CodeMirror
// Definitions by: mihailik <https://github.com/mihailik>
// nrbernard <https://github.com/nrbernard>
// Pr1st0n <https://github.com/Pr1st0n>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = CodeMirror;
@@ -336,6 +337,11 @@ declare namespace CodeMirror {
"subtract" Reduce the indentation of the line. */
indentLine(line: number, dir?: string): void;
/** Tells you whether the editor's content can be edited by the user. */
isReadOnly(): boolean;
/** Runs the command with the given name on the editor. */
execCommand(name: string): void;
/** Give the editor focus. */
focus(): void;
+3
View File
@@ -68,3 +68,6 @@ myCodeMirror.on(
);
CodeMirror.registerHelper("lint", "javascript", {});
myCodeMirror.isReadOnly();
myCodeMirror.execCommand('selectAll');