Skip to content

Commit b0026d9

Browse files
committed
(#455) New interfaces to search for text or windows
1 parent a3a2f05 commit b0026d9

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

lib/provider/text-finder.interface.ts

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { MatchRequest } from "../match-request.class";
2+
import { MatchResult } from "../match-result.class";
3+
import { TextQuery } from "../query.class";
4+
5+
/**
6+
* A TextFinder should provide an abstraction layer to perform text searches
7+
*
8+
* @interface TextFinderInterface
9+
*/
10+
export interface TextFinderInterface {
11+
/**
12+
* findMatch should provide an abstraction to search for an image needle
13+
* in another image haystack
14+
*
15+
* @param {MatchRequest} matchRequest A {@link MatchRequest} containing needed matching data
16+
* @returns {Promise<MatchResult>} A {@link MatchResult} holding the match probability and location
17+
* @memberof TextFinderInterface
18+
*/
19+
findMatch<PROVIDER_DATA_TYPE>(
20+
matchRequest: MatchRequest<TextQuery, PROVIDER_DATA_TYPE>
21+
): Promise<MatchResult>;
22+
23+
/**
24+
* findMatches should provide an abstraction to search for an image needle
25+
* in another image haystack
26+
*
27+
* @param {MatchRequest} matchRequest A {@link MatchRequest} containing needed matching data
28+
* @returns {Promise<MatchResult[]>} A list of {@link MatchResult}s holding the match probability and location
29+
* @memberof TextFinderInterface
30+
*/
31+
findMatches<PROVIDER_DATA_TYPE>(
32+
matchRequest: MatchRequest<TextQuery, PROVIDER_DATA_TYPE>
33+
): Promise<MatchResult[]>;
34+
}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { WindowQuery } from "../query.class";
2+
3+
/**
4+
* A WindowFinder should provide an abstraction layer to perform window searches
5+
*
6+
* @interface WindowFinderInterface
7+
*/
8+
export interface WindowFinderInterface {
9+
/**
10+
* findMatch should provide an abstraction to search for a window on screen
11+
*
12+
* @param {WindowQuery} query A {@link WindowQuery} containing needed data
13+
* @returns {Promise<number>} A single window handle
14+
* @memberof WindowFinderInterface
15+
*/
16+
findMatch(query: WindowQuery): Promise<number>;
17+
18+
/**
19+
* findMatches should provide an abstraction to search for a window on screen
20+
*
21+
* @param {WindowQuery} query A {@link WindowQuery} containing needed data
22+
* @returns {Promise<number[]>} A list of window handles
23+
* @memberof WindowFinderInterface
24+
*/
25+
findMatches(query: WindowQuery): Promise<number[]>;
26+
}

0 commit comments

Comments
 (0)