我在哪里可以找到draft.js的输出示例?我想找到向编辑器添加图像,提及内容等的输出示例。我的意思是该字符串作为输出应存储到数据库中。
Flow typing在这里,复制如下。
export type RawDraftContentState = {
blocks: Array<RawDraftContentBlock>,
entityMap: {[key: string]: RawDraftEntity, ...},
};
export type RawDraftContentBlock = {
key: ?string,
type: DraftBlockType,
text: string,
depth: ?number,
inlineStyleRanges: ?Array<InlineStyleRange>,
entityRanges: ?Array<EntityRange>,
data?: Object,
children?: Array<RawDraftContentBlock>,
...
};
export type RawDraftEntity = {
type: DraftEntityType,
mutability: DraftEntityMutability,
data: ?{[key: string]: any, ...},
...
};