This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,13 @@ import {diffAtCaret, diffDeletion} from "./diff";
1919import DocumentPosition from "./position" ;
2020import Range from "./range" ;
2121
22+ /**
23+ * @callback ModelCallback
24+ * @param {DocumentPosition? } caretPosition the position where the caret should be position
25+ * @param {string? } inputType the inputType of the DOM input event
26+ * @param {object? } diff an object with `removed` and `added` strings
27+ */
28+
2229 /**
2330 * @callback TransformCallback
2431 * @param {DocumentPosition? } caretPosition the position where the caret should be position
@@ -50,6 +57,9 @@ export default class EditorModel {
5057 this . _transformCallback = transformCallback ;
5158 }
5259
60+ /** Set a callback for rerendering the model after it has been updated.
61+ * @param {ModelCallback } updateCallback
62+ */
5363 setUpdateCallback ( updateCallback ) {
5464 this . _updateCallback = updateCallback ;
5565 }
@@ -376,6 +386,11 @@ export default class EditorModel {
376386 return new DocumentPosition ( index , totalOffset - currentOffset ) ;
377387 }
378388
389+ /**
390+ * Starts a range, which can span across multiple parts, to find and replace text.
391+ * @param {DocumentPosition } position where to start the range
392+ * @return {Range }
393+ */
379394 startRange ( position ) {
380395 return new Range ( this , position ) ;
381396 }
You can’t perform that action at this time.
0 commit comments