[@types/codemirror] Add boolean type to autoCloseBrackets option (#36323)

Currently definition for autoCloseBrackets doesn't allow boolean values, which
is wrong. Setting autoCloseBrackets to true enables autoclosing feature with
the default settings, as is visible in the source code of a demo on the
CodeMirror's official website: https://codemirror.net/demo/closebrackets.html

var editor = CodeMirror.fromTextArea(document.getElementById("code"), {autoCloseBrackets: true});
This commit is contained in:
ᎷᎪᎢᎬᏌᏚᏃ ᎢᏌᎡᏟᏃᎪ
2019-06-24 12:51:17 -07:00
committed by Daniel Rosenwasser
parent 4f3e646ab1
commit 545e576c1c
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -42,6 +42,6 @@ declare module "codemirror" {
* By default, it'll auto-close ()[]{}''"", but you can pass it a string similar to that (containing pairs of matching characters),
* or an object with pairs and optionally explode properties to customize it.
*/
autoCloseBrackets?: AutoCloseBrackets | string;
autoCloseBrackets?: AutoCloseBrackets | boolean | string;
}
}
@@ -4,3 +4,7 @@
var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, {
autoCloseBrackets: "()[]{}''\"\""
});
var myCodeMirror2: CodeMirror.Editor = CodeMirror(document.body, {
autoCloseBrackets: true
});