@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
56 lines (52 loc) • 1.83 kB
TypeScript
import { ControlValueAccessor } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
import * as i0 from '@angular/core';
declare enum TimeSpanInMs {
'MINUTE' = 60000,
'HOUR' = 3600000,
'DAY' = 86400000,
'WEEK' = 604800000,
'MONTH'
}
type Interval = {
id: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'custom';
title: string;
timespanInMs?: number;
};
type AlarmFilterInterval = Interval | {
id: 'none';
title: string;
timespanInMs?: number;
};
declare const INTERVALS: Interval[];
declare const INTERVAL_TITLES: Record<Interval['id'], string>;
type IntervalKey = Interval['id'];
type IntervalMap = {
[K in IntervalKey]: K;
};
declare const INTERVAL_VALUES: IntervalMap;
declare class IntervalPickerComponent implements ControlValueAccessor {
private translate;
INTERVALS: Interval[] | AlarmFilterInterval[];
value: Interval['id'];
touched: boolean;
disabled: boolean;
translatedIntervals: {
id: string;
title: string;
}[];
constructor(translate: TranslateService);
ngOnInit(): void;
onChange: (_: any) => void;
onTouched: () => void;
writeValue(value: Interval['id']): void;
registerOnChange(fn: any): void;
registerOnTouched(onTouched: any): void;
markAsTouched(): void;
setDisabledState(disabled: boolean): void;
static ɵfac: i0.ɵɵFactoryDeclaration<IntervalPickerComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<IntervalPickerComponent, "c8y-interval-picker", never, { "INTERVALS": { "alias": "INTERVALS"; "required": false; }; }, {}, never, never, true, never>;
}
export { INTERVALS, INTERVAL_TITLES, INTERVAL_VALUES, IntervalPickerComponent, TimeSpanInMs };
export type { AlarmFilterInterval, Interval };
//# sourceMappingURL=index.d.ts.map