/** * @fileoverview Pure (Angular-free) model + serialization for the field-rules builder: the flattened * {@link RuleDraft} the UI edits, and the lossless mapping to/from the engine's {@link FieldRuleSet}. * Kept separate from the component so it's unit-testable without a TestBed and reusable elsewhere. * @module @memberjunction/ng-entity-action-ux */ import type { FieldRule, FieldRuleSet, FieldRuleValueSource } from '@memberjunction/global'; /** The source kinds the visual builder edits directly (entityDocument is authored as JSON for now). */ export type BuilderSourceKind = 'static' | 'field' | 'formula' | 'lookup' | 'prompt'; /** The editable, flattened form of one rule (one screen row). */ export interface RuleDraft { TargetField: string; SourceKind: BuilderSourceKind; StaticValue: string; SourceField: string; Formula: string; LookupEntity: string; LookupMatchField: string; LookupMatchValueField: string; LookupReturnField: string; PromptID: string | null; Condition: string; } /** A fresh, empty draft (static source, no target). */ export declare function blankRuleDraft(): RuleDraft; /** Maps a draft to the engine's discriminated {@link FieldRuleValueSource}. */ export declare function draftToSource(d: RuleDraft): FieldRuleValueSource; /** Builds a {@link FieldRuleSet} from drafts, dropping any with no target field. */ export declare function draftsToRuleSet(drafts: RuleDraft[]): FieldRuleSet; /** Inflates an engine rule back into an editable draft (inverse of {@link draftToSource}). */ export declare function ruleToDraft(rule: FieldRule): RuleDraft; //# sourceMappingURL=field-rules-model.d.ts.map