ConditionalCheck
Stentor API Reference / stentor-models/src / ConditionalCheck
Interface: ConditionalCheck\<T>
Defined in: packages/stentor-models/src/Conditional.ts:10
A conditional check is used to test an object to see if the check applies and also can perform the check.
The functions are used to check the condition with evaluating a string conditional.
Type Parametersβ
Tβ
T = any
Propertiesβ
test()β
test: (
obj) =>obj is T
Defined in: packages/stentor-models/src/Conditional.ts:15
A test for an object, that if returns true, can then be passed to the check function.
Parametersβ
objβ
object | T
Returnsβ
obj is T
check()β
check: (
obj, ...args) =>boolean
Defined in: packages/stentor-models/src/Conditional.ts:24
Check that is performed on the object to determine if it passes or fails the criteria.
The first argument is the object while the subsequent parameters are any additional optional information that is required to make the determination.
Parametersβ
objβ
T
argsβ
...any
Returnsβ
boolean
functionsβ
functions: (...
args) =>string|number|boolean[]
Defined in: packages/stentor-models/src/Conditional.ts:34
A set of functions that help determination within a string.
For example, for a time based conditional check, you can provide a function:
schedule(startTime: string, duration: number, timezone: string): boolean
which turns true if the current time is within the provided parameters.
Parametersβ
argsβ
...any
Returnsβ
string | number | boolean