@deviceinsight/ng-ui-scale-lib 9.18.3 → 9.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/{AccessEditModal-9e099de6.js → AccessEditModal-cdd9bdbe.js} +1 -1
  2. package/dist/{BundleManagementContainer-e2e023e4.js → BundleManagementContainer-cecadff6.js} +1 -1
  3. package/dist/{BundlesContainer-fe9d8333.js → BundlesContainer-6a3a6b7f.js} +2 -2
  4. package/dist/{ContextBarContext-925a628f.js → ContextBarContext-48d70f1c.js} +19 -19
  5. package/dist/{DatapointImport-b71a1fb7.js → DatapointImport-e3af14a7.js} +1 -1
  6. package/dist/{FileUploadInput-3a3864f1.js → FileUploadInput-676a1a0e.js} +1 -1
  7. package/dist/{Files-f6724431.js → Files-167b7d8b.js} +2 -2
  8. package/dist/{GlobalPowerBiReports-c65f2db5.js → GlobalPowerBiReports-f0504977.js} +1 -1
  9. package/dist/{Graph-a68526cc.js → Graph-8f20873d.js} +1 -1
  10. package/dist/{JsonSettingWidget-b2ee4eb1.js → JsonSettingWidget-bbb898ed.js} +2 -2
  11. package/dist/{LicensesEditPage-06347792.js → LicensesEditPage-a8507923.js} +1 -1
  12. package/dist/{LicensesList-42e68f81.js → LicensesList-e3fea154.js} +1 -1
  13. package/dist/{PropertiesEditPage-d30ad124.js → PropertiesEditPage-fdc7c3ab.js} +2 -2
  14. package/dist/{PropertiesList-d294ec55.js → PropertiesList-d16edee6.js} +1 -1
  15. package/dist/{TemplateEditPage-a7ec0bd8.js → TemplateEditPage-5abef5ff.js} +4 -4
  16. package/dist/{TemplateTextInput-371f1882.js → TemplateTextInput-b40d36ff.js} +2 -2
  17. package/dist/{TemplatesListPage-d20e6d3a.js → TemplatesListPage-cf586809.js} +2 -2
  18. package/dist/{UserGroupAssignments-d1a0ecf7.js → UserGroupAssignments-2da9917f.js} +1 -1
  19. package/dist/{UserGroupTheme-c77740fb.js → UserGroupTheme-177dea88.js} +2 -2
  20. package/dist/api.d.ts +1175 -0
  21. package/dist/api.js +2 -2
  22. package/dist/{index-fb9aff4b.js → index-7a76fcc9.js} +1 -1
  23. package/dist/index.d.ts +12 -0
  24. package/dist/index.js +1 -1
  25. package/dist/{react-router-9e614587.js → react-router-bd7ead27.js} +1 -1
  26. package/package.json +1 -1
package/dist/api.d.ts ADDED
@@ -0,0 +1,1175 @@
1
+ import * as api from '@deviceinsight/ng-ui-api-client';
2
+ import { Datapoint, User, UserGroup, Role, Asset, Gateway, AssetGroup, Event, AssetDefinition, AssetGroupDefinition, Bundle, BundleVersion, AuthInfo, PaginationSettings, Pageable, Sort } from '@deviceinsight/ng-ui-api-client';
3
+ import { HttpBackendOptions } from 'i18next-http-backend';
4
+ import { TOptions, i18n } from 'i18next';
5
+ import * as React from 'react';
6
+ import React__default, { ComponentType, ReactNode, ButtonHTMLAttributes, PropsWithChildren } from 'react';
7
+ import { Layout } from 'react-grid-layout';
8
+ import { ReactableColumnDef, Period } from '@deviceinsight/ng-ui-components';
9
+ import { AxiosInstance } from 'axios';
10
+ import { Trans as Trans$1, useTranslation as useTranslation$1 } from 'react-i18next';
11
+ import { GrantRequestFunctionType } from 'ux4iot-react';
12
+
13
+ /**
14
+ * Sets the application title.
15
+ * @param {string} title The application title.
16
+ */
17
+ declare const setTitle: (title: string) => Promise<void>;
18
+
19
+ /**
20
+ * Allows to load the custom locize.io project.
21
+ * @param {object} locizeProject The configuration for the locize.io project.
22
+ * @param {string} locizeProject.projectId The project id.
23
+ * @param {string} locizeProject.apiKey The api key.
24
+ * @param {string} locizeProject.version The version.
25
+ * @example
26
+ * ```ts
27
+ * import { setLocizeProject } from '@deviceinsight/scale-ui-types';
28
+ *
29
+ * setLocizeProject({
30
+ * projectId: 'my-project-id',
31
+ * apiKey: 'my-api-key',
32
+ * version: 'latest'
33
+ * });
34
+ * ```
35
+ */
36
+ declare const setLocizeProject: (locizeProject: {
37
+ projectId: string;
38
+ apiKey: string;
39
+ version: string;
40
+ }) => Promise<void>;
41
+
42
+ /**
43
+ * Adds a i18next XHR backend to the i18next instance.
44
+ * It's helpful if you store the translations in a json file.
45
+ * @param {Record<string, any>} httpBackendOptions The configuration for the i18next XHR backend.
46
+ * @example
47
+ * ```ts
48
+ * import { addI18nextXHRBackend } from '@deviceinsight/scale-ui-types';
49
+ *
50
+ * addI18nextXHRBackend({
51
+ * loadPath: '/lib/public/i18n/{{lng}}/{{ns}}.json'
52
+ * });
53
+ * ```
54
+ */
55
+ declare const addI18nextXHRBackend: (httpBackendOptions: HttpBackendOptions) => Promise<void>;
56
+
57
+ type DatapointValue = [number, boolean | string | number | {
58
+ latitude: number;
59
+ longitude: number;
60
+ }];
61
+
62
+ type DatapointWithLastValue = Datapoint & {
63
+ lastValue: DatapointValue | null | undefined;
64
+ lastValueTimestamp: number | null | undefined;
65
+ };
66
+
67
+ type UserWithGroupsAndRoles = User & {
68
+ userGroups: Array<UserGroup>;
69
+ roles: Array<Role>;
70
+ };
71
+
72
+ type Context = Asset | Gateway | AssetGroup | User | UserWithGroupsAndRoles | UserGroup | Datapoint | DatapointWithLastValue | Event | void;
73
+ type TranslationRule = {
74
+ pattern: string;
75
+ modification: (key: string, context: Context) => string;
76
+ };
77
+ /**
78
+ * Translation API class
79
+ */
80
+ declare class TranslationApi {
81
+ context: Context;
82
+ rules: TranslationRule[];
83
+ setRules: (rules: TranslationRule[]) => void;
84
+ getRules: () => TranslationRule[];
85
+ setContext: (context: Context) => void;
86
+ getContext: () => Context;
87
+ modifyTranslationKey: (key: string, context?: Context | undefined) => string;
88
+ }
89
+ declare const _default$5: TranslationApi;
90
+
91
+ type TranslationDescriptor = {
92
+ id: string;
93
+ defaultValue: string;
94
+ };
95
+ /**
96
+ * Translation function type.
97
+ * @param {string} key The key of the text to translate.
98
+ * @param {Record<string, any>} [data] The data to pass to the translation function.
99
+ * @returns {string} The translated text.
100
+ */
101
+ type TFunction = (key: string, options?: TOptions, context?: Context) => string;
102
+
103
+ interface Props$2 extends Omit<React__default.ComponentProps<typeof Trans$1>, 'context'> {
104
+ context?: Context;
105
+ }
106
+ declare const StaticTrans: (props: Props$2) => JSX.Element;
107
+ /**
108
+ * Component to translate a text.
109
+ * This component mimics the functionality of the `Trans` component of `react-i18next`.
110
+ * @param {string} props.i18nKey The key of the text to translate.
111
+ * @param {ReactNode} props.children The default value of the text to translate.
112
+ * @example
113
+ * ```tsx
114
+ * import { Trans } from '@deviceinsight/scale-ui-types';
115
+ *
116
+ * <Trans i18nKey="my.key">My Default Translation</Trans>
117
+ * ```
118
+ */
119
+ declare function Trans(props: React__default.ComponentProps<typeof StaticTrans>): JSX.Element;
120
+
121
+ type Result = {
122
+ t: TFunction;
123
+ i18n: i18n;
124
+ ready: boolean;
125
+ };
126
+ /**
127
+ * Hook to use the translation function in a functional component.
128
+ * @param {Namespace} ns The namespace of the translation function.
129
+ * @param {Record<string, any>} props The props to pass to the translation function.
130
+ * @returns {WithTranslation} The translation function.
131
+ * @example
132
+ * import { useTranslation } from '@deviceinsight/scale-ui-types';
133
+ *
134
+ * const { t } = useTranslation('namespace');
135
+ * const text = t('my.title', {defaultValue: 'My Title'});
136
+ */
137
+ declare function useTranslation(...args: Parameters<typeof useTranslation$1>): Result;
138
+
139
+ type ContextInfoPathName = {
140
+ pathname: string;
141
+ };
142
+ type ContextInfoString = ContextInfoPathName & {
143
+ type: 'string';
144
+ value: string;
145
+ };
146
+ type ContextInfoSearch = ContextInfoPathName & {
147
+ type: 'search';
148
+ elements: number;
149
+ totalElements: number | null | undefined;
150
+ totalElementsAccurate?: boolean;
151
+ context: string;
152
+ customTranslations?: {
153
+ all: TranslationDescriptor;
154
+ some: TranslationDescriptor;
155
+ };
156
+ tooltip?: string;
157
+ };
158
+ type ContextInfoAsset = ContextInfoPathName & {
159
+ type: 'asset';
160
+ asset: Asset;
161
+ assetGroups: Array<AssetGroup>;
162
+ assetDefinition: AssetDefinition | undefined;
163
+ gateway: Gateway | null | undefined;
164
+ };
165
+ type ContextInfoAssetGroup = ContextInfoPathName & {
166
+ type: 'assetGroup';
167
+ assetGroup: AssetGroup;
168
+ assetGroupDefinition: AssetGroupDefinition;
169
+ };
170
+ type ContextInfo = ContextInfoString | ContextInfoSearch | ContextInfoAsset | ContextInfoAssetGroup;
171
+
172
+ type AppConfiguration<ConfigurationType> = {
173
+ enabled: boolean;
174
+ configuration: ConfigurationType;
175
+ };
176
+ type AppConfigurationBundle = Record<string, AppConfiguration<any>>;
177
+ type validateAppConfigurationFunctionType = (appConfigurationUntyped: AppConfiguration<any>) => AppConfiguration<any>;
178
+ type ThemeConfig = {
179
+ logo?: string;
180
+ favicon?: string;
181
+ primaryColor?: string;
182
+ };
183
+ type EventPriority = {
184
+ priority: number;
185
+ label: string;
186
+ icon: string;
187
+ color: string;
188
+ };
189
+
190
+ type Authorities = string[] | string[][];
191
+ /**
192
+ * Checks if the current user has the given authorities.
193
+ * @param {Authorities} authorities The authorities to check. Can be a list of authorities or a list of lists of authorities. In first case the user needs to have all authorities, in the second case the user needs to have all the authorities in at leat one list.
194
+ * @returns {boolean} True if the current user has the given authorities, false otherwise.
195
+ * @example
196
+ * import { hasAuthorities } from '@deviceinsight/scale-ui-types';
197
+ *
198
+ * const hasAdminOrUserAuthorities = hasAuthorities(['ROLE_ADMIN', 'ROLE_USER']);
199
+ */
200
+ declare const hasAuthorities: (authorities?: Authorities) => boolean;
201
+
202
+ type ContextInfoProps = {
203
+ pathname: string;
204
+ contextInfo?: ContextInfo;
205
+ };
206
+ type ContextActionType = {
207
+ pathname: string;
208
+ HasAuthorities: React.ComponentType<{
209
+ authorities: Authorities;
210
+ children: React.ReactNode;
211
+ }>;
212
+ };
213
+ type App = 'dashboard' | 'trend' | 'events' | 'files' | 'usergroupthemes' | 'auditLog' | 'bundleManagement';
214
+ type VisibilityProps = {
215
+ onlyOnAsset?: string;
216
+ onlyOnAssetGroup?: string;
217
+ onlyIfInAssetGroup?: string;
218
+ onlyIfAsset?: boolean;
219
+ onlyIfGateway?: boolean;
220
+ onlyWithAssetGroupProperties?: Array<string>;
221
+ onlyWithAssetGroupDefinition?: string;
222
+ onlyWithAssetDefinition?: string;
223
+ sidebarIndex?: number;
224
+ onlyIfRouteChildrenAllowed?: boolean;
225
+ };
226
+ type RouteConfig = {
227
+ relativePath: string;
228
+ label?: TranslationDescriptor;
229
+ component?: React.ComponentType<any>;
230
+ className?: string;
231
+ childRoutes?: RouteConfig[];
232
+ childRoutesContainer?: React.ComponentType<any>;
233
+ iconSvg?: React.ComponentType<any>;
234
+ iconLight?: string;
235
+ iconDark?: string;
236
+ show?: (contextInfo: ContextInfo | null | undefined, user: User) => boolean;
237
+ requiredAuthorities?: string[] | Array<string[]>;
238
+ appName?: App;
239
+ scope?: string;
240
+ validateAppConfiguration?: validateAppConfigurationFunctionType;
241
+ config?: VisibilityProps;
242
+ getTitleSegments?: (contextInfo: ContextInfo) => Array<string | TranslationDescriptor>;
243
+ contextAction?: React.ComponentType<ContextActionType>;
244
+ contextInfo?: React.ComponentType<ContextInfoProps>;
245
+ excludeFromNavigation?: boolean;
246
+ };
247
+ type RouteLink = {
248
+ path: string;
249
+ label: TranslationDescriptor | null | undefined;
250
+ active: boolean;
251
+ iconSvg?: React.ComponentType<any>;
252
+ iconLight?: string;
253
+ iconDark?: string;
254
+ requiredAuthorities?: string[] | string[][];
255
+ };
256
+ type NavGroup = {
257
+ label: TranslationDescriptor;
258
+ icon?: string;
259
+ iconSvg?: React.ComponentType<any>;
260
+ paths: Array<string>;
261
+ appName?: App;
262
+ scope?: string;
263
+ separator?: boolean;
264
+ };
265
+
266
+ type UpdateAuthoritiesConfig = {
267
+ onlyChildren: boolean;
268
+ } | {
269
+ includeChildren: boolean;
270
+ };
271
+ type Link = {
272
+ appName?: string;
273
+ scope: string[];
274
+ value: string;
275
+ label: TranslationDescriptor;
276
+ };
277
+ /**
278
+ * Route API class.
279
+ * Allows to manage the client-side routes.
280
+ *
281
+ * ## Adding a route
282
+ * The class allows to add a custom route on different levels:
283
+ * - global level ([`addGlobalApp`](#addglobalapp))
284
+ * - asset level ([`addAssetTopLevelApp`](#addassettoplevelapp))
285
+ * - asset details level ([`addAssetApp`](#addassetapp))
286
+ * - asset group level ([`addAssetGroupTopLevelApp`](#addassetgrouptoplevelapp))
287
+ * - asset group details level ([`addAssetGroupApp`](#addassetgroupapp))
288
+ * - user level ([`addUserTopLevelApp`](#addusertoplevelapp))
289
+ * - user details level ([`addUserApp`](#adduserapp))
290
+ * - user group level ([`addUserGroupTopLevelApp`](#addusergrouptoplevelapp)
291
+ * - user group details level ([`addUserGroupApp`](#addusergroupapp))
292
+ *
293
+ * The above functions accept a [RouteConfig](../modules.html#routeconfig) object as parameter. The parameter defines the path of the route, the component to render, the appeareance in the navigation menu and the access rules.
294
+ *
295
+ * @example
296
+ * ```ts
297
+ * // adding a route on the asset details level, visible only for users
298
+ * // having the ROLE_ADMIN authority and only if the asset is in the asset group
299
+ * // with id 'my-asset-group'.
300
+ * RouteApi.addAssetApp({
301
+ * relativePath: 'my-route',
302
+ * label: {
303
+ * id: 'my-route.label',
304
+ * defaultValue: 'My Route'
305
+ * },
306
+ * component: MyRouteComponent,
307
+ * requiredAuthorities: ['ROLE_ADMIN'],
308
+ * config: {
309
+ * onlyIfInAssetGroup: 'my-asset-group'
310
+ * });
311
+ * ```
312
+ * ## Removing a route
313
+ * The class allows to remove a custom route on different levels:
314
+ * - global level ([`removeGlobalApp`](#removeglobalapp))
315
+ * - asset level ([`removeAssetTopLevelApp`](#removeassettoplevelapp))
316
+ * - asset details level ([`removeAssetApp`](#removeassetapp))
317
+ * - asset group level ([`removeAssetGroupTopLevelApp`](#removeassetgrouptoplevelapp))
318
+ * - asset group details level ([`removeAssetGroupApp`](#removeassetgroupapp)
319
+ * - user level ([`removeUserTopLevelApp`](#removeusertoplevelapp))
320
+ * - user details level ([`removeUserApp`](#removeuserapp))
321
+ * - user group level ([`removeUserGroupTopLevelApp`](#removeusergrouptoplevelapp)
322
+ * - user group details level ([`removeUserGroupApp`](#removeusergroupapp)
323
+ *
324
+ * The above functions accept a `string` as parameter. The parameter defines the name (`relativePath` field) of the route to remove.
325
+ *
326
+ * ## Adding a navigation group
327
+ * The class allows to add a custom navigation group with a function [`addNavGroup`](#addnavgroup). This allows to group the custom routes in the navigation menu.
328
+ * The function [`addNavGroup`](#addNavGroup) accepts a [`NavGroup`](../modules.html#navgroup) object as parameter.
329
+ * The parameter defines the label of the navigation group, the icon to show in the navigation menu and the routes to include in the navigation group.
330
+ * The routes are identified by the `relativePath` field of the [`RouteConfig`](../modules.html#routeconfig) object.
331
+ * @example
332
+ * ```ts
333
+ * // adding a navigation group with the label 'My Group' and the icon 'my-icon'
334
+ * // containing the routes 'my-route-1' and 'my-route-2'
335
+ * RouteApi.addNavGroup({
336
+ * label: {
337
+ * id: 'my-group.label',
338
+ * defaultValue: 'My Group'
339
+ * },
340
+ * icon: 'my-icon',
341
+ * paths: ['my-route-1', 'my-route-2']
342
+ * });
343
+ * ```
344
+ */
345
+ declare class RouteApi {
346
+ routes: Array<RouteConfig>;
347
+ navGroups: Array<NavGroup>;
348
+ /** @hidden */
349
+ constructor(routes: Array<RouteConfig>);
350
+ /** returns routes having name equal to the passed parameter */
351
+ findRoutes: (routeName: string, routes?: Array<RouteConfig>) => Array<RouteConfig>;
352
+ /** @deprecated please use findRoutes instead.*/
353
+ findRoute: (routeName: string, routes?: Array<RouteConfig>) => RouteConfig | null | undefined;
354
+ /** returns all routes */
355
+ getRoutes: () => RouteConfig[];
356
+ /** returns all navigation groups */
357
+ getNavGroups: () => NavGroup[];
358
+ /** @internal returns the given routes filtered by the enabled apps */
359
+ filterRoutes: (routes: Array<RouteConfig> | undefined, user: User, contextInfo: ContextInfo | null | undefined) => Array<RouteConfig>;
360
+ /** returns the given links filtered by the enabled apps */
361
+ filterLinksByEnabledApps: (links: Array<Link>) => Array<Link>;
362
+ /** returns the given routes filtered by the enabled apps */
363
+ filterRoutesByEnabledApps: (routes?: Array<RouteConfig>) => RouteConfig[];
364
+ /** returns the given navigation groups filtered by the enabled apps */
365
+ filterNavGroupsByEnabledApps: (navGroups?: Array<NavGroup>) => Array<NavGroup>;
366
+ private findAppRoute;
367
+ private addApp;
368
+ private removeApp;
369
+ /** adds a route on the asset details level */
370
+ addAssetApp: (assetApp: RouteConfig) => void;
371
+ /** adds a route on the asset level */
372
+ addAssetTopLevelApp: (assetTopLevelApp: RouteConfig) => void;
373
+ /** adds a route on the asset group details level */
374
+ addAssetGroupApp: (assetGroupApp: RouteConfig) => void;
375
+ /** adds a route on the asset group level */
376
+ addAssetGroupTopLevelApp: (assetGroupTopLevelApp: RouteConfig) => void;
377
+ /** adds a route on the user details level */
378
+ addUserApp: (userApp: RouteConfig) => void;
379
+ /** adds a route on the user level */
380
+ addUserTopLevelApp: (userTopLevelApp: RouteConfig) => void;
381
+ /** adds a route on the user group details level */
382
+ addUserGroupApp: (userGroupApp: RouteConfig) => void;
383
+ /** adds a route on the user group level */
384
+ addUserGroupTopLevelApp: (userGroupTopLevelApp: RouteConfig) => void;
385
+ /** adds a navigation group */
386
+ addNavGroup: (navGroup: NavGroup) => number;
387
+ /** removes a route on the asset details level */
388
+ removeAssetApp: (assetAppName: string) => void;
389
+ /** removes a route on the asset group details level */
390
+ removeAssetGroupApp: (assetGroupAppName: string) => void;
391
+ /** removes a route on the asset level */
392
+ removeAssetTopLevelApp: (assetTopLevelAppName: string) => void;
393
+ /** removes a route on the asset group level */
394
+ removeAssetGroupTopLevelApp: (assetGroupTopLevelAppName: string) => void;
395
+ /** removes a route on the user details level */
396
+ removeUserApp: (userAppName: string) => void;
397
+ /** removes a route on the user group details level */
398
+ removeUserGroupApp: (userGroupAppName: string) => void;
399
+ /** removes a route on the user level */
400
+ removeUserTopLevelApp: (userTopLevelAppName: string) => void;
401
+ /** removes a route on the user group level */
402
+ removeUserGroupTopLevelApp: (userGroupTopLevelAppName: string) => void;
403
+ /** adds a route on the global level */
404
+ addGlobalApp: (globalApp: RouteConfig) => void;
405
+ /** removes a route on the global level */
406
+ removeGlobalApp: (globalAppName: string) => void;
407
+ updateSingleRouteAuthorities: (route: RouteConfig, authorities: Array<string>) => void;
408
+ /**
409
+ * Makes all routes having name equal to the passed parameter enabled only for users having the specified authorities.
410
+ *
411
+ * @param {string} routeName
412
+ * @param {string[]} authorities
413
+ * @param {object} [config] extra configuration
414
+ * @param {boolean} [config.onlyChildren] only direct children of the found routes will be enabled or disabled
415
+ * @param {boolean} [config.includeChildren] fond routes and their direct children will be enabled or disabled
416
+ */
417
+ updateAuthorities: (routeName: string, authorities: Array<string>, config?: UpdateAuthoritiesConfig) => void;
418
+ }
419
+ declare const _default$4: RouteApi;
420
+
421
+ type DefaultStyleCustomization = {
422
+ colorPalette: Array<string>;
423
+ trueColors: Array<string>;
424
+ falseColors: Array<string>;
425
+ };
426
+ type StyleCustomization = {
427
+ colorPalette?: Array<string>;
428
+ trueColors?: Array<string>;
429
+ falseColors?: Array<string>;
430
+ };
431
+ /**
432
+ * Style API class.
433
+ *
434
+ * Allows to manage the CSS variables and the custom style customizations, as well as the color palette.
435
+ *
436
+ * ## Customizing the style configuration
437
+ * The class allows to customize the style configuration with the method `setStyleCustomizations`.
438
+ * The method accepts a `StyleCustomization` object as parameter.
439
+ * The object can contain the following properties:
440
+ * - `colorPalette`: an array of colors to be used as color palette. The colors can be any valid CSS color.
441
+ * - `trueColors`: an array of colors to be used as true colors. The colors can be any valid CSS color. Used by the DigitalIO widget.
442
+ * - `falseColors`: an array of colors to be used as false colors. The colors can be any valid CSS color. Used by the DigitalIO widget.
443
+ *
444
+ * @example
445
+ * ```ts
446
+ * await StyleApi.setStyleCustomizations({
447
+ * colorPalette: ['#000000', '#ffffff']
448
+ * });
449
+ * ```
450
+ *
451
+ *
452
+ * ## CSS variables
453
+ * The class allows to define custom CSS variables and custom style customizations.
454
+ *
455
+ * @example
456
+ * await StyleApi.setCssVariables({
457
+ * '--primary-color-darker-10-percent': '#dedede'
458
+ * });
459
+ *
460
+ *
461
+ */
462
+ declare class StyleApi {
463
+ defaultStyleSettings: DefaultStyleCustomization;
464
+ customStyleSettings: StyleCustomization;
465
+ /** @hidden */
466
+ constructor();
467
+ /** allows to set the global css variables */
468
+ setCssVariables: (variablesToSet: Record<string, string>) => Promise<void>;
469
+ /** allows to set the color palette */
470
+ setStyleCustomizations: (styleCustomizations: StyleCustomization) => Promise<void>;
471
+ /** returns the color palette */
472
+ getColorPalette: (defaults?: boolean) => Array<string>;
473
+ /** @internal returns the true colors. Used internally by the DigitalIO widget */
474
+ getTrueColors: () => Array<string>;
475
+ /** @internal returns the default true color. Used internally by the DigitalIO widget */
476
+ getDefaultTrueColor: () => string;
477
+ /** @internal returns the default false color. Used internally by the DigitalIO widget */
478
+ getDefaultFalseColor: () => string;
479
+ /** @internal returns the false colors. Used internally by the DigitalIO widget */
480
+ getFalseColors: () => Array<string>;
481
+ /**
482
+ * Helper function allowing to get the next color from the color palette.
483
+ * @param {Array<string>} [excludeColors] An array of colors to exclude from the color palette.
484
+ * @param {Array<string>} [colorList] An array of colors to use as color palette. If not specified, the color palette is used.
485
+ * @returns {string} The next color from the color palette.
486
+ */
487
+ getNextColor: (excludeColors?: Array<string>, colorList?: Array<string>) => string;
488
+ }
489
+ /**
490
+ * Style API Singleton instance.
491
+ */
492
+ declare const _default$3: StyleApi;
493
+
494
+ /**
495
+ * Theme API class.
496
+ * @example
497
+ * import { ThemeApi } from '@deviceinsight/scale-ui-types';
498
+ *
499
+ * ThemeApi.setCustomTheme({
500
+ * logo: 'https://www.example.com/logo.png',
501
+ * favicon: 'https://www.example.com/favicon.ico',
502
+ * primaryColor: '#000000'
503
+ * });
504
+ */
505
+ declare class ThemeApi {
506
+ /**
507
+ * @internal
508
+ * Stores the default theme.
509
+ */
510
+ private defaultTheme;
511
+ private userTheme;
512
+ private customTheme;
513
+ /**
514
+ * @internal
515
+ * Internal initialization function. Shouldn't be used directly.
516
+ */
517
+ initializeThemeConfiguration: () => void;
518
+ /**
519
+ * @internal
520
+ * sets the current theme. Shouldn't be used directly.
521
+ */
522
+ setTheme: (config?: ThemeConfig) => void;
523
+ /**
524
+ * returns a default theme
525
+ */
526
+ getDefaultTheme: () => ThemeConfig;
527
+ /**
528
+ * sets the default theme
529
+ */
530
+ setDefaultTheme: (config: ThemeConfig) => void;
531
+ /**
532
+ * returns the user theme, which is taken from the user group configuration.
533
+ */
534
+ getUserTheme: () => ThemeConfig;
535
+ /**
536
+ * @internal
537
+ * Internal function to set the user theme. Shouldn't be used directly.
538
+ */
539
+ setUserTheme: (config: ThemeConfig) => void;
540
+ /**
541
+ * sets the custom theme
542
+ */
543
+ setCustomTheme: (config: ThemeConfig) => void;
544
+ /**
545
+ * @internal
546
+ * Internal function to set the user theme. Shouldn't be used directly.
547
+ */
548
+ loadThemeForUser: (user: User) => Promise<void>;
549
+ }
550
+ /**
551
+ * Singleton instance of the ThemeApiClass.
552
+ * Allows to change the theme programmatically.
553
+ */
554
+ declare const _default$2: ThemeApi;
555
+
556
+ type PowerBiReportConfigBase = {
557
+ reportHeading: string;
558
+ workspaceId: string;
559
+ reportId: string;
560
+ };
561
+ type PowerBiReportConfig = PowerBiReportConfigBase & {
562
+ tabName: string;
563
+ };
564
+
565
+ type DashboardWidgetType = 'default' | 'map' | 'image' | 'dpvalue' | 'datapoints' | 'trend' | 'trendv2' | 'properties' | 'barchart' | 'digitalio' | 'link' | 'svg' | 'assignedAssets' | 'emptyInfoWidget' | 'kpiSingleValue' | 'kpiAggregatedChart' | 'aggregation' | 'kpiSingleValueColumn' | 'kpiPieChart' | 'kpiSinglePeriodChart' | 'assetsInfo' | 'testWidget';
566
+ type DashboardWidgetConfig = {
567
+ key: string;
568
+ type: DashboardWidgetType;
569
+ span?: number;
570
+ title: string;
571
+ settings: any;
572
+ };
573
+ type DashboardConfig = {
574
+ key: string;
575
+ name: string | null | undefined;
576
+ description: string | null | undefined;
577
+ labels?: string[];
578
+ isAssetDefinitionDashboard?: boolean;
579
+ shared: boolean;
580
+ assetGroupId?: number;
581
+ creationDate: number;
582
+ orderId?: number;
583
+ widgets: Array<DashboardWidgetConfig>;
584
+ layout: Layout[];
585
+ columnsCount: number;
586
+ /** By default for new dashboards set to TRUE, but for old (based on rows) to FALSE */
587
+ autoAdjustLayout: boolean;
588
+ };
589
+ type AssetContext = {
590
+ type: 'asset';
591
+ asset: Asset;
592
+ };
593
+ type AssetGroupContext = {
594
+ type: 'assetGroup';
595
+ assetGroup: AssetGroup;
596
+ };
597
+ type GlobalDashboardContext = {
598
+ type: 'global';
599
+ };
600
+ type AssetDefinitionContext = {
601
+ type: 'assetDefinition';
602
+ assetDefinition: AssetDefinition;
603
+ };
604
+ type DashboardContext = AssetContext | AssetGroupContext | GlobalDashboardContext | AssetDefinitionContext;
605
+
606
+ type RoleTemplate = {
607
+ id: number;
608
+ name: string;
609
+ description: string;
610
+ authorities: string[];
611
+ };
612
+
613
+ /**
614
+ * UI Configuration API class.
615
+ * Provides the Tenant UI configuration.
616
+ */
617
+ declare class UIConfiguration {
618
+ appConfiguration: AppConfigurationBundle | null | undefined;
619
+ syncWithBackend(uiConfiguration: Record<string, any>): Promise<any>;
620
+ getAppName(): string;
621
+ getFavicon(): string;
622
+ /**
623
+ * returns a boolean indicating if the app is enabled
624
+ * @param {string} appName The name of the app
625
+ * @param {string} scope The scope
626
+ */
627
+ isAppEnabled(appName: string, scope?: string): boolean;
628
+ /** @internal */
629
+ getAppConfiguration(appName: string, validateAppConfiguration?: validateAppConfigurationFunctionType): AppConfiguration<any> | null | undefined;
630
+ getPrimaryColor(): string;
631
+ getLogo(): string;
632
+ getErrorMessageAutocloseTimeout(): number | null | undefined;
633
+ getCustomStyleConfiguration(): StyleCustomization;
634
+ getTenantConfigUrl(): string | null | undefined;
635
+ isTenantShowingAssetQRCodes(): boolean;
636
+ getTenant(): string;
637
+ getApiBaseUrl(): string;
638
+ getDefaultTimezone(): string;
639
+ getGoogleMapsAPIKey(): string;
640
+ getDefaultMapCenter(): string;
641
+ getDefaultMapZoom(): string;
642
+ getTenantStartPageUrl(): string | null | undefined;
643
+ getTransportChannelsAvailable(): string;
644
+ getSupportedTimezones(): string[];
645
+ getDatapointExplorerEnabled(): boolean;
646
+ getInitialUserState(): 'TERMS_ACCEPTANCE_PENDING' | 'ACTIVE';
647
+ isPubSubStompDebuggingEnabled(): boolean;
648
+ getMainLocizeProject(): {
649
+ apiKey: string;
650
+ projectId: string;
651
+ version: string;
652
+ };
653
+ getTenantLocizeProject(): null | {
654
+ apiKey: any;
655
+ projectId: any;
656
+ version: any;
657
+ };
658
+ getSvgWidgetFieldIdentifier(): string;
659
+ getGatewayPrefix(): string;
660
+ getAssetPrefix(): string;
661
+ getFallbackLocale(): string;
662
+ getConfigurationsStatusInterval(): number;
663
+ hasLegalPages(): boolean;
664
+ getAppFooter(): string | null | undefined;
665
+ getPublicAppFooter(): string | null | undefined;
666
+ getAppWhatsNewVersion(): string | null | undefined;
667
+ getDocumentationStandardBaseUrl(): string | null | undefined;
668
+ getDocumentationStandardNamespace(): string | null | undefined;
669
+ getDocumentationStandardVersion(): string | null | undefined;
670
+ getDocumentationCustomBaseUrl(): string | null | undefined;
671
+ getDocumentationCustomNamespace(): string | null | undefined;
672
+ getDocumentationCustomVersion(): string | null | undefined;
673
+ getAvailableApps(): Array<string> | null | undefined;
674
+ getTrendExactValuesMinutes(): number;
675
+ getAccountCreationPrinciple(): 'username' | 'email';
676
+ getEnabledWidgets(): string[] | null | undefined;
677
+ isDashboardTimeDriveEnabled(context: DashboardContext['type']): boolean;
678
+ isWidgetTimeDriveEnabled(widgetType: DashboardWidgetType, context: DashboardContext['type']): boolean;
679
+ getEventPriorities(): EventPriority[];
680
+ getEventPriority(priorityValue: number): EventPriority | null;
681
+ getDefaultEventPriority(): EventPriority;
682
+ getTrendSlicesDivisor(): number;
683
+ getTrendSlicesMinimum(): number;
684
+ getDisplayWelcomeScreen(): boolean;
685
+ getGitCommitShaShort(): string;
686
+ getPowerBiReports(): PowerBiReportConfig[] | null | undefined;
687
+ getUx4iotUrl(): string | null | undefined;
688
+ getAssetListDefaultSearch(): string | null | undefined;
689
+ getAssetListAssetTypes(): 'all' | 'only_gateways' | 'only_assets';
690
+ getAssetGroupAssetAssignmentAssetTypes(): 'all' | 'only_assets' | 'only_gateways';
691
+ isFavoritesEnabled(): boolean;
692
+ isHistoryEnabled(): boolean;
693
+ isDatapointValuesUseAdx(): boolean;
694
+ getDashboardLabels(): string[];
695
+ getDefaultDashboardLabel(): string | undefined;
696
+ isReleaseNotesHidden(): boolean;
697
+ getDefaultSearchMode(): 'context' | 'full';
698
+ getRoleTemplates(): RoleTemplate[];
699
+ getGlobalAssetTimezoneMode(): 'browser' | 'asset' | 'user';
700
+ getPrimaryColorAvoidingGray(): string;
701
+ getUx4IotGrantRequestEndpoint(): string;
702
+ isTestTenant(): boolean;
703
+ }
704
+ declare const _default$1: UIConfiguration;
705
+
706
+ /**
707
+ * Allows to add a custom React element in the header
708
+ * @param {string} customHeaderElementId A unique id of the custom header element
709
+ * @param {ComponentType<any>} customHeaderElementComponent The React component to render
710
+ * @example
711
+ * ```ts
712
+ * import { addCustomHeaderElement } from '@deviceinsight/scale-ui-types';
713
+ * import { MyCustomHeaderElement } from './MyCustomHeaderElement';
714
+ *
715
+ * addCustomHeaderElement('my-custom-header-element', MyCustomHeaderElement);
716
+ * ```
717
+ */
718
+ declare const addCustomHeaderElement: (customHeaderElementId: string, customHeaderElementComponent: ComponentType<any>) => void;
719
+ /**
720
+ * Allows to remove a custom React element from the header added with `addCustomHeaderElement`
721
+ * @param {string} customHeaderElementId The id of the custom header element to remove
722
+ * @example
723
+ * ```ts
724
+ * import { removeCustomHeaderElement } from '@deviceinsight/scale-ui-types';
725
+ * removeCustomHeaderElement('my-custom-header-element');
726
+ * ```
727
+ */
728
+ declare const removeCustomHeaderElement: (customHeaderElementId: string) => void;
729
+
730
+ /**
731
+ * @deprecated Please use the RouteApi.
732
+ * Allows to define a custom list of routes.
733
+ * @param {function(routes: Array<RouteConfig>): Array<RouteConfig>} modifyRoutesFn The custom function for determining the list of routes.
734
+ * The function receives the default list of routes and returns the modified list of routes.
735
+ * @example Adding a new custom route
736
+ * ```ts
737
+ * import { modifyRoutes } from '@deviceinsight/scale-ui-types';
738
+ *
739
+ * modifyRoutes((routes) => {
740
+ * return [...routes, {
741
+ * relativePath: 'my-route',
742
+ * label: {
743
+ * id: 'my-route.label',
744
+ * defaultValue: 'My Route'
745
+ * },
746
+ * component: MyRouteComponent,
747
+ * requiredAuthorities: ['ROLE_ADMIN']
748
+ * }];
749
+ * });
750
+ * ```
751
+ */
752
+ declare const modifyRoutes: (modifyRoutesFn: (currentRoutes: Array<RouteConfig>) => Array<RouteConfig>) => Promise<void>;
753
+
754
+ type AssetAndGroupsAndGateway = {
755
+ id: number;
756
+ asset: Asset;
757
+ assetGroups: Array<AssetGroup>;
758
+ gateway: Gateway | null | undefined;
759
+ };
760
+
761
+ type AssetColumnDefs = Array<ReactableColumnDef<AssetAndGroupsAndGateway>>;
762
+
763
+ type AssetGroupInfo = {
764
+ id: number;
765
+ assetGroup: AssetGroup;
766
+ assetGroupDefinition: AssetGroupDefinition;
767
+ ancestors: Array<AssetGroup>;
768
+ };
769
+
770
+ type AssetGroupColumnDefs = Array<ReactableColumnDef<AssetGroupInfo>>;
771
+
772
+ type UserColumnDefs = Array<ReactableColumnDef<UserWithGroupsAndRoles>>;
773
+
774
+ type UserGroupInfo = UserGroup & {
775
+ roleName?: string;
776
+ licenseDisplayName?: string[];
777
+ };
778
+
779
+ type UserGroupColumnDefs = Array<ReactableColumnDef<UserGroupInfo>>;
780
+
781
+ /**
782
+ * Asset Column Definition Customization
783
+ * */
784
+ type GetCustomAssetColumnDefsFunction = (defaultColumnDefinitions: AssetColumnDefs, context: string, withLink?: boolean) => AssetColumnDefs;
785
+ /**
786
+ * Allows to define a custom list of columns for the asset table.
787
+ * @param {function(defaultColumnDefinitions: Array<ReactableColumnDef<AssetAndGroupsAndGateway>>): Array<ReactableColumnDef<AssetAndGroupsAndGateway>>} modifier The custom function for determining the list of columns.
788
+ * The function receives the default list of columns and returns the modified list of columns.
789
+ * @example
790
+ * ```ts
791
+ * import { modifyAssetColumnDefinitions } from '@deviceinsight/scale-ui-types';
792
+ * import { AssetAndGroupsAndGateway } from '@deviceinsight/ng-ui-api-client';
793
+ * import { MyCustomAssetColumnDefs } from './MyCustomAssetColumnDefs';
794
+ *
795
+ * modifyAssetColumnDefinitions((defaultColumnDefinitions) => {
796
+ * return [...defaultColumnDefinitions, ...MyCustomAssetColumnDefs];
797
+ * });
798
+ * ```
799
+ */
800
+ declare const modifyAssetColumnDefinitions: (getTenantSpecificColumnDefs: GetCustomAssetColumnDefsFunction) => Promise<void>;
801
+ /**
802
+ * Asset Group Column Definition Customization
803
+ * */
804
+ type GetCustomAssetGroupColumnDefsFunction = (defaultColumnDefinitions: AssetGroupColumnDefs, context: string, withLink?: boolean) => AssetGroupColumnDefs;
805
+ /**
806
+ * Allows to define a custom list of columns for the asset group table.
807
+ * @param {function(defaultColumnDefinitions: Array<ReactableColumnDef<AssetGroupInfo>>): Array<ReactableColumnDef<AssetGroupInfo>>} modifier The custom function for determining the list of columns.
808
+ * The function receives the default list of columns and returns the modified list of columns.
809
+ * @example
810
+ * ```ts
811
+ * import { modifyAssetGroupColumnDefinitions } from '@deviceinsight/scale-ui-types';
812
+ * import { AssetGroupInfo } from '@deviceinsight/ng-ui-api-client';
813
+ * import { MyCustomAssetGroupColumnDefs } from './MyCustomAssetGroupColumnDefs';
814
+ *
815
+ * modifyAssetGroupColumnDefinitions((defaultColumnDefinitions) => {
816
+ * return [...defaultColumnDefinitions, ...MyCustomAssetGroupColumnDefs];
817
+ * });
818
+ * ```
819
+ */
820
+ declare const modifyAssetGroupColumnDefinitions: (getTenantSpecificColumnDefs: GetCustomAssetGroupColumnDefsFunction) => Promise<void>;
821
+ /**
822
+ * User Column Definition Customization
823
+ * */
824
+ type GetCustomUserColumnDefsFunction = (defaultColumnDefinitions: UserColumnDefs, withLink?: boolean) => UserColumnDefs;
825
+ /**
826
+ * Allows to define a custom list of columns for the user table.
827
+ * @param {function(defaultColumnDefinitions: Array<ReactableColumnDef<UserWithGroupsAndRoles>>): Array<ReactableColumnDef<UserWithGroupsAndRoles>>} getTenantSpecificColumnDefs The custom function for determining the list of columns.
828
+ * The function receives the default list of columns and returns the modified list of columns.
829
+ * @example
830
+ * ```ts
831
+ * import { modifyUserColumnDefinitions } from '@deviceinsight/scale-ui-types';
832
+ * import { UserWithGroupsAndRoles } from '@deviceinsight/ng-ui-api-client';
833
+ * import { MyCustomUserColumnDefs } from './MyCustomUserColumnDefs';
834
+ *
835
+ * modifyUserColumnDefinitions((defaultColumnDefinitions) => {
836
+ * return [...defaultColumnDefinitions, ...MyCustomUserColumnDefs];
837
+ * });
838
+ * ```
839
+ */
840
+ declare const modifyUserColumnDefinitions: (getTenantSpecificColumnDefs: GetCustomUserColumnDefsFunction) => Promise<void>;
841
+ /**
842
+ * User Group Column Definition Customization
843
+ * */
844
+ type GetCustomColumnDefsFunction = (defaultColumnDefinitions: UserGroupColumnDefs, withLink?: boolean) => UserGroupColumnDefs;
845
+ /**
846
+ * Allows to define a custom list of columns for the user group table.
847
+ * @param {function(defaultColumnDefinitions: Array<ReactableColumnDef<UserGroup>>): Array<ReactableColumnDef<UserGroup>>} getTenantSpecificColumnDefs The custom function for determining the list of columns.
848
+ * The function receives the default list of columns and returns the modified list of columns.
849
+ * @example
850
+ * ```ts
851
+ * import { modifyUserGroupColumnDefinitions } from '@deviceinsight/scale-ui-types';
852
+ * import { UserGroup } from '@deviceinsight/ng-ui-api-client';
853
+ * import { MyCustomUserGroupColumnDefs } from './MyCustomUserGroupColumnDefs';
854
+ *
855
+ * modifyUserGroupColumnDefinitions((defaultColumnDefinitions) => {
856
+ * return [...defaultColumnDefinitions, ...MyCustomUserGroupColumnDefs];
857
+ * });
858
+ * ```
859
+ */
860
+ declare const modifyUserGroupColumnDefinitions: (getTenantSpecificColumnDefs: GetCustomColumnDefsFunction) => Promise<void>;
861
+
862
+ type GetCustomMapMarkerIconFunction = (asset: Asset) => string;
863
+ /**
864
+ * Allows to define a custom function returning a map icon for a specific asset.
865
+ * @param {function(asset: Asset): string} modifier The custom function for determining the map icon.
866
+ * The function receives the asset and returns the map icon.
867
+ */
868
+ declare const modifyMapMarkerIcon: (getTenantSpecificMapMarkerIcon: GetCustomMapMarkerIconFunction) => Promise<void>;
869
+
870
+ type CanDeleteResult = {
871
+ canBeDeleted: boolean;
872
+ error?: string;
873
+ };
874
+
875
+ /**
876
+ * Allows to define a custom function for determining if a bundle can be deleted or not.
877
+ * @param {function(bundle: Bundle): Promise<CanDeleteResult>} modifier The custom function for determining if a bundle can be deleted or not.
878
+ */
879
+ declare const modifyCanDeleteBundle: (customCanDeleteBundle: (arg0: Bundle) => Promise<CanDeleteResult>) => Promise<void>;
880
+
881
+ /**
882
+ * Allows to define a custom function for determining if a bundle version can be deleted or not.
883
+ * @param {function(bundle: Bundle, version: BundleVersion): Promise<CanDeleteResult>} modifier The custom function for determining if a bundle version can be deleted or not.
884
+ */
885
+ declare const modifyCanDeleteBundleVersion: (customCanDeleteBundleVersion: (bundle: Bundle, version: BundleVersion) => Promise<CanDeleteResult>) => Promise<void>;
886
+
887
+ type IsPropertyVisible = (propertyKey: string, userRoles: Role[]) => boolean;
888
+ /**
889
+ * Allows to define a rule for determining if a property is visible or not.
890
+ * @param {IsPropertyVisible} customFunction The custom function for determining if a property is visible or not.
891
+ * @example
892
+ * ```ts
893
+ * import { modifyPropertyVisibility } from '@deviceinsight/scale-ui-types';
894
+ *
895
+ * const isPropertyVisible: IsPropertyVisible = (propertyKey, userRoles) => {
896
+ * return propertyKey !== 'my-property' || userRoles.some(role => role.name === 'ROLE_ADMIN');
897
+ * };
898
+ *
899
+ * modifyPropertyVisibility(isPropertyVisible);
900
+ * ```
901
+ */
902
+ declare const modifyPropertyVisibility: (customFunction: IsPropertyVisible) => void;
903
+
904
+ /**
905
+ * Allows setting runtime environment variables
906
+ * @param {Record<string, string>} env The environment variables to set.
907
+ */
908
+ declare const setEnvironment: (env: Record<string, string>) => Promise<void>;
909
+
910
+ /**
911
+ * Returns the user start page. If it is not defined, returns `/`.
912
+ * @returns Promise<string>
913
+ */
914
+ declare const getStartPage: () => Promise<string>;
915
+
916
+ /**
917
+ * Returns an axios instance storing the current user's token and preconfigured to handle token refresh when needed.
918
+ */
919
+ declare const _default: () => AxiosInstance;
920
+
921
+ /**
922
+ * Helper function to retrieve the auth info of the current user.
923
+ * @returns {Promise<AuthInfo>} The auth info of the current user.
924
+ */
925
+ declare const retrieveAuthInfo: () => Promise<AuthInfo>;
926
+
927
+ /**
928
+ * Sets the globally available information about the current context.
929
+ * Note it's an internal scale-ui function. Use it only if you know what you are doing.
930
+ * @param {ContextInfo} contextInfo The context information.
931
+ */
932
+ declare function setContextInfo(contextInfo: ContextInfo): void;
933
+
934
+ type Props$1 = {
935
+ authorities: Authorities;
936
+ };
937
+ /**
938
+ * Renders the wrapped component only if the current user has the given authorities.
939
+ * @param {Authorities} authorities The authorities to check. Can be a list of authorities or a list of lists of authorities. In first case the user needs to have all authorities, in the second case the user needs to have all the authorities in at leat one list.
940
+ * @returns {React.ReactNode} The wrapped component.
941
+ * @example
942
+ * import { HasAuthorities } from '@deviceinsight/scale-ui-types';
943
+ *
944
+ * <HasAuthorities authorities={['ROLE_ADMIN', 'ROLE_USER']}>
945
+ * <div>Only visible for users with ROLE_ADMIN or ROLE_USER</div>
946
+ * </HasAuthorities>
947
+ *
948
+ * // ...
949
+ * <HasAuthorities authorities={[['ROLE_ADMIN'], ['ROLE_CUSTOMER', 'ROLE_MAINTENANCE']}>
950
+ * <div>Only visible for users with ROLE_ADMIN or both roles: ROLE_USER and ROLE_MAINTENANCE</div>
951
+ * </HasAuthorities>
952
+ */
953
+ declare const HasAuthorities: ({ authorities, children }: React__default.PropsWithChildren<Props$1>) => JSX.Element | null;
954
+
955
+ type IsDashboardVisible = (dashboard: DashboardConfig, context: DashboardContext, user: User) => Promise<boolean>;
956
+ /**
957
+ * Allows to define a custom function to determine if a dashboard is visible for the current user.
958
+ * @param {IsDashboardVisible} isDashboardVisible The custom function to determine if a dashboard is visible for the current user.
959
+ * @example
960
+ * import { modifyIsDashboardVisible } from '@deviceinsight/scale-ui-types';
961
+ *
962
+ * modifyIsDashboardVisible(async (dashboard, context, user) => {
963
+ * if (dashboard.key === 'settings' && context.type === 'assetGroup' && !user.userGroups.some(userGroup => userGroup.name === 'admin')) {
964
+ * return false;
965
+ * }
966
+ * return true;
967
+ * });
968
+ */
969
+ declare function modifyIsDashboardVisible(isDashboardVisible: IsDashboardVisible): void;
970
+
971
+ type CustomCategory = {
972
+ categoryName: string;
973
+ type: 'documents' | 'images';
974
+ locizeKey: string;
975
+ locizeDefaultValue: string;
976
+ };
977
+ /**
978
+ * Sets custom file categories for the files app.
979
+ * @param {CustomCategory[]} categories The custom file categories.
980
+ * @example
981
+ * import { setCustomFilesCategories } from '@deviceinsight/scale-ui-types';
982
+ * setCustomFilesCategories([
983
+ * {
984
+ * categoryName: 'Custom Category',
985
+ * type: 'documents',
986
+ * locizeKey: 'customCategory',
987
+ * locizeDefaultValue: 'Custom Category'
988
+ * }
989
+ * ]);
990
+ */
991
+ declare function setCustomFilesCategories(categories: CustomCategory[]): void;
992
+
993
+ type WidgetProps = {
994
+ context: DashboardContext;
995
+ config: DashboardWidgetConfig;
996
+ assetGroupId: number | null | undefined;
997
+ editMode: boolean;
998
+ dashboardId: string;
999
+ dashboardPeriod?: Period | null | undefined;
1000
+ dashboardTime?: number | null | undefined;
1001
+ setTimeDriveSupported?: (supported: boolean) => void;
1002
+ };
1003
+ type WidgetConfigProps = {
1004
+ context: DashboardContext;
1005
+ config: DashboardWidgetConfig;
1006
+ assetGroupId: number | null | undefined;
1007
+ onChangeConfig: (config: DashboardWidgetConfig, withoutLivePreview?: boolean) => void;
1008
+ setApplyButtonDisabled: (value: boolean) => void;
1009
+ configChanged: boolean;
1010
+ };
1011
+ type WidgetDefinition = {
1012
+ name: DashboardWidgetType;
1013
+ widgetComponent: React__default.ComponentType<WidgetProps>;
1014
+ configComponent?: React__default.ComponentType<WidgetConfigProps>;
1015
+ contextComponent?: React__default.ComponentType<React__default.PropsWithChildren<unknown>>;
1016
+ title: TranslationDescriptor;
1017
+ subtitle?: TranslationDescriptor;
1018
+ autoOpenConfig?: boolean;
1019
+ defaultSettings?: Record<string, any>;
1020
+ scope: Array<'asset' | 'gateway' | 'assetGroup' | 'global' | 'assetDefinition'>;
1021
+ disabledByDefault?: boolean;
1022
+ timeDriveSupport?: boolean | ((config: any) => boolean | null | undefined);
1023
+ };
1024
+
1025
+ type GetCustomDashboardWidgets = (widgets: WidgetDefinition[]) => WidgetDefinition[];
1026
+ /**
1027
+ * Allows to define a custom list of available widgets on the dashboards.
1028
+ * @param {function(widgets: Array<WidgetDefinition<any, any>>): Array<WidgetDefinition<any, any>>} modifier The custom function for determining the list of available widgets.
1029
+ * The function receives the default list of available widgets and returns the modified list of available widgets.
1030
+ *
1031
+ * @example Adding a custom widget
1032
+ * ```ts
1033
+ * import { modifyDashboardWidgets } from '@deviceinsight/scale-ui-types';
1034
+ * import { MyCustomWidgetDefinition } from './MyCustomWidget';
1035
+ *
1036
+ * modifyDashboardWidgets((widgets) => {
1037
+ * return [...widgets, MyCustomWidgetDefinition];
1038
+ * });
1039
+ * ```
1040
+ * @example Removing a widget
1041
+ * ```ts
1042
+ * import { modifyDashboardWidgets } from '@deviceinsight/scale-ui-types';
1043
+ *
1044
+ * modifyDashboardWidgets((widgets) => {
1045
+ * return widgets.filter(widget => widget.name !== 'MyCustomWidget');
1046
+ * });
1047
+ * ```
1048
+ */
1049
+ declare const modifyDashboardWidgets: (modifyWidgetsFn: GetCustomDashboardWidgets) => void;
1050
+
1051
+ type CustomizableComponentName = 'Logo' | 'Footer' | 'AssetConnectionState' | 'HeaderSearch';
1052
+ /**
1053
+ * Allows to replace some of the scale-ui components with custom ones.
1054
+ * @param {'Logo' | 'Footer' | 'AssetConnectionState' | 'HeaderSearch'} name The name of the component to replace.
1055
+ * @param {ComponentType<any> | null} component The React component to render.
1056
+ * @example
1057
+ * ```ts
1058
+ * import { replaceComponent } from '@deviceinsight/scale-ui-types';
1059
+ * import { MyCustomLogo } from './MyCustomLogo';
1060
+ *
1061
+ * replaceComponent('Logo', MyCustomLogo);
1062
+ * ```
1063
+ */
1064
+ declare const replaceComponent: (name: CustomizableComponentName, component: ComponentType<any>) => Promise<void>;
1065
+
1066
+ type GenerateAssetUrnFn = (isGateway: boolean) => string;
1067
+ /**
1068
+ * Allows to define a custom function for generating the asset URN.
1069
+ * @param {function(boolean): string} generator The custom function for generating the asset URN.
1070
+ * It takes a boolean parameter indicating if the asset is a gateway or not and returns the generated URN.
1071
+ * @param {boolean} editable Indicates if the URN is editable or not.
1072
+ * @example
1073
+ * ```ts
1074
+ * import { generateAssetUrn } from '@deviceinsight/scale-ui-types';
1075
+ *
1076
+ * modifyGenerateAssetUrn((isGateway) => {
1077
+ * return isGateway ? 'urn:scale:gateway:' : 'urn:scale:asset:';
1078
+ * }, true);
1079
+ * ```
1080
+ */
1081
+ declare const modifyGenerateAssetUrn: (generator: GenerateAssetUrnFn, editable: boolean) => void;
1082
+
1083
+ type CustomLoginPageElementsContextType = {
1084
+ aboveForm: ReactNode;
1085
+ belowForm: ReactNode;
1086
+ belowLoginButton: ReactNode;
1087
+ nextToLoginButton: ReactNode;
1088
+ };
1089
+ type Position = keyof CustomLoginPageElementsContextType;
1090
+
1091
+ /**
1092
+ * Sets a custom login page element.
1093
+ * @param {'aboveForm' | 'belowForm' | 'belowLoginButton' | 'nextToLoginButton'} position The position of the custom element.
1094
+ * @param {ReactNode} element The custom element.
1095
+ * @returns {Promise<void>}
1096
+ * @example
1097
+ * import { setCustomLoginPageElement } from '@deviceinsight/scale-ui-types';
1098
+ * setCustomLoginPageElement('aboveForm', <div>Custom element</div>);
1099
+ */
1100
+ declare function setCustomLoginPageElement(position: Position, element: ReactNode): Promise<void>;
1101
+
1102
+ declare const ux4iotGrantRequestFunction: GrantRequestFunctionType;
1103
+
1104
+ /**
1105
+ * Returns the timezone selected by the user. Might be the browser timezone or the timezone set in the current asset object.
1106
+ * @returns {string} The timezone selected by the user.
1107
+ * @example
1108
+ * import { useAssetTimezone } from '@deviceinsight/scale-ui-types';
1109
+ * const timezone = useAssetTimezone();
1110
+ */
1111
+ declare function useAssetTimezone(): string;
1112
+
1113
+ /**
1114
+ * Returns the current user account info.
1115
+ * @returns {User} The current user account info.
1116
+ * @example
1117
+ * import { useUserAccountInfo } from '@deviceinsight/scale-ui-types';
1118
+ * const user = useUserAccountInfo();
1119
+ */
1120
+ declare function useUserAccountInfo(): User;
1121
+
1122
+ type SearchProps<T> = {
1123
+ query: string;
1124
+ paginationSettings: PaginationSettings;
1125
+ searchResult: Pageable<T> | null | undefined;
1126
+ isSearching: boolean;
1127
+ search?: (query: string, paginationSettings: PaginationSettings) => Promise<Pageable<any>>;
1128
+ onChangePageSize?: (size: number) => void;
1129
+ };
1130
+
1131
+ /**
1132
+ * Allows to change the initial sort configuration for the child asset groups table placed in the asset group masterdata page.
1133
+ * @param {Sort} sort The sort configuration.
1134
+ * @example <caption>Sort by definition name ascending</caption>
1135
+ * import { modifyChildAssetGroupsInitialSort } from '@deviceinsight/scale-ui-types';
1136
+ *
1137
+ * modifyChildAssetGroupsInitialSort({
1138
+ * property: 'definitionName',
1139
+ * direction: 'ASC'
1140
+ * });
1141
+ */
1142
+ declare const modifyChildAssetGroupsInitialSort: (sort: Sort) => void;
1143
+
1144
+ type Props = ButtonHTMLAttributes<HTMLButtonElement> & {
1145
+ icon: ReactNode;
1146
+ };
1147
+ declare function ContextBarAction({ className, icon, ...props }: Props): JSX.Element;
1148
+
1149
+ declare function ContextBarActionContainer({ children }: PropsWithChildren): null;
1150
+
1151
+ type CustomSearchProperty = {
1152
+ key: string;
1153
+ type: 'string' | 'number' | 'boolean';
1154
+ };
1155
+
1156
+ /**
1157
+ * Allows to define custom search properties in the advanced search panel.
1158
+ * @param {Array<CustomSearchProperty> | undefined} properties The custom search properties.
1159
+ * @example
1160
+ * import {modifyCustomSearchProperties} from '@deviceinsight/ng-ui-scale-lib/api';
1161
+ *
1162
+ * modifyCustomSearchProperties([{key: 'custom.prop', type: 'string'}, {key: 'custom.bool', type: 'boolean'}]);
1163
+ */
1164
+ declare const modifyCustomSearchProperties: (properties: CustomSearchProperty[]) => void;
1165
+
1166
+ declare function setFavicon(filename: string): Promise<void>;
1167
+ declare function setPrimaryColor(color: string): Promise<void>;
1168
+ declare const eventBus: {
1169
+ onSignin: (eventHandler: (user: api.User, autoSignin: boolean) => any, once?: boolean) => void;
1170
+ onSignout: (eventHandler: (arg0: api.User) => any, once?: boolean) => void;
1171
+ onThemeChange: (eventHandler: (config: ThemeConfig) => any, once?: boolean) => void;
1172
+ onUserProfileChange: (eventHandler: (user: api.User) => void, once?: boolean) => void;
1173
+ };
1174
+
1175
+ export { App, AppConfigurationBundle, AssetAndGroupsAndGateway, AssetGroupInfo, CanDeleteResult, ContextActionType, ContextBarAction, ContextBarActionContainer, ContextInfoProps, DashboardConfig, DashboardWidgetConfig, DashboardWidgetType, HasAuthorities, NavGroup, _default$4 as RouteApi, RouteConfig, RouteLink, SearchProps, _default$3 as StyleApi, StyleCustomization, TFunction, _default$2 as ThemeApi, ThemeConfig, Trans, _default$5 as TranslationApi, TranslationDescriptor, _default$1 as UiConfigurationApi, UserColumnDefs, UserGroupColumnDefs, VisibilityProps, WidgetConfigProps, WidgetDefinition, WidgetProps, addCustomHeaderElement, addI18nextXHRBackend, eventBus, modifyGenerateAssetUrn as generateAssetUrn, _default as getNguiAxios, getStartPage, hasAuthorities, modifyAssetColumnDefinitions, modifyAssetGroupColumnDefinitions, modifyCanDeleteBundle, modifyCanDeleteBundleVersion, modifyChildAssetGroupsInitialSort, modifyCustomSearchProperties, modifyDashboardWidgets, modifyIsDashboardVisible, modifyMapMarkerIcon, modifyPropertyVisibility, modifyRoutes, modifyUserColumnDefinitions, modifyUserGroupColumnDefinitions, removeCustomHeaderElement, replaceComponent, retrieveAuthInfo, setContextInfo, setCustomFilesCategories, setCustomLoginPageElement, setEnvironment, setFavicon, setLocizeProject, setPrimaryColor, setTitle, useAssetTimezone, useTranslation, useUserAccountInfo, ux4iotGrantRequestFunction };