UNPKG

1.43 kBTypeScriptView Raw
1/**
2 * A find options property bag with the selector and thisArg for binding all optional.
3 *
4 * @export
5 * @interface OptionalFindOptions
6 * @template T The type of the elements in the source sequence.
7 */
8export interface OptionalFindOptions<T> {
9 /**
10 * The optional `this` binding for the predicate function.
11 *
12 * @type {*}
13 * @memberof OptionalFindOptions
14 */
15 thisArg?: any;
16 /**
17 * The optional predicate which gives the current value and the current index. This function
18 * returns either a boolean or a promise containing a boolean whether the condition holds or not.
19 *
20 * @memberof OptionalFindOptions
21 */
22 predicate?: (value: T, index: number) => boolean;
23}
24/**
25 * A find options property bag with the selector being required and the thisArg for binding are all optional.
26 *
27 * @export
28 * @interface FindOptions
29 * @template T The type of the elements in the source sequence.
30 */
31export interface FindOptions<T> {
32 /**
33 * The optional `this` binding for the predicate function.
34 *
35 * @type {*}
36 * @memberof FindOptions
37 */
38 thisArg?: any;
39 /**
40 * The optional predicate which gives the current value and the current index. This function
41 * returns either a truthy value whether the condition holds or not.
42 *
43 * @memberof FindOptions
44 */
45 predicate: (value: T, index: number, signal?: AbortSignal) => boolean;
46}