diff --git a/draft-js/index.d.ts b/draft-js/index.d.ts index 1805a17ab0..a79de31e70 100644 --- a/draft-js/index.d.ts +++ b/draft-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Draft.js v0.9.0 +// Type definitions for Draft.js v0.10.0 // Project: https://facebook.github.io/draft-js/ // Definitions by: Dmitry Rogozhny , Eelco Lempsink // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -357,7 +357,7 @@ declare namespace Draft { * - "props": Props to be passed into the React component that will be used. */ interface DraftDecorator { - strategy: (block: ContentBlock, callback: (start: number, end: number) => void) => void; + strategy: (block: ContentBlock, callback: (start: number, end: number) => void, contentState: ContentState) => void; component: Function; props?: Object; } @@ -564,6 +564,9 @@ declare namespace Draft { import DraftBlockType = Draft.Model.Constants.DraftBlockType; import DraftDecoratorType = Draft.Model.Decorators.DraftDecoratorType; + import DraftEntityType = Draft.Model.Entity.DraftEntityType; + import DraftEntityMutability = Draft.Model.Entity.DraftEntityMutability; + type DraftInlineStyle = Immutable.OrderedSet; type BlockMap = Immutable.OrderedMap; @@ -701,6 +704,10 @@ declare namespace Draft { static createFromBlockArray(blocks: Array): ContentState; static createFromText(text: string, delimiter?: string): ContentState; + createEntity(type: DraftEntityType, mutability: DraftEntityMutability, data?: Object): ContentState; + getEntity(key: string): EntityInstance; + getLastCreatedEntityKey(): string; + getBlockMap(): BlockMap; getSelectionBefore(): SelectionState; getSelectionAfter(): SelectionState;