Adds definition of ContentState.getEntityMap() (#31706)

This commit is contained in:
Claudio Procida
2018-12-31 12:53:32 -08:00
committed by Sheetal Nandi
parent 71211f88c4
commit e338aaeaa4
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -315,6 +315,7 @@ ReactDOM.render(
const editorState = EditorState.createEmpty();
const contentState = editorState.getCurrentContent();
const entityMap = contentState.getEntityMap();
const rawContentState: RawDraftContentState = convertToRaw(contentState);
rawContentState.blocks.forEach((block: RawDraftContentBlock) => {
+2
View File
@@ -9,6 +9,7 @@
// Santiago Vilar <https://github.com/smvilar>
// Ulf Schwekendiek <https://github.com/sulf>
// Pablo Varela <https://github.com/pablopunk>
// Claudio Procida <https://github.com/claudiopro>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -754,6 +755,7 @@ declare namespace Draft {
createEntity(type: DraftEntityType, mutability: DraftEntityMutability, data?: Object): ContentState;
getEntity(key: string): EntityInstance;
getEntityMap(): any;
getLastCreatedEntityKey(): string;
mergeEntityData(key: string, toMerge: { [key: string]: any }): ContentState;
replaceEntityData(key: string, toMerge: { [key: string]: any }): ContentState;