mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-03 16:50:15 +00:00
fix(draft-js): Update definitions for draft-js@0.10.0 (#14651)
* fix(draft-js): Update definitions for draft-js@0.10.0 * fix(draft-js): Update header version * fix(draft-js): Add contentState#getLastCreatedEntityKey()
This commit is contained in:
committed by
Mohamed Hegazy
parent
4aae472c0f
commit
09a387491d
11
draft-js/index.d.ts
vendored
11
draft-js/index.d.ts
vendored
@@ -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 <https://github.com/dmitryrogozhny>, Eelco Lempsink <https://github.com/eelco>
|
||||
// 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<string>;
|
||||
type BlockMap = Immutable.OrderedMap<string, Draft.Model.ImmutableData.ContentBlock>;
|
||||
|
||||
@@ -701,6 +704,10 @@ declare namespace Draft {
|
||||
static createFromBlockArray(blocks: Array<ContentBlock>): 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;
|
||||
|
||||
Reference in New Issue
Block a user