Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit b4a1db9

Browse files
mrkevfacebook-github-bot
authored andcommitted
Strictify DraftEditorLeaf.react.js
Summary: happyflow Didn't need to change any functionality too. Reviewed By: gkz Differential Revision: D19894146 fbshipit-source-id: 9d94eab312b979257aeb79a57e10c8590a42a63a
1 parent 0a4952c commit b4a1db9

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/component/contents/DraftEditorLeaf.react.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*
77
* @format
8-
* @flow
8+
* @flow strict-local
99
* @emails oncall+draft_js
1010
*/
1111

@@ -23,15 +23,25 @@ const isHTMLBRElement = require('isHTMLBRElement');
2323
const setDraftEditorSelection = require('setDraftEditorSelection')
2424
.setDraftEditorSelection;
2525

26+
type CSSStyleObject = {
27+
[property: string]: string | number,
28+
};
29+
30+
type CustomStyleMap = {[name: string]: CSSStyleObject};
31+
type CustomStyleFn = (
32+
style: DraftInlineStyle,
33+
block: BlockNodeRecord,
34+
) => ?CSSStyleObject;
35+
2636
type Props = {
2737
// The block that contains this leaf.
2838
block: BlockNodeRecord,
2939

3040
// Mapping of style names to CSS declarations.
31-
customStyleMap: Object,
41+
customStyleMap: CustomStyleMap,
3242

3343
// Function that maps style names to CSS style objects.
34-
customStyleFn: Function,
44+
customStyleFn: CustomStyleFn,
3545

3646
// Whether to force the DOM selection after render.
3747
forceSelection: boolean,

0 commit comments

Comments
 (0)