import { ApplicationAvailability, ApplicationType, FetchClient, IApplication, IApplicationBinary, InventoryBinaryService, InventoryService } from '@c8y/client';
import { ApplicationService } from '@c8y/client';
import { AppStateService, ThemeSwitcherService, ZipService } from '@c8y/ngx-components';
import { BehaviorSubject, Observable } from 'rxjs';
import { BrandingVersionService } from './branding-version.service';
import { BrandingOptionsJson } from './branding.type';
import { StaticAsset, StaticAssetsService } from '@c8y/ngx-components/static-assets/data';
import { BrandingTrackingService } from './branding-tracking.service';
import * as i0 from "@angular/core";
export interface BrandVersion {
    name: string;
    id: string;
    revision: number;
    version: string;
    tags: string[];
    owner?: string;
    lastUpdated?: string;
    publicOptionsApp?: IApplication;
}
export interface BrandingFileDetails {
    fileName: string;
    blob: Blob;
    jsonContent?: any;
}
export interface BrandingFileDetailsLegacy {
    path: string;
    value: string;
    blob?: Blob;
    fileName: string;
    urlWrapped: boolean;
}
/**
 * Service to load and store the branding of the tenant.
 */
export declare class StoreBrandingService {
    private applicationService;
    private inventory;
    private binary;
    private zip;
    private fetch;
    private brandingVersionService;
    private appState;
    private staticAssets;
    private themeSwitcher;
    private brandingTracking;
    readonly fileNames: {
        readonly options: "options.json";
        readonly manifest: "cumulocity.json";
        readonly exportZipName: "public-options.zip";
    };
    readonly manifestValues: {
        readonly name: "public-options";
        readonly contextPath: "public-options";
        readonly key: "public-options-key";
        readonly description: "Application containing static assets used by e.g. branding.";
        readonly noAppSwitcher: true;
        readonly type: ApplicationType.HOSTED;
        readonly availability: ApplicationAvailability.SHARED;
    };
    refreshTriggerBrandingVariants: BehaviorSubject<void>;
    constructor(applicationService: ApplicationService, inventory: InventoryService, binary: InventoryBinaryService, zip: ZipService, fetch: FetchClient, brandingVersionService: BrandingVersionService, appState: AppStateService, staticAssets: StaticAssetsService, themeSwitcher: ThemeSwitcherService, brandingTracking: BrandingTrackingService);
    /**
     * Sets the `latest` tag on the provided branding version. Making it the global active branding.
     */
    markAsActive(brandingVersion: BrandVersion, app?: IApplication): Promise<void>;
    /**
     * Opens a new tab with to preview the branding. The branding must have been saved beforehand.
     * @param brandingName the name of the branding to be previewed
     */
    openPreviewForBranding(brandingName: string): void;
    /**
     * Returns the brandings of the tenant.
     * If no public options app is found, publicOptions will be undefined and variants an empty array.
     * For old brandings (created without versioning) a default version is returned.
     */
    loadBrandingVariants(app?: IApplication): Promise<{
        publicOptions: IApplication | undefined;
        variants: BrandVersion[];
    }>;
    /**
     * As the branding is not immediately available after creation, this method will wait for the branding to be present.
     * @param version The version of the branding to be retrieved.
     */
    waitForBrandingToBePresent(version: string): Promise<void>;
    /**
     * Will create a the initial branding based on the currently applied CSS variables.
     */
    getStartedUsingBranding(): Promise<void>;
    getZipForBinary(binaryId: string, fileName?: string): Observable<File>;
    /**
     * Deletes the public options app and therefore all brandings.
     * The public options app can be optionally provided to avoid another request for it.
     */
    deleteAllBrandings(publicOptions?: IApplication): Promise<void>;
    /**
     * Enhances the provided branding versions with metadata from the linked binaries.
     * It will add the owner and lastUpdated fields to the versions.
     * The provided array is altered.
     */
    getMetadataOfBrandingBinaries(versions: BrandVersion[]): Promise<BrandVersion[]>;
    /**
     * Saves the provided branding as a new version for the public options app.
     * The public options app can be optionally provided to avoid another request for it.
     */
    saveBranding(blob: Blob | File, version: string, tags?: string[], publicOptionsApp?: IApplication): Promise<{
        version: string;
        binary: IApplicationBinary;
        tags: string[];
    }>;
    /**
     * Removes a branding version from the public options app.
     * The public options app can be optionally provided to avoid another request for it.
     */
    deleteBrandingVersion(version: string, publicOptions?: IApplication): Promise<void>;
    /**
     * Returns the blob of a zip file containing the provided branding options (options.json) and the manifest (cumulocity.json).
     */
    getBrandingZip(content?: Record<string, any>): Promise<Blob>;
    /**
     * Adds a new branding version to the public options app.
     * The public options app can be optionally provided to avoid another request for it.
     */
    addBranding(version: string, content?: BrandingOptionsJson, tags?: string[], publicOptionsApp?: IApplication): Promise<{
        version: string;
        binary: IApplicationBinary;
        tags: string[];
    }>;
    /**
     * Returns the branding options for the provided version.
     * If no branding was found (e.g. status 404), an error is thrown.
     */
    getBrandingOptionsForVersion(version?: string): Promise<BrandingOptionsJson>;
    /**
     * Saves a new iteration of an already existing branding.
     */
    saveExistingBranding(branding: Record<string, any>, currentVersion: string, tagsOfCurrentVersion?: string[], newVersion?: string): Promise<string>;
    /**
     * Combines current branding options with the provided branding variables and creates a new public options app.
     * Any assets in the branding will be cloned.
     */
    createPublicOptionsAppFromInheritedOptions(brandingVars?: Record<string, string>): Promise<{
        version: string;
        binary: IApplicationBinary;
        tags: string[];
    }>;
    /**
     * Replaces the assets in the branding options with the new assets.
     * Goes through the provided `oldAssets` and replaces their occurrences in the branding with the corresponding `newAssets` entry sharing the same fileName.
     * Returns the updated branding options.
     */
    replaceBrandingAssetsInBrandingOptions(branding: BrandingOptionsJson, oldAssets: StaticAsset[], newAssets: StaticAsset[]): BrandingOptionsJson;
    private getPublicOptionsApp;
    private createPublicOptionsApp;
    static ɵfac: i0.ɵɵFactoryDeclaration<StoreBrandingService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<StoreBrandingService>;
}
//# sourceMappingURL=store-branding.service.d.ts.map