1+ // @flow
12import * as timings from "./timings" ;
23import { prefs , features } from "./prefs" ;
34import { isDevelopment } from "devtools-config" ;
45import { formatPausePoints } from "./pause/pausePoints" ;
56
6- function findSource ( dbg , url ) {
7+ function findSource ( dbg : any , url : string ) {
78 const sources = dbg . selectors . getSources ( ) ;
89 const source = sources . find ( s => ( s . get ( "url" ) || "" ) . includes ( url ) ) ;
910
@@ -14,23 +15,23 @@ function findSource(dbg, url) {
1415 return source . toJS ( ) ;
1516}
1617
17- function sendPacket ( dbg , packet , callback ) {
18+ function sendPacket ( dbg : any , packet : any , callback : ( ) = > void ) {
1819 dbg . client . sendPacket ( packet , callback || console . log ) ;
1920}
2021
21- function sendPacketToThread ( dbg , packet , callback ) {
22+ function sendPacketToThread ( dbg : Object , packet : any , callback : ( ) = > void ) {
2223 sendPacket (
2324 dbg ,
2425 { to : dbg . connection . tabConnection . threadClient . actor , ...packet } ,
2526 callback
2627 ) ;
2728}
2829
29- function evaluate ( dbg , expression , callback ) {
30+ function evaluate ( dbg : Object , expression : any , callback : ( ) = > void ) {
3031 dbg . client . evaluate ( expression ) . then ( callback || console . log ) ;
3132}
3233
33- function bindSelectors ( obj ) {
34+ function bindSelectors ( obj : Object ) : Object {
3435 return Object . keys ( obj . selectors ) . reduce ( ( bound , selector ) => {
3536 bound [ selector ] = ( a , b , c ) =>
3637 obj . selectors [ selector ] ( obj . store . getState ( ) , a , b , c ) ;
@@ -39,19 +40,19 @@ function bindSelectors(obj) {
3940}
4041
4142function getCM ( ) {
42- const cm = document . querySelector ( ".CodeMirror" ) ;
43+ const cm : any = document . querySelector ( ".CodeMirror" ) ;
4344 return cm && cm . CodeMirror ;
4445}
4546
46- function _formatPausePoints ( dbg , url ) {
47+ function _formatPausePoints ( dbg : Object , url : string ) {
4748 const source = dbg . helpers . findSource ( url ) ;
4849 const pausePoints = dbg . selectors . getPausePoints ( source ) ;
4950 console . log ( formatPausePoints ( source . text , pausePoints ) ) ;
5051}
5152
52- export function setupHelper ( obj ) {
53+ export function setupHelper ( obj : Object ) {
5354 const selectors = bindSelectors ( obj ) ;
54- const dbg = {
55+ const dbg : Object = {
5556 ...obj ,
5657 selectors,
5758 prefs,
0 commit comments