forked from codex-team/editor.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Caret API * Check block existence before setting the caret * Update docs/api.md Co-Authored-By: gohabereg <gohabereg@users.noreply.github.com> * Update docs/api.md Co-Authored-By: gohabereg <gohabereg@users.noreply.github.com> * Update docs/api.md Co-Authored-By: gohabereg <gohabereg@users.noreply.github.com> * Update CHANGELOG.md
- Loading branch information
Showing
8 changed files
with
235 additions
and
43 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,56 @@ | ||
/** | ||
* Describes Editor`s caret API | ||
* | ||
* TODO | ||
*/ | ||
export interface Caret {} | ||
export interface Caret { | ||
|
||
/** | ||
* Sets caret to the first Block | ||
* | ||
* @param {string} position - position where to set caret | ||
* @param {number} offset - caret offset | ||
* | ||
* @return {boolean} | ||
*/ | ||
setToFirstBlock(position?: 'end'|'start'|'default', offset?: number): boolean; | ||
|
||
/** | ||
* Sets caret to the last Block | ||
* | ||
* @param {string} position - position where to set caret | ||
* @param {number} offset - caret offset | ||
* | ||
* @return {boolean} | ||
*/ | ||
setToLastBlock(position?: 'end'|'start'|'default', offset?: number): boolean; | ||
|
||
/** | ||
* Sets caret to the previous Block | ||
* | ||
* @param {string} position - position where to set caret | ||
* @param {number} offset - caret offset | ||
* | ||
* @return {boolean} | ||
*/ | ||
setToPreviousBlock(position?: 'end'|'start'|'default', offset?: number): boolean; | ||
|
||
/** | ||
* Sets caret to the next Block | ||
* | ||
* @param {string} position - position where to set caret | ||
* @param {number} offset - caret offset | ||
* | ||
* @return {boolean} | ||
*/ | ||
setToNextBlock(position?: 'end'|'start'|'default', offset?: number): boolean; | ||
|
||
/** | ||
* Sets caret to the Block by passed index | ||
* | ||
* @param {number} index - index of Block where to set caret | ||
* @param {string} position - position where to set caret | ||
* @param {number} offset - caret offset | ||
* | ||
* @return {boolean} | ||
*/ | ||
setToBlock(index: number, position?: 'end'|'start'|'default', offset?: number): boolean; | ||
} |