Skip to content

Commit 651c61f

Browse files
committed
Updated docstrings
1 parent 7cecfc3 commit 651c61f

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

lib/query.class.ts

+32-2
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,52 @@ type Query =
2323

2424
export type TextQuery = Extract<Query, { type: "text" }>;
2525

26-
export type WordQuery = Extract<TextQuery, { by: { word: string | RegExp } }>;
27-
export type LineQuery = Extract<TextQuery, { by: { line: string | RegExp } }>;
26+
/**
27+
* A word query is a text query that searches for a single word on screen.
28+
* It will be processed by an {@link TextFinderInterface} instance.
29+
*/
30+
export type WordQuery = Extract<TextQuery, { by: { word: string } }>;
2831

32+
/**
33+
* A word query is a text query that searches for a single text line on screen.
34+
* It will be processed by an {@link TextFinderInterface} instance.
35+
*/
36+
export type LineQuery = Extract<TextQuery, { by: { line: string } }>;
37+
38+
/**
39+
* A window query is a query that searches for a window on screen.
40+
* It will be processed by an {@link WindowFinderInterface} instance.
41+
*/
2942
export type WindowQuery = Extract<Query, { type: "window" }>;
3043

44+
/**
45+
* Type guard for {@link WordQuery}
46+
* @param possibleQuery A possible word query
47+
*/
3148
export const isWordQuery = (possibleQuery: any): possibleQuery is WordQuery => {
3249
return possibleQuery?.type === "text" && possibleQuery?.by?.word != null;
3350
};
51+
52+
/**
53+
* Type guard for {@link LineQuery}
54+
* @param possibleQuery A possible line query
55+
*/
3456
export const isLineQuery = (possibleQuery: any): possibleQuery is LineQuery => {
3557
return possibleQuery?.type === "text" && possibleQuery?.by?.line != null;
3658
};
3759

60+
/**
61+
* Type guard for {@link TextQuery}
62+
* @param possibleQuery A possible line or word query
63+
*/
3864
export const isTextQuery = (possibleQuery: any): possibleQuery is TextQuery => {
3965
return possibleQuery?.type === "text";
4066
};
4167

68+
/**
69+
* Type guard for {@link WindowQuery}
70+
* @param possibleQuery A possible window query
71+
*/
4272
export const isWindowQuery = (
4373
possibleQuery: any
4474
): possibleQuery is WindowQuery => {

lib/screen.class.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ export class ScreenClass {
415415
* @param searchInput Filename of the template image, relative to {@link ScreenClass.config.resourceDirectory}, or an {@link Image}
416416
* @param timeoutMs Timeout in milliseconds after which {@link waitFor} fails
417417
* @param updateInterval Update interval in milliseconds to retry search
418-
* @param params {@link LocationParameters} which are used to fine tune search region and / or match confidence
418+
* @param params {@link OptionalSearchParameters} which are used to fine tune search region and / or match confidence
419419
*/
420420
public async waitFor<PROVIDER_DATA_TYPE>(
421421
searchInput: RegionResultFindInput | Promise<RegionResultFindInput>,

0 commit comments

Comments
 (0)