diff --git a/types/draft-js/draft-js-tests.tsx b/types/draft-js/draft-js-tests.tsx index c0c64256fd..2375da74d4 100644 --- a/types/draft-js/draft-js-tests.tsx +++ b/types/draft-js/draft-js-tests.tsx @@ -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) => { diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index 4f2c34dd3a..4c00e7598f 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -9,6 +9,7 @@ // Santiago Vilar // Ulf Schwekendiek // Pablo Varela +// Claudio Procida // 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;