@@ -15,25 +15,25 @@ export class MatchRequest<NEEDLE_TYPE, PROVIDER_DATA_TYPE> {
1515 public constructor (
1616 public readonly haystack : Image ,
1717 public readonly needle : NEEDLE_TYPE ,
18- public readonly confidence : number ,
19- public readonly providerData ?: PROVIDER_DATA_TYPE
18+ public readonly confidence : number | undefined ,
19+ public readonly providerData ?: PROVIDER_DATA_TYPE ,
2020 ) { }
2121}
2222
2323export function isImageMatchRequest < PROVIDER_DATA_TYPE > (
24- matchRequest : any
24+ matchRequest : any ,
2525) : matchRequest is MatchRequest < Image , PROVIDER_DATA_TYPE > {
2626 return isImage ( matchRequest . needle ) ;
2727}
2828
2929export function isTextMatchRequest < PROVIDER_DATA_TYPE > (
30- matchRequest : any
30+ matchRequest : any ,
3131) : matchRequest is MatchRequest < TextQuery , PROVIDER_DATA_TYPE > {
3232 return isTextQuery ( matchRequest . needle ) ;
3333}
3434
3535export function isColorMatchRequest < PROVIDER_DATA_TYPE > (
36- matchRequest : any
36+ matchRequest : any ,
3737) : matchRequest is MatchRequest < ColorQuery , PROVIDER_DATA_TYPE > {
3838 return isColorQuery ( matchRequest . needle ) ;
3939}
@@ -42,35 +42,35 @@ export function createMatchRequest<PROVIDER_DATA_TYPE>(
4242 providerRegistry : ProviderRegistry ,
4343 needle : PointResultFindInput ,
4444 searchRegion : Region ,
45- minMatch : number ,
45+ minMatch : number | undefined ,
4646 screenImage : Image ,
47- params ?: OptionalSearchParameters < PROVIDER_DATA_TYPE >
47+ params ?: OptionalSearchParameters < PROVIDER_DATA_TYPE > ,
4848) : MatchRequest < PointResultFindInput , PROVIDER_DATA_TYPE > ;
4949export function createMatchRequest < PROVIDER_DATA_TYPE > (
5050 providerRegistry : ProviderRegistry ,
5151 needle : RegionResultFindInput ,
5252 searchRegion : Region ,
53- minMatch : number ,
53+ minMatch : number | undefined ,
5454 screenImage : Image ,
55- params ?: OptionalSearchParameters < PROVIDER_DATA_TYPE >
55+ params ?: OptionalSearchParameters < PROVIDER_DATA_TYPE > ,
5656) : MatchRequest < RegionResultFindInput , PROVIDER_DATA_TYPE > ;
5757export function createMatchRequest < PROVIDER_DATA_TYPE > (
5858 providerRegistry : ProviderRegistry ,
5959 needle : RegionResultFindInput | PointResultFindInput ,
6060 searchRegion : Region ,
61- minMatch : number ,
61+ minMatch : number | undefined ,
6262 screenImage : Image ,
63- params ?: OptionalSearchParameters < PROVIDER_DATA_TYPE >
63+ params ?: OptionalSearchParameters < PROVIDER_DATA_TYPE > ,
6464) :
6565 | MatchRequest < RegionResultFindInput , PROVIDER_DATA_TYPE >
6666 | MatchRequest < PointResultFindInput , PROVIDER_DATA_TYPE > ;
6767export function createMatchRequest < PROVIDER_DATA_TYPE > (
6868 providerRegistry : ProviderRegistry ,
6969 needle : RegionResultFindInput | PointResultFindInput ,
7070 searchRegion : Region ,
71- minMatch : number ,
71+ minMatch : number | undefined ,
7272 screenImage : Image ,
73- params ?: OptionalSearchParameters < PROVIDER_DATA_TYPE >
73+ params ?: OptionalSearchParameters < PROVIDER_DATA_TYPE > ,
7474) :
7575 | MatchRequest < RegionResultFindInput , PROVIDER_DATA_TYPE >
7676 | MatchRequest < PointResultFindInput , PROVIDER_DATA_TYPE > {
@@ -80,27 +80,27 @@ export function createMatchRequest<PROVIDER_DATA_TYPE>(
8080 . info (
8181 `Searching for image ${
8282 needle . id
83- } in region ${ searchRegion . toString ( ) } . Required confidence: ${ minMatch } `
83+ } in region ${ searchRegion . toString ( ) } . Required confidence: ${ minMatch } `,
8484 ) ;
8585
8686 return new MatchRequest (
8787 screenImage ,
8888 needle ,
8989 minMatch ,
90- params ?. providerData
90+ params ?. providerData ,
9191 ) ;
9292 } else if ( isTextQuery ( needle ) ) {
9393 providerRegistry . getLogProvider ( ) . info (
9494 `Searching for ${ isLineQuery ( needle ) ? "line" : "word" } {
9595 ${ isLineQuery ( needle ) ? needle . by . line : needle . by . word }
96- } in region ${ searchRegion . toString ( ) } . Required confidence: ${ minMatch } `
96+ } in region ${ searchRegion . toString ( ) } . Required confidence: ${ minMatch } ` ,
9797 ) ;
9898
9999 return new MatchRequest (
100100 screenImage ,
101101 needle ,
102102 minMatch ,
103- params ?. providerData
103+ params ?. providerData ,
104104 ) ;
105105 } else if ( isColorQuery ( needle ) ) {
106106 const color = needle . by . color ;
@@ -109,7 +109,7 @@ export function createMatchRequest<PROVIDER_DATA_TYPE>(
109109 . info (
110110 `Searching for color RGBA(${ color . R } ,${ color . G } ,${ color . B } ,${
111111 color . A
112- } ) in region ${ searchRegion . toString ( ) } .`
112+ } ) in region ${ searchRegion . toString ( ) } .`,
113113 ) ;
114114
115115 return new MatchRequest ( screenImage , needle , 1 , params ?. providerData ) ;
0 commit comments