- Source:
- Since:
- 1.0.0
Data classes
Methods
(static) Target(target) → {Target}
- Source:
Create a new target
Parameters:
Name | Type | Description |
---|---|---|
target
|
object | |
↳
target_id
|
string | unique id for this target |
↳
label
|
string | label that will be displayed for this target |
↳
type_id
|
string | the type_id name this target has |
Returns:
- Type
- Target
(static) Operator(operator) → {Operator}
- Source:
Create a new operator
Parameters:
Name | Type | Description |
---|---|---|
operator
|
object | |
↳
operator_id
|
string | unique id for this operator |
↳
label
|
string | label that will be displayed for this operator |
Returns:
- Type
- Operator
(static) Type(type) → {Type}
- Source:
Create a new type
Parameters:
Name | Type | Description |
---|---|---|
type
|
Object | |
↳
type_id
|
string | |
↳
operator_ids
|
Array.<string> |
Returns:
- Type
- Type
(static) LogicalType(logic)
- Source:
Create a new type logical type
Logical types or used in CompoundPredicates
Parameters:
Name | Type | Description |
---|---|---|
logic
|
Object | The predicate logic |
type.logicalType_id
|
string | |
type.label
|
string |
(static) Predicate(type) → {dataclasses.Predicate}
- Source:
Abstract Predicate type, a Predicate is the union type of CompoundPredicate | ComparisonPredicate
Parameters:
Name | Type | Description |
---|---|---|
type
|
function | Predicate subtype function constructor |
Returns:
(static) ComparisonPredicate(target, operator, args) → {Promise.<dataclasses.ComparisonPredicate>}
- Source:
A specialized predicate that you use to compare expressions.
Parameters:
Name | Type | Description |
---|---|---|
target
|
dataclasses.Target | |
operator
|
dataclasses.Operator | |
args
|
Array.<*> |
Returns:
yield a ComparisonPredicate or a rejected promise
- Type
- Promise.<dataclasses.ComparisonPredicate>
(static) ComparisonPredicate.is(predicate) → {Boolean}
- Source:
Yield true if `predicate` is a ComparisonPredicate
Parameters:
Name | Type | Description |
---|---|---|
predicate
|
dataclasses.Predicate | dataclasses.Predicate |
Returns:
- Type
- Boolean
(static) CompoundPredicate(logic, predicates) → {Promise.<dataclasses.CompoundPredicate>}
- Source:
A specialized predicate that evaluates logical combinations of other predicates.
Parameters:
Name | Type | Description |
---|---|---|
logic
|
dataclasses.LogicalType | The predicate logic |
predicates
|
Array.<dataclasses.Predicate> | predicates |
Returns:
yield a dataclasses.CompoundPredicate or a errors.CompoundPredicateMustHaveAtLeastOneSubPredicate rejected promise
- Type
- Promise.<dataclasses.CompoundPredicate>
(static) CompoundPredicate.reduce(compoundPredicate, f, acc, [parents]) → {T}
- Source:
Reduce through the predicates tree
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
compoundPredicate
|
dataclasses.CompoundPredicate | starter node | ||
f
|
function | accumulation function, f(acc, predicate, parents) | ||
acc
|
T | accumulator | ||
parents
|
Array |
optional
|
[]
|
path to the node, array of parents |
Returns:
yield the accumulator
- Type
- T
(static) CompoundPredicate.forEach(compoundPredicate, f(predicate))
- Source:
Walk through the predicates tree
Parameters:
Name | Type | Description |
---|---|---|
compoundPredicate
|
dataclasses.CompoundPredicate | starter node |
f(predicate)
|
function | iterator function |
(static) CompoundPredicate.is(predicate) → {Boolean}
- Source:
Yield true if `predicate` is a CompoundPredicate
Parameters:
Name | Type | Description |
---|---|---|
predicate
|
dataclasses.Predicate |
Returns:
- Type
- Boolean
Type Definitions
Target
- Source:
Target type definition
Type:
- Object
Operator
- Source:
A type operator
Type
- Source:
Defines a target type
Predicate
- Source:
Abstract Predicate type, a Predicate is the union type of CompoundPredicate | ComparisonPredicate
Type:
- object
ComparisonPredicate
- Source:
Abstract Predicate type, a Predicate is the union type of CompoundPredicate | ComparisonPredicate
Type:
- object