All files / src/components conditionActions.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18                                6x  
// Mutations of the condition being edited, provided by ConditionBuilder.vue to
// its nested ConditionGroup / ConditionRow components (which never mutate
// their props).
import type { InjectionKey } from 'vue'
import type { GroupMode, NodeModel } from '@/utils/conditionModel'
 
export interface ConditionActions {
  setMode(groupKey: string, mode: GroupMode): void
  addRow(groupKey: string): void
  addFormula(groupKey: string): void
  addGroup(groupKey: string): void
  remove(key: string): void
  reorder(groupKey: string, children: NodeModel[]): void
  updateRow(key: string, patch: Record<string, unknown>): void
}
 
export const CONDITION_ACTIONS: InjectionKey<ConditionActions> = Symbol('conditionActions')