Like Command, i.e. can pass or fail with Error. It is defined as separate type alias to differentiate the usage scenarios. Conditions we use in context of matching condition on entity. Condition is like a predicate but instead of (true | false) you get (passed | throws Error)
Read "void" in Query<T, void> as "matched", or "passed".
▪ E
- Condition
- Fn‹E, void›
+ new Condition(description
: any, fn
: any): Condition
Defined in lib/wait.ts:75
Parameters:
Name | Type |
---|---|
description |
any |
fn |
any |
Returns: Condition
• description: string
Defined in lib/wait.ts:74
• fn: Lambda‹E, void›
Defined in lib/wait.ts:75
▸ and(condition
: Condition‹E›): any
Defined in lib/wait.ts:86
Parameters:
Name | Type |
---|---|
condition |
Condition‹E› |
Returns: any
▸ call(entity
: E): Promise‹void›
Implementation of Fn
Defined in lib/wait.ts:82
Parameters:
Name | Type |
---|---|
entity |
E |
Returns: Promise‹void›
▸ or(condition
: Condition‹E›): Condition‹E›
Defined in lib/wait.ts:90
Parameters:
Name | Type |
---|---|
condition |
Condition‹E› |
Returns: Condition‹E›
▸ toString(): string
Defined in lib/wait.ts:94
Returns: string
▸ all<T>(...conditions
: Condition‹T›[]): Condition‹T›
Defined in lib/wait.ts:161
Transforms conditions array provided as varargs to condition by applying Condition.and
Type parameters:
▪ T
Parameters:
Name | Type |
---|---|
...conditions |
Condition‹T›[] |
Returns: Condition‹T›
▸ allNot<T>(...conditions
: Condition‹T›[]): Condition‹T›
Defined in lib/wait.ts:176
Transforms conditions array provided as varargs to condition by applying Condition.and
Type parameters:
▪ T
Parameters:
Name | Type |
---|---|
...conditions |
Condition‹T›[] |
Returns: Condition‹T›
▸ and<T>(...conditions
: Condition‹T›[]): Condition‹T›
Defined in lib/wait.ts:130
Combines conditions by logical AND
Type parameters:
▪ T
Parameters:
Name | Type |
---|---|
...conditions |
Condition‹T›[] |
Returns: Condition‹T›
▸ asPredicate<T>(...conditions
: Condition‹T›[]): (Anonymous function)
Defined in lib/wait.ts:193
Transforms Conditions (returning (void | throws Error)), combined by AND if more than one, to async Predicate (returning (true | false))
Type parameters:
▪ T
Parameters:
Name | Type |
---|---|
...conditions |
Condition‹T›[] |
Returns: (Anonymous function)
▸ not<T>(condition
: Condition‹T›, description?
: string): Condition‹T›
Defined in lib/wait.ts:109
Negates condition. Making the negated condition to:
- pass (return void) in case original condition would throw Error
- throw Error in case original condition would pass (return void)
Type parameters:
▪ T
Parameters:
Name | Type | Description |
---|---|---|
condition |
Condition‹T› | original condition to be negated |
description? |
string | custom description if "not " version is not enough |
Returns: Condition‹T›
▸ or<T>(...conditions
: Condition‹T›[]): Condition‹T›
Defined in lib/wait.ts:142
Combines conditions by logical OR
Type parameters:
▪ T
Parameters:
Name | Type |
---|---|
...conditions |
Condition‹T›[] |
Returns: Condition‹T›