@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
38 lines (37 loc) • 1.68 kB
TypeScript
import { AttributeTypeGroup, FilterOperator } from '../../models/filter.js';
import IGirafeContext from '../context/icontext.js';
/**
* Base class for all filter conditions.
*/
export declare abstract class BaseFilterCondition<PropertyType> {
property: string;
propertyType?: PropertyType;
operator: FilterOperator;
value: string;
value2: string;
propertyTypeGroup?: AttributeTypeGroup;
protected constructor(property: string, operator: FilterOperator, value?: string, value2?: string, propertyType?: PropertyType, propertyTypeGroup?: AttributeTypeGroup);
/**
Returns the supported operators for the given filter class.
*/
static get supportedOperators(): Array<{
operator: FilterOperator;
displayName: string;
}>;
/**
* Returns the supported operators for the given attribute type. This function supports mapping for
* the three basic attribute types: string, number and date. More diverse types must be mapped in the subclass.
*/
static supportedOperatorsByAttributeType(attributeType: string): Array<{
operator: FilterOperator;
displayName: string;
}>;
/**
* Generates a simple text representation of the filter, for example, "attributeName [attributeType] = value"
* Needs the context to translate the operator and other terms.
* If instead of the attribute name and type, an alias or translated name should be displayed,
* provide the string via the optional propertyDisplayName parameter
*/
toTextRepresentation(context: IGirafeContext, propertyDisplayName?: string): string;
private static geometryToTextRepresentation;
}