import { IZFilter } from './filter.mjs'; import { IZFilterMetadata, IZFilterOperator } from './filter-subject.mjs'; /** * The connectors for an {@link IZFilterLogic} filter. */ export declare enum ZOperatorLogic { /** * And. */ And = "and", /** * Or */ Or = "or" } /** * Represents a composite logical filter. * * Logical filters do not have associated subjects and values. Instead * they relate a conjunction of child filters with {@link ZOperatorLogic.And} / {@link ZOperatorLogic.Or} * operators. */ export interface IZFilterLogic extends IZFilterOperator { /** * Child clauses that are related by and/or. */ clauses: IZFilter[]; } /** * Represents a builder for a logic filter. */ export declare class ZFilterLogicBuilder { /** * The __type__ identifier for an {@link IZFilterLogic} object. */ static readonly Type = "logic"; private _filter; /** * Initializes a new instance of this object. */ constructor(); /** * Sets the operator. * * @param val - * The value to set. * * @returns * This object. */ operator(val: ZOperatorLogic): this; /** * Sets the operator to and. * * @returns * This object. */ and: () => this; /** * Sets the operator to or. * * @returns * This object. */ or: () => this; /** * Adds another clause. * * @param val - * The clause to add. * * @returns * This object. */ clause(val: IZFilter): this; /** * Sets the list of clauses. * * @param val - * The value to set. * * @returns * This object */ clauses(val: IZFilter[]): this; /** * Returns the filter. * * @returns * The logic filter */ build(): IZFilterLogic; } /** * Type guard for determining if a target filter is a logic filter. * * @param filter - * The filter to test. * * @returns * True if filters type is a logic filter. False otherwise. */ export declare function isLogicFilter(filter: IZFilterMetadata | null | undefined): filter is IZFilterLogic; /** * A list of all logic operators. */ export declare const ZOperatorsLogic: ZOperatorLogic[]; /** * Gets whether a candidate string represents a logic operator. * * @returns * Type guard true if candidate is a logic operator, false * otherwise. */ export declare function isLogicOperator(candidate: string | null | undefined): candidate is ZOperatorLogic;