From 6268433bd9d984fd544e1d2a05d5f77074fb747b Mon Sep 17 00:00:00 2001 From: Sixin Li Date: Wed, 23 Sep 2015 03:03:15 -0400 Subject: [PATCH] add configuration typing for matchBrackets addon --- codemirror/codemirror-matchbrackets-tests.ts | 4 ++++ codemirror/codemirror-matchbrackets.d.ts | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 codemirror/codemirror-matchbrackets-tests.ts create mode 100644 codemirror/codemirror-matchbrackets.d.ts diff --git a/codemirror/codemirror-matchbrackets-tests.ts b/codemirror/codemirror-matchbrackets-tests.ts new file mode 100644 index 000000000..2189612c0 --- /dev/null +++ b/codemirror/codemirror-matchbrackets-tests.ts @@ -0,0 +1,4 @@ +/// +/// + +var myCodeMirror: CodeMirror.Editor = CodeMirror(document.body, { matchBrackets: true }); diff --git a/codemirror/codemirror-matchbrackets.d.ts b/codemirror/codemirror-matchbrackets.d.ts new file mode 100644 index 000000000..13241a5a3 --- /dev/null +++ b/codemirror/codemirror-matchbrackets.d.ts @@ -0,0 +1,13 @@ +// Type definitions for CodeMirror +// Project: https://github.com/marijnh/CodeMirror +// Definitions by: Sixin Li +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// See docs https://codemirror.net/doc/manual.html#addon_matchbrackets + +declare module CodeMirror { + interface EditorConfiguration { + // when set to true, causes matching brackets to be highlighted whenever the cursor is next to them + matchBrackets?: boolean; + } +}