import * as i0 from '@angular/core'; import { OnInit, OnDestroy, AfterViewInit, QueryList, TemplateRef, OnChanges, SimpleChanges } from '@angular/core'; import { FormGroup, FormBuilder, NgForm } from '@angular/forms'; import { FilesService, AlertService, OnBeforeSave } from '@c8y/ngx-components'; import { WidgetConfigComponent, WidgetConfigService } from '@c8y/ngx-components/context-dashboard'; import { BehaviorSubject, Observable, Subject } from 'rxjs'; import { InventoryService, InventoryBinaryService } from '@c8y/client'; import { TranslateService } from '@ngx-translate/core'; interface ImageWidgetConfig { imageBinaryId: string; styling?: ImageWidgetConfigStyling; } interface ImageWidgetConfigStyling { objectFit: string; objectPositionX: string; objectPositionY: string; } interface ImageWidgetStyle { [key: string]: string; } declare const defaultObjectFitValue = "contain"; declare const defaultObjectPositionValue = "center"; declare class ImageWidgetService { private inventory; private fileService; private alert; private translate; private binary; constructor(inventory: InventoryService, fileService: FilesService, alert: AlertService, translate: TranslateService, binary: InventoryBinaryService); getImageDetails(imageBinaryId: string | null): Promise<{ file: File; base64: string; c8y_SHA256: string; }>; uploadFile(file: File, options?: { dashboardMoId?: string; isDeviceTypeDashboard?: boolean; }): Promise; getStyling(config: ImageWidgetConfig): ImageWidgetStyle | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ImageWidgetConfigComponent implements OnInit, OnDestroy, OnBeforeSave, AfterViewInit { private formBuilder; private form; private fileService; private alert; private imageWidget; private widgetConfig; private widgetConfigService; config: ImageWidgetConfig; imageBinaryId$: BehaviorSubject; imageSrc$: Observable; loading: boolean; formGroup: FormGroup; fileFromConfig: File; styling: ImageWidgetStyle | null; destroyed$: Subject; objectFitOptions: ({ label: "Contain`verb, image fitting option`"; value: string; description: "The image is entirely displayed within the widget while preserving the aspect ratio."; } | { label: "Cover`verb, image fitting option`"; value: string; description: "The image is resized to fill the widget while preserving the aspect ratio. Overflowing areas are clipped."; } | { label: "Fill`verb, image fitting option`"; value: string; description: "The image is stretched to fill the widget, overriding the aspect-ratio."; } | { label: "Full width`image fitting option`"; value: string; description: "The image is resized to fit the widget's width while preserving the aspect ratio. Overflowing area is scrollable."; })[]; imagePreviewTemplate: QueryList>; constructor(formBuilder: FormBuilder, form: NgForm, fileService: FilesService, alert: AlertService, imageWidget: ImageWidgetService, widgetConfig: WidgetConfigComponent, widgetConfigService: WidgetConfigService); onBeforeSave(config?: ImageWidgetConfig): Promise; ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; private getDashboardMoId; private initForm; private getFileFromFormValue; private setStyling; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ImageWidgetViewComponent implements OnChanges { private imageWidget; config: ImageWidgetConfig; imageBinaryId$: BehaviorSubject; imageDetails$: Observable<{ file: File; base64: string; }>; styling: ImageWidgetStyle | null; loading: boolean; constructor(imageWidget: ImageWidgetService); ngOnChanges(changes: SimpleChanges): void; private setStyling; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { ImageWidgetConfigComponent, ImageWidgetService, ImageWidgetViewComponent, defaultObjectFitValue, defaultObjectPositionValue }; export type { ImageWidgetConfig, ImageWidgetConfigStyling, ImageWidgetStyle }; //# sourceMappingURL=index.d.ts.map