5
5
import React from 'react' ;
6
6
import ReactHover , { Trigger , Hover } from 'react-hover' ;
7
7
import { changeView , changeSlider } from '../actions/actions' ;
8
- import { ActionProps } from '../components/FrontendTypes' ;
8
+ import { ActionProps , OptionsCursorTrueWithMargin } from '../components/FrontendTypes' ;
9
9
10
10
/**
11
11
* @function Action
@@ -41,12 +41,12 @@ const Action = (props: ActionProps): JSX.Element => {
41
41
* @function cleanTime: Displays render times for state changes
42
42
* @returns render display time in seconds in milliseconds
43
43
*/
44
- const cleanTime = ( ) :string => {
44
+ const cleanTime = ( ) : string => {
45
45
if ( ! componentData || ! componentData . actualDuration ) {
46
46
return 'NO TIME' ;
47
47
}
48
48
let seconds : number | string ;
49
- let milliseconds : any = componentData . actualDuration ;
49
+ let milliseconds : any = componentData . actualDuration ;
50
50
if ( Math . floor ( componentData . actualDuration ) > 60 ) {
51
51
seconds = Math . floor ( componentData . actualDuration / 60 ) ;
52
52
seconds = JSON . stringify ( seconds ) ;
@@ -57,8 +57,8 @@ const Action = (props: ActionProps): JSX.Element => {
57
57
} else {
58
58
seconds = '00' ;
59
59
}
60
- milliseconds = Number . parseFloat ( milliseconds ) . toFixed ( 2 ) ;
61
- const arrayMilliseconds = milliseconds . split ( '.' ) ;
60
+ milliseconds = Number . parseFloat ( milliseconds as string ) . toFixed ( 2 ) ;
61
+ const arrayMilliseconds : string | number = milliseconds . split ( '.' ) ;
62
62
if ( arrayMilliseconds [ 0 ] . length < 2 ) {
63
63
arrayMilliseconds [ 0 ] = '0' . concat ( arrayMilliseconds [ 0 ] ) ;
64
64
}
@@ -69,7 +69,7 @@ const Action = (props: ActionProps): JSX.Element => {
69
69
} ;
70
70
const displayTime : string = cleanTime ( ) ;
71
71
72
- const optionsCursorTrueWithMargin : { } = {
72
+ const optionsCursorTrueWithMargin : OptionsCursorTrueWithMargin = {
73
73
followCursor : true ,
74
74
shiftX : 20 ,
75
75
shiftY : 0 ,
@@ -79,7 +79,7 @@ const Action = (props: ActionProps): JSX.Element => {
79
79
< div className = 'individual-action' >
80
80
< div
81
81
// Invoking keyboard functionality; functionality is in ActionContainer;
82
- onKeyDown = { ( e ) => handleOnkeyDown ( e , viewIndex ) }
82
+ onKeyDown = { ( e ) : void => handleOnkeyDown ( e , viewIndex ) }
83
83
className = { selected || last ? 'action-component selected' : 'action-component' }
84
84
onClick = { ( ) => {
85
85
dispatch ( changeView ( index ) ) ;
@@ -112,7 +112,7 @@ const Action = (props: ActionProps): JSX.Element => {
112
112
) : (
113
113
< button
114
114
className = 'jump-button'
115
- onClick = { ( e : any ) : void => {
115
+ onClick = { ( e ) : void => {
116
116
e . stopPropagation ( ) ;
117
117
dispatch ( changeSlider ( index ) ) ;
118
118
dispatch ( changeView ( index ) ) ;
0 commit comments