react-querybuilder
Version:
React Query Builder component for constructing queries and filters, with utilities for executing them in various database and evaluation contexts
32 lines (31 loc) • 843 B
text/typescript
import type { Path } from "./basic.mjs";
import type { RuleType } from "./ruleGroups.mjs";
import type { RuleGroupTypeAny } from "./ruleGroupsIC.mjs";
export type DndDropTargetType = "rule" | "ruleGroup" | "inlineCombinator";
export type DraggedItem = (RuleType & {
path: Path;
qbId: string;
}) | (RuleGroupTypeAny & {
path: Path;
qbId: string;
});
export type DropEffect = "move" | "copy";
export interface DropResult {
path: Path;
type: DndDropTargetType;
dropEffect?: DropEffect;
groupItems?: boolean;
qbId: string;
getQuery: () => RuleGroupTypeAny;
dispatchQuery: (query: RuleGroupTypeAny) => void;
}
export interface DragCollection {
isDragging: boolean;
dragMonitorId: string | symbol;
}
export interface DropCollection {
isOver: boolean;
dropMonitorId: string | symbol;
dropEffect?: DropEffect;
groupItems?: boolean;
}