Skip to main content

FormatRulesEngineOptions

Defined in: rules-engine/src/types/export.ts:53

Options object shape for formatRulesEngine.

Properties

context?

optional context?: Record<string, unknown>

Defined in: rules-engine/src/types/export.ts:83

Arbitrary values passed through to the rules engine processor.

For the "json-rules-engine" format, set the engine property to an Engine instance and the additional operators (beginsWith, between, etc.) will be registered on it as a side effect, so exported rules that use those operators can be evaluated without registering the operators yourself.

Example

const engine = new Engine();
for (const rule of formatRulesEngine(re, {
format: 'json-rules-engine',
context: { engine },
})) {
engine.addRule(rule);
}

evaluationMode?

optional evaluationMode?: EvaluationMode

Defined in: rules-engine/src/types/export.ts:65

Overrides the react-querybuilder!RulesEngine.evaluationMode evaluationMode stored on the rules engine object. If neither is specified, defaults to "cascade".

  • "cascade": conditions are evaluated in order; a later sibling only fires if all prior siblings' antecedents failed (if/else-if/else semantics).
  • "cumulative": every condition is evaluated independently and any number may fire.

format?

optional format?: RulesEngineExportFormat

Defined in: rules-engine/src/types/export.ts:54


formatQueryOptions?

optional formatQueryOptions?: FormatQueryOptions

Defined in: rules-engine/src/types/export.ts:56


rulesEngineProcessor?

optional rulesEngineProcessor?: RulesEngineProcessor<unknown>

Defined in: rules-engine/src/types/export.ts:55


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.