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<string>;
    getStyling(config: ImageWidgetConfig): ImageWidgetStyle | null;
    static ɵfac: i0.ɵɵFactoryDeclaration<ImageWidgetService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ImageWidgetService>;
}

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<string>;
    imageSrc$: Observable<string>;
    loading: boolean;
    formGroup: FormGroup;
    fileFromConfig: File;
    styling: ImageWidgetStyle | null;
    destroyed$: Subject<void>;
    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<TemplateRef<any>>;
    constructor(formBuilder: FormBuilder, form: NgForm, fileService: FilesService, alert: AlertService, imageWidget: ImageWidgetService, widgetConfig: WidgetConfigComponent, widgetConfigService: WidgetConfigService);
    onBeforeSave(config?: ImageWidgetConfig): Promise<boolean>;
    ngOnInit(): void;
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    private getDashboardMoId;
    private initForm;
    private getFileFromFormValue;
    private setStyling;
    static ɵfac: i0.ɵɵFactoryDeclaration<ImageWidgetConfigComponent, [null, null, null, null, null, { optional: true; }, null]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ImageWidgetConfigComponent, "c8y-image-widget-config", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}

declare class ImageWidgetViewComponent implements OnChanges {
    private imageWidget;
    config: ImageWidgetConfig;
    imageBinaryId$: BehaviorSubject<string>;
    imageDetails$: Observable<{
        file: File;
        base64: string;
    }>;
    styling: ImageWidgetStyle | null;
    loading: boolean;
    constructor(imageWidget: ImageWidgetService);
    ngOnChanges(changes: SimpleChanges): void;
    private setStyling;
    static ɵfac: i0.ɵɵFactoryDeclaration<ImageWidgetViewComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ImageWidgetViewComponent, "c8y-image-widget-view", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}

export { ImageWidgetConfigComponent, ImageWidgetService, ImageWidgetViewComponent, defaultObjectFitValue, defaultObjectPositionValue };
export type { ImageWidgetConfig, ImageWidgetConfigStyling, ImageWidgetStyle };
//# sourceMappingURL=index.d.ts.map
