You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/document.js
+6-6
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ var Anchor = require("./anchor").Anchor;
16
16
/**
17
17
*
18
18
* Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty.
19
-
* @param {String | Array} text The starting text
19
+
* @param {String | String[]} textOrLines text The starting text
20
20
* @constructor
21
21
**/
22
22
@@ -190,7 +190,7 @@ var Document = function(textOrLines) {
190
190
* Returns all the text within `range` as an array of lines.
191
191
* @param {Range} range The range to work with.
192
192
*
193
-
* @returns {Array}
193
+
* @returns {string[]}
194
194
**/
195
195
this.getLinesForRange=function(range){
196
196
varlines;
@@ -322,7 +322,7 @@ var Document = function(textOrLines) {
322
322
/**
323
323
* Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event.
324
324
* @param {Number} row The index of the row to insert at
325
-
* @param {Array} lines An array of strings
325
+
* @param {string[]} lines An array of strings
326
326
* @returns {Object} Contains the final row and column, like this:
327
327
* ```
328
328
* {row: endRow, column: 0}
@@ -358,7 +358,7 @@ var Document = function(textOrLines) {
358
358
/**
359
359
* Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event.
360
360
* @param {Number} row The index of the row to insert at
361
-
* @param {Array} lines An array of strings
361
+
* @param {string[]} lines An array of strings
362
362
* @returns {Object} Contains the final row and column, like this:
363
363
* ```
364
364
* {row: endRow, column: 0}
@@ -514,7 +514,7 @@ var Document = function(textOrLines) {
514
514
515
515
/**
516
516
* Applies all changes in `deltas` to the document.
517
-
* @param {Array} deltas An array of delta objects (can include "insert" and "remove" actions)
517
+
* @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions)
518
518
**/
519
519
this.applyDeltas=function(deltas){
520
520
for(vari=0;i<deltas.length;i++){
@@ -524,7 +524,7 @@ var Document = function(textOrLines) {
524
524
525
525
/**
526
526
* Reverts all changes in `deltas` from the document.
527
-
* @param {Array} deltas An array of delta objects (can include "insert" and "remove" actions)
527
+
* @param {Delta[]} deltas An array of delta objects (can include "insert" and "remove" actions)
Copy file name to clipboardExpand all lines: src/edit_session.js
+7-7
Original file line number
Diff line number
Diff line change
@@ -102,9 +102,9 @@ var SearchHighlight = require("./search_highlight").SearchHighlight;
102
102
//}
103
103
104
104
/**
105
-
* Sets up a new `EditSession` and associates it with the given `Document` and `TextMode`.
105
+
* Sets up a new `EditSession` and associates it with the given `Document` and `Mode`.
106
106
* @param {Document | String} text [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam}
107
-
* @param {TextMode} mode [The initial language mode to use for the document]{: #modeParam}
107
+
* @param {Mode} mode [The initial language mode to use for the document]{: #modeParam}
108
108
*
109
109
* @constructor
110
110
**/
@@ -683,7 +683,7 @@ EditSession.$uid = 0;
683
683
*/
684
684
/**
685
685
* Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event.
686
-
* @param {Array} annotations A list of annotations
686
+
* @param {Annotation[]} annotations A list of annotations
687
687
*
688
688
**/
689
689
this.setAnnotations=function(annotations){
@@ -693,7 +693,7 @@ EditSession.$uid = 0;
693
693
694
694
/**
695
695
* Returns the annotations for the `EditSession`.
696
-
* @returns {Array}
696
+
* @returns {Annotation[]}
697
697
**/
698
698
this.getAnnotations=function(){
699
699
returnthis.$annotations||[];
@@ -1113,7 +1113,7 @@ EditSession.$uid = 0;
1113
1113
1114
1114
/**
1115
1115
* Reverts previous changes to your document.
1116
-
* @param {Array} deltas An array of previous changes
1116
+
* @param {Delta[]} deltas An array of previous changes
1117
1117
* @param {Boolean} dontSelect [If `true`, doesn't select the range of where the change occured]{: #dontSelect}
1118
1118
*
1119
1119
* @returns {Range}
@@ -1142,7 +1142,7 @@ EditSession.$uid = 0;
1142
1142
1143
1143
/**
1144
1144
* Re-implements a previously undone change to your document.
1145
-
* @param {Array} deltas An array of previous changes
1145
+
* @param {Delta[]} deltas An array of previous changes
1146
1146
* @param {Boolean} dontSelect {:dontSelect}
1147
1147
*
1148
1148
* @returns {Range}
@@ -2077,7 +2077,7 @@ EditSession.$uid = 0;
2077
2077
* Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations}
2078
2078
* @param {Number} screenRow The screen row to check
2079
2079
* @param {Number} screenColumn The screen column to check
2080
-
* @param {int} screen character x-offset [optional]
2080
+
* @param {Number} offsetX screen character x-offset [optional]
2081
2081
*
2082
2082
* @returns {Object} The object returned has two properties: `row` and `column`.
0 commit comments