UNPKG

@sap-cloud-sdk/core

Version:
35 lines 1.66 kB
import { Constructable, Entity, EntityIdentifiable } from '../entity'; import type { Filterable } from './filterable'; /** * Data structure to combine [[Filterable]]s conjunctively and / or disjunctively. A FilterList matches when all filterables within the `andFilters` match and when at least one filterable within the `orFilters` matches. Should not be used directly. * @typeparam EntityT - */ export declare class FilterList<EntityT extends Entity> implements EntityIdentifiable<EntityT> { andFilters: Filterable<EntityT>[]; orFilters: Filterable<EntityT>[]; /** * Constructor type of the entity to be filtered. */ readonly _entityConstructor: Constructable<EntityT>; /** * Entity type of the entity tp be filtered. */ readonly _entity: EntityT; /** * Creates an instance of FilterList. * @param andFilters - Filters to be combined by logical conjunction (`and`) * @param orFilters - Filters to be combined by logical disjunction (`or`) */ constructor(andFilters?: Filterable<EntityT>[], orFilters?: Filterable<EntityT>[]); /** * @deprecated Since v1.28.1. This function should not be used, since some OData Services might not support the flattened filter expression. * Flattens `andFilters` and `orFilters` as far as possible while staying logically equivalent. * @returns Flattened filter list. */ flatten(): FilterList<EntityT>; private canFlatten; private isEmpty; private _flatten; } export declare function isFilterList<T extends Entity>(filterable: Filterable<T>): filterable is FilterList<T>; //# sourceMappingURL=filter-list.d.ts.map