dataclasses

dataclasses

Source:
Since:
  • 1.0.0
Data classes

Methods

(static) ArgumentType(argumentType) → {object}

Source:
Create a new argument type
Parameters:
Name Type Description
argumentType Object argumentType
type.argumentType_id string argumentType_id
type.component * this attribute will be used by the UI Framework adapter
Returns:
ArgumentType
Type
object

(static) ComparisonPredicate(target, operator, argument) → {Promise.<dataclasses.ComparisonPredicate>}

Source:
A specialized predicate that you use to compare expressions.
Parameters:
Name Type Default Description
target dataclasses.Target target
operator dataclasses.Operator operator
argument * null argument
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:
true if `predicate` is a ComparisonPredicate
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 predicates
Returns:
Type
Promise.<dataclasses.CompoundPredicate>

(static) CompoundPredicate.forEach(compoundPredicate, f(predicate)) → {undefined}

Source:
Walk through the predicates tree
Parameters:
Name Type Description
compoundPredicate dataclasses.CompoundPredicate starter node
f(predicate) function iterator function
Returns:
Type
undefined

(static) CompoundPredicate.is(predicate) → {Boolean}

Source:
Yield true if `predicate` is a CompoundPredicate
Parameters:
Name Type Description
predicate dataclasses.Predicate predicate
Returns:
true if `predicate` is a CompoundPredicate
Type
Boolean

(static) CompoundPredicate.reduce(compoundPredicate, f, acc, parentsopt) → {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) LogicalType(logicalType) → {object}

Source:
Create a new type logical type Logical types or used in CompoundPredicates
Parameters:
Name Type Description
logicalType Object The predicate logic
Properties
Name Type Description
logicalType_id string logicalType_id
label string label
Returns:
logicalType object
Type
object

(static) Operator(operator) → {Operator}

Source:
Create a new operator
Parameters:
Name Type Description
operator object operator
Properties
Name Type Description
operator_id string unique id for this operator
argumentType_id string the argumentType associated with the operator. For example to define a "is" operator and associate it with two targets "article publishing date" and "article title" then we would have to define 2 operators because ["article publishing date" "is"] and ["article title" "is"] do NOT have the same kind of arguments (one is a date the other is a string) and associated UI components (one is a date picker the other is a text input)
label string label that will be displayed for this operator
Returns:
Type
Operator

(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:
predicate
Type
dataclasses.Predicate

(static) Target(target) → {Target}

Source:
Create a new target
Parameters:
Name Type Description
target object target
Properties
Name Type Description
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) Type(type) → {Type}

Source:
Create a new type
Parameters:
Name Type Description
type Object type
Properties
Name Type Description
type_id string type_id
operator_ids Array.<string> array of operator_id
Returns:
Type
Type

Type Definitions

ComparisonPredicate

Source:
Abstract Predicate type, a Predicate is the union type of CompoundPredicate | ComparisonPredicate
Type:
  • object

Operator

Source:
A type operator

Predicate

Source:
Abstract Predicate type, a Predicate is the union type of CompoundPredicate | ComparisonPredicate
Type:
  • object

Target

Source:
Target type definition
Type:
  • Object

Type

Source:
Defines a target type