import * as i0 from '@angular/core'; import { PipeTransform, EnvironmentInjector, Injector, NgModuleRef, Type, InjectionToken, ValueProvider, ClassProvider, ExistingProvider, StaticProvider, AfterViewInit, OnDestroy, OnChanges, EventEmitter, ElementRef, ChangeDetectorRef, SimpleChanges, Provider, ModuleWithProviders, ViewContainerRef, Renderer2, TemplateRef, OnInit, AfterViewChecked, EnvironmentProviders, QueryList, AfterContentInit, DoCheck, NgZone, DestroyRef, ApplicationRef } from '@angular/core'; import * as _c8y_client from '@c8y/client'; import { IApplication, VersioningMatrix, IManagedObject, SystemOptionsService, TenantOptionsService, IUser, ICurrentUser, ICurrentTenant, ApplicationService, FetchClient, TenantLoginOptionsService, Realtime, InventoryService, UserService, IIdentified, IResultList, Paging, InventoryBinaryService, IManagedObjectBinary, IdReference, IEvent, OperationStatus, ITenantLoginOption, TenantLoginOptionType, ICustomProperties, BasicAuth, CookieAuth, PasswordStrength, Client, ITotp, TenantService, QueriesUtil, ApplicationType, IResult, Service, aggregationType, AuditRecordType, IAuditRecord, AuditService, IAlarm, IMeasurement, MeasurementService, IOperationBulk, IOperation, DeviceRegistrationStatus, ApplicationRemotePlugins, IManifest, FeatureService } from '@c8y/client'; import * as rxjs from 'rxjs'; import { Observable, BehaviorSubject, ReplaySubject, Subject, UnaryFunction, MonoTypeOperatorFunction, Subscription } from 'rxjs'; import * as _c8y_options from '@c8y/options'; import { ApplicationOptions as ApplicationOptions$1, BrandingCssVars, Languages, I18nExtra, Docs, Icon, LoginExtraLink, CookieBannerConfiguration, CookiePreferencesConfiguration, MessageBannerConfiguration, PluginsExports, RemotePlugins, MapTileLayer, MapDefaultConfig } from '@c8y/options'; export { ApplicationOptions } from '@c8y/options'; import * as i1$2 from '@angular/router'; import { ActivatedRoute, Router, NavigationExtras, Route as Route$1, RouterStateSnapshot, ActivatedRouteSnapshot, Data, Routes, ExtraOptions, Event as Event$1 } from '@angular/router'; import { ApiService, ApiCall } from '@c8y/ngx-components/api'; import { BootstrapMetaData, RemoteModuleFactoryWithMetadata } from '@c8y/bootstrap'; import { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons'; import { TranslateService as TranslateService$1, TranslatePipe, TranslateDirective, TranslateStore, Language, InterpolatableTranslation, TranslationObject, RootTranslateServiceConfig, MissingTranslationHandler, TranslateParser, MissingTranslationHandlerParams, TranslateLoader } from '@ngx-translate/core'; import * as i1 from '@angular/common'; import { DatePipe as DatePipe$1, DatePipeConfig, DecimalPipe, LocationStrategy, Location } from '@angular/common'; import * as i3 from 'ngx-bootstrap/tooltip'; import * as i4 from '@angular/cdk/scrolling'; import { CdkVirtualScrollViewport, VirtualScrollStrategy } from '@angular/cdk/scrolling'; import * as _angular_platform_browser from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { Stream } from 'stream'; import * as i5 from 'ngx-bootstrap/dropdown'; import { BsDropdownDirective } from 'ngx-bootstrap/dropdown'; import * as i1$1 from '@angular/cdk/a11y'; import * as i2 from 'ngx-bootstrap/collapse'; import * as i3$1 from 'ngx-bootstrap/popover'; import { PopoverDirective } from 'ngx-bootstrap/popover'; import * as i2$3 from '@angular/cdk/stepper'; import { StepState, CdkStepper, CdkStep } from '@angular/cdk/stepper'; import * as i2$1 from '@angular/forms'; import { NgModel, FormControlName, ValidationErrors, FormControl, Validator, AbstractControl, ValidatorFn, NgControl, ControlValueAccessor, AsyncValidatorFn, CheckboxControlValueAccessor, FormGroup, FormBuilder, NgForm, AbstractControlOptions } from '@angular/forms'; import * as i1$3 from 'ngx-bootstrap/modal'; import { BsModalRef, BsModalService, ModalOptions } from 'ngx-bootstrap/modal'; import * as i5$1 from 'angularx-qrcode'; import * as i4$1 from 'ngx-bootstrap/datepicker'; import { BsLocaleService, BsDatepickerDirective, BsDaterangepickerConfig } from 'ngx-bootstrap/datepicker'; import * as i6 from '@ngx-formly/core'; import { FormlyFieldConfig, FieldArrayType, FormlyFieldProps, FieldType, FieldWrapper, FieldTypeConfig, FormlyFormOptions } from '@ngx-formly/core'; import * as _c8y_ngx_components_dist_icon_selector_icons from '@c8y/ngx-components/dist/icon-selector/icons'; import { Directionality } from '@angular/cdk/bidi'; import { Entry } from '@zip.js/zip.js'; import * as i10 from '@ngx-formly/core/select'; import * as i5$2 from 'ngx-bootstrap/timepicker'; import * as i16 from '@angular/cdk/text-field'; import { FormlyJsonschema } from '@ngx-formly/core/json-schema'; import { JSONSchema7 } from 'json-schema'; import * as i3$2 from '@angular/cdk/drag-drop'; import { CdkDrag, CdkDragStart, CdkDragEnd } from '@angular/cdk/drag-drop'; import * as i16$1 from '@c8y/ngx-components/interval-picker'; import { Interval } from '@c8y/ngx-components/interval-picker'; import * as packages_client_lib from 'packages/client/lib'; import * as i2$2 from '@angular/cdk/table'; import { CdkTable } from '@angular/cdk/table'; import * as i12 from 'ngx-bootstrap/pagination'; import { DataSource, CollectionViewer } from '@angular/cdk/collections'; import { ComponentType } from '@angular/cdk/overlay'; declare class AppSwitcherComponent { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ApplicationOptions implements ApplicationOptions$1 { /** Application name (saved to the server). */ name: string; /** Application context path (saved to the server). */ contextPath: string; /** Application key (saved to the server). */ key: string; /** The version of the application */ version: string; /** The version of the used WebSDK version */ webSdkVersion?: string; /** Set to `true` if the application is hybrid and uses Angular and AngularJS simultaneously. */ upgrade?: boolean; /** * Path to the branding entry file. (Set it to false to disable any styling. You can handle the styling then on your own e.g. in an angular.json file using ng-cli) * @deprecated Add your global styles via the angular.json file. */ brandingEntry?: false; /** * Enables all preview features in the application UI. * * Note: This only affects features on the frontend. * If a preview feature also requires backend support it must be enabled separately on the backend. */ enableAllPreviewFeatures?: boolean; /** * Hides the feature preview section in the right drawer. */ hidePreviewFeature?: boolean; /** Path to tsccnfig.json file if TypeScript is used (default: ./tsconfig.json). */ tsConfigPath?: string; /** Entry module for Angular compiler (only used with lazy loaded routes), e.g. `'app.module.ts#AppModule'`. */ entryModule?: string; /** Path to custom index.html (otherwise default one will be used). */ indexTemplate?: string; /** * URL to dynamically fetched options. * If set to `true` or left undefined, an URL will be used based on the applications contextPath. * If set to `false`, no dynamic options will be fetched. * */ dynamicOptionsUrl?: string | boolean; /** URL to favicon. */ faviconUrl?: string; /** URL to `*.css` file which will replace default branding. */ brandingUrl?: string; /** Enables the branding preview mode. If set to true, the `dynamicOptionsUrl` will be polled regularly for changes. In case the `lastUpdated` field of the dynamic options changes, the page is reloaded in order to apply the new branding. */ brandingPreview?: boolean; /** Object with properties that will be converted to CSS custom variables. */ brandingCssVars?: BrandingCssVars; /** * Allows for adding or overriding languages available in the application. * * Its keys are language codes and its values are objects with the following properties: * * - **name:** English name of the language, * - **nativeName:** native name of the language, * - **url:** full URL to JSON file with compiled translations; * if not defined, translations will be loaded from `${localePath}/${langCode}.json. * * ```json * "languages": { * "de": { * "name": "German", * "nativeName": "Deutsch", * "url": "/apps/public/ui-assets/de.json" * } * } * ``` */ languages?: Languages; /** * Allows to add custom translations. It is an optional property. * * Its keys are language codes (https://cumulocity.com/guides/users-guide/getting-started/#a-name-languages-a-available-languages) * and its values are objects with key-value pairs, where the key is the original string in English and the value - its translation. * * - **Home:** "Startseite"` * * For example you can add the translation of your custom cookie banner configured in the branding settings: * ```json * "i18nExtra": { * "de": { * "About cookies on Cumulocity IoT": "Informationen zu Cookies in Cumulocity IoT", * "Click Agree and Proceed to accept cookies and go directly to the platform or click on Privacy Policy to see detailed descriptions of the used cookies.": "Klicken Sie auf Zustimmen und fortfahren, um Cookies zu akzeptieren und direkt zur Plattform zu gelangen, oder klicken Sie auf Datenschutzrichtlinie, um detaillierte Beschreibungen der verwendeten Cookies anzuzeigen." * } * } * ``` */ i18nExtra?: I18nExtra; /** Path to the folder from which *.po files will be loaded. */ localePath?: string; /** Array of URLs to additional `*.css` files to be loaded at runtime. */ extraCssUrls?: string[]; /** Stylesheet (CSS) that will be added at runtime. The string should actually contain the CSS not a path or URL to it. */ extraCss?: string; /** Documentation links settings. */ docs?: Docs; /** Application icon to be displayed in app switcher and header bar. */ icon?: Icon; /** Hide application in app switcher (saved to the server). */ noAppSwitcher?: boolean; /** HTML page title. */ globalTitle?: string; /** Hide "powered by" and version info at the bottom of the navigator and in the right drawer. */ hidePowered?: boolean; /** Hides the header bar */ hideHeader?: boolean; /** Hides the "Platform information" in the right drawer, will overrule the "hidePowered" option */ hidePlatformInformation?: boolean; /** URL to support page (set to `false` to hide the link). */ supportUrl?: boolean | string; /** * Replacement string for `user` field in audit logs for actions performed by a support user * (available placeholders: `{{support_user}}`, `{{supported_user}}`). */ supportUserString?: string; /** * Disables realtime updates on the map widget and maps in general. */ mapWidgetRealtimeDisabled?: boolean; /** * Allows to adjust the default pagesize of 100 items of the map widget and maps in general. */ mapWidgetPageSize?: number; /** * Allows to hide the hint that there are more devices with geo coordinates then displayed on the map widget and maps in general. */ mapWidgetHideMaxDeviceOnMapHint?: boolean; /** Enable or disable the right drawer. */ rightDrawer?: boolean; /** Enable or disable breadcrumbs in the header for groups and devices (default: false). */ breadcrumbs?: boolean; /** Collapse navigator on initial load. */ hideNavigator?: boolean; /** Show tabs horizontally or vertically. */ tabsHorizontal?: boolean; /** Additional link(s) to display on login screen. */ loginExtraLink?: LoginExtraLink | LoginExtraLink[]; /** Enable or disable storage limitation feature. */ storageLimitationFeatureEnabled?: boolean; /** Name of company handling support requests from app users (displayed in notification message). */ companyName?: string; /** URL template for documentation links (default: `'${docsBaseUrl}${partialUrl}'`). */ guideHrefTemplate?: string; /** Base URL for documentation links (include `{{ version }}` placeholder, if you want versioned links). */ docsBaseUrl?: string; /** CSP string to be applied to `index.html` by replacing default values. */ contentSecurityPolicy?: string; /** Enables cloud sensor wizard */ sensorPhone?: boolean; /** Show or hide a newsletter subscription checkbox in edit user modal. */ newsletter?: boolean; /** Path to the root node_modules dir (useful when working in monorepo setup, e.g. yarn workspaces). */ rootNodeModulesPath?: string; /** Cookie Banner configuration */ cookieBanner?: CookieBannerConfiguration; /** Cookie preferences configuration. Here you can enable or disable cookie categories */ cookiePreferences?: CookiePreferencesConfiguration; /** Message Banner configuration */ messageBanner?: MessageBannerConfiguration; /** A key for the product experience software Gainsight. */ gainsightKey?: string; /** Disable user tracking */ disableTracking?: boolean; /** NgModule export for plugins. */ exports?: PluginsExports[]; /** List of imported remote plugins. */ remotes?: RemotePlugins; /** If set to true, only remotes defined in the `remotes` query parameter will be loaded. */ forceUrlRemotes?: boolean; /** The package source a application origins from as IApplication or simply the id of the source */ source?: string | number | IApplication; /** * Additional assets to copy to the build output. * See https://github.com/webpack-contrib/copy-webpack-plugin for more information * about the patterns to add here. */ copy?: []; /** * Allows to enable or disable context help, or to override the default base URL used to load its contents. * By default, the context help uses the same base URL as defined in the `docsBaseUrl` option * (if this option is undefined, then the following value will be used: `https://cumulocity.com/guides/{{version}}`). * Alternatively, if a string is provided here, it'll be used as the base URL * and any `{{ version }}` placeholder will be replaced with the relevant docs version. */ contextHelp?: boolean | string; /** * By default, cockpit and devicemanagement use the onlyRoots query to resolve root nodes. This * could lead to performance issues, if a customer has a lot of root nodes. Therefore you can disable * the use of this query with this flag. */ disableOnlyRootsQuery?: boolean; /** * Allows to force showing the setup wizard. */ forceSetup?: boolean; /** * Indicates if the application needs to show the setup wizard. */ isSetup?: boolean; /** * By default a WebSDK app requires the user to be logged in. * In case you would like to develop just a static application, that does not require any kind of access to the backend, * you can use this flag to disable the login screen. * NOTE: not all WebSDK components support this, some might require the user to be logged in and won't work. */ noLogin?: boolean; /** * Allows to opt out of supporting/loading plugins for this application. */ noPlugins?: boolean; /** * Allows to opt out of the version warning which is shown in the dev tools. */ noVersionWarning?: boolean; /** * Allows to set the map layers. If not set, defaults to open street map layer. */ mapLayers?: MapTileLayer[]; /** * Allows to set default configurations on the maps. */ mapConfig?: MapDefaultConfig; /** * The URL used to lookup geo coordinates for a user provided address via [nominatim API](https://nominatim.org/release-docs/develop/api/Search/). * Can be set to empty to disable the find address feature on the location tab. * Uses: `https://nominatim.openstreetmap.org/search?format=json&q={searchTerm}` if not set. */ mapNominatimUrl?: string; /** * The name of the root element. By default c8y-bootstrap. */ rootTagName?: string; /** * Hides possibility to create typed dashboards for assets (and groups). If true, typed dashboards can be created only for devices. * It is true by default. */ hideTypeDashboardForAssets?: boolean; /** * A matrix of versions indicating which versions of the application (key) are dependent on which version of a cumulocity component (API version and Web SDK version of the shell application currently supported, indicated by the value). * The versions of the dependent components can be indicated by a semver range. * ```json * { * "1.0.0": { * "sdk": ">=1016.0.0 <1017.0.0", * "api": ">=1016.0.0 <1017.0.0" * }, * "2.0.0": { * "sdk": "~1017.0.0", * "api": "~1017.0.0" * }, * "3.0.0": { * "sdk": ">=1018.0.0", * "api": ">=1018.0.0" * }, * } * ``` */ versioningMatrix?: VersioningMatrix; /** * Is used for plugins to indicate their owner. Cumulocity plugins are marked with OFFICIAL label. * You can use the special "ARCHIVED" label to mark them as archived. */ label?: string; /** * Defines the type of refresh mechanism used for alarms in the application. * * - **realtime:** Utilizes a realtime mechanism for updating alarms. * - **interval:** Utilizes HTTP polling at regular intervals to refresh the alarms. * * This setting allows to switch between realtime and interval-based refresh methods. */ alarmsRefreshType?: 'interval' | 'realtime'; /** * A map of import paths to their corresponding URLs. * This is used to resolve module paths when loading remote modules * (e.g. in the HTML-Widget). The keys are the import paths and the values are the URLs. * * You can also add a js file but need to copy it. Or you can add a node module name but * this need to have a single entry point. Otherwise you need to copy the files. A url can also * be used but you need to ensure that the CSP rules are not blocking the loading of the file. * * ``` * { * 'my-widget': 'https://example.com/path/to/widget.js', * 'node-module': '@scope/my-node-module', * 'local-js': './my-local-file.js' * } * ``` */ importMap?: { [key: string]: string; }; /** * Defines to which path the user will be redirected in case he is not logged in yet. * * This needs to be used for e.g. people who embed the application in an iframe in order to redirect to a none index.html file. */ loginRedirectPath?: string; /** * Allows to skip the Single Sign-On (SSO) redirect during the login process. * * Can be used to avoid the redirect to the Identity Provider, when you still want to use the built-in login instead. * This is needed in scenarios like e.g. support user access. */ skipSSORedirect?: boolean; } /** * Tells how a plugin is scoped. */ declare enum PluginsExportScopes { /** * Limit the plugin to the current application. It is imported by default. */ SELF = "self", /** * Allows to add the plugin to a global scope, meaning it is imported to all applications at the same time. * This is not used at the moment but planned to be implemented in the new branding editor. */ GLOBAL = "global", /** * Limit the plugin to the current application. The plugin is not imported by default. */ SELF_OPTIONAL = "self-optional", /** * Like undefined the plugin is available for any private application. */ DEFAULT = "" } /** * Converts a managed object into a context-aware URL, depending on its type and fragments. * Usage: * * ```html * {{ managedObject | assetLink }} * ``` */ declare class AssetLinkPipe implements PipeTransform { private groupService; transform(mo: IManagedObject): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } interface BytesOptions { precision?: number; binary?: boolean; } /** * Converts the file size to a readable format. * Supports both decimal (default) and binary units. * * Usage: * ```html * {{ myData | bytes }} * {{ myData | bytes:2 }} * {{ myData | bytes:1:true }} * {{ myData | bytes:{binary: true} }} * {{ myData | bytes:{precision: 2, binary: true} }} * ``` * * @param value The number of bytes to convert * @param precisionOrOptions Number of decimal places or options object * @param binary Whether to use binary (1024) or decimal (1000) units (legacy parameter) * * Options object properties: * - precision: number of decimal places (default: 1) * - binary: whether to use binary units (default: false) * * Decimal units: bytes, kB, MB, GB, TB, PB * Binary units: bytes, KiB, MiB, GiB, TiB, PiB */ declare class BytesPipe implements PipeTransform { static bytes(bytes: number, precisionOrOptions?: number | BytesOptions, binary?: boolean, translateService?: TranslateService$1): string | number; private translateService; transform(value: number, precisionOrOptions?: number | BytesOptions, binary?: boolean): string | number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class ColorService { generateColor(data: string): Promise; generateColorForDatapoint(fragment: string, series: string): Promise; protected sha256(message: string): Promise; protected stringToColor(str: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * The maximum pageSize used in API queries to c8y. */ declare const MAX_PAGE_SIZE = 2000; declare class PluginsResolveService { /** * Emits all injectors of already loaded plugins on subscription. */ injectors$: Observable; /** * Emits once remotePlugins have been resolved. */ refresh$: Observable; /** * Emits all plugin details of already loaded plugins on subscription. */ pluginDetails$: Observable<{ remoteNgModule: NgModuleRef | Type; moduleRef: NgModuleRef; }>; allPluginsLoaded$: Observable; loadedPluginNames$: Observable; /** * Emits all contextPaths (including the corresponding version/tag, if provided) that have been already loaded on startup and further any newload loaded. */ contextPathsFromWhereRemotesHaveBeenLoaded$: Observable; private _refresh$; private _allPluginsLoaded$; _contextPathsFromWhereRemotesHaveBeenLoaded$: BehaviorSubject; _loadedPluginNames$: BehaviorSubject; _injectors$: ReplaySubject; _pluginDetails$: ReplaySubject<{ remoteNgModule: NgModuleRef | Type; moduleRef: NgModuleRef; }>; constructor(); /** * Will refresh all current registered hooks. */ refreshHooks(): void; addInjector(injector: EnvironmentInjector | Injector): void; waitForPluginsToLoad(): Promise; getAllInjectors(): Promise<(EnvironmentInjector | Injector)[]>; getAllInjectors$(): Observable; getFromAllInjectors(token: Type, notFoundValue?: any): Observable; markPluginsAsLoaded(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * A abstract state which should be included in each state. * @abstract */ declare abstract class StateService { /** * Saves the state. Should not be accessible directly. Use map or the getter to access * the state. Use functions in the implementation to change the state. */ protected abstract state$: BehaviorSubject | any; /** * Should return the current state of this StateService */ abstract get state(): any; /** * Maps to a property and just returns that property. * @param mappedProperty The property to map to. */ map(mappedProperty: (stateProperty: any) => any): Observable; /** * Emits a new state. */ protected emitNewState(): void; } declare function fromTrigger(router: Router, refresh: Observable | Observable[], factories: Array | ExtensionFactory[] | (() => T | ExtensionFactory | Array>)>): Observable; declare function fromTriggerOnce(router: Router, refresh: Observable | Observable[], factories: Array | ExtensionFactory[] | (() => T | ExtensionFactory | Array>)>, withFirstEmpty?: boolean): Observable; declare enum InjectionType { COMPONENT = 0, ROUTE = 1 } declare function getInjectedHooks(token: InjectionToken, injectors: Injector[], type?: InjectionType): () => T[]; declare function fromFactories(factories?: Array | ExtensionFactory[] | (() => T | ExtensionFactory | Array>)>, router?: Router, withFirstEmpty?: boolean): Observable; declare function resolveInjectedFactories(factories: Array | ExtensionFactory[] | (() => T | ExtensionFactory | Array>)>): Array>; declare function stateToFactory(componentsState: any): ExtensionFactory; declare function sortByPriority(items: T[]): T[]; declare function removeDuplicatesIds(items: T[]): T[]; declare function toObservableOfArrays(factoryResult: T | T[] | Promise | Observable, withFirstEmpty: boolean): Observable; declare function isPromise(obj: any): obj is Promise; declare function isExtensionFactory(obj: any): obj is ExtensionFactory; /** * Converts any value provided to an Observable that emits this value once and then completes. * A convenience method to represent all the data as Observables rather than * a mixture of Observables and other types. * * @param value The value the resulting Observable will emit. */ declare function toObservable(value: T | Promise | Observable): Observable; /** * Allows to extend the existing applications from a module. */ interface ExtensionFactory { /** * Allows to resolve the data of an extension point. * The return value can be a Promise or Observable * (allowing for asynchronous data resolution). * * @param activatedRoute The current activated route (if possible to resolve). */ get(activatedRoute?: ActivatedRoute): Observable | Promise | T[] | T; } /** * Extension points allow to extend the application from * any module */ interface ExtensionPoint { /** * Observable that emits of array of extensions active at any give time */ readonly items$: Observable; /** * Additional factories that can be added dynamically. (without hook) */ factories: ExtensionFactory[]; /** * Call the extension factories to refresh them. */ refresh(): any; } declare abstract class ExtensionPointWithoutStateForPlugins implements ExtensionPoint { items$: Observable; factories: ExtensionFactory[]; readonly refresh$: Observable; /** * All injectors to search for an extension. */ protected injectors: Injector[]; private readonly refreshTrigger; constructor(rootInjector: Injector, pluginService: PluginsResolveService); /** * Refresh the extension factories */ refresh(): void; /** * Should be called within the constructor of the extending class and set the items$ attribute. */ protected abstract setupItemsObservable(): Observable; } declare abstract class ExtensionPointForPlugins extends StateService implements ExtensionPoint { items$: Observable; factories: ExtensionFactory[]; readonly refresh$: Observable; readonly state$: BehaviorSubject>; /** * All injectors to search for an extension. */ protected injectors: Injector[]; private readonly refreshTrigger; constructor(rootInjector: Injector, pluginService: PluginsResolveService); /** * Refresh the extension factories */ refresh(): void; /** * Should be called within the constructor of the extending class and set the items$ attribute. */ protected abstract setupItemsObservable(): Observable; } /** * Helper function to get the activated route in * a service (as ActivatedRoute injection only * works in components). Works as long as we only use * a tree and no child is active at the same time. * * @param router The current router */ declare function getActivatedRoute(router: Router): ActivatedRoute; type GenericHookType = T | T[] | Type>; type HookValueType = T | T[] | Type; /** * A generic function to be used by specific implementations of the HOOK concept. * @param items The items that should be provided under the `useValue` or `useClass` attribute. * Allows an extension factory to be passed as an argument, which can create instances of type T. * @param token The InjectionToken/HOOK to be provided. * @param options If this is a multi provider or not (defaults to true) and provider type definition (defaults to ClassProvider) - `HookOptions`. * @returns A `Provider` (either `ValueProvider` or `ClassProvider`) to be provided in a module. */ declare function hookGeneric(items: GenericHookType | HookValueType, token: InjectionToken, options?: Partial): ValueProvider | ClassProvider | ExistingProvider; interface GenericHookOptions { multi: boolean; providerType: HookProviderTypes; } declare enum HookProviderTypes { ExistingProvider = "ExistingProvider", ClassProvider = "ClassProvider" } declare function allEntriesAreEqual(previous: Array, next: Array): boolean; /** * @deprecated Consider using the `hookOptions` function instead. */ declare const HOOK_OPTIONS: InjectionToken>; /** * You can either provide a single `ApplicationOptions` as parameter: * ```typescript * hookOptions(...) * ``` * * Or an array to directly register multiple: * ```typescript * hookOptions([...]) * ``` * * Or you provide an Service that implements `ExtensionFactory` * ```typescript * export class MyApplicationOptionsFactory implements ExtensionFactory {...} * ... * hookOptions(MyApplicationOptionsFactory) * ``` * A typed alternative to `HOOK_OPTIONS`. * @param options The `ApplicationOptions`'s or `ExtensionFactory` to be provided. * @returns An `Provider` to be provided in your module. */ declare function hookOptions(options: GenericHookType, hookOptions?: Partial): i0.ValueProvider | i0.ClassProvider | i0.ExistingProvider; /** * A service that allows to set or get application options * which configure the default behavior of the UI. */ declare class OptionsService extends ApplicationOptions { private systemOptionsService; private tenantOptionService; optionsUpdated$: Observable; [key: string]: any; private _optionsUpdated$; constructor(options: any, systemOptionsService: SystemOptionsService, tenantOptionService: TenantOptionsService); /** * Returns an application option used to configure the UI. * @param optionKey The application options key. * @param defaultValue A value to return if non is set. * @param attemptParse Indicates whether the value should be parsed with JSON.parse. */ get(optionKey: T, defaultValue?: OptionsService[T], attemptParse?: boolean): OptionsService[T]; /** * Returns an observable of an application option used to configure the UI. * @param optionKey The application options key. * @param defaultValue A value to return if non is set. * @param attemptParse Indicates whether the value should be parsed with JSON.parse. */ get$(optionKey: T, defaultValue?: OptionsService[T], attemptParse?: boolean): Observable; /** * Sets an application option. * @param key The key to set. * @param value The value to set. */ set(key: T, value: OptionsService[T]): void; /** * Deletes an application option. * @param key The key to remove. */ delete(key: T): void; /** * Gets support URL from: * - application option: `supportUrl` * - or current tenant's option: `configuration / system.support.url` * - or current tenant's inherited option: `configuration / system.support.url` * - or system option: `configuration / system.support.url` * - otherwise defaults to: `false` * * @returns Returns support url or false. */ getSupportUrl(): Promise; /** * Returns if the tenant allows to show the activate-support user menu entry. * Note: Only if system-level support-user/enabled is false we can activate it at tenant level. */ getActivateSupportUser(): Promise; /** * Gets a value from the system service and parses it. * * @param category The category for this option. * @param key The key for that option. * @param defaultValue The default if the option was not found. */ getSystemOption(category: string, key: string, defaultValue?: T): Promise; /** * Gets a value from the tenant service and parses it. * * @param category The category for this option. * @param key The key for that option. * @param defaultValue The default if the option was not found. */ getTenantOption(category: string, key: string, defaultValue?: T): Promise; /** * Gets an inherited from parent value from the tenant service if inheritance supported based on given parameters. * * @param category The category for this option. * @param key The key for that option. * @param defaultValue The default if the option was not found. */ getInheritedTenantOption(category: string, key: string, defaultValue?: T): Promise; /** * Gets current tenant option value from the tenant service omitting the inheritance supported based on given parameters. * * @param category The category for this option. * @param key The key for that option. * @param defaultValue The default if the option was not found. */ getCurrentTenantOption(category: string, key: string, defaultValue?: T): Promise; private setupOptions; private applyOptions; private getOptionFromService; private parseOptionRawValue; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare const HOOK_CURRENT_USER: InjectionToken; declare const HOOK_CURRENT_APPLICATION: InjectionToken; declare const HOOK_CURRENT_TENANT: InjectionToken; declare function hookCurrentUser(user: IUser | ICurrentUser): i0.ValueProvider | i0.ClassProvider | i0.ExistingProvider; declare function hookCurrentApplication(application: IApplication): i0.ValueProvider | i0.ClassProvider | i0.ExistingProvider; declare function hookCurrentTenant(tenant: ICurrentTenant): i0.ValueProvider | i0.ClassProvider | i0.ExistingProvider; declare function provideBootstrapMetadata(metadata: BootstrapMetaData): StaticProvider[]; declare class AppStateService extends StateService { private applicationService; apiService: ApiService; private options; private fetchClient; private tenantLoginOptionsService; /** * Saves the state. Should not be accessible directly. Use map or the getter to access * the state. Use functions in the implementation to change the state. */ state$: BehaviorSubject; currentSupportUserName: BehaviorSubject; currentUser: BehaviorSubject; currentTenant: BehaviorSubject; currentApplication: BehaviorSubject; currentApplicationConfig: Observable; /** * An Observable of the applications available for the current user. * The Observable emits a new array on user changes or if the application * performs POST, PUT or DELETE requests to the application API. */ currentAppsOfUser: Observable; constructor(applicationService: ApplicationService, apiService: ApiService, options: OptionsService, fetchClient: FetchClient, tenantLoginOptionsService: TenantLoginOptionsService, user?: IUser, application?: IApplication, tenant?: ICurrentTenant); assignApplicationKeyToDefaultHeaders(): void; /** * Returns the current state. */ get state(): any; getLangs(): any; /** * Returns the correct UI version. In hybrid mode for angular and ngx. */ get uiVersion(): any; /** * Dynamic options are stored on the API in a specific config: {} object. They can * be used to configure the app dynamically. * * Note: To avoids conflicts with the default Config, it is recommended * to use a certain namespace. */ updateCurrentApplicationConfig(config: T): Promise; /** * When this function called, it refreshes the values of loginOptions stored within ui state object. * Function is throttled to execute the refresh once in a time specified by params of @throttled decorator, * it should be called on leading edge of the timeout. */ refreshLoginOptions(): Promise; /** * Checks current users application list and matches it against given application name. * Returns true if application is in the list. * @param name application name */ isApplicationAvailable(name: string): Promise; /** * Sets current user (including support user). * @param userInfo Info about current user and support user to be set. */ setUser(userInfo: { user: IUser | ICurrentUser; supportUserName?: string; }): void; /** * Verifies if the current application is owned by the current tenant. * @param app The application to verify. * @returns true if it belongs to the current tenant. */ isOwnerOfApplication(app?: IApplication): boolean; /** * Verifies if the current application is owned by the current tenant. * @param app The application to verify. * @returns true if it belongs to the current tenant. */ isOwnerOfApplication$(app?: IApplication): Observable; loadDefaultOptions(): Promise; protected currentAppsOfUser$(): Observable; /** * An Observable emitting once all POST, PUT, DELETE requests to the application API finished */ protected onAppChangesCompletion$(): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface DateFormatOptions { locale?: string; useUppercaseFormat?: boolean; } declare class DateFormatService { private appStateService; constructor(appStateService: AppStateService); /** * Returns date format pattern based on locale and formatting syntax. * * @param formattingOptions - Object containing formatting options * @returns A string containing the date format pattern for the specified locale */ getDateFormat(formattingOptions?: DateFormatOptions): string; /** * Determines whether a given locale should use 12-hour clock format with AM/PM. * * @param locale - The locale code (e.g., 'en', 'pl', 'en_US') * @returns boolean indicating whether meridian format (AM/PM) should be used */ shouldUseMeridianFormat(locale?: any): boolean; private isNonEmptyString; private isValidLocale; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * The range of times supported by ECMAScript Date objects in milliseconds. * @see http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.1 */ declare const ES_MAX_TIME_MILLISECONDS = 8640000000000000; /** * Formats a date value according to locale rules. If no other format specified it defaults to `medium` * used as standard date/time format. * * Extends Angular's DatePipe in a way so that date values exceeding the range supported by ECMAScript * are displayed as earliest/latest supported point in time printed in the desired format pre- or postfixed * by the word `before` or `after`, respectively. * In all other cases the pipe behaves as the standard [DatePipe](https://angular.io/api/common/DatePipe). * * ```html * {{ deadline | c8yDate }} * {{ lastUpdated | c8yDate: 'a h:MM:ss' }} * {{ 8640000000000000 + 1 | c8yDate }} * {{ timestamp | c8yDate: 'adaptiveDate' }} * ``` * * The `adaptiveDate` format type automatically selects the appropriate format based on the date: * - For dates from today: Uses the `shortTime` format (e.g., "2:45 PM") * - For all other dates: Uses the `mediumDate` format (e.g., "Oct 23, 2025") */ declare class DatePipe extends DatePipe$1 { private translateService; private appStateService?; private dateFormatService?; constructor(locale: string, translateService: TranslateService$1, appStateService?: AppStateService, dateFormatService?: DateFormatService, defaultTimezone?: string | null, defaultOptions?: DatePipeConfig | null); transform(value: any, format?: string, timezone?: string, locale?: string): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } interface AssetTypeChildEntry { id: string; isRequired: boolean; } interface AssetTypeIcon { category: string; name: string; } interface AssetType extends IManagedObject { c8y_IsAssetType: { properties?: AssetTypeChildEntry[]; allowedAssetTypes?: AssetTypeChildEntry[]; icon?: AssetTypeIcon; }; } declare class RealtimeMessage { id: string; channel: string; realtimeAction: RealtimeAction; data: T | number; } type RealtimeAction = 'UPDATE' | 'DELETE' | 'CREATE'; /** * Service (providedIn root) that ensures to only create a single realtime subscription for each channel */ declare class RealtimeSubjectService { protected realtime: Realtime; reconnect$: Observable; connectionStatus$: Observable<'connected' | 'disconnected'>; private subjects$; constructor(realtime: Realtime); getObservableForChannel(channel: string): Observable>; protected createObservableForChannel(channel: string, realtime: Realtime): Observable>; protected createObservableForReconnect(): Observable; protected createObservableForConnectionStatus(): Observable<"connected" | "disconnected">; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * AssetTypesRealtimeService is being used to manage a cache of all existing asset types. * This service is injected in the AssetOverviewNavigationFactory class, which will trigger * the initialization of the cache as the constructor is called. */ declare class AssetTypesRealtimeService { private inventory; private appStateService; private realtimeSubject; private readonly DEFAULT_ASSET_ICON; private readonly assetTypes$; private readonly refreshTrigger; private managedObjectRealtimeService; constructor(inventory: InventoryService, appStateService: AppStateService, realtimeSubject: RealtimeSubjectService); /** * Returns an asset type from the cache based on the unique name property. * @param name Name of the asset type. * @returns IManagedObject which represents the asset type. */ getAssetTypeByName$(name: string): Observable; /** * Returns an asset type from the cache based on the id. * @param assetTypeId Id of the asset type. * @returns IManagedObject which represents the asset type. */ getAssetTypeById$(assetTypeId: string): Observable; /** * Returns all the available asset types from the cache. * @returns available asset types. */ getAssetTypesCache$(): Observable>; /** * Extracts an icon from an asset type. * @param type Type of the asset type. * @returns Returns an icon for a given asset type. */ getIcon$(type: string): Observable; /** * Refreshes the asset types cache */ refreshCache(): void; private initAssetTypes$; /** * Queries available asset types and adds every asset type to the local cache. * @returns available asset types. */ private getAssetTypes; private getAssetTypes$; /** * Validates whether the MO to update local asset types cache is already present. * If present, the MO gets subscribed for future updates. * else, the MO will not be subscribed */ private subscribeToCacheInvalidatorUpdates$; /** * Gets the MO that is used to update the local asset types cache. * @returns the id of the MO that has 'c8yAssetTypesCacheInvalidator' fragment, or 'null' */ private getAssetTypesCacheInvalidator; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare const MO_TYPES: readonly ["asset", "dynamicGroup", "brokerSource", "brokerSourceInactive", "group", "other"]; type MoTypes = (typeof MO_TYPES)[number]; type AssetTypes = Omit; /** * Enumerates the supported asset paths. */ declare enum ASSET_PATH { /** * The default asset path. */ DEFAULT = "group", /** * The asset path for devices. */ DEVICE = "device" } /** * Asset paths. */ type AssetPath = `${ASSET_PATH}`; declare class GroupService { private assetTypesRealtimeService; readonly icons: { readonly brokerSourceInactive: { readonly icon: "c8y-group-remote-inactive"; readonly iconOpen: "c8y-group-remote-inactive"; }; readonly brokerSource: { readonly icon: "c8y-group-remote"; readonly iconOpen: "c8y-group-remote-open"; }; readonly group: { readonly icon: "c8y-group"; readonly iconOpen: "c8y-group-open"; }; readonly dynamicGroup: { readonly icon: "c8y-group-smart"; readonly iconOpen: "c8y-group-smart-open"; }; readonly other: { readonly icon: "exchange"; readonly iconClass: "statusUnknown"; }; }; /** * A mapping of managed object types to their corresponding asset path. */ assetPaths: Map; dataBrokerSourceFragmentInactive: string; constructor(assetTypesRealtimeService: AssetTypesRealtimeService); /** * Finds an icon based on the contents of a managed object. * It takes into account factors such as type, and specific fragments. * @param mo Managed object to be checked. * @param open Determines whether the method should return an alternative icon showing the open state. * @param fallbackIcon If no icon is found, this icon is returned. * @returns Returns an icon. */ getIcon(mo: IManagedObject, open?: boolean, fallbackIcon?: string): Promise; /** * Checks whether a given managed object is a group. * @param mo Managed object to be checked. * @returns Returns true if the managed object is a group. */ isGroup(mo: IManagedObject): boolean; /** * Checks whether a given managed object is a dynamic group. * @param mo Managed object to be checked. * @returns Returns true if the managed object is a dynamic group. */ isDynamicGroup(mo: IManagedObject): boolean; /** * Checks whether a given managed object is a data broker. * @param mo Managed object to be checked. * @returns Returns true if the managed object is a data broker. */ isDataBroker(mo: IManagedObject): boolean; /** * Checks whether a given managed object is a data broker active. * @param mo Managed object to be checked. * @returns Returns true if the managed object is a data broker active. */ isDataBrokerActive(mo: IManagedObject): boolean; /** * Checks whether a given managed object is an asset. * @param mo Managed object to be checked. * @returns Returns true if the managed object is an asset. */ isAsset(mo: IManagedObject): boolean; /** * Checks whether the object belongs to any type of group. * Types of groups: group, dynamic group, data broker, data broker active. * @param mo Managed object to be checked. * @returns Returns true if the managed object belongs to the group category. */ isAnyGroup(mo: IManagedObject): boolean; /** * Checks whether a given managed object is a device. * @param mo Managed object to be checked. * @returns Returns true if the managed object is a device. */ isDevice(mo: IManagedObject): boolean; /** * Retrieves the path associated with a given managed object. * @param mo The managed object for which the asset path is to be retrieved. * @returns The path associated with the managed object's type. */ getAssetPath(mo: IManagedObject): AssetPath; private getAssetCustomIcon; private getDefaultIcon; private determineMoType; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class GetGroupIconPipe implements PipeTransform { private groupService; constructor(groupService: GroupService); transform(mo: IManagedObject, open?: boolean, defaultIcon?: SupportedIconsSuggestions): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Humanize an application name and translates it. * * ```html *

{{ appNameOrApp | humanizeAppName | async }}

* ``` */ declare class HumanizeAppNamePipe implements PipeTransform { private translateService; constructor(translateService: TranslateService$1); transform(appNameOrApp?: IApplication | string): Observable; private getAppName; private getFirstDefined; private isPublicApp; private humanize; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class MapFunctionPipe implements PipeTransform { transform(value: any, mappingFunction: (arg: any) => any, thisArg?: any): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class ShouldShowMoPipe implements PipeTransform { private groupService; constructor(groupService: GroupService); transform(mo: IManagedObject, option: string): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class PropertyValueTransformService { getName(namedObject: { name: string; }): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Service transforms the name for translation based on mapping provided by * PropertyValueTransformService. * Usage: * value | nameTransform | translate * Example: * {{ 'admins' | nameTransform | translate }} * transforms original string to: 'Admin User`role`' and then translates it like 'Admin User' */ declare class NameTransformPipe implements PipeTransform { private propertyTransformService; constructor(propertyTransformService: PropertyValueTransformService); transform(value: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Provides copy of original pipe for C8yTranslateModule */ declare class C8yTranslatePipe extends TranslatePipe { transform(query: string, ...args: any[]): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class C8yTranslateDirective extends TranslateDirective implements AfterViewInit, OnDestroy, OnChanges { /** * Used to get private element property from TranslateDirective, so it doesn't throw tsErrors */ private get _elementRef(); /** * Used to get private translateService property from TranslateDirective, so it doesn't throw tsErrors */ private get _translateService(); /** * Used to trigger events when html is replaced by directive. */ htmlUpdateEvent: EventEmitter; /** * When this directive successfully translates node, it stores its value in this property. * Another translation will be performed only if new translation value differs from stored one. */ lastTranslation: string; /** * When this directive encounters element that is HTML, it should switch to Html mode even if * new translated element does not contain any HTML. */ htmlMode: boolean; initialValue: string; destroy$: Subject; elementTranslated: boolean; constructor(_translateService: TranslateService$1, _element: ElementRef, _ref: ChangeDetectorRef); /** * Overridden method from original directive. * For simple text nodes, it just invokes the base method. * For complex nodes, it builds translation key from whole `inner HTML` * and replaces it with its translation. * This prevents splitting `HTML` into pieces and attempting to translate each one separately * which doesn't work, because we extract strings in whole. */ checkNodes(forceUpdate?: boolean, translations?: any): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; ngAfterViewInit(): void; setTranslatedStatus(status: boolean): void; /** * Builds lookup key from innerHTML, removes comments (that might be added by Angular) and trims it. */ private getLookupKey; private isElementSimpleTextType; private isElementInnerHtmlEmpty; private isLookupKeyMissing; private lookupKeyExist; private getNewTranslation; private updateHtmlContent; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Module must be redeclared, as Components cant be declared by two modules. */ declare class C8yTranslateModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare function localePathFactory(options: OptionsService): string; declare function languagesFactory(options: OptionsService): _c8y_options.Languages; declare function localeId(appStateService: AppStateService): { readonly lang: string; toLowerCase(): any; toString(): any; }; declare function getAngularLocalesLanguageString(language?: string): string; declare class CustomTranslateStore extends TranslateStore { protected getValue(language: Language, key: string): InterpolatableTranslation; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Custom TranslateService that prevents setting translations before the current language is set. * Required since apama team sets their translations too early before even the user language is determined. */ declare class CustomTranslateService extends TranslateService$1 { setTranslation(lang: Language, translations: TranslationObject, shouldMerge?: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare function provideTranslationServiceInstance(options?: RootTranslateServiceConfig): Provider[]; declare function provideI18n(): Provider[]; /** * The angular module definition for i18n (translation). * @exports I18nModule */ declare class I18nModule { static providers(): Provider[]; static forRoot(): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * Simplified version of [NgComponentOutlet](https://github.com/angular/angular/blob/main/packages/common/src/directives/ng_component_outlet.ts) * * In contrast to NgComponentOutlet it allows to set the environment injector. * * A [PR](https://github.com/angular/angular/pull/54764) has been raised to add that functionality in Angular. * * TODO: Remove this directive once the PR is merged. */ declare class C8yComponentOutlet implements OnChanges, OnDestroy { private __viewContainerRef; c8yComponentOutlet: Type | null; c8yComponentOutletInjector?: Injector; c8yComponentOutletEnvironmentInjector?: EnvironmentInjector; c8yComponentOutletProviders?: Type[]; c8yComponentOutletInitialState?: any; private _componentRef; private environment; private _newEnvInjector; constructor(__viewContainerRef: ViewContainerRef); ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private _needToReCreateComponentInstance; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Allows to set a icon. Switches between c8y default icons * and font awesome icons. * ```html * * ``` */ declare class IconDirective { private el; private renderer; /** * Sets the icon to be displayed. This directive handles the correct CSS classes * for Cumulocity IoT's dual-color icon sets. * * There are two main icon sets: * 1. **Cumulocity Icons**: These are specific to the platform. To use them, provide the icon name prefixed with **c8y-**. * 2. **Delight Icons**: This is the default icon set. To use them, provide just the icon name without any prefix. * * ```html * * * * * * * * * ``` */ set c8yIcon(icon: SupportedIconsSuggestions | { class: string; }); private c8yMatch; private dltC8yMatch; private currentClasses; constructor(el: ElementRef, renderer: Renderer2); private isC8y; private isDltC8y; private getClasses; private updateIcon; private mapFontAwesomeToDelightIcons; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class LoadingComponent { /** * Defining the layout of the loading component. By default the * component loading activity is used. */ layout: 'component' | 'application' | 'page'; /** * If set, a progress bar is shown. The layout property is ignored. */ progress: number; /** * Showing a message while loading. The application layout by default shows the label `Loading…`. */ message: string; /** * @ignore */ get defaultLoadingMessage(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * A component to show generic empty state. * Title and subtitle should be used with translate pipe to mark strings for translation. * Component can be displayed vertically (default) or horizontally. * Additional markup elements can be placed inside the tag. * * ```html * * (...) * * ``` */ declare class EmptyStateComponent { /** Icon name. */ icon: SupportedIconsSuggestions; /** Required title. */ title: string; /** Optional subtitle. */ subtitle: string; /** Whether to display it in horizontal layout. */ horizontal: boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Injects data statistics object of type `DataSourceStats` into your template * so that you can adjust your empty state messages according to them. * * Works only within the `c8y-data-grid` component. * * ```html * * * [...] * * ``` */ declare class EmptyStateContextDirective { templateRef: TemplateRef; constructor(templateRef: TemplateRef); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * A pipe that transforms a user object into their initials. * ```html * {{ user | userNameInitials }} * ``` */ declare class UserNameInitialsPipe implements PipeTransform { transform(user: any): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class ShortenUserNamePipe implements PipeTransform { transform(user: any): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Transforms a string into a human-readable format. * * ```html *

{{ 'c8y_hello world' | humanize }}

* ``` */ declare class HumanizePipe implements PipeTransform { static humanize(str?: string): string; transform(str: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } type CanEditConfig = { /** * Skips roles check. */ skipRolesCheck?: boolean; /** * Skips managed object ownership check. */ skipOwnerCheck?: boolean; /** * Skips checks with a query to the inventory API. */ skipRequestCheck?: boolean; }; declare class Permissions { private appState; private inventory; private user; static ROLE_ADVANCED_SOFTWARE_ADMIN: string; static ROLE_ADVANCED_SOFTWARE_READ: string; static ROLE_ALARM_ADMIN: string; static ROLE_ALARM_READ: string; static ROLE_ANALYTICSBUILDER_READ: string; static ROLE_APPLICATION_MANAGEMENT_ADMIN: string; static ROLE_APPLICATION_MANAGEMENT_READ: string; static ROLE_AUDIT_ADMIN: string; static ROLE_AUDIT_READ: string; static ROLE_BINARY_ADMIN: string; static ROLE_BINARY_CREATE: string; static ROLE_BINARY_READ: string; static ROLE_BULK_OPERATION_ADMIN: string; static ROLE_BULK_OPERATION_READ: string; static ROLE_CEP_MANAGEMENT_ADMIN: string; static ROLE_CEP_MANAGEMENT_READ: string; static ROLE_DATA_BROKER_ADMIN: string; static ROLE_DATA_BROKER_READ: string; static ROLE_DEVICE_CONTROL_ADMIN: string; static ROLE_DEVICE_CONTROL_READ: string; static ROLE_EMAIL_CREATE: string; static ROLE_EPLAPPS_READ: string; static ROLE_EVENT_ADMIN: string; static ROLE_EVENT_READ: string; static ROLE_GENERIC_MQTT_ADMIN: string; static ROLE_IDENTITY_ADMIN: string; static ROLE_IDENTITY_READ: string; static ROLE_INVENTORY_ADMIN: string; static ROLE_INVENTORY_CREATE: string; static ROLE_INVENTORY_READ: string; static ROLE_MACHINE_LEARNING_READ: string; static ROLE_MANAGED_OBJECT_ADMIN: string; static ROLE_MANAGED_OBJECT_CREATE: string; static ROLE_MANAGED_OBJECT_READ: string; static ROLE_MEASUREMENT_ADMIN: string; static ROLE_MEASUREMENT_READ: string; static ROLE_MQTT_CONNECT_ADMIN: string; static ROLE_MQTT_SERVICE_ADMIN: string; static ROLE_NOTIFICATION_2_ADMIN: string; static ROLE_OPTION_MANAGEMENT_ADMIN: string; static ROLE_OPTION_MANAGEMENT_READ: string; static ROLE_PROVISIONING_CREATE: string; static ROLE_PROVISIONING_READ: string; static ROLE_PROVISIONING_UPDATE: string; static ROLE_REMOTE_ACCESS_ADMIN: string; static ROLE_RETENTION_RULE_ADMIN: string; static ROLE_RETENTION_RULE_READ: string; static ROLE_SCHEDULE_REPORT_ADMIN: string; static ROLE_SIMULATOR_ADMIN: string; static ROLE_SMARTGROUP_ADMIN: string; static ROLE_SMARTGROUP_CREATE: string; static ROLE_SMARTGROUP_UPDATE: string; static ROLE_SMARTRULE_ADMIN: string; static ROLE_SMARTRULE_READ: string; static ROLE_SMS_ADMIN: string; static ROLE_SMS_READ: string; static ROLE_SUPPORT_ADMIN: string; static ROLE_SUPPORT_READ: string; static ROLE_TENANT_ADMIN: string; static ROLE_TENANT_MANAGEMENT_ADMIN: string; static ROLE_TENANT_MANAGEMENT_CREATE: string; static ROLE_TENANT_MANAGEMENT_READ: string; static ROLE_TENANT_MANAGEMENT_UPDATE: string; static ROLE_TENANT_STATISTICS_READ: string; static ROLE_USER_MANAGEMENT_ADMIN: string; static ROLE_USER_MANAGEMENT_CREATE: string; static ROLE_USER_MANAGEMENT_OWN_ADMIN: string; static ROLE_USER_MANAGEMENT_OWN_READ: string; static ROLE_USER_MANAGEMENT_READ: string; constructor(appState: AppStateService, inventory: InventoryService, user: UserService); /** * Checks if the current user has write permissions for the given mo * (either through global role, individual device permissions or via inventory roles). * * ```ts * async canEditGroup(group: IManagedObject): Promise { * return await this.permissions.canEdit( * [Permissions.ROLE_INVENTORY_ADMIN, Permissions.ROLE_MANAGED_OBJECT_ADMIN], * group * ); * } * ``` * * @param roleIds The array of role ids to check if the current user have at least one of them. * @param mo The managed object for which we are checking whether the user has access. * @param config A configuration object that can take the following values: `skipRolesCheck`: `boolean` - skips roles check, `skipOwnerCheck`: `boolean` - skips ownership check, `skipRequestCheck`: `boolean` - skips checks with a query to the inventory API. UI will make a query to backend whether the user can edit the managed object. A rejection from BE indicates a lack of permission. * * @returns A Promise resolving to a boolean value. `true` if editing is permitted based on the given parameters and configuration; otherwise, `false`. * */ canEdit(roleIds: string[], mo: IManagedObject | IIdentified, config?: CanEditConfig): Promise; /** * Checks if the current user has the specified role. * * ```ts * hasSmsReadRole(): boolean { * return this.permissions.hasRole(Permissions.ROLE_SMS_READ); * }; * ``` * * @param roleId The ID of the role to check against the current user's roles. * @returns A boolean value indicating whether the current user has the specified role. * @throws Error if no user is currently logged in. * */ hasRole(roleId: string): boolean; /** * Checks if the current user possesses all the specified roles. * * ```ts * hasMOReadAndBinaryReadRoles(): boolean { * return this.permissions.hasAllRoles([ * Permissions.ROLE_MANAGED_OBJECT_READ, * Permissions.ROLE_BINARY_READ * ]); * } * ``` * * @param roleIds An array of strings representing the role IDs to check against the current user's roles. * @returns A boolean value indicating whether the current user has all the specified roles. * @throws Error if no user is currently logged in. * */ hasAllRoles(roleIds: string[]): boolean; /** * Checks if the current user possesses any of the specified roles. * * ```ts * hasTenantAdminOrTenantManagementAdminRoles(): boolean { * return this.permissions.hasAnyRole([ * Permissions.ROLE_TENANT_ADMIN, * Permissions.ROLE_TENANT_MANAGEMENT_ADMIN * ]); * }; * ``` * * @param roleIds An array of strings representing the role IDs to check against the current user's roles. * @returns A boolean value indicating whether the current user has any of the specified roles. * @throws Error if no user is currently logged in. * */ hasAnyRole(roleIds: string[]): boolean; /** * Checks if the current user possesses any of the specified global roles. * * ```ts * hasAnyGlobalRoles(dashboard: ContextDashboardManagedObject): boolean { * const globalRolesIds = dashboard?.c8y_Dashboard?.globalRolesIds; * return this.permissions.hasAnyGlobalRole(globalRolesIds); * } * ``` * * @param globalRolesIds An array of numbers representing the global role IDs to check against the current user's roles. * @returns A boolean value indicating whether the current user has any of the specified global roles. * @throws Error if no user is currently logged in. * */ hasAnyGlobalRole(globalRolesIds: number[]): boolean; /** * Checks if the current user is the owner of the managed object. * Utilizes memoization to cache the result based on the managed object's id, * improving performance for subsequent checks of the same object. * * ```ts * const managedObject = { id: '123', owner: 'johnDoe' }; * this.checkIfOwner(managedObject).then(isOwner => { * console.log(isOwner); * }); * ``` * * @param mo The managed object to check ownership against. * @returns A promise that resolves to `true` if the current user is the owner of the managed object, and `false` otherwise. * */ protected checkIfOwner(mo: IManagedObject | IIdentified): Promise; /** * Attempts to perform a partial update on a managed object as a means to check for edit permissions. * Utilizes memoization to cache the result based on the managed object's id, * thereby avoiding unnecessary repeated requests for the same object. * * This method essentially tests if the current user has permission to update the managed object, * serving as an indirect permission check. * * ```ts * const managedObject = { id: '456' }; * this.checkWithRequest(managedObject).then(hasPermission => { * console.log(hasPermission); * }).catch(error => { * console.error(error); * }); * ``` * * @param mo The managed object to test edit permissions on. * @returns A promise that resolves to `true` if the update request succeeds (indicating edit permissions), and `false` if it fails. * */ protected checkWithRequest(mo: IManagedObject | IIdentified): Promise; /** * Checks if the current user has the necessary permissions to edit a managed object. * This method considers various conditions to determine editability, including role checks, * ownership, and custom request-based checks. Each of these checks can be optionally skipped * based on the provided configuration. * * @param roleIds An array of role IDs to check against the current user's roles. * @param mo The managed object or an identified resource to check edit permissions for. * @param config Configuration options to customize the checks performed. This includes options to skip role checks, owner checks, or custom request checks. * @returns A promise that resolves to `true` if the current user can edit the managed object based on the given conditions, and `false` otherwise. * */ private checkIfCanEdit; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * A structural directive that conditionally includes a template only if the user has * all or any of the roles passed as an input. By default the directive checks all roles: * * ```html * * ``` * * To check if the user has any of the required roles to view the element you need to use the `allowAny` input: * * ```html * * ``` * * or use the shorter version * * ```html * * ``` */ declare class IfAllowedDirective { private template; private container; private permissions; /** * One or many roles required for the element to be rendered */ set c8yIfAllowed(roleIds: string | string[]); /** * Switches to the mode where at least one of the provided roles is sufficient for the element to be rendered */ set c8yIfAllowedAllowAny(allowAny: boolean); private rolesIds; private allowAny; constructor(template: TemplateRef, container: ViewContainerRef, permissions: Permissions); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare const NUMBER_FORMAT_REGEXP: RegExp; /** * Formats a value according to digit options and locale rules. * Extends the behavior of Angular's number pipe by * providing an option to define if a truncated value should be * rounded up or down (with the number pipe the * value will be rounded using the "to-nearest" method). * * ```html * {{ 3.45612 | c8yNumber: 'ceil':'1.1-3' }} * {{ 3.46 | c8yNumber: 'ceil':'1.3-3' }} * {{ 3.45685 | c8yNumber: 'floor':'1.1-3' }} * ``` */ declare class NumberPipe extends DecimalPipe { constructor(locale: string); transform(value: number | string, round: 'ceil' | 'floor' | null | undefined, digitsInfo?: string, locale?: string): string | null; transform(value: null | undefined, round: 'ceil' | 'floor' | null | undefined, digitsInfo?: string, locale?: string): null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class OperationResultComponent { text: string; vertical: boolean; size: number; type: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * A pipe that transforms a Markdown string into sanitized HTML. * * * ```html *
* ``` */ declare class MarkdownToHtmlPipe implements PipeTransform { private sanitizer; constructor(sanitizer: DomSanitizer); transform(markdown: string, args?: { baseUrl: string; }): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class MoNameCacheService { private inventoryService; private clearCacheTimer; private cacheLifeSpan; getMoName: any; constructor(inventoryService: InventoryService); resetCacheTimer(id: any): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class MoNamePipe implements PipeTransform { private moNamePipeService; constructor(moNamePipeService: MoNameCacheService); transform(entityOrId: Partial): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Directive to set a DOM node, a TemplateRef or any Component to a container or any node. * ```html *
*
*
* ``` * * Note: When passing a native `HTMLElement`, be aware that a single element instance can only exist in one * place in the DOM. If you need to render the same element in multiple locations, the passed element * should have a `createCopy` function that returns a new instance or a clone of the element. */ declare class OutletDirective { private viewContainer; private injector; private renderer; private el; private properties; private _element; private _template; constructor(viewContainer: ViewContainerRef, injector: Injector, renderer: Renderer2, el: ElementRef); /** * Directive to set a `DOM node`, a `TemplateRef` or any `Component` to a container or any node. * ```html *
*
*
* ``` */ set c8yOutlet(template: TemplateRef | Type | Element); /** * Additional properties that should be added to the component * instance. */ set c8yOutletProperties(value: any); /** * Allows to use a different injector. */ set c8yOutletInjector(value: Injector); /** * @ignore */ ngOnChanges(): void; /** * @ignore */ ngOnDestroy(): void; private render; private destroy; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * A directive to iterate over `IResultList` data from `@c8y/client`. * Depending on the `[c8yForLoadMore]` a load more button is: * - **auto**: Tries to automatically load more data (default maximum 10 iterations; can be * change with maxIterations settings). * - **show**: Shows a load more button for the user to decide * - **none**: Doesn't perform any load more action. * - **hidden**: Loads more data automatically but with no visible button for the user. * * Additional, any rxjs operator pipe can be applied to the `[c8yForPipe]` input, e.g. to * filter the data displayed currently as well as the data loaded by subsequent requests. * * ```html *
* {{ i + 1 }}. {{device.name}} *
* ``` * The above example will list all entities that are applied to `devices`: * ```typescript * this.devices = this.inventoryService.list({ pageSize: 10, fragmentType: 'c8y_IsDevice' }) * ``` * It will display the first `10` items, if there is more space left on the screen, and there are more * than `10` devices, it will automatically load up to 10 pages more. If it still can't fit the screen * it will stop and switch to `show` mode. * * A pipe can be applied e.g. for filtering or grouping. This pipe is attached to every follow up * request done by the load more component: * ```typescript * this.filterPipe = pipe( * map((data: []) => { * return data.filter( * (mo: any) => mo.name && mo.name.toLowerCase().indexOf(value.toLowerCase()) > -1 * ); * }) * ); * ``` * The pipe must be an rxjs pipe and can take any operator. * * Example with realtime support and items count output (e.g. for handling empty state and header): * * ```html * *
* (...) *
* * * * * * (...) * * *
* ``` * * ```typescript * @Component({ * (...) * }) * export class ExampleComponent { * @Input() deviceId: IIdentified; * items$ = this.operationService.list({ * deviceId: this.deviceId, * fragmentType: 'c8y_MyOperation', * dateFrom: new Date(0).toISOString(), * dateTo: new Date(Date.now()).toISOString(), * revert: true, * withTotalPages: true * }); * filterPipe = pipe(map((ops: IOperation[]) => ops.filter(op => op.c8y_MyOperation))); * realtimeOptions: ForOfRealtimeOptions = { * entityOrId: this.deviceId, * removeOnUpdate: true, * insertOnUpdate: true * } as ForOfRealtimeOptions; * count: number; * * constructor( * private operationService: OperationService, * public realtime: OperationRealtimeService * ) {} * } * ``` */ declare class ForOfDirective { private tpl; private vcr; private cdRef; private cachedData; private paging; private loadMoreMode; private dataPipe; private itemDataPipe; private pagingSub; private obs$; private loadMore; private loadingTemplate; private maxIterations; private notFoundTemplate; private loadNextLabel; private loadingLabel; private realtime; private realtimeOptions; private comparator; private unsubscribe$; private virtualScrollInstance; private get shouldUseLoadMoreButton(); private get hasMoreData(); private get length(); /** * The data setter. Must be a response from @c8y/data or an observable. * You can pass an observable with null to explicitly clear the list. */ set c8yForOf(fetchData: IResultList | Observable>); /** * The mode setter: * - **auto**: Tries to automatically load more data (default maximum 10 iterations; can be * change with maxIterations settings). * - **show**: Shows a load more button for the user to decide * - **none**: Doesn't perform any load more action. * - **hidden**: Loads more data automatically but with no visible button for the user. */ set c8yForLoadMore(type: ForOfDirective['loadMoreMode']); /** * The pipe setter to attach any rxjs pipe to the current and more loaded data. */ set c8yForPipe(dataPipe: ForOfDirective['dataPipe']); /** * A template to use if no data is found at all (e.g. if you apply a filter pipe). */ set c8yForNotFound(notFoundTemplate: ForOfDirective['notFoundTemplate']); /** * The maximum numbers of iterations to call data from the api. */ set c8yForMaxIterations(maxIterations: number); /** * A custom loading component. */ set c8yForLoadingTemplate(loadingTemplate: ForOfDirective['loadingTemplate']); /** * Load next text label. */ set c8yForLoadNextLabel(loadNextLabel: string); /** * Loading text label. */ set c8yForLoadingLabel(loadingLabel: string); /** * A `RealtimeService` instance. */ set c8yForRealtime(source: ForOfDirective['realtime']); /** * Realtime options. */ set c8yForRealtimeOptions(realtimeOptions: ForOfDirective['realtimeOptions']); /** * A comparator function for comparing list items. Used to determine * the position at which a new element should be added to the list. */ set c8yForComparator(comparator: ForOfDirective['comparator']); /** * Enable virtual scroll rendering method. */ c8yForEnableVirtualScroll: boolean; /** * Provides fixed item size for virtual scroll window strategy. */ c8yForVirtualScrollElementSize: any; /** * Sets mode of virtual scroller instance. * window is used for case when whole viewport is scrolled. * fixed can be used on inner-scroll containers. */ c8yForVirtualScrollStrategy: 'fixed' | 'window'; /** * When used fixed strategy, there needs to be fixed height set on scrolling container. */ c8yForVirtualScrollContainerHeight: number; /** * The number of items currently loaded in the list. * * Note: This can only be used if the `forOf` isn't used with * the sugared asterisk (*) syntax. Instead you need to use an ng-template: * ```html * * * ``` */ private c8yForCount; /** * The items change event emitting the newly loaded items. * * Note: This can only be used if the `forOf` isn't used with * the sugared asterisk (*) syntax. Instead you need to use an ng-template: * ```html * * * ``` */ private c8yForChange; /** * The current instance of the `LoadMoreComponent`. */ private c8yForLoadMoreComponent; private count; constructor(tpl: TemplateRef, vcr: ViewContainerRef, cdRef: ChangeDetectorRef); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; private handleRealtime; /** * On create notification: * - if item passes data pipe, then insert it. * @private */ private handleRealtimeCreate; /** * On update notification: * - if item is displayed and passes data pipe, then update it, * - if item is displayed and doesn't pass data pipe, then remove it (if `removeOnUpdate` is true), * - if item is not displayed and passes data pipe, then insert it (if `insertOnUpdate` is true), * - if item is not displayed and doesn't pass data pipe, then ignore it. * @private */ private handleRealtimeUpdate; /** * On delete notification: * - remove item from the list (if not there, it will be just ignored). * @private */ private handleRealtimeDelete; private render; private append; private loadMoreData; private createLoadMoreButtonComponent; private createVirtualScrollWrapperComponent; private insert; private update; private remove; private updateCount; private isDisplayed; private forMatchingEmbeddedViewRef; private checkForDuplicates; private unsubscribePaging; private setVirtualScrollContents; private appendVirtualScrollContent; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class LoadMoreComponent { private element; private cdRef; paging: Paging; useIntersection: boolean; hidden: boolean; container: ElementRef; class: string; maxIterations: number; noMoreDataHint: TemplateRef; loadingTemplate: TemplateRef; hideNoMoreDataHint: boolean; loadNextLabel: string; loadingLabel: string; onLoad: EventEmitter; isLoading: boolean; counter: number; hasNoMoreData: boolean; private loadUntilIntersected; private readonly LOAD_SAME_PAGE_THRESHOLD; private intersectionObserver; private destroyed; get hostClass(): string; get hasMore(): boolean; get isLastPage(): boolean; constructor(element: ElementRef, cdRef: ChangeDetectorRef); ngAfterContentInit(): void; ngOnDestroy(): void; loadMore(event?: any): Promise; private intersectionLoading; private getLoadingThreshold; private shouldShowNoMoreDataHint; private shouldSwitchMode; private buttonInView; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * @deprecated Use `c8y-loading` instead. */ declare class ProgressBarComponent { message: string; progress: number; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * A directive to determine if a dropdown should open to the top or as usual to the bottom. * It starts by checking the available space on the closese parent container with the class * `inner-scroll`, fallback to the `window.innerHeight` if no parent is found. * This directive has a direct dependency to the bootstrap dropdown (!) * * Preconditions: * - Bootstrap dropdown is used * - Bootstrap dropdown is not used with container="body" * - Bootstrap dropdown is used like it is intended and documented for e.g. * ```html * * ``` * * ```html * * ``` * Make use of the bootstrap dropdown as usual and additionally add the direction directive to it. */ declare class DropdownDirectionDirective { private elementRef; private renderer; private readonly MARGIN_BOTTOM; private readonly VISIBILITY; private readonly DROPUP; private readonly MENUHEIGHT; private readonly MAX_ANCESTOR_SEARCH_ITERATIONS; constructor(elementRef: ElementRef, renderer: Renderer2); onClick(): void; private shouldDropup; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class TextareaAutoresizeDirective implements OnInit { private elementRef; private focused; private resizeObserver; constructor(elementRef: ElementRef); onInput(): void; onFocus(): void; onBlur(): void; ngOnInit(): void; ngOnDestroy(): void; resize(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Adds necessary attributes to ngx-bootstrap's tabset markup to comply with a11y requirements. */ declare class TabsetAriaDirective implements AfterViewInit { private elementRef; constructor(elementRef: ElementRef); ngAfterViewInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class VirtualScrollerWrapperComponent implements AfterViewChecked { virtualScrollViewport: CdkVirtualScrollViewport; items: unknown[]; itemHeight: number; containerHeight: number; template: TemplateRef; filterPipe: rxjs.UnaryFunction, Observable>; strategy: 'fixed' | 'window'; items$: Observable; private checkViewportSize$; private readonly destroyRef; constructor(); trackByFn: (i: any, item: any) => any; ngAfterViewChecked(): void; apply(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class VirtualScrollWindowStrategy implements VirtualScrollStrategy { scrolledIndexChange: Observable; private destroy$; private _viewport; private _itemSizePx; private _offsetSizePx; private _minBufferPx; private _maxBufferPx; private readonly _scrolledIndexChange; private readonly destroy; constructor(itemSizePx: number, offsetSizePx: number, minBufferPx: number, maxBufferPx: number); /** * Attaches this scroll strategy to a viewport. * @param viewport The viewport to attach this strategy to. */ attach(viewport: CdkVirtualScrollViewport): void; /** Detaches this scroll strategy from the currently attached viewport. */ detach(): void; /** * Update the item size and buffer size. * @param itemSize The size of the items in the virtually scrolling list. * @param offsetSizePx The size of the offset (in pixels).. * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more. */ updateItemAndBufferSize(itemSize: number, offsetSizePx: number, minBufferPx: number, maxBufferPx: number): void; /** @docs-private Implemented as part of VirtualScrollStrategy. */ onContentScrolled(): void; /** @docs-private Implemented as part of VirtualScrollStrategy. */ onDataLengthChanged(): void; /** @docs-private Implemented as part of VirtualScrollStrategy. */ onContentRendered(): void; /** @docs-private Implemented as part of VirtualScrollStrategy. */ onRenderedOffsetChanged(): void; /** * Scroll to the offset for the given index. * @param index The index of the element to scroll to. * @param behavior The ScrollBehavior to use when scrolling. */ scrollToIndex(index: number, behavior: ScrollBehavior): void; /** Update the viewport's total content size. */ private _updateTotalContentSize; /** Update the viewport's rendered range. */ private _updateRenderedRange; } /** * Provider factory for `VirtualScrollWindowStrategy` that simply extracts the already created * `VirtualScrollWindowStrategy` from the given directive. * @param windowDir The instance of `VirtualScrollWindowDirective` to extract the * `VirtualScrollWindowStrategy` from. */ declare function _virtualScrollWindowStrategyFactory(windowDir: VirtualScrollWindowDirective): VirtualScrollWindowStrategy; declare class VirtualScrollWindowDirective implements OnChanges { /** The size of the items in the list (in pixels). */ get itemSizePx(): number; set itemSizePx(value: number); _itemSizePx: number; /** * The minimum amount of buffer rendered beyond the viewport (in pixels). * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px. */ get minBufferPx(): number; set minBufferPx(value: number); _minBufferPx: number; /** * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px. */ get maxBufferPx(): number; set maxBufferPx(value: number); _maxBufferPx: number; /** The size of the offset (in pixels). */ get offsetSizePx(): number; set offsetSizePx(value: number); _offsetSizePx: number; /** The scroll strategy used by this directive. */ _scrollStrategy: VirtualScrollWindowStrategy; ngOnChanges(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class ShowIfFilterPipe implements PipeTransform { transform boolean | Promise | Observable); }; }>(value: T): Observable>; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Sets the focus on the give targetId on click. */ declare class SkipLinkDirective { targetId: string; onClick(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } interface IFetchWithProgress { totalBytes: number; bufferedBytes: number; percentage: number; bytesPerSecond: number; blob?: Blob; } declare enum GENERIC_FILE_TYPE { ARCHIVE = "archive", AUDIO = "audio", CODE = "code", EXCEL = "excel", IMAGE = "image", PDF = "pdf", POWERPOINT = "powerpoint", TEXT = "text", VIDEO = "video", WORD = "word", EPL = "epl", FONT = "font" } declare class FilesService { private systemOptionsService; private inventoryBinaryService; readonly DEFAULT_BYTES_LIMIT = 52428800; readonly FILENAME_MAX_LENGTH = 128; fileTypeExtensionsMap: { readonly archive: { readonly exts: readonly ["7z", "apk", "cab", "gz", "iso", "jar", "rar", "tar", "zip"]; }; readonly audio: { readonly exts: readonly ["3gp", "aiff", "aac", "amr", "m4a", "m4p", "mp3", "oga", "ogg", "raw", "wav", "wma"]; }; readonly code: { readonly exts: readonly ["aspx", "exe", "htm", "html", "jad", "js", "json", "jsp", "php", "xml"]; }; readonly excel: { readonly exts: readonly ["xls", "xlsx"]; }; readonly image: { readonly exts: readonly ["bmp", "gif", "jpeg", "jpg", "png", "tiff", "svg", "ico", "apng", "webp"]; }; readonly pdf: { readonly exts: readonly ["pdf"]; }; readonly powerpoint: { readonly exts: readonly ["ppt", "pptx"]; }; readonly text: { readonly exts: readonly ["txt"]; }; readonly video: { readonly exts: readonly ["asf", "avi", "flv", "mov", "mp4", "ogv", "qt", "rm", "rmvb", "wmv", "3gp"]; }; readonly word: { readonly exts: readonly ["doc", "docx"]; }; readonly epl: { readonly exts: readonly ["mon"]; }; readonly font: { readonly exts: readonly ["ttf", "otf", "woff", "woff2"]; }; }; private fileSizeLimitCfg; constructor(systemOptionsService: SystemOptionsService, inventoryBinaryService: InventoryBinaryService); /** * Checks if files have valid size. * @param files Files to check. * @returns Returns true if each file has the correct size. */ haveValidSizes(files: FileList, maxFileSizeInBytes?: number): Promise; /** * Checks the system file size limit, if not available returns the default value. * Default limit: [DEFAULT_BYTES_LIMIT]{@link DEFAULT_BYTES_LIMIT} * @returns Returns promise with the limit value. */ loadBytesSizeLimit(): Promise; /** * Checks the size of the file * @param file File to check. * @returns Returns size of the file in bytes. */ size(file: File | IManagedObjectBinary): number; /** * Checks whether files have allowed extensions. * If the accept parameter is not specified, all extensions are accepted. * @param files Files to check. * @param accept String of comma separated file extensions and generic types ([GENERIC_FILE_TYPE]{@link GENERIC_FILE_TYPE}), e.g. .zip,.7z,excel. * @returns Returns true if each file has allowed extension. */ haveValidExtensions(files: FileList | File | File[], accept: string): boolean; /** * Checks if file names have allowed extension. * If the accept parameter is not specified, all extensions are accepted. * @param fileNames The file names to check. * @param accept String of comma separated file extensions and generic types ([GENERIC_FILE_TYPE]{@link GENERIC_FILE_TYPE}), e.g. .zip,.7z,excel. * @returns Returns true if each file has allowed extension. */ fileNamesHaveValidExtension(fileNames: string | string[], accept: string): boolean; /** * Checks if each file has a valid filename length. * @param files Files to check. * @returns Returns true if each file has a valid filename length. */ checkMaxLength(files: FileList): boolean; /** * Extracts the file extension. * @param fileOrFileName File or name of file from which the extension should be extracted. * @returns Returns the file extension or undefined if the file has no extension. */ getFileExtension(fileOrFileName: File | string): string | undefined; /** * List of file extensions. * @returns Returns list of file extensions. */ getFileExtensions(): string[]; /** * The list of generic file types. * @returns Returns the list of generic file types. */ getGenericFileTypes(): GENERIC_FILE_TYPE[]; /** * @ignore */ mapGenericFileTypesToExtensions(genericFileTypes?: GENERIC_FILE_TYPE[]): string[]; /** * Extracts a list of file extensions from a string. * Can accept generic file types check: [GENERIC_FILE_TYPE]{@link GENERIC_FILE_TYPE}. * * @param str String from which the file extensions are extracted (comma separated values). * Accepted string format: * * ".zip,.iso", * * "zip,ISO", * * "archive". * Important: generic types cannot contain a dot. All values with a dot are treated as a normal extension. * @returns Returns a list of the file extensions. */ extractFileExtensions(str: string): string[]; /** * Converts a file to a base64 image string. * * @param file The file to convert to base 64. * @returns The image string in base64 format. */ toBase64(file: File): Promise; /** * Allows to get a File representation of an managed object binary. Can be used * to convert this file toBase64 to show it to the end-user. * @param binary The binary managed object * @returns The file representation. */ getFile(binary: IManagedObjectBinary): Promise; /** * Allows to calculate the hash sum of the provided file. * @param file The file to hash. * @returns The SHA-256 hash of the file. */ getHashSumOfFile(file: File | Blob): Promise; /** * Allows to download a file (opens the browser download prompt). * @param binary The binary managed object. */ download(binary: IManagedObjectBinary): Promise; /** * Loads the file to JavaScript memory. * Returns an observable that emits progression status object, * and after download is completed, blob property is populated with Blob result object. * Unsubscribing from the returned observable aborts the file fetch request. * * @param binary The binary managed object. */ fetchFileWithProgress$(binary: IManagedObjectBinary): Observable; uploadFileWithProgress$(file: Stream | Buffer | File | Blob): Observable; private processResponse$; private isGenericType; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Returns a generic file icon name matching the extension of the given File object. * One of the following icon names may be returned: file-archive-o, file-audio-o, * document-with-code, file, file-excel-o, file-image-o, pdf-2, file-powerpoint-o, * file-text, file-video-o, file-word-o, file, or unknown. * * ```html *
* *
* ``` */ declare class GenericFileIconPipe implements PipeTransform { filesService: FilesService; constructor(filesService: FilesService); transform(file: File): string; getGenericType(file: File): GENERIC_FILE_TYPE | 'unknown'; getIcon(genericType: GENERIC_FILE_TYPE | 'unknown'): string; private matchGenericType; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class StringifyObjectPipe implements PipeTransform { private c8yDatePipe; private readonly isoDateTimeRegex; constructor(c8yDatePipe: DatePipe); transform(value: any): string; private isDate; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Sets the application language during the app initialization. * @returns An app initializer that sets the language based on user preference or browser settings. */ declare function provideLanguageSelectorAppInitializer(): EnvironmentProviders; /** * Loads all configured plugins on application startup. * @returns An app initializer that loads all plugin modules and sets the application state accordingly. */ declare function providePluginsLoaderServiceAppInitializer(): EnvironmentProviders; /** * Loads the default application options during the app initialization. * * e.g. loads supportUrl, activateSupportUserAvailable, backend version * @returns An app initializer that loads the default application options. */ declare function provideDefaultOptionsAppInitializer(): EnvironmentProviders; /** * Provides commonly used pipes. To be injected via dependency injection. * @returns An array of commonly used pipes. */ declare function provideCommonPipes(): (typeof BytesPipe | typeof DatePipe | typeof GetGroupIconPipe | typeof HumanizeAppNamePipe | typeof MapFunctionPipe | typeof ShouldShowMoPipe)[]; /** * Provides commonly used services and app initializers. * @returns An array of commonly used services and app initializers. */ declare function provideCommonServices(): (Provider | EnvironmentProviders)[]; /** * Commonly used directives, data access and translation. This module is the shared * module across all core components. It should be imported by default. * * @exports IconDirective A directive to set a c8y icon with [c8yIcon]="'rocket'". * @exports OutletDirective A directive which allows to set DOM or Angular templates (used for upgrade). * @exports I18nModule Translation module. * @exports NgCommonModule Angular common module. * @exports DataModule The data layer to allow DI with @c8y/client. * @exports HumanizeAppNamePipe Humanize an application name for display in e.g. the app switcher (e.g. `devicemanagement` becomes `Device Management`). * @exports HumanizePipe Humanize a string, e.g. `c8y_water_temperature` becomes `Water Temperature`. * @exports ShouldShowMoPipe Checks if passed managed object is device or group type. * @exports GetGroupIconPipe Gets proper group icon. * @exports ShortenUserNamePipe Allows a short name. E.g. `Foo Bar` gets `F. Bar`. * @exports UserNameInitialsPipe Allows the initials from the name. E.g. `Foo Bar` gets `FB`. * @exports ForOfDirective A forOf directive like ngFor but with load-more function. * @exports LoadMoreComponent A component to load more data from a certain data-source. * @exports ProgressBarComponent Displays either defined or undefined progress. * @exports DropdownDirectionDirective Determines if a dropdown opens to the bottom or to the top. * @exports TextareaAutoresizeDirective resizes a textarea height as the user inputs. * @exports OperationResultComponent displays an animated svg for success and error operations. */ declare class CommonModule { static providers(): (Provider | EnvironmentProviders)[]; static forRoot(): ModuleWithProviders; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class DeviceService { static FRAGMENTS_FOR_NO_DEVICE: readonly ["c8y_Dashboard", "c8y_Report", "c8y_Kpi", "c8y_ExportConfiguration", "c8y_IsBinary", "c8y_NoDevice", "c8y_IsDeviceGroup", "c8y_IsDynamicGroup", "c8y_Group", "com_cumulocity_model_smartrest_SmartRestTemplate", "com_cumulocity_model_devicesimulator_SensorTemplate", "_attachments", "c8y_IsDeviceType", "c8y_objectmapping_ObjectMapping", "c8y_IsAssetType"]; static TYPES_FOR_NO_DEVICE: readonly ["c8y_ConfigurationDump", "c8y_Firmware", "c8y_SmartRule", "c8y_Software", "impact_object_mapping", "c8y_UserPreference", "c8y_TenantPolicy", "c8y_PrivateSmartRule", "c8y_SmartRest2Template", "c8y_JsonSchema", "c8y_DeviceShellTemplate", "c8y_DemoStatus", "c8y_DataBroker", "c8y_Application_", "brandingVariables", "c8y_DeviceSimulator", "c8y_CertificateMetadata", "lwm2m_post_registration", "c8y_microservice_manifest_"]; static DEVICE_FRAGMENT_TYPE: "c8y_IsDevice"; static isAnyDevice(mo: IManagedObject): boolean; static hasFragmentOrTypeFromBlacklist(mo: IManagedObject): boolean; static hasTypeFromBlacklist(mo: IManagedObject): boolean; static hasFragmentFromBlacklist(mo: IManagedObject): boolean; static isRootDevice(mo: IManagedObject): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Service for retrieving ancestor paths in the Cumulocity asset hierarchy. * * This service traverses upward through parent relationships (assetParents, deviceParents, * additionParents) to find all possible paths from root ancestors down to a target asset. * * @example * Given this hierarchy: * ``` * Root1 -> Building1 -> Floor1 -> Device * Root2 -> Building2 -> Floor1 -> Device * ``` * * Calling `getAncestorPaths('Device')` returns: * ``` * [ * [Root1, Building1, Floor1, Device], * [Root2, Building2, Floor1, Device] * ] * ``` */ declare class AssetHierarchyService { private inventory; private alertService; /** * Retrieves all ancestor paths from root nodes down to the specified asset. * * This method fetches the target asset and all its ancestors, then constructs * all possible paths from root ancestors (objects with no parents) down to the * target asset. Multiple paths may exist if the asset has multiple parent chains. * * @param assetId - The ID of the target asset * @returns A promise that resolves to an array of paths, where each path is an * array of managed objects ordered from root to target asset. * Returns an empty array if the asset is not found or an error occurs. */ getAncestorPaths(assetId: string): Promise; /** * Gets all parent IDs of a managed object. */ private getParentIds; /** * Gets all child IDs of a managed object. */ private getChildrenIds; /** * Recursively finds all paths from a root node to the target asset. * Returns an array of paths, where each path is an array of managed objects. */ private findAllPathsToAsset; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Represents a single section in the icon panel */ interface IconPanelSection { /** Unique identifier for the section */ id: string; /** Label text for the section */ label: string; /** Icon name (e.g., 'c8y-device', 'c8y-connection') */ icon: string; /** Whether the section should be displayed */ visible: boolean; /** HTML content to display in the section */ content: string; /** Custom CSS classes for the section container */ containerClass?: string; /** Data-cy attribute for testing */ dataCy?: string; /** Responsive grid classes (e.g., 'col-xs-12 col-md-6') */ colClass?: string; /** Additional CSS classes for the icon */ iconClass?: string; } /** * Icon Panel Component * * Displays information in a grid of bordered panels, each with an icon, label, and content. * Useful for showing structured metadata, device information, connection status, etc. * * @example * ```typescript * sections: IconPanelSection[] = [ * { * id: 'device-info', * label: 'Device Information', * icon: 'c8y-device', * visible: true, * content: '

Device ID: THM-001

Type: Sensor

', * colClass: 'col-xs-12 col-md-6' * }, * { * id: 'status', * label: 'Status', * icon: 'c8y-connection', * visible: true, * content: 'Connected', * colClass: 'col-xs-12 col-md-6' * } * ]; * ``` * * ```html * * ``` * * You can also project additional content: * ```html * *
*

Additional custom content here

*
*
* ``` */ declare class IconPanelComponent { /** * Array of sections to display in the panel */ sections: IconPanelSection[]; /** * Accessible label for the icon panel region. */ ariaLabel: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Realtime options for `ForOfDirective`. */ interface ForOfRealtimeOptions { /** An entity object or id to be used with a [[RealtimeService]] instance. */ entityOrId?: IdReference; /** Whether to insert an item which passes `pipe` but is not in the list yet (e.g. it didn't pass `pipe` on creation, but now it does). */ insertOnUpdate?: boolean; /** Whether to remove an item which doesn't pass `pipe` but is in the list already (e.g. it passed `pipe` on creation, but now it doesn't). */ removeOnUpdate?: boolean; } type ForOfFilterPipe = UnaryFunction, Observable>; declare class GeoService { private readonly C8Y_POSITION_FRAGMENT; getLatLong(mo: IEvent | IManagedObject): [number, number]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } type ManagedObjectTypeForConfig = 'c8y_Software' | 'c8y_Firmware' | 'c8y_ConfigurationDump' | 'c8y_ModbusDeviceType' | 'c8y_CANopenDeviceType' | 'c8y_LoraDeviceType' | 'c8y_SigfoxDeviceType' | 'c8y_DeviceShellTemplate' | 'c8y_Profile'; declare class GlobalConfigService { private inventory; protected cache: Promise>; private fragmentTypeMapping; constructor(inventory: InventoryService); /** * Retrieves the global configuration for a specific fragment type. * @param fragmentType - The fragment type on which the managed object type corresponds. * @returns A promise that resolves in the first global configuration managed object. */ getGlobalConfig(fragmentType: string): Promise; /** * Retrieves whether an object should include the c8y_Global fragment in its declaration. * If the fragment is set to false it should return false; * If the fragment is set to true it should return true; * If no fragment is available it should return true; * @param objectType - The type of managed object. * @returns A promise that resolves into a boolean value indicating whether the global parameter should be set. */ getGlobalParam(objectType: ManagedObjectTypeForConfig): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare enum GroupFragment { groupType = "c8y_DeviceGroup", subGroupType = "c8y_DeviceSubgroup", groupFragmentType = "c8y_IsDeviceGroup", dataBrokerSourceFragment = "c8y_BrokerSource", dynamicGroupType = "c8y_DynamicGroup", dynamicGroupFragment = "c8y_IsDynamicGroup", dynamicGroupColumnConfig = "c8y_UIDeviceFilterConfig", dynamicGroupQueryString = "c8y_DeviceQueryString" } declare const internalApps: { readonly administration: "Administration"; readonly cockpit: "Cockpit"; readonly devicemanagement: "Device Management"; readonly 'digital-twin-manager': "Digital Twin Manager"; readonly streaminganalytics: "Streaming Analytics"; }; /** * The mode for components using infinite scroll: * - auto: Tries to automatically load more data; * - show: Shows a load more button for the user to decide; * - none: Doesn't perform any load more action; * - hidden: Loads more data automatically but with no visible button for the user. */ type LoadMoreMode = 'auto' | 'show' | 'none' | 'hidden'; declare enum ManagedObjectType { DEVICE = "device", GROUP = "group" } /** * Decorator to memoize function results. * @param resolver Cache key resolver function, used by memoize from lodash. */ declare function memoize(resolver?: any): (target: any, fnName: any, descriptor: any) => void; declare const NULL_VALUE_PLACEHOLDER = "--"; declare class RelativeTimePipe implements PipeTransform { private translateService; constructor(translateService: TranslateService$1); /** * Transforms the given input into a formatted time difference string. * * This method calculates the time difference between the current date and the input. * If the input is a `Date` object, the difference in milliseconds is calculated from the current date. * If the input is a number, it is treated as the difference in milliseconds. * * The method returns a string representing the time difference, optionally prefixed with * "in " for future dates or suffixed with " ago" for past dates, based on the `noPrefixOrSuffix` flag. * * @param input - The date or the time difference in milliseconds to be transformed. * A positive number indicates a future time relative to now, and a negative number indicates a past time. * @param noPrefixOrSuffix - If `true`, the output will not include "in" or "ago" prefixes/suffixes. * If `false`, the output will include these based on whether the time is in the future or past. * @returns The formatted and translated time difference string. */ transform(input: Date | number, noPrefixOrSuffix?: boolean): string; /** * Calculates a human-readable representation of a time difference. * * Time ranges are same as moment.js timeFromNow function counterpart: * https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/02-fromnow/ * * @param differenceMs - The time difference in milliseconds. * A positive number indicates a future time relative to now, and a negative number indicates a past time. * @param noPrefixOrSuffix - If `true`, the output will not include "in" or "ago" prefixes/suffixes. * If `false`, the output will include these based on whether the time is in the future or past. * @returns A string representing the time difference in a human-readable format. * The format depends on the duration of the difference: * - Less than 45 seconds: returns 'a few seconds' * - 45 to 89 seconds: returns 'a minute' * - 90 seconds to 44 minutes: returns the number of minutes * - 45 to 89 minutes: returns 'an hour' * - 90 minutes to 21 hours: returns the number of hours * - 22 to 35 hours: returns 'a day' * - 36 hours to 25 days: returns the number of days * - 26 to 45 days: returns 'a month' * - 45 to 319 days: returns the number of months * - 320 days to 1.5 years: returns 'a year' * - More than 1.5 years: returns the number of years */ getHumanReadableTimeDiffString(differenceMs: number, noPrefixOrSuffix: boolean): string; private withinFewSeconds; private withinMinute; private withinMinutes; private withinHour; private withinHours; private withinDay; private withinDays; private withinMonth; private withinMonths; private withinYear; private withinYears; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare function retryWithDelay(delayTime: number, count?: number): MonoTypeOperatorFunction; /** * Global namespace declaration to enhance type safety for extension keys and associated service types. * Extend the `ExtensionKeys` interface within this namespace to declare new extension keys and their service types. * * @example * ```typescript * // Extending the CumulocityServiceRegistry with a new service * declare global { * namespace CumulocityServiceRegistry { * interface ExtensionKeys { * layersServiceKey: TestService; * } * * interface TestService { * getLayers(): Promise; * } * } * } * ``` */ declare global { /** * Global namespace declaration to enhance type safety for extension keys and associated service types of the `ServiceRegistry`. */ namespace CumulocityServiceRegistry { /** * Holds the association between extension keys and their corresponding service types. * Extend this interface to declare new extension keys and their service types. */ interface ExtensionKeys extends SpecificExtensionKeys { [key: string]: unknown; } interface SpecificExtensionKeys { additionalDeviceStatusButtons: AdditionalDeviceStatusButtonProvider; } /** * Defines a provider for additional device status buttons. * TODO to be removed when DeviceStatusWidget is migrated to Angular */ interface AdditionalDeviceStatusButtonProvider { /** * Determines whether the button should be shown for a given device. * @param device The device for which to determine button visibility. * @returns A boolean value indicating whether the button should be displayed. */ canShowButton(device: IManagedObject): boolean; /** * Provides the properties necessary to render the button. * @returns An object containing the button's title, icon, label, click action and optionally a class. */ getButtonInfo(): { title: string; icon: SupportedIconsSuggestions; label: string; class?: string; action: (device: IManagedObject) => void | Promise; }; } } } /** * Registers a service using a specified extension key. * This function facilitates dynamic service registration, enabling services * to be retrieved and used throughout the application based on their extension key. * * @param extensionKey The unique identifier for the service, defined within the ExtensionKeys interface. * @param service The class type of the service to register. * @returns A provider configuration for Angular's dependency injection, allowing the service to be injected where needed. * * * @example * ```typescript * hookService('layersServiceKey', TestService); * ``` */ declare function hookService(extensionKey: T, service: Type, options?: Partial): i0.ValueProvider | i0.ClassProvider | i0.ExistingProvider; /** * Service for managing and retrieving dynamically registered services within the application. * It leverages a map of InjectionTokens to associate services with unique extension keys. */ declare class ServiceRegistry { protected injectors: Injector[]; constructor(rootInjector: Injector, pluginService: PluginsResolveService); /** * Retrieves instances of services registered under a specified extension key. * * @param key - The extension key associated with the desired service. * @returns An array of service instances registered under the given key. * * @example * ```typescript * // Retrieving instances of Service example * const layersServices = serviceRegistry.get('layersServiceKey'); * layersServices.forEach(service => service.get().then(layer => console.log(layer))); * ``` */ get(key: T): R[]; /** * Allows to retrieve all registered extension keys. * * @returns An array of extension keys that have been registered. */ getRegisteredExtensionKeys(): Array; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Pipe that strips HTML tags from a string. * * Useful for creating plain text versions of HTML content, * such as for aria-labels or other accessibility attributes. * * @example * ```html *
*
*
* ``` * * @example * ```typescript * const html = '

Hello world

'; * // Result: 'Hello world' * ``` */ declare class StripHtmlPipe implements PipeTransform { /** * Strips HTML tags from the input string. * * @param value - The HTML string to process * @returns Plain text with HTML tags removed */ transform(value: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare enum Status { SUCCESS = "success", WARNING = "warning", DANGER = "danger", INFO = "info" } type StatusType = Status | 'success' | 'warning' | 'danger' | 'info'; declare const statusIcons: { success: string; warning: string; danger: string; info: string; }; declare const statusClasses: { success: string; warning: string; danger: string; info: string; }; declare const statusAlert: { success: string; warning: string; danger: string; info: string; }; declare const operationStatusIcons: { [OperationStatus.PENDING]: string; [OperationStatus.EXECUTING]: string; [OperationStatus.SUCCESSFUL]: string; [OperationStatus.FAILED]: string; }; declare const operationStatusClasses: { [OperationStatus.PENDING]: string; [OperationStatus.EXECUTING]: string; [OperationStatus.SUCCESSFUL]: string; [OperationStatus.FAILED]: string; }; type PasswordStrengthSettings = Required>; /** The helper UI service for tenant related methods built upon client services. */ declare class TenantUiService { private userService; private appStateService; private tenantLoginOption; readonly MANAGEMENT = "management"; readonly ROLE_TENANT_MANAGEMENT_READ: string; constructor(userService: UserService, appStateService: AppStateService, tenantLoginOption: TenantLoginOptionsService); /** * Returns current tenant */ get currentTenant(): ICurrentTenant; /** * Checks whether current tenant is the management tenant. * @returns True if current tenant is the management tenant. */ isManagementTenant(): Promise; /** * Checks whether current tenant is an enterprise tenant. * An enterprise tenant is a tenant which has subscribed: * - `branding` microservice or `feature-branding` feature app, * - `sslmanagement` microservice, * - `feature-user-hierarchy` feature app, * - `feature-broker` feature app. * * See https://cumulocity.com/guides/users-guide/enterprise-edition/ for details about such tenants. * * @returns True, if current tenant is an enterprise tenant. */ isEnterpriseTenant(): Promise; /** * Checks whether the current user has read access to tenants, i.e.: * - the current tenant can create subtenants or it's the management tenant, * - the current user has ROLE_TENANT_MANAGEMENT_READ role. * @returns True, if the current user has read access to tenants. */ canReadTenants(): boolean; /** * Returns current tenant preferred login mode. */ getCurrentTenantPreferredLoginOption(): ITenantLoginOption; /** * Returns current user login mode. */ getCurrentUserLoginMode(): TenantLoginOptionType; /** * Returns tenant login option which is preferred. * * @param loginOptions The list of all available tenant's login options. * * @returns Returns ITenantLoginOption. * * **Example** * ```typescript * * (() => { * const preferredLoginOption = tenantLoginOptionsService.getPreferredLoginOption(loginOptions); * })(); * ``` */ getPreferredLoginOption(loginOptions: ITenantLoginOption[]): ITenantLoginOption; /** * Returns Oauth2 login option if it can be used by UI. * * @param loginOptions The list of all available tenant's login options. * * @returns Returns ITenantLoginOption. * * **Example** * ```typescript * * (() => { * const oauth2 = tenantLoginOptionsService.getOauth2Option(loginOptions); * })(); * ``` */ getOauth2Option(loginOptions: ITenantLoginOption[]): ITenantLoginOption; /** * Callback which checks if login option is visible on login page. * * @param loginOption The tenant login option. * * **Example** * ```typescript * * (() => { * const loginOptionsVisibleOnLoginPage = loginOptions.filter(tenantLoginOptionsService.isVisibleOnLoginPage); * })(); * ``` */ isVisibleOnLoginPage(loginOption: ITenantLoginOption): boolean; /** * Callback which checks if login option type is 'OAUTH2_INTERNAL'. * * @param loginOption The tenant login option. * * **Example** * ```typescript * * (() => { * const oauth2InternalLoginOptions = loginOptions.filter(tenantLoginOptionsService.isOauthInternal); * })(); * ``` */ isOauthInternal(loginOption: ITenantLoginOption): boolean; /** * Callback which checks if login option type is 'BASIC'. * * @param loginOption The tenant login option. * * **Example** * ```typescript * * (() => { * const basicLoginOptions = loginOptions.filter(tenantLoginOptionsService.isBasic); * })(); * ``` */ isBasic(loginOption: ITenantLoginOption): boolean; /** * Callback which checks if login option type is 'OAUTH2' and grantType is 'AUTHORIZATION_CODE'. * * @param loginOption The tenant login option. * * **Example** * ```typescript * * (() => { * const oauth2LoginOptions = loginOptions.filter(tenantLoginOptionsService.OAUTH2); * })(); * ``` */ isOauth2(loginOption: ITenantLoginOption): boolean; /** * Checks if application of type MICROSERVICE is subscribed to the current tenant. * It checks the application references of the currentTenant from the application state. * No additional request. * @param identifier application name or contextPath */ isMicroserviceSubscribedInCurrentTenant(identifier: string): boolean; /** * Gets all application of type MICROSERVICE subscribed to the current tenant. * It checks the application references of the currentTenant from the application state. * No additional request. */ getSubscribedMicroservicesInCurrentTenant(): IApplication[]; /** * Gets password constraints setting from loginOptions. * @returns Returns Promise with password properties. */ getPasswordStrengthSettings(): Promise; private hasApp; private isManagement; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Decorator to throttle functions call. * @param wait throttle time. * @param options set triggers, eg on trailing edge or falling edge, * see lodash documentation for details */ declare function throttle(wait?: any, options?: any): (target: any, fnName: any, descriptor: any) => void; interface UserPreference { key: string; value: any; } declare class UserPreferencesStorageLocal { private LOCAL_STORAGE_KEY; private store; constructor(); get(key: any): Promise; set(key: any, value: any): void; private saveJsonStore; } declare class UserPreferencesStorageInventory { private inventory; TYPE: string; constructor(inventory: InventoryService); get(key: any): Promise; set(key: any, value: any): Promise; } /** * An alert is a message show to the user. */ interface Alert { /** * The text to display. */ text: string | TemplateRef; /** * The type of the alert. */ type: 'success' | 'warning' | 'danger' | 'info' | 'system'; /** * Detailed information to display. */ detailedData?: any; /** * Timeout to auto close */ timeout?: number; /** * Allows to display alert's text as HTML. */ allowHtml?: boolean; /** * Function to call if user clicks on the detail button. */ onDetail?: () => void; /** * Function to call if user clicks on the close button. */ onClose?: () => void; } type AlertType = 'success' | 'warning' | 'danger' | 'info' | 'system'; /** * A service which allows to display alerts. */ declare class AlertService extends StateService { /** * Returns all alerts. * @readonly */ get state(): Alert[]; /** * @ignore */ state$: BehaviorSubject; private MAX_ALERTS; private ALERT_TIMEOUT; /** * Adds a new alert to the current state. * @param alert The alert object to be added. */ add(alert: Alert): void; /** * Adds a alert by text. * @param type The type of the alert. * @param txt The text to be displayed in the alert. * @param detailedData Optional detailed data for the alert. */ addByText(type: AlertType, txt: string, detailedData?: string): void; /** * Returns all alerts. * @deprecated Use alertService.alerts instead. */ list(): Alert[]; /** * Remove an alert from the current state. * @param alert The alert object to be removed. */ remove(alert: Alert): void; /** * Updates matching alert with provided values. * @param alert The alert to be updated. * @param fieldsToUpdate An object with the fields to update in the alert. */ update(alert: Alert, fieldsToUpdate: Partial): void; /** * Removes last danger alert. * It can be used e.g. in the case of a failed request which triggered an alert, to hide it from user. * * ```js * try { * // something that might throw a danger server msg * } catch (ex) { * this.alertService.removeLastDanger(); * } * ``` */ removeLastDanger(): void; /** * Shorthand for a save successful alert. * @param savedObject The name of the object which was saved. * @return A function that can be executed to show the msg. */ saveSuccess(savedObject: string): () => void; /** * Shorthand for a create successful alert. * @param createdObject The name of the object which was created. * @return A function that can be executed to show the msg. */ createSuccess(createdObject: string): () => void; /** * Clears all alerts. */ clearAll(): void; /** * A shorthand to display a simple success message. * @param text The success text. * @param detailedData The text with additional information. */ success(text: string, detailedData?: string): void; /** * A shorthand to display a simple danger message. * @param text The danger text. * @param detailedData The text with additional information. */ danger(text: string, detailedData?: string): void; /** * A shorthand to display a simple info message. * @param text The info text. * @param detailedData The text with additional information. */ info(text: string, detailedData?: string): void; /** * A shorthand to display a simple warning message. * @param text The warning text. * @param detailedData The text with additional information. */ warning(text: string, detailedData?: string): void; /** * A shorthand to display a simple system message. * @param text The system message text. * @param detailedData The text with additional information. */ system(text: string, detailedData?: string): void; /** * Creates alert from standard api errors. * Should be used for errors generated by @c8y/client services. * @param error The error from server. * @param type The type of alert. */ addServerFailure(error: any, type?: AlertType): void; /** * Compares two alert objects. Alerts are same if text, type, detailed data and callbacks are same. * Callbacks are same if they refer to the same function. * @param alert1 First alert to compare. * @param alert2 Second alert to compare. */ areSame(alert1: Alert, alert2: Alert): boolean; private changeAlerts; private addAlert; private hideAutomaticallyIfNeeded; private removeOldestIfMax; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class UserPreferencesService { private user; private inventory; private appState; private alert; currentUser: Observable; preferenceChanges$: Subject; private storage; constructor(user: UserService, inventory: InventoryService, appState: AppStateService, alert: AlertService); /** * Returns an observable of a user preference with given key. * Emits its initial value first and then updated values when set by user. * @param key The storage key for searched value. * @returns An Observable of a user preference. */ observe(key: string): Observable; /** * Get an Observable value for searched key for current user. * @param key The storage key for searched value. * @returns An Observable with the value of preference. */ get(key: string): Observable; /** * Sets a value in storage for current user. * @param key The storage key for the value to be set. * @param value The storage value to be set. * @returns A promise with saved value. */ set(key: string, value: any): Promise; /** * Get an Observable value of searched key for a specific user. * @param key The storage key for searched value. * @param user The user for whom the search is done. * @returns An Observable with the value of preference. * * @deprecated Uses deprecated inventory approach. Use get instead. */ getForUser(key: string, user: IUser | ICurrentUser): Observable; /** * Sets a value in storage for a specific user. * @param key The storage key for the value to be set. * @param value The storage value to be set. * @returns A promise with saved value. * * @deprecated Uses deprecated inventory approach. Use set instead. */ setForUser(key: string, value: any, user: IUser | ICurrentUser): Promise; /** * Get value of searched key for current user. * If preference is not found in user's customProperties, it will try to get it from inventory or local storage and * update user's customProperties with the value and return that value. * @param key The preference key for searched value. * @param user The user for whom the search is done. * @returns A Promise with the value of preference. */ private getForCurrentUser; /** * Sets a value for current user. * @param key The preference key for the value to be set. * @param value The preference value to be set. */ private setForCurrentUser; /** * Get a string of key concatenated with username. * Used by deprecated invetory storage approach and for leftovers in local storage. * It was used to store preferences for specific users and it as replacing "." with "__" * because of MongoDB restrictions. * @param key The storage key for searched value. * @param user The user for whom the search is done. * @returns A string of key concatenated with username. */ private getTransformedRawKey; /** * Get a string of key concatenated with username. * Used by local storage. * @param key The storage key for searched value. * @param user The user for whom the search is done. * @returns A string of key concatenated with username. */ private getRawKey; /** * Get a key for user preferences. Used current user customProperties. * @param key The storage key for searched value. * @returns A key for user preferences. */ private getCustomPropertiesKey; /** * Gets a proper storage depending on the user roles. * @param user The user for whom the role check is done. * @returns A proper storage. */ private getStorage; private getCurrentUserStorage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ZipService { getEntries(zipFile: File): Observable; getData(entry: ZipEntry): Observable; getJsonData(zipFile: File, fileEntryFilter: { filename: string; }): Observable; createZip(files: { fileName: string; blob: Blob; }[]): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } type ZipEntry = Entry; declare const SupportedApps: { readonly devicemanagement: "devicemanagement-application-key"; readonly cockpit: "cockpit-application-key"; readonly administration: "administration-application-key"; readonly smartrules: "smartrule-key"; }; type SupportedAppKey = (typeof SupportedApps)[keyof typeof SupportedApps]; /** * Service that provides methods to interact with other applications. * It allows retrieving a specific app by key, checking its availability, verifying if it is not the current application, * determining if a link to another app should be shown, and navigating to it. */ declare class InterAppService { private stateService; private alertService; private translateService; /** * Retrieve application by its key as observable. * @param key {SupportedAppKey} - Application key. * @returns Observable of Application */ getApp$(key: T): Observable; /** * Checks if current application is the same as the one that key is provided * @param key {SupportedAppKey} - Application key. * @returns Observable of boolean; true if current app matches provided key. */ isCurrentApp$(key: T): Observable; /** * Checks if other (other than current) application link should be displayed. It consists of two conditions: * - app that link leads to exists and is available for current user * - app link leads to app that is not current app * @param appKey {SupportedAppKey} - Application key that link leads to. * @returns Observable of boolean; only true when app that link leads to is available and app link leads to app that is not current app */ shouldShowAppLink$(appKey: T): Observable; /** * Navigates to app by provided app key * @param appKey {SupportedAppKey} - Application key that links leads to. * @param path {string} - Additional path in target application. */ navigateToApp(appKey: T, path?: string): Promise; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵprov: i0.ɵɵInjectableDeclaration>; } /** * Component to count down specific time interval, then emit when countdown ends. * Next countdown is started right after previous one. */ declare class CountdownIntervalComponent implements OnInit, OnDestroy { /** * Time in milliseconds to count down from. */ set countdownInterval(value: number); get countdownInterval(): number; /** * Configuration object for the countdown interval component. */ private _config; shouldShowPulseIcon: i0.Signal; set config(value: { enforcePulseIcon?: boolean; }); /** * Emits when countdown ends. */ countdownEnded: EventEmitter; runSpinner$: BehaviorSubject; secondsUntilRefresh$: BehaviorSubject; progressPercentage$: BehaviorSubject; enableTransition$: BehaviorSubject; private _countdownInterval; private destroy$; private readonly MINIMUM_INTERVAL; private readonly ONE_SECOND; private start$; private countdownSubscription; ngOnInit(): void; ngOnDestroy(): void; /** * Starts the countdown timer. */ start(): void; /** * Stops the countdown timer. * @param stopAtZero - If true, stops the timer when it reaches zero. Otherwise, stops it at the current countdown interval. */ stop(stopAtZero?: boolean): void; reset(): void; /** * Initializes the countdown timer. * Kicks off the timer logic and activates any associated UI elements. */ private initializeCountdownInterval; /** * Creates an Observable stream that emits events when the document's visibility changes. * @returns An Observable emitting `null` whenever the visibility of the document changes. */ private createDocumentHiddenEventStream; /** * Creates the main interval Observable for the countdown timer. * @param timerStart$ - A Subject to signal the start of the timer. * @param documentHiddenEvent$ - An Observable for document visibility changes. * @returns An Observable that orchestrates the timer logic. */ private createIntervalStream; /** * Creates a timer Observable that emits every second. * @returns An Observable that emits a number every second, starting from 0. */ private createTimer; /** * Updates the remaining time in the countdown. * @param value - The current timer value in seconds. */ private updateRemainingTime; /** * Sets progress without transition to prevent animation glitches * @param value - The progress percentage to set */ private setProgressWithoutTransition; /** * Subscribes to the interval Observable and sets up the event handlers for the countdown. * @param interval$ - The countdown interval Observable to subscribe to. */ private subscribeToInterval; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class CountdownIntervalModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } interface CookieBannerSettings { cookieBannerTitle?: string; cookieBannerText: string; policyUrl?: string; policyVersion?: string; cookieBannerDisabled?: boolean; } interface CookiePreferences { required?: boolean | string; functional?: boolean | string; marketing?: boolean | string; policyVersion?: string; } interface Cookie { name: string; value: boolean; isReadonly?: boolean; } /** * This service is handling the cookie banner and cookie preferences related logic. */ declare class CookieBannerService { private options; readonly STORAGE_KEY: string; readonly COOKIE_BANNER = "cookieBanner"; readonly PREVIEW_COOKIE_BANNER = "previewCookieBanner"; readonly IS_PREVIEW = "preview"; readonly COOKIE_PREFERENCES_CONFIG = "cookiePreferences"; isCookieBannerShowed$: Subject; cookieDescriptions: { required: "These cookies are required to enable core site functionality. They perform a task or operation without which a site's functionality would not be possible."; functional: "These cookies are used to support you during your first steps with the product, to deliver content tailored to your needs, and to collect usage statistics."; marketing: "These cookies are used to target advertising to a user."; }; constructor(options: OptionsService); /** * Returns Cookie preferences configuration. * @returns {object} Return an object with cookie preferences configuration defined in application options. */ getCookiePreferencesConfig(): CookiePreferences; /** * Returns Cookie banner configuration. * @returns {object} Return an object with cookie banner configuration defined in application options. */ getCookieBannerSettings(): Partial; /** * Converts the cookie preferences to boolean. Sets the cookie preferences configuration in local storage. * @param {object} cookiePreferences Object with cookie preferences configuration */ setCookies(cookiePreferences: CookiePreferences, policyVersion?: string): void; /** * Verifies that cookie banner should be shown. * @returns {boolean} Returns if the cookie banner should be shown. */ shouldShowCookieBanner(): boolean; /** * Gets the cookie preferences configuration from local storage. * @returns {object} Object with cookie preferences configuration. */ getUserCookiePreferences(): CookiePreferences; /** * Verifies that cookie preferences configuration is defined in the application options. * @returns {boolean} Returns if the cookie preferences configuration is defined. */ isConfigCookiePreferencesDefined(): boolean; /** * Verifies that functional cookies are enabled. * @returns {boolean} True when functional cookies are enabled. */ isFunctionalCookieEnabled(): boolean; /** * Description of cookies. * @param {'required' | 'functional' | 'marketing'} cookieType Takes one of the following options: 'required', 'functional', 'marketing'. * @returns {string} The default cookie description, if not explicitly defined in application options. */ getCookieDescription(cookieType: 'required' | 'functional' | 'marketing'): string; /** * Transforms cookie preferences configuration object to an array of cookie preferences objects. Each object in returned array contains cookie 'name', 'value' and 'isReadonly' property. * @param {object} cookiePreferences. * @returns {Array} Array shows if the cookie is Readonly. */ transformCookiePreferencesToList(cookiePreferences: CookiePreferences): Cookie[]; /** * Transforms an array of cookie preferences objects to cookie preferences configuration object. * @param {Array} cookiePreferencesList Array of cookie preferences. * @returns {object} An object with cookie preferences configuration. */ transformCookiePreferencesListToCookiePreferences(cookiePreferencesList: Cookie[]): CookiePreferences; private isPreviewMode; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Marks a component that can emit product experience events. */ interface ProductExperienceEventSource { productExperienceEvent: ProductExperienceEvent; } /** * Defines the payload for a product experience event. */ interface ProductExperienceEvent { /** * Name of the event. */ eventName: string; /** * Any other data that will be sent as payload. */ data?: PxEventData; } /** * Suggets some common product experience event properties. */ interface PxEventData { /** * Description or an identifier of user interaction. */ action?: string; /** * Component that triggered the event. */ component?: string; /** * The URL that the action was triggered at. */ url?: string; /** * The result from the user action, e.g. when 'Cancel' * when a user has cancelled a confirmation prompt. */ result?: string; [key: string]: any; } /** * Use this token for components that can provide product experience events. */ declare const PRODUCT_EXPERIENCE_EVENT_SOURCE: InjectionToken; /** * @property user The user which is given to Gainsight. * @property tenant The tenant which is given to Gainsight. * @property instanceId Extracted domain part of an URL. * @property versionUI The UI version used. * @property versionBE The BE version used. */ interface IdentifyData { user: IUser; currentTenant: ICurrentTenant; instanceId: string; versionUI?: string; versionBE?: string; } /** * A service to manage the Gainsight integration. It allows to load the * tag and */ declare class GainsightService { private appState; private options; private cookieBannerService; private userPreferencesService; private translateService; private translateStore; /** * A subject that emits the tag function as soon as a new tag is set. */ tagFunction$: BehaviorSubject; trackingLoaded$: Subject; /** * Gainsight is activated only when the cookie banner is present. If functional cookies are enabled, both personally identifiable information (PII) and required data are sent. * Otherwise, only the required data is transmitted during the identity step execution. */ readonly USER_PREFERENCES_GAINSIGHT_KEY = "gainsightEnabled"; /** * The name of the key remained unchanged, but applies to all engagements. */ readonly USER_PREFERENCES_GAINSIGHT_ENGAGEMENTS_KEY = "gainsightBotEnabled"; readonly HIDE_GAINSIGHT_BOT_STYLE_ID = "hide-gs-bot"; private readonly GAINSIGHT_URL; private readonly GAINSIGHT_GLOBAL_SCOPE; private readonly SCRIPT_EXECUTION_WAIT_TIME; private readonly OPTIONS_KEY_CATEGORY; private readonly OPTIONS_KEY_NAME; private isScriptLoaded; private gainsightKey; private cachedRevertedTranslations; private cachedLanguage; constructor(appState: AppStateService, options: OptionsService, cookieBannerService: CookieBannerService, userPreferencesService: UserPreferencesService, translateService: TranslateService$1, translateStore: TranslateStore); /** * Checks if the specified Gainsight preference is disabled in user preferences. * @param preferenceName - Name of the Gainsight preference. * @returns A promise that resolves to `true` if the preference is disabled, otherwise `false`. */ isGainsightPreferenceDisabledInUserPreferences(preferenceName: string): Promise; /** * Sets the state of the functional cookie. * @param value - A boolean value to indicate whether the functional cookie should be enabled (`true`) or disabled (`false`). */ setFunctionalCookie(value: boolean): void; getGainsightKey(): Promise; /** * Returns the tag global function which can be used to identify user * or add special events. */ get tagFunction(): any; /** * Load the script tag and calls the identify function to start the tracking. * @param currentTenant The current tenant. * @param sendPiiData Flag for sending personally identifiable information (PII) during identification in Gainsight. */ loadTag(currentTenant: ICurrentTenant, sendPiiData: boolean): Promise; /** * Identifies the user/account at Gainsight. * @param sendPiiData Flag for sending personally identifiable information. * @param identifyData Object containing identification data. */ identify(sendPiiData: boolean, identifyData: IdentifyData): void; /** * Triggers an event to be recorded by Gainsight PX. * This method calls the Gainsight PX's tracking mechanism to log a specific event * along with its associated properties. * @param eventName - Name of the event to be triggered. * @param props - Optional properties associated with the event. */ triggerEvent(eventName: string, props?: PxEventData): void; translateToEnglish(textToTranslate: string): string; /** * Determines whether personally identifiable information (PII) should be sent while loading a tag. * The decision to activate Gainsight and send PII relies on whether the cookiePreferences option is defined in the application settings, * if the functional cookie is enabled, and if the user grants permission. */ shouldSendPiiData(): Promise; /** * Updates a specific user attribute in the Gainsight global scope. * This method interfaces with the Gainsight global object to set a user's specific attribute with a provided value. * @param name - Name of the user attribute to be updated. * @param value - Value to set for the specified user attribute. */ updateUserAttribute(name: string, value: string | Date | number | boolean): void; /** * Determines if the current user has the capability to modify Gainsight PX settings. * * This method checks multiple conditions: * 1. Whether tracking has been disabled globally via application options. * 2. Whether Gainsight is disabled at the tenant level through custom properties. * 3. Whether a Gainsight key is available, either currently loaded or fetched asynchronously. * 4. Whether cookie preferences are defined and available for the user. * * @returns Promise that resolves to a boolean. True indicates the user can edit product experience settings, and false otherwise. */ canEditProductExperienceSettings(): Promise; hashGroupName(groupName: string): Promise; /** * Sets the global context for Gainsight with the current application name. * The global context can be utilized by Gainsight for various purposes, such as segmenting users. */ setGlobalContext(): void; transformUserRolesToStr(userRoles?: IIdentified[]): string; /** * Checks if Gainsight is disabled based on tenant custom properties. * * @param customProperties - The custom properties of the tenant. * @returns {boolean} - True if Gainsight is disabled, false otherwise. */ isGainsightDisabledAtTenantCustomProperties(customProperties: ICustomProperties): boolean; /** * Determines if custom branding is enabled based on the presence of a brand logo. * * @returns {boolean} - True if custom branding is applied, false otherwise. */ isCustomBranding(): boolean; /** * Determines if tracking is disabled based on the application options. * @returns `true` if tracking is disabled, otherwise `false`. */ isTrackingDisabled(): boolean; private prepareEventName; private loadScriptTag; private getInstanceIdFromUrl; /** * Reverses the translation object. * * **Example** * { Add widget: "Widget hinzufügen" } * * will be changed to: * * { Widget hinzufügen: "Add widget" } * * @param currentLang Language whose translated values are to be placed in the object key. * @returns Returns an inverted object where the keys have been swapped with the values. */ private getRevertedTranslations; /**Translates string back into English. * If the current application language is set to English, the string passed as an argument is returned. * @param textToTranslate string to translate. * @returns Returns the string translated into English. */ private getEnTranslation; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ProductExperienceDirective { private component; private parentEventSource; private gainsightService; /** * A value that will be used as a custom event name. */ actionName: string; /** * Data that will be used as event properties. */ actionData: object; /** * If set to true, actionName and actionData will be * inherited from the parent component if it has the c8yProductExperience applied to it. * With inherit set to true the local actionName value is * ignored and overriden by the parent component's actionName. This allows for easy * re-use of core components (e.g. <c8y-li-action>) that would use the inherited * action name rather than their generic action name. Own actionData properties with * the same name take precedence to those inheritted from the parent component. */ set _inherit(inherit: any); /** * If set to true own actionData properties would not override * actionData properties of the parent component. Instead, values will be * inherited from the parent component. It is only effective if inherit * is set to true. */ set _suppressDataOverriding(suppressDataOverriding: any); private inherit; private suppressDataOverriding; constructor(component: ProductExperienceEventSource, parentEventSource: ProductExperienceEventSource, gainsightService: GainsightService); onClick(): void; ngOnInit(): void; private getAction; private mergeData; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class UserEngagementsService { private document; private userPreferencesService; private gainsightService; readonly USER_PREFERENCES_GAINSIGHT_ENGAGEMENTS_KEY = "gainsightBotEnabled"; readonly userEngagementsEnabled$: BehaviorSubject; readonly HIDE_GAINSIGHT_BOT_STYLE_ID = "hide-gs-bot"; private readonly ENGAGEMENTS; constructor(document: Document, userPreferencesService: UserPreferencesService, gainsightService: GainsightService); /** * Handles user engagement settings based on various conditions. * * - Waits for the Gainsight tracking to be loaded. * - Retrieves the engagement settings. * - Updates the engagement settings based on the combined observations. * - Finally, toggles the Gainsight engagements based on the latest `userEngagementsEnabled$` value. */ handleUserEngagements(): void; /** * Updates the user's preference for Gainsight Engagements. * @param {boolean} isEnabled - The new value for the user's engagement preference. */ updateUserEngagementPreference(isEnabled: boolean): void; /** * Toggles the visibility of Gainsight Engagements based on the provided flag. * * @param isEnabled - A flag indicating whether Gainsight Engagements should be visible. */ toggleGainsightEngagements(isEnabled: boolean): void; /** * Constructs an observable that emits an array of boolean values representing * the current engagement settings. The observable combines the latest values from: * * 1. User's preferences for Gainsight engagements. * 2. A flag indicating if PII data should be sent. * 3. A flag indicating if the platform uses custom branding. * * @returns An observable emitting an array of boolean values. */ private getEngagementSettingsObservable; /** * Updates user engagement settings based on provided preferences and settings. * * Based on the received values, the method decides to: * 1. Disable user engagements if PII data should not be shared or certain branding/settings conditions are met. * 2. Update the user engagement preference if the user engagement bot setting is undefined. * * @param userEngagementBotSetting - The user's setting for the engagement bot. * @param shouldSendPiiData - Indicates whether PII data should be shared. * @param hasCustomBranding - Indicates if custom branding is applied. */ private updateUserEngagementSettings; /** * Determines whether user engagements should be disabled due to PII data settings. * * If the `shouldSendPiiData` parameter is false, this indicates that the user engagements * should be disabled to prevent sharing personally identifiable information. * * @param {boolean} shouldSendPiiData - Indicates whether PII data is allowed to be sent. * @returns {boolean} Returns true if user engagements should be disabled, otherwise false. */ private shouldDisableUserEngagementsDueToPIIData; /** * Determines if the user engagement bot setting is undefined. * * @param {boolean | undefined} userEngagementBotSetting - The setting value to check. * @returns {boolean} Returns `true` if the setting is undefined; otherwise, `false`. * * This scenario occurs when a user is new and hasn't modified the bot settings in the user details UI yet. */ private isUserEngagementBotSettingUndefined; /** * Enables the visibility of Gainsight engagements. * * This method removes the CSS styles that hide the Gainsight engagements * and updates the relevant user attribute to mark the engagements as visible. */ private showGainsightEngagements; /** * Hides the Gainsight engagements. * * This method applies CSS styles to hide the Gainsight engagements * and updates the relevant user attribute to mark the engagements as hidden. */ private hideGainsightEngagements; /** * Removes the specified CSS style from the document. * * @param {string} styleId - The ID of the CSS style element to remove. */ private removeHidingStyle; /** * Adds a new CSS style to the document. * * If the style with the specified ID already exists, the method will do nothing. * Otherwise, it creates a new `