@@ -13,6 +13,8 @@ import reducer, { LogMonitorState } from './reducers';
13
13
import LogMonitorButtonBar from './LogMonitorButtonBar' ;
14
14
import LogMonitorEntryList from './LogMonitorEntryList' ;
15
15
import debounce from 'lodash.debounce' ;
16
+ import { DockMonitorState } from 'redux-devtools-dock-monitor/lib/reducers' ;
17
+ import { DockMonitorAction } from 'redux-devtools-dock-monitor/lib/actions' ;
16
18
17
19
// eslint-disable-next-line @typescript-eslint/unbound-method
18
20
const { toggleAction, setActionsActive } = ActionCreators ;
@@ -41,6 +43,27 @@ const styles: {
41
43
} ,
42
44
} ;
43
45
46
+ interface ExternalProps < S , A extends Action < unknown > > {
47
+ dispatch : Dispatch < LogMonitorAction | LiftedAction < S , A , LogMonitorState > > ;
48
+
49
+ preserveScrollTop : boolean ;
50
+ select : ( state : S ) => unknown ;
51
+ theme : keyof typeof themes | Base16Theme ;
52
+ expandActionRoot : boolean ;
53
+ expandStateRoot : boolean ;
54
+ markStateDiff : boolean ;
55
+ hideMainButtons ?: boolean ;
56
+ }
57
+
58
+ interface DefaultProps < S > {
59
+ select : ( state : unknown ) => unknown ;
60
+ theme : keyof typeof themes | Base16Theme ;
61
+ preserveScrollTop : boolean ;
62
+ expandActionRoot : boolean ;
63
+ expandStateRoot : boolean ;
64
+ markStateDiff : boolean ;
65
+ }
66
+
44
67
export interface LogMonitorProps < S , A extends Action < unknown > >
45
68
extends LiftedState < S , A , LogMonitorState > {
46
69
dispatch : Dispatch < LogMonitorAction | LiftedAction < S , A , LogMonitorState > > ;
@@ -54,10 +77,9 @@ export interface LogMonitorProps<S, A extends Action<unknown>>
54
77
hideMainButtons ?: boolean ;
55
78
}
56
79
57
- export default class LogMonitor <
58
- S ,
59
- A extends Action < unknown >
60
- > extends PureComponent < LogMonitorProps < S , A > > {
80
+ class LogMonitor < S , A extends Action < unknown > > extends PureComponent <
81
+ LogMonitorProps < S , A >
82
+ > {
61
83
static update = reducer ;
62
84
63
85
static propTypes = {
@@ -80,7 +102,7 @@ export default class LogMonitor<
80
102
hideMainButtons : PropTypes . bool ,
81
103
} ;
82
104
83
- static defaultProps = {
105
+ static defaultProps : DefaultProps < unknown > = {
84
106
select : ( state : unknown ) => state ,
85
107
theme : 'nicinabox' ,
86
108
preserveScrollTop : true ,
@@ -248,3 +270,14 @@ export default class LogMonitor<
248
270
) ;
249
271
}
250
272
}
273
+
274
+ export default ( LogMonitor as unknown ) as React . ComponentType <
275
+ ExternalProps < unknown , Action < unknown > >
276
+ > & {
277
+ update (
278
+ monitorProps : ExternalProps < unknown , Action < unknown > > ,
279
+ state : DockMonitorState | undefined ,
280
+ action : DockMonitorAction
281
+ ) : DockMonitorState ;
282
+ defaultProps : DefaultProps < unknown > ;
283
+ } ;
0 commit comments