This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary:Added some missing documentation. I didn't really document `RichUtils`, I just added a placeholder so it's at least easy to find out which methods are available without having to resort to the source code (and the names should be self explanatory enough for it to be good for now). Resolves #263 Closes #269 Differential Revision: D3139568 fb-gh-sync-id: 34cfa671c189b561c6a84c5ba991be224019dbe1 fbshipit-source-id: 34cfa671c189b561c6a84c5ba991be224019dbe1
- Loading branch information
Showing
5 changed files
with
146 additions
and
3 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,124 @@ | ||
--- | ||
id: api-reference-rich-utils | ||
title: RichUtils | ||
layout: docs | ||
category: API Reference | ||
next: api-reference-modifier | ||
permalink: docs/api-reference-rich-utils.html | ||
--- | ||
|
||
The `RichUtils` module is a static set of utility functions for rich text | ||
editing. | ||
|
||
In each case, these methods accept `EditorState` objects with relevant | ||
parameters and return `EditorState` objects. | ||
|
||
## Static Methods | ||
|
||
### currentBlockContainsLink | ||
|
||
``` | ||
currentBlockContainsLink( | ||
editorState: EditorState | ||
): boolean | ||
``` | ||
|
||
### getCurrentBlockType | ||
|
||
``` | ||
getCurrentBlockType( | ||
editorState: EditorState | ||
): string | ||
``` | ||
|
||
### handleKeyCommand | ||
|
||
``` | ||
handleKeyCommand( | ||
editorState: EditorState, | ||
command: string | ||
): boolean | ||
``` | ||
|
||
### insertSoftNewline | ||
|
||
``` | ||
insertSoftNewline( | ||
editorState: EditorState | ||
): EditorState | ||
``` | ||
|
||
### onBackspace | ||
|
||
``` | ||
onBackspace( | ||
editorState: EditorState | ||
): EditorState? | ||
``` | ||
|
||
### onDelete | ||
|
||
``` | ||
onDelete( | ||
editorState: EditorState | ||
): EditorState? | ||
``` | ||
|
||
### onTab | ||
|
||
``` | ||
onTab( | ||
event: SyntheticEvent, | ||
editorState: EditorState, | ||
maxDepth: integer | ||
): EditorState | ||
``` | ||
|
||
### toggleBlockType | ||
|
||
``` | ||
toggleBlockType( | ||
editorState: EditorState, | ||
blockType: string | ||
): EditorState | ||
``` | ||
|
||
### toggleCode | ||
|
||
``` | ||
toggleCode( | ||
editorState: EditorState | ||
): EditorState | ||
``` | ||
|
||
### toggleInlineStyle | ||
|
||
``` | ||
toggleInlineStyle( | ||
editorState: EditorState, | ||
inlineStyle: string | ||
): EditorState | ||
``` | ||
|
||
Toggle the specified inline style for the selection. If the | ||
user's selection is collapsed, apply or remove the style for the | ||
internal state. If it is not collapsed, apply the change directly | ||
to the document state. | ||
|
||
### toggleLink | ||
|
||
``` | ||
toggleLink( | ||
editorState: EditorState, | ||
targetSelection: SelectionState, | ||
entityKey: string | ||
): EditorState | ||
``` | ||
|
||
### tryToRemoveBlockStyle | ||
|
||
``` | ||
tryToRemoveBlockStyle( | ||
editorState: EditorState | ||
): EditorState? | ||
``` |
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