Skip to content
This repository was archived by the owner on May 31, 2020. It is now read-only.

Commit febab93

Browse files
committed
add missing flowtype
1 parent 6e41163 commit febab93

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/atomic-block/src/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow
22

33
import React, { Component } from 'react'
4+
import type { Node } from 'react'
45
import { withPluginContext, constants } from '@djsp/core'
56
import type { PluginProps } from '@djsp/core'
67
import { ContentBlock, EditorState, Modifier, SelectionState } from 'draft-js'
@@ -13,7 +14,7 @@ const _BlockChildren = ({
1314
editorState,
1415
setEditorState,
1516
...props
16-
}: Object) => {
17+
}: Object): Node => {
1718
const blockKey = props.block.getKey()
1819
const { children, focusBlock } = props.blockProps
1920
const selection = editorState.getSelection()
@@ -43,7 +44,7 @@ type Props = PluginProps & {
4344
// Set selection of editor to next/previous block
4445
const setSelection = (
4546
editorState: EditorState,
46-
setEditorState: EditorState,
47+
setEditorState: (editorState: EditorState) => void,
4748
newActiveBlock: ContentBlock
4849
): void => {
4950
// TODO verify that always a key-0-0 exists
@@ -91,7 +92,7 @@ class AtomicBlockPlugin extends Component<Props> {
9192
this.unregister()
9293
}
9394

94-
handleKeyCommand = (command, editorState) => {
95+
handleKeyCommand = (command: string, editorState: EditorState): DraftHandleValue => {
9596
const { setEditorState } = this.props
9697

9798
let contentState = editorState.getCurrentContent()
@@ -189,7 +190,7 @@ class AtomicBlockPlugin extends Component<Props> {
189190
)
190191
}
191192

192-
handleReturn = (event, editorState) => {
193+
handleReturn = (event: SyntheticKeyboardEvent<*>, editorState: EditorState): DraftHandleValue => {
193194
const { setEditorState } = this.props
194195
const selection = editorState.getSelection()
195196

@@ -205,7 +206,7 @@ class AtomicBlockPlugin extends Component<Props> {
205206
return constants.NOT_HANDLED
206207
}
207208

208-
blockRendererFn = block => {
209+
blockRendererFn = (block: ContentBlock): ?Object => {
209210
const { type, children, editorState } = this.props
210211

211212
const content = editorState.getCurrentContent()

0 commit comments

Comments
 (0)