import type { FilterFieldProps } from '../../FilterField.types.js'; import type { FilterFieldComparisonOperators, FilterFieldPrimitive } from '../../types/validation.js'; /** * A single statement found in a FilterField value for a queried key. * * @public */ export type FilterFieldStatementMatch = { /** The key the statement targets. */ key: string; /** The operator the statement uses. */ comparisonOperator: FilterFieldComparisonOperators; /** * Every value the statement carries — a single entry for `key = value`, one * entry per list item for `key in (a, b)`, and empty for `exists` / * `not-exists`. */ values: Array; }; /** * Reads which statements an existing FilterField value string holds for a given key. * * The read counterpart to `addFilter` / `removeFilter`: it answers whether a key * is already filtered and, if so, with which operator and which value(s). A key * can appear more than once (e.g. `status = "INFO" and status contains "err"`), * so every match is returned in document order. * * @public * @param currentValue - The current FilterField value string. * @param filter - The key to look for. Pass `valueType` to read only the statements whose * value is of that type — the read counterpart to the `valueType` hint on * `addFilter` / `removeFilter`. With `valueType: 'String'`, `key = true` * is not reported, because `addFilter` would have written `key = "true"`. * A list statement keeps only the values matching the type, and is skipped * entirely when none of them does. Existence statements carry no value and * are always reported. For the flag-gated types (`'IPAddress'`, * `'Timestamp'`, `'UID'`, `'SmartscapeId'`) pass the matching * `options.parserConfig` flag as well, otherwise the value resolves to a * `String`. `'Any'`, `'JSONPath'`, unrecognized custom type names and an * omitted `valueType` report every statement. * @param options - Optional configuration. `parserConfig` controls how `currentValue` is * parsed and how `valueType` is resolved; pass the same config used for * the corresponding `addFilter` call so read and write agree. * @returns Every statement targeting the key, in document order. Empty when the key is absent. */ export declare function getFilters(currentValue: string, filter: { key: string; valueType?: FilterFieldPrimitive | (string & {}); }, options?: { /** Parser config to apply when interpreting the existing value and resolving `valueType`. */ parserConfig?: FilterFieldProps['parserConfig']; }): FilterFieldStatementMatch[]; //# sourceMappingURL=get-filters.d.ts.map