@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
50 lines • 2.8 kB
TypeScript
import { WidgetTimeContextActionBarPriority, WidgetDisplaySettings } from './widget-time-context.model';
import { DateTimeContext } from '../widget-change-event.model';
import { aggregationType } from '@c8y/client';
import { Interval } from '@c8y/ngx-components/interval-picker';
import * as i0 from "@angular/core";
export declare class WidgetTimeContextHelperService {
/**
* Validates provided param for being selectable Interval id.
* @param intervalId Interval id to be validated.
* @returns True if provided id is valid, selectable Interval id and false if it's not.
*/
isSelectableInterval(intervalId: Interval['id']): boolean;
/**
* Validates provided date "from" and date "to":
* - if both dates are proper date strings
* - if provided date from is earlier than date to.
* @param stringifiedDateFrom Date "from" that should be validated.
* @param stringifiedDateTo Date "to" that should be validated.
* @returns Result of validation of dates range.
*/
isValidDateRange(stringifiedDateFrom: string, stringifiedDateTo: string): boolean;
/**
* Validates provided aggregation:
* @param aggregation Date "from" that should be validated.
* @returns Result of validation of aggregation.
*/
isValidAggregation(aggregation: aggregationType): boolean;
/**
* Calculates date time context according to provided interval.
* @param intervalId Interval id indicating time range.
* @returns Tuple of dates- the first one is date "from" according to selected interval, second one is date "to" (now).
*/
getDateTimeContextByInterval(intervalId: Interval['id']): DateTimeContext;
/**
* Defines priority for single action bar item of bar items that has the 'timecontext' groupId.
* Widgets that uses WidgetTimeContextComponent can be assigned to three levels of priority:
* HIGH priority means that widget is using time range pickers, realtime and aggregation features.
* Widgets: Data points graph, Data points graph 2.0, Data points table.
* MEDIUM priority means that widget is using time range pickers and realtime features.
* Widgets: Event list.
* LOW priority means that widget is using realtime feature only.
* Widgets: Map
* @param displaySettings Settings indicating which features of WidgetTimeContextComponent are used by widget.
* @returns priority of widget action bar item.
*/
getActionBarPriority(displaySettings: WidgetDisplaySettings): WidgetTimeContextActionBarPriority;
static ɵfac: i0.ɵɵFactoryDeclaration<WidgetTimeContextHelperService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<WidgetTimeContextHelperService>;
}
//# sourceMappingURL=widget-time-context-helper.service.d.ts.map