Add strongly typed overload to CodeMirror.defineMode (#9025)

This commit is contained in:
Paul Chen
2016-04-23 16:43:21 +09:00
committed by Masahiro Wakame
parent 71b4d6f608
commit eef739049c
+6
View File
@@ -1063,6 +1063,12 @@ declare namespace CodeMirror {
*/
function defineMode(id: string, modefactory: ModeFactory<any>): 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<T>(id: string, modefactory: ModeFactory<T>): 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.