import { HsLayerDescriptor, WfsFeatureAttribute, FilterType, LogicalOperatorType, Filter, ComparisonOperatorType } from 'hslayers-ng/types'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { HsLanguageService } from 'hslayers-ng/services/language'; import { HsToastService } from 'hslayers-ng/common/toast'; import { HsProxyService } from 'hslayers-ng/services/utils'; import * as i0 from '@angular/core'; import { OnChanges, EventEmitter, SimpleChange, OnInit, Injector, WritableSignal, DestroyRef } from '@angular/core'; import { HsStylerPartBaseComponent } from 'hslayers-ng/services/styler'; import { Rule } from 'geostyler-style'; import { HsEventBusService } from 'hslayers-ng/services/event-bus'; import { Feature } from 'ol'; import { FormControl } from '@angular/forms'; import { Geometry } from 'ol/geom'; import { HsLayoutService } from 'hslayers-ng/services/layout'; declare class HsFiltersService { http: HttpClient; hsToastService: HsToastService; hsLanguageService: HsLanguageService; hsProxyService: HsProxyService; selectedLayer: HsLayerDescriptor; attributesExcludedFromList: string[]; layerAttributes: WfsFeatureAttribute[]; /** * Sets the selected layer for filtering operations * @param layer The layer to be set as selected */ setSelectedLayer(layer: HsLayerDescriptor): void; /** * Sets the attributes for the selected layer * @param attributes Array of WFS feature attributes */ setLayerAttributes(attributes: WfsFeatureAttribute[]): void; /** * Adds a new filter to the collection based on the specified type * @param type The type of filter to add (AND, OR, COMPARE, NOT) * @param append Whether to append the new filter or replace existing ones * @param collection The collection to add the filter to */ add(type: FilterType, append: boolean, collection: any[]): void; /** * Converts logical operators to human-readable format * @param logOp The logical operator to convert * @returns The human-readable version of the operator */ humanReadableLogOp(logOp: string): LogicalOperatorType; /** * Checks if the given filter is a logical operator * @param filters The filter array to check * @returns True if the filter is a logical operator, false otherwise */ isLogOp(filters: any[]): boolean; /** * Checks if a filter can be deleted */ private canDeleteFilter; /** * Displays a warning message when a filter cannot be deleted. * @param parent The parent filter array */ private showCannotDeleteFilterWarning; /** * Removes a filter from the parent filter array * @param parent The parent filter array * @param filter The filter to remove * @returns True if the filter was successfully removed, false otherwise */ removeFilter(parent: Filter, filter: Filter): boolean; /** * Fetches attribute values for a given attribute name * @param attributeName The name of the attribute to fetch values for * @returns An Observable of the WfsFeatureAttribute with fetched values */ getAttributeWithValues(attributeName: string): Observable; /** * Fetches attribute values from the WFS service * @param attribute The attribute to fetch values for * @returns An Observable of the updated WfsFeatureAttribute */ private fetchAttributeValues; /** * Builds the WFS URL for fetching attribute values * @param layer The layer to build the URL for * @param attributeName The name of the attribute * @returns The constructed WFS URL */ private buildWfsUrl; /** * Returns an array of unique, sorted attribute values * @param values The array of values to sort * @returns An array of unique, sorted values */ getSortedUniqueValues(values: any[]): any[]; /** * Extracts attribute values from the WFS response * @param response The WFS response (can be JSON or XML) * @param attribute The WFS feature attribute * @returns An array of unique, sorted attribute values */ private extractValuesFromResponse; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class HsFilterComponent extends HsStylerPartBaseComponent { filter: Filter; parent: Filter; hsFiltersService: HsFiltersService; constructor(); remove(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class HsAddFilterButtonComponent implements OnChanges { clicks: EventEmitter; rule: i0.InputSignal; ngOnChanges({ rule }: { rule?: SimpleChange & { currentValue: Rule; }; }): void; hsFiltersService: HsFiltersService; activeTab: FilterType; readonly logicalOperators: LogicalOperatorType[]; readonly comparisonOperator: ComparisonOperatorType; readonly filterOptions: FilterType[]; emitClick(type: FilterType): void; setActiveTab(type: FilterType): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class HsFiltersComponent extends HsStylerPartBaseComponent { rule: any; set selectedLayer(layer: HsLayerDescriptor); addFilterButton: i0.Signal; hsFiltersService: HsFiltersService; hsEventBusService: HsEventBusService; constructor(); add(type: FilterType, append: boolean): void; remove(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class FilterRangeInputComponent { min: i0.InputSignal; max: i0.InputSignal; value: i0.ModelSignal; change: i0.OutputEmitterRef; bubblePosition: i0.Signal; private expandedSignal; expanded: i0.Signal; constructor(); expandRange(): void; contractRange(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface Operator { value: string; alias: string; } interface FilterWithArgs { name: 'property'; args: [string]; } declare class HsComparisonFilterComponent extends HsStylerPartBaseComponent implements OnInit, OnChanges { filter: Filter; parent: Filter; _filter: Filter; injector: Injector; filterRangeInput: i0.Signal; expanded: i0.Signal; private readonly OPERATORS; customOperatorSelected: WritableSignal; features: Feature[]; attributeControl: FormControl; attributes: string[]; operators: Observable; currentAttribute: WritableSignal; hsFiltersService: HsFiltersService; hsLayoutService: HsLayoutService; destroyRef: DestroyRef; loading: WritableSignal; selectedOperator: WritableSignal; valueSource: WritableSignal<"property" | "value">; constructor(); isWfsFilter: i0.Signal; emitChange(): void; /** * Extracts the value from the FilterWithArgs object * @param value The value to extract * @returns The extracted value */ extractValue(value: string | FilterWithArgs): string; /** * Parses filter values to extract the attribute name from the FilterWithArgs object * in order to keep local state simple: string based */ parseFilterValues(filter: Filter): Filter; /** * In case user toggles between layer with comparison filters set up * component is not recreated, only its inputs are changed. * In that case we need to update features and reinitialize the filter. */ ngOnChanges({ filter, parent, }: { filter?: SimpleChange & { currentValue: any; }; parent?: SimpleChange & { currentValue: any; }; }): void; /** * Handles operator selection changes */ onOperatorChange(e: Event): void; ngOnInit(): void; /** * Set up the filter with initial values and streams * Is used both on init and on filter change (in case previous value is present) */ private initializeFilter; /** * Init operator value and adjusts it if necessary to match the custom operator mappings * geostyler parses '= ∅' as '==', so in case value is undefined we need to adjust the operator */ private initOperator; /** * Retrieves attribute with values based on the current filter type (WFS or local) * @param attrName The name of the attribute to retrieve * @returns An Observable of WfsFeatureAttribute */ private getAttributeWithValues; /** * Returns an array of values for the given attribute from the existing features. * @param attrName The name of the attribute to retrieve values from. * @returns An array of values for the given attribute. */ private getValidValuesFromExistingFeatures; /** * Creates WFSFeatureAttribute object from the existing feature values * @param attrName The name of the attribute to retrieve. * @returns An observable of WfsFeatureAttribute. */ getLocalAttributesWithValues(attrName: string): Observable; /** * Updates the features and attributes based on the selected layer */ updateFeatures(): void; /** * Removes the current filter from its parent or deletes the rule filter */ remove(): void; /** * Toggles the value source between value and property * @param source The source to toggle to */ toggleValueSource(source: 'value' | 'property'): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { HsAddFilterButtonComponent, HsComparisonFilterComponent, HsFilterComponent, HsFiltersComponent, HsFiltersService };