/** * Constructs a regular expression pattern for matching search filter strings. * The pattern captures "column", "operator", and "value" groups for filter expressions. * Supported operators include common comparison and wildcard operators. * * Examples of valid expressions this regex can match: * - "username:john_doe" * - "age>30" * - "status!=active" * - "title~\"Product Manager\"" * - "completed!~*yes" * * The "column" group matches one or more word characters. * The "operator" group matches one among the specified comparison or wildcard operators: * :, >, <, >=, <=, =<, =>, =, !=, ~, ~*, !~, !~*. * The "value" group matches either a double-quoted string or a single unquoted word * that doesn't include whitespace or any of the operator characters. * * @returns {RegExp} - The regular expression pattern to identify search filter elements. */ export function getRegex(): RegExp; /** * A parsed filter condition. * * @typedef {Object} FilterObject * @property {string} [column] - Column to filter (undefined = search all columns) * @property {string} operator - Comparison operator * @property {string|number|RegExp} value - Filter value */ /** * Parses a search string and extracts filters based on a predefined regular expression pattern. * Each filter captures column, operator, and value components. Any remaining text that * does not fit the pattern is considered a general search term. * * @param {string} string - The search string to parse for filters. * @returns {FilterObject[]} - An array of filter objects each containing the column, operator, and value, * plus an additional object for general search if there is remaining text. */ export function parseFilters(string: string): FilterObject[]; /** * A parsed filter condition. */ export type FilterObject = { /** * - Column to filter (undefined = search all columns) */ column?: string | undefined; /** * - Comparison operator */ operator: string; /** * - Filter value */ value: string | number | RegExp; };