import { default as React } from 'react'; import { FieldWidgetComponentProps } from './types.js'; interface BuilderCondition { id: string; field: string; operator: string; value: any; } /** * Opt-in FilterBuilder operators this widget offers (objectui#4023, * objectui#4736). * * The shared dropdown withholds these because two of its three consumers * persist into dialects that cannot carry them (see `OPT_IN_OPERATORS` in * `@object-ui/components`'s `filter-builder.tsx`). THIS widget can: its value * is a MongoDB-style `FieldOperatorsSchema` criteria that the server's engine * evaluates directly — never lowered through the array/triplet AST and never * folded into a `ViewFilterRule` — so the spec's `FILTER_OPERATORS` is the only * vocabulary it has to satisfy. * * - `containsCaseInsensitive` authors `$icontains`, executable on every * driver and evaluation face the platform ships (objectstack#5702 + * objectstack#6520). * - `exists` / `notExists` author `$exists`, which `condToMongo` has emitted * and `kvToCondition` has read back since objectui#2942. Naming them here * is what KEEPS them reachable now that the shared dropdown no longer * offers them to the list and view surfaces, whose dialects have no * existence operator at all (objectui#4736). * * Module scope, not an inline literal: a fresh array each render would reset * `FilterBuilder`'s memo inputs on every keystroke. * * @internal exported for tests */ export declare const FILTER_CONDITION_EXTRA_OPERATORS: readonly string[]; /** * Builder condition → `$`-operator criteria. Exported for tests: this is the * chokepoint where a builder token becomes a spec `FieldOperatorsSchema` key, * and a wrong spelling here is rejected downstream by `convertFiltersToAST` * rather than at authoring time. @internal */ export declare function condToMongo(c: BuilderCondition, typeOf: (f: string) => string | undefined): Record | null; /** * Criteria → builder condition (the reverse of {@link condToMongo}). Returning * `null` makes the builder refuse to load the rule ("criteria can't be * represented"), so this must keep accepting spellings previously written. * @internal */ export declare function kvToCondition(field: string, v: any, idx: number): BuilderCondition | null; /** * Would this criteria select EVERY record of the object? * * Mirrors the server's `isMatchAllCriteria` (objectstack `plugin-sharing`, * #3896) closely enough to warn before the round-trip: blank, `{}`, `[]`, and * the vacuous combinators. Deliberately conservative in the same direction — * the cost of a false positive is one extra hint, the cost of a false negative * is a save that fails with a toast. The server stays authoritative. * * @internal exported for tests */ export declare function isMatchAllCriteria(parsed: any): boolean; export declare function FilterConditionField({ value, onChange, readonly, className, error, ...props }: FieldWidgetComponentProps): React.JSX.Element; export default FilterConditionField;