Skip to content

Commit a21df03

Browse files
committed
(#500) Provide types to now generic MatchResult
1 parent 38fa0f8 commit a21df03

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/provider/image-finder.interface.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { MatchRequest } from "../match-request.class";
22
import { MatchResult } from "../match-result.class";
33
import { Image } from "../image.class";
4+
import { Region } from "../region.class";
45

56
/**
67
* An ImageFinder should provide an abstraction layer to perform image matching
@@ -18,17 +19,17 @@ export interface ImageFinderInterface {
1819
*/
1920
findMatch<PROVIDER_DATA_TYPE>(
2021
matchRequest: MatchRequest<Image, PROVIDER_DATA_TYPE>
21-
): Promise<MatchResult>;
22+
): Promise<MatchResult<Region>>;
2223

2324
/**
2425
* findMatches should provide an abstraction to search for an image needle
2526
* in another image haystack
2627
*
27-
* @param {MatchRequest} matchRequest A matchrequest containing needed matching data
28+
* @param {MatchRequest} matchRequest A match request containing needed matching data
2829
* @returns {Promise<MatchResult[]>} A list of {@link MatchResult}s holding the match probability and location
2930
* @memberof ImageFinderInterface
3031
*/
3132
findMatches<PROVIDER_DATA_TYPE>(
3233
matchRequest: MatchRequest<Image, PROVIDER_DATA_TYPE>
33-
): Promise<MatchResult[]>;
34+
): Promise<MatchResult<Region>[]>;
3435
}

lib/provider/text-finder.interface.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { MatchRequest } from "../match-request.class";
22
import { MatchResult } from "../match-result.class";
33
import { TextQuery } from "../query.class";
4+
import { Region } from "../region.class";
45

56
/**
67
* A TextFinder should provide an abstraction layer to perform text searches
@@ -18,7 +19,7 @@ export interface TextFinderInterface {
1819
*/
1920
findMatch<PROVIDER_DATA_TYPE>(
2021
matchRequest: MatchRequest<TextQuery, PROVIDER_DATA_TYPE>
21-
): Promise<MatchResult>;
22+
): Promise<MatchResult<Region>>;
2223

2324
/**
2425
* findMatches should provide an abstraction to search for an image needle
@@ -30,5 +31,5 @@ export interface TextFinderInterface {
3031
*/
3132
findMatches<PROVIDER_DATA_TYPE>(
3233
matchRequest: MatchRequest<TextQuery, PROVIDER_DATA_TYPE>
33-
): Promise<MatchResult[]>;
34+
): Promise<MatchResult<Region>[]>;
3435
}

0 commit comments

Comments
 (0)