import { Subject } from 'rxjs'; import { View, Feature } from 'ol'; import { Layer, Vector } from 'ol/layer'; import { Source, Vector as Vector$1 } from 'ol/source'; import { QueryPopupWidgetsType, WidgetItem, AddDataUrlType, AddDataFileType, HsEndpoint } from 'hslayers-ng/types'; import { StyleLike } from 'ol/style/Style'; import * as i0 from '@angular/core'; /** * Type for validation rules * @param condition - Condition function that should return true in case of conflict. * @param message - The message to display if the condition is true (conflict found) */ type HsConfigValidationRule = { condition: (config: HsConfigObject) => boolean; message: string; }; declare class HsConfigValidationService { /** * Default validation rules for detecting incompatible configuration combinations */ private readonly defaultValidationRules; constructor(); /** * Validates configuration for incompatible combinations and returns warning messages * @param config - The configuration object to validate * @param userRules - Optional user-defined validation rules from config * @param useDefaultRules - Whether to include default validation rules (default: true) * @returns Array of warning messages for detected conflicts */ validate(config: HsConfigObject, userRules?: HsConfigValidationRule[], useDefaultRules?: boolean): string[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } type ToastPosition = 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center'; type SymbolizerIcon = { name: string; url: string; }; type MapSwipeOptions = { orientation?: 'vertical' | 'horizontal'; }; /** * Names and corresponding numbers */ interface KeyNumberDict { [key: string]: number; } type PanelsEnabled = { legend?: boolean; measure?: boolean; query?: boolean; compositions?: boolean; draw?: boolean; layerManager?: boolean; featureTable?: boolean; print?: boolean; saveMap?: boolean; language?: boolean; share?: boolean; sensors?: boolean; search?: boolean; tripPlanner?: boolean; addData?: boolean; mapSwipe?: boolean; wfsFilter?: boolean; }; type DefaultPanel = keyof PanelsEnabled | (string & Record); declare class HsConfigObject { componentsEnabled?: { guiOverlay?: boolean; info?: boolean; sidebar?: boolean; toolbar?: boolean; drawToolbar?: boolean; searchToolbar?: boolean; measureToolbar?: boolean; geolocationButton?: boolean; defaultViewButton?: boolean; mapControls?: boolean; basemapGallery?: boolean; mapSwipe?: boolean; queryPopup?: boolean; }; /** * Master switch for layer editor widgets. * If false, all widgets are disabled regardless of layerEditorWidgets settings. * Default: true */ layerEditorWidgetsEnabled?: boolean; /** * Configuration for individual layer editor widgets. * Only applied when layerEditorWidgetsEnabled is true. * Set individual widgets to false to disable them. * Default: all true */ layerEditorWidgets?: { type?: boolean; metadata?: boolean; extent?: boolean; cluster?: boolean; scale?: boolean; legend?: boolean; dimensions?: boolean; folder?: boolean; opacity?: boolean; idw?: boolean; wmsSource?: boolean; layerType?: boolean; }; clusteringDistance?: number; mapInteractionsEnabled?: boolean; sidebarClosed?: boolean; sidebarPosition?: string; default_layers?: Layer[]; mobileBreakpoint?: number; base_layers?: { url: string; default: string; }; senslog?: { url: string; user_id: number; group: string; user: string; /** * Whitelist object defining which units and which unit sensors * should be listed. Each key is a `unit_id`, and the value is an array * of `sensor_id`s to be included for that unit. * If the value is `all`, all sensors for that unit will be included. * * Example: * ``` * { * default: [1,2,3], * 1305167: [530040, 560030], * 1405167: 'all' * } *``` * The `default` property defines a common set of sensor IDs that should be included for all units, * unless overridden by a specific unit's configuration. */ filter?: { default?: number[]; [unit_id: number]: number[] | 'all'; }; liteApiPath?: string; mapLogApiPath?: string; senslog1Path?: string; senslog2Path?: string; /** * Directory path in which objects defining vega view timeFormatLocale attribute are located. * Used to localize time unit of vega charts for non default languages/specific changes */ timeFormatConfigPath?: string; }; proxyPrefix?: string; defaultDrawLayerPath?: string; defaultComposition?: string; default_view?: View; panelsEnabled?: PanelsEnabled; defaultPanel?: DefaultPanel; /** * Controls where toast notifications are anchored to * 'screen' - anchors toasts to the viewport * 'map' - anchors toasts to the map container * @default 'map' - anchors toasts to the map container */ toastAnchor?: 'screen' | 'map'; /** * Controls the position of toast notifications * @default 'bottom-right' */ toastPosition?: ToastPosition; errorToastDuration?: number; advancedForm?: boolean; project_name?: string; hostname?: { shareService?: { url: string; }; user?: { url: string; }; default?: { url: string; }; }; mapSwipeOptions?: MapSwipeOptions; shareServiceUrl?: string; shortenUrl?: (url: any) => any; permalinkLocation?: { origin: string; pathname: string; }; social_hashtag?: string; useProxy?: boolean; layerTooltipDelay?: number; search_provider?: string; geonamesUser?: string; searchProvider?: any; language?: string; enabledLanguages?: string; /** * Allows adding natively not supported languages. * Use it together with `enabledLanguages` and `translationOverrides`. * @example * { * 'af' : 'Afrikaans' * } */ additionalLanguages?: { [key: string]: string; }; query?: { multi?: boolean; style?: StyleLike; hitTolerance?: number; }; /** * Panel names to add to the default non-queryable panels list. * Default non-queryable panels: measure, compositions, analysis, sensors, tripPlanner. */ additionalNonQueryablePanels?: string[]; /** * Configures visibility of clicked point feature. * - `'hidden'` - Hides clicked point feature at all times * - `'notWithin'` - Hides clicked point feature in case it would overlap with other features */ queryPoint?: 'notWithin' | 'hidden'; popUpDisplay?: 'none' | 'click' | 'hover'; /** * Configures query popup widgets, the order in which they are generated, and visibility */ queryPopupWidgets?: QueryPopupWidgetsType[] | string[]; /** * Allows the user to add custom widgets to query popup */ customQueryPopupWidgets?: WidgetItem[]; preserveLastSketchPoint?: boolean; zoomWithModifierKeyOnly?: boolean; pureMap?: boolean; translationOverrides?: any; layersInFeatureTable?: Vector>[]; open_lm_after_comp_loaded?: boolean; draggable_windows?: boolean; connectTypes?: AddDataUrlType[]; uploadTypes?: AddDataFileType[]; datasources?: HsEndpoint[]; panelWidths?: KeyNumberDict; sidebarToggleable?: boolean; sizeMode?: string; symbolizerIcons?: SymbolizerIcon[]; openQueryPanelOnDrawEnd?: boolean; assetsPath?: string; reverseLayerList?: boolean; /** * When set to 'true', the map layers are stored temporarily to localStorage * on page reload, loaded when it starts and deleted afterwards. * Otherwise, nothing is stored to localStorage and only default_layers are loaded * after page reloads. * Default: true */ saveMapStateOnReload?: boolean; /** * Triggered when config is updated using 'update' function of HsConfig. * The full resulting config is provided in the subscriber as a parameter */ timeDisplayFormat?: string; /** * Determines behavior of exclusive layers (layer.exclusive = true) visibility * If set to true, only layers with same path are affected by exclusivity */ pathExclusivity?: boolean; ngRouter?: boolean; /** * User-defined validation rules to check for configuration conflicts. * These rules will be added to the default validation rules. */ configValidationRules?: HsConfigValidationRule[]; /** * Whether to use default validation rules. * Set to false to disable all default validation and only use configValidationRules. * @default true */ useDefaultValidationRules?: boolean; /** * Controls the concurrency of the loading queues for tile and image loads * @default {tileLoad: 6, imageLoad: 4} */ loadingQueueConcurrency?: { tileLoad?: number; imageLoad?: number; }; /** * Configuration to mark URLs that should NOT be treated as Layman, * even if the generic detection says they are. * If any condition matches, the URL is treated as non-Layman. */ laymanUrlExceptions?: { /** * Array of strings. If the URL starts with any of these strings, it's treated as non-Layman. */ startsWith?: string[]; /** * Array of strings. If the URL includes any of these strings, it's treated as non-Layman. */ includes?: string[]; /** * Array of regex pattern strings. If the URL matches any of these patterns, it's treated as non-Layman. */ regex?: string[]; }; constructor(); } declare class HsConfig extends HsConfigObject { private validationService; id: string; configChanges?: Subject; private defaultSymbolizerIcons?; private logConfigWarning; /** * Validates configuration for incompatible combinations and logs warnings * @param config - The configuration object to validate * @param userRules - Optional user-defined validation rules * @param useDefaultRules - Whether to use default validation rules */ private validateConfigCompatibility; /** * Safely executes a configuration update operation and handles any errors * @param operation - Function to execute * @param errorMessage - Message to log if operation fails * @returns The result of the operation or a fallback value if provided */ private safeUpdate; checkDeprecatedCesiumConfig?(newConfig: any): void; update?(newConfig: HsConfigObject): void; /** * Merges componentsEnabled from newConfig with existing componentsEnabled * Preserves the order of keys from newConfig.componentsEnabled */ updateComponentsEnabled?(newConfig: HsConfigObject): HsConfigObject['componentsEnabled']; updateSymbolizers?(config: HsConfigObject): { url: string; name: string; }[]; setAppId(id: string): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { HsConfig, HsConfigObject, HsConfigValidationService }; export type { DefaultPanel, HsConfigValidationRule, KeyNumberDict, MapSwipeOptions, SymbolizerIcon, ToastPosition };