import { Filter, Where } from '@loopback/filter'; import { AnyObject, DataObject } from '../common-types'; import { Entity } from '../model'; /** * A utility function which takes a filter and enforces constraint(s) * on it * @param originalFilter - the filter to apply the constrain(s) to * @param constraint - the constraint which is to be applied on the filter * @returns Filter the modified filter with the constraint, otherwise * the original filter */ export declare function constrainFilter(originalFilter: Filter | undefined, constraint: AnyObject): Filter; /** * A utility function which takes a where filter and enforces constraint(s) * on it * @param originalWhere - the where filter to apply the constrain(s) to * @param constraint - the constraint which is to be applied on the filter * @returns Filter the modified filter with the constraint, otherwise * the original filter */ export declare function constrainWhere(originalWhere: Where | undefined, constraint: Where): Where; /** * A utility function which takes a where filter and enforces constraint(s) * on it with OR clause * @param originalWhere - the where filter to apply the constrain(s) to * @param constraint - the constraint which is to be applied on the filter with * or clause * @returns Filter the modified filter with the constraint, otherwise * the original filter */ export declare function constrainWhereOr(originalWhere: Where | undefined, constraint: Where[]): Where; /** * A utility function which takes a model instance data and enforces constraint(s) * on it * @param originalData - the model data to apply the constrain(s) to * @param constraint - the constraint which is to be applied on the data object * @returns the modified data with the constraint, otherwise * the original instance data */ export declare function constrainDataObject(originalData: DataObject, constraint: DataObject): DataObject; /** * A utility function which takes an array of model instance data and * enforces constraint(s) on it * @param originalData - the array of model data to apply the constrain(s) to * @param constraint - the constraint which is to be applied on the data objects * @returns an array of the modified data with the constraint, otherwise * the original instance data array */ export declare function constrainDataObjects(originalData: DataObject[], constraint: DataObject): DataObject[];