mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[codemirror] Add lacked arguments of runMode (#43629)
This commit is contained in:
parent
f020953f46
commit
36d0ed0829
12
types/codemirror/addon/runmode/runmode.d.ts
vendored
12
types/codemirror/addon/runmode/runmode.d.ts
vendored
@ -12,13 +12,13 @@ declare module "codemirror" {
|
||||
/**
|
||||
* Runs a CodeMirror mode over text without opening an editor instance.
|
||||
*
|
||||
* @param text The document to run through the highlighter.
|
||||
* @param mode The mode to use (must be loaded as normal).
|
||||
* @param text The document to run through the highlighter.
|
||||
* @param mode The mode to use (must be loaded as normal).
|
||||
* @param output If this is a function, it will be called for each token with
|
||||
* two arguments, the token's text and the token's style class
|
||||
* (may be null for unstyled tokens). If it is a DOM node, the
|
||||
* tokens will be converted to span elements as in an editor,
|
||||
* five arguments, the token's text, the token's style class (may be null for unstyled tokens),
|
||||
* the number of row of the token, the column position of token and the state of mode.
|
||||
* If it is a DOM node, the tokens will be converted to span elements as in an editor,
|
||||
* and inserted into the node (through innerHTML).
|
||||
*/
|
||||
function runMode(text: string, modespec: any, callback: (HTMLElement | ((text: string, style: string | null) => void)), options? : { tabSize?: number; state?: any; }): void;
|
||||
function runMode(text: string, mode: any, callback: (HTMLElement | ((text: string, style?: string | null, row?: number, column?: number, state?: any) => void)), options? : { tabSize?: number; state?: any; }): void;
|
||||
}
|
||||
|
||||
@ -4,3 +4,4 @@ import "codemirror/addon/runmode/runmode";
|
||||
const query = "SELECT * FROM Table";
|
||||
|
||||
CodeMirror.runMode(query, "text/x-sql", document.body);
|
||||
CodeMirror.runMode(query, "text/x-sql", (text, style, row, column, state) => {});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user