From eef739049cdd4509bb02f6b71e1b7cc7bacd7c2b Mon Sep 17 00:00:00 2001 From: Paul Chen Date: Sat, 23 Apr 2016 15:43:21 +0800 Subject: [PATCH] Add strongly typed overload to CodeMirror.defineMode (#9025) --- codemirror/codemirror.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 6196d015c6..bade422821 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -1063,6 +1063,12 @@ declare namespace CodeMirror { */ function defineMode(id: string, modefactory: ModeFactory): void; + /** + * id will be the id for the defined mode. Typically, you should use this second argument to defineMode as your module scope function + * (modes should not leak anything into the global scope!), i.e. write your whole mode inside this function. + */ + function defineMode(id: string, modefactory: ModeFactory): void; + /** * The first argument is a configuration object as passed to the mode constructor function, and the second argument * is a mode specification as in the EditorConfiguration mode option.