mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
[@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:
committed by
Daniel Rosenwasser
parent
4f3e646ab1
commit
545e576c1c
+1
-1
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user