File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ seen in recoil apps...
20
20
*/
21
21
22
22
/* TYPESCRIPT */
23
- type snapshot = any ;
24
-
25
23
interface margin { top : number ; right : number ; bottom : number ; left : number } ;
26
24
27
25
interface TooltipData {
@@ -35,6 +33,10 @@ interface TooltipData {
35
33
color : string ;
36
34
}
37
35
36
+ interface data {
37
+ snapshotId ?: string ;
38
+ }
39
+
38
40
// typescript for PROPS from StateRoute.tsx
39
41
interface BarStackProps {
40
42
width : number ;
@@ -43,6 +45,13 @@ interface BarStackProps {
43
45
hierarchy : any ;
44
46
}
45
47
48
+ interface snapshot {
49
+ children : [ ] ;
50
+ componentData : any ;
51
+ name : string ;
52
+ state : string ;
53
+ }
54
+
46
55
/* DEFAULTS */
47
56
const margin = { top : 60 , right : 30 , bottom : 0 , left : 50 } ;
48
57
const axisColor = '#679DCA' ;
@@ -58,10 +67,6 @@ const tooltipStyles = {
58
67
59
68
// traverses a snapshot - returns object of rendering times OR component state types. Depends on 2nd arg
60
69
61
- interface data {
62
- snapshotId ?: string ;
63
- }
64
-
65
70
const traverse = ( snapshot , data : data = { } ) => {
66
71
if ( ! snapshot . children [ 0 ] ) return ;
67
72
for ( let i = 0 ; i < snapshot . children . length ; i ++ ) {
@@ -115,7 +120,7 @@ const PerformanceVisx = (props: BarStackProps) => {
115
120
116
121
const data = getPerfMetrics ( snapshots , getSnapshotIds ( hierarchy ) ) ;
117
122
118
- const keys = Object . keys ( data [ 0 ] ) . filter ( d => d !== 'snapshotId' ) as [ ] ;
123
+ const keys = Object . keys ( data [ 0 ] ) . filter ( d => d !== 'snapshotId' ) ;
119
124
120
125
const allComponentStates = traverse ( snapshots [ 0 ] ) ;
121
126
You can’t perform that action at this time.
0 commit comments