mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
CodeMirror documentation differs from types for addLineWidget (#30529)
This commit is contained in:
parent
615629e8f9
commit
cff4ff4231
5
types/codemirror/index.d.ts
vendored
5
types/codemirror/index.d.ts
vendored
@ -670,6 +670,11 @@ declare namespace CodeMirror {
|
||||
/** Returns an array containing all marked ranges in the document. */
|
||||
getAllMarks(): CodeMirror.TextMarker[];
|
||||
|
||||
/** Adds a line widget, an element shown below a line, spanning the whole of the editor's width, and moving the lines below it downwards.
|
||||
line should be either an integer or a line handle, and node should be a DOM node, which will be displayed below the given line.
|
||||
options, when given, should be an object that configures the behavior of the widget.
|
||||
Note that the widget node will become a descendant of nodes with CodeMirror-specific CSS classes, and those classes might in some cases affect it. */
|
||||
addLineWidget(line: any, node: HTMLElement, options?: CodeMirror.LineWidgetOptions): CodeMirror.LineWidget;
|
||||
|
||||
/** Gets the mode object for the editor. Note that this is distinct from getOption("mode"), which gives you the mode specification,
|
||||
rather than the resolved, instantiated mode object. */
|
||||
|
||||
@ -91,3 +91,12 @@ CodeMirror.registerHelper("lint", "javascript", {});
|
||||
|
||||
myCodeMirror.isReadOnly();
|
||||
myCodeMirror.execCommand('selectAll');
|
||||
|
||||
let htmlElement1 = document.createElement('div');
|
||||
let htmlElement2 = document.createElement('div');
|
||||
let widget1 = myCodeMirror.addLineWidget(1, htmlElement1, {});
|
||||
let widget2 = doc.addLineWidget(1, htmlElement2, {});
|
||||
widget1.clear();
|
||||
widget2.clear();
|
||||
htmlElement1.remove();
|
||||
htmlElement2.remove();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user