|
| 1 | +import Vue, { Component } from 'vue'; |
| 2 | +import { SortableOptions } from 'sortablejs'; |
| 3 | + |
| 4 | +export interface Rule { |
| 5 | + identifier: string, |
| 6 | + value: any, |
| 7 | +} |
| 8 | + |
| 9 | +export interface RuleSet { |
| 10 | + operatorIdentifier: string, |
| 11 | + children: Array<RuleSet | Rule>, |
| 12 | +} |
| 13 | + |
| 14 | +export interface OperatorDefinition { |
| 15 | + identifier: string, |
| 16 | + name: string, |
| 17 | +} |
| 18 | + |
| 19 | +export interface RuleDefinition { |
| 20 | + identifier: string, |
| 21 | + name: string, |
| 22 | + component: Component | string, |
| 23 | + initialValue?: any, |
| 24 | +} |
| 25 | + |
| 26 | +export interface QueryBuilderConfig { |
| 27 | + operators: OperatorDefinition[], |
| 28 | + rules: RuleDefinition[], |
| 29 | + colors?: string[], |
| 30 | + dragging?: SortableOptions, |
| 31 | +} |
| 32 | + |
| 33 | +export interface GroupOperatorSlotProps { |
| 34 | + currentOperator: string, |
| 35 | + operators: OperatorDefinition[], |
| 36 | + updateCurrentOperator: (newOperator: string) => void, |
| 37 | +} |
| 38 | + |
| 39 | +export interface GroupCtrlSlotProps { |
| 40 | + rules: RuleDefinition[], |
| 41 | + addRule: (newRule: string) => void, |
| 42 | + newGroup: () => void, |
| 43 | +} |
| 44 | + |
| 45 | +export interface RuleSlotProps { |
| 46 | + ruleComponent: Component | string, |
| 47 | + ruleData: any, |
| 48 | + updateRuleData: (newData: any) => void, |
| 49 | +} |
0 commit comments