File

libs/ngx-pfe/pfe-conditions/conditions.model.ts

Description

PFE Condition

Index

Properties

Properties

type
type: string
Type : string

Helps to identify the condition

import { ConditionAdvanced, ExpressionCondition } from './rules-evaluator';
import { PfeAndCondition } from './and';
import { PfeOrCondition } from './or';
import { PfeExpressionCondition } from './expression';

/**
 * Conditions that are available by default
 */
export type DefaultCondition = PfeAndCondition | PfeOrCondition | PfeExpressionCondition;

/**
 * A single condition. Includes the legacy and new conditions.
 */
export type Condition = PfeBaseCondition | DefaultCondition | ExpressionCondition | ConditionAdvanced;

/**
 * Help type to include all the possible types that can have an array
 */
export type BaseOrExpressionCondition = PfeBaseCondition | DefaultCondition | ExpressionCondition;

/**
 * The legacy `ExpressionCondition` and `ConditionAdvanced`, including also the `PfeBaseCondition[]`
 */
export type Conditions = BaseOrExpressionCondition[] | ConditionAdvanced;

/**
 * PFE Condition
 */
export interface PfeBaseCondition {
  /** Helps to identify the condition */
  type: string;
}

export type ConditionEvaluatorFunction<CONFIGURATION = PfeBaseCondition> = (config: CONFIGURATION, state?: unknown) => boolean;

results matching ""

    No results matching ""