@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
90 lines • 4.13 kB
TypeScript
import { Interval } from '@c8y/ngx-components/interval-picker';
import { DateTimeContext } from '../widget-change-event.model';
import { aggregationType } from '@c8y/client';
export type WidgetDisplaySettings = {
/**
* If enabled the widget is bound to the global time context. You can listen to ngOnChanges() change detection
* to react to changes on the context. When a more detailed configuration is needed, use the <c8y-widget-time-context>
* component instead.
*/
globalTimeContext?: boolean;
/**
* If enabled the widget is bound to the global realtime context. You can listen to ngOnChanges() change detection
* to react to changes on the context.
*/
globalRealtimeContext?: boolean;
/**
* If enabled the widget is bound to the global aggregation context. You can listen to ngOnChanges() change detection
* to react to changes on the context.
*/
globalAggregationContext?: boolean;
/**
* If enabled the widget is bound to the global auto refresh context. You can listen to ngOnChanges() change detection
* to react to changes on the context. When a more detailed configuration is needed, use the WidgetGlobalAutoRefreshService
* service instead.
*/
globalAutoRefreshContext?: boolean;
};
export interface GlobalTimeContextWidgetConfig {
/**
* Indicates if instance of widget is bound to global date context. It can be only used with widgets which
* dynamic component definition contains displaySettings allowing to use it with global date context.
*/
widgetInstanceGlobalTimeContext?: boolean;
/**
* Indicates if widget that is bound to global date context can decouple from it. If that widget is decoupled, it is
* unsubscribed from global date context updates and date context related controls are displayed on widget view.
*/
canDecoupleGlobalTimeContext?: boolean;
}
export type WidgetTimeContextState = {
date: DateTimeContext;
interval: Interval['id'];
realtime: boolean;
aggregation: aggregationType;
};
export declare enum DateContextQueryParamNames {
DATE_CONTEXT_FROM = "dateContextFrom",
DATE_CONTEXT_TO = "dateContextTo",
DATE_CONTEXT_INTERVAL = "dateContextInterval",
DATE_CONTEXT_REALTIME = "dateContextRealtime",
DATE_CONTEXT_AGGREGATION = "dateContextAggregation"
}
type DateContextFromToQueryParams = {
[DateContextQueryParamNames.DATE_CONTEXT_FROM]: string;
[DateContextQueryParamNames.DATE_CONTEXT_TO]: string;
[DateContextQueryParamNames.DATE_CONTEXT_INTERVAL]?: never;
};
type DateContextIntervalQueryParams = {
[DateContextQueryParamNames.DATE_CONTEXT_FROM]?: never;
[DateContextQueryParamNames.DATE_CONTEXT_TO]?: never;
[DateContextQueryParamNames.DATE_CONTEXT_INTERVAL]: Interval['id'];
};
/**
* Input query params is an object representing all possible query params related to widget time context.
* It can be provided by user typing them in browser URL address bar, so all of them should be considered.
*/
export type InputDateContextQueryParams = {
[DateContextQueryParamNames.DATE_CONTEXT_FROM]?: string;
[DateContextQueryParamNames.DATE_CONTEXT_TO]?: string;
[DateContextQueryParamNames.DATE_CONTEXT_INTERVAL]?: Interval['id'];
[DateContextQueryParamNames.DATE_CONTEXT_REALTIME]?: boolean;
[DateContextQueryParamNames.DATE_CONTEXT_AGGREGATION]?: aggregationType;
};
/**
* Output query params is an object representing params that are applied to current URL in browser address bar.
* These params are set programmatically.
* Time context interval and time range described by date "from" and date "to" exclude each other.
*/
export type OutputDateContextQueryParams = (DateContextFromToQueryParams | DateContextIntervalQueryParams) & {
[DateContextQueryParamNames.DATE_CONTEXT_REALTIME]: boolean;
[DateContextQueryParamNames.DATE_CONTEXT_AGGREGATION]: aggregationType;
};
export declare enum WidgetTimeContextActionBarPriority {
NONE = 0,
LOW = 1,
MEDIUM = 2,
HIGH = 3
}
export {};
//# sourceMappingURL=widget-time-context.model.d.ts.map