@@ -465,7 +465,9 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
465
465
* a specified scroll position (for cases like `cut` behavior where it should
466
466
* be restored to a known position).
467
467
*/
468
- focus: any = ( scrollPosition ? : DraftScrollPosition ) : void => {
468
+ focus: ( scrollPosition ? : DraftScrollPosition ) => void = (
469
+ scrollPosition ? : DraftScrollPosition ,
470
+ ) : void => {
469
471
const { editorState} = this . props ;
470
472
const alreadyHasFocus = editorState . getSelection ( ) . getHasFocus ( ) ;
471
473
const editorNode = ReactDOM . findDOMNode ( this . editor ) ;
@@ -504,7 +506,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
504
506
}
505
507
} ;
506
508
507
- blur: any = ( ) : void => {
509
+ blur: ( ) => void = ( ) : void => {
508
510
const editorNode = ReactDOM . findDOMNode ( this . editor ) ;
509
511
invariant (
510
512
editorNode instanceof HTMLElement ,
@@ -520,11 +522,11 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
520
522
* handler module to ensure that DOM events are managed appropriately for
521
523
* the active mode.
522
524
*/
523
- setMode: any = ( mode : DraftEditorModes ) : void => {
525
+ setMode: DraftEditorModes => void = ( mode : DraftEditorModes ) : void => {
524
526
this . _handler = handlerMap [ mode ] ;
525
527
} ;
526
528
527
- exitCurrentMode: any = ( ) : void => {
529
+ exitCurrentMode: ( ) => void = ( ) : void => {
528
530
this . setMode ( 'edit' ) ;
529
531
} ;
530
532
@@ -537,7 +539,9 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
537
539
* reconciliation occurs on a version of the DOM that is synchronized with
538
540
* our EditorState.
539
541
*/
540
- restoreEditorDOM: any = ( scrollPosition ? : DraftScrollPosition ) : void => {
542
+ restoreEditorDOM: ( scrollPosition ? : DraftScrollPosition ) => void = (
543
+ scrollPosition ? : DraftScrollPosition ,
544
+ ) : void => {
541
545
this. setState ( { contentsKey : this . state . contentsKey + 1 } , ( ) => {
542
546
this . focus ( scrollPosition ) ;
543
547
} ) ;
@@ -548,7 +552,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
548
552
*
549
553
* Set the clipboard state for a cut/copy event.
550
554
*/
551
- setClipboard: any = ( clipboard : ?BlockMap ) : void => {
555
+ setClipboard: ( ? BlockMap ) => void = ( clipboard : ?BlockMap ) : void => {
552
556
this . _clipboard = clipboard ;
553
557
} ;
554
558
@@ -557,7 +561,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
557
561
*
558
562
* Retrieve the clipboard state for a cut/copy event.
559
563
*/
560
- getClipboard: any = ( ) : ?BlockMap => {
564
+ getClipboard: ( ) => ? BlockMap = ( ) : ?BlockMap => {
561
565
return this . _clipboard ;
562
566
} ;
563
567
@@ -570,7 +574,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
570
574
* an `onChange` prop to receive state updates passed along from this
571
575
* function.
572
576
*/
573
- update: any = ( editorState : EditorState ) : void => {
577
+ update: EditorState => void = ( editorState : EditorState ) : void => {
574
578
this . _latestEditorState = editorState ;
575
579
this . props . onChange ( editorState ) ;
576
580
} ;
@@ -580,14 +584,14 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
580
584
* a dragged element enters and leaves the editor (or any of its children),
581
585
* to determine when the dragged element absolutely leaves the editor.
582
586
*/
583
- onDragEnter: any = ( ) : void => {
587
+ onDragEnter: ( ) => void = ( ) : void => {
584
588
this . _dragCount ++ ;
585
589
} ;
586
590
587
591
/**
588
592
* See `onDragEnter()`.
589
593
*/
590
- onDragLeave: any = ( ) : void => {
594
+ onDragLeave: ( ) => void = ( ) : void => {
591
595
this . _dragCount -- ;
592
596
if ( this . _dragCount === 0 ) {
593
597
this . exitCurrentMode ( ) ;
0 commit comments