import { ApplicationOptions, OptionsService, GainsightService, ZipService, AppStateService, ThemeSwitcherService } from '@c8y/ngx-components'; import * as _angular_forms from '@angular/forms'; import { FormBuilder, FormControl } from '@angular/forms'; import * as i0 from '@angular/core'; import { IApplication, ApplicationType, ApplicationAvailability, ApplicationService, InventoryService, InventoryBinaryService, FetchClient, IApplicationBinary } from '@c8y/client'; import { BehaviorSubject, Observable } from 'rxjs'; import { StaticAssetsService, StaticAsset } from '@c8y/ngx-components/static-assets/data'; type BrandingFormValue = ReturnType['value']; type BrandingFormKeys = keyof BrandingFormValue; type BrandingFormTopLevelKeys = (typeof brandingFormGroupTopLevelEntries)[number]; type BrandingFormTopLevelKeysToUnpack = (typeof brandingFormGroupTopLevelEntriesToUnpack)[number]; type TopLevelFormKeysNotToUnpack = Exclude; type UnpackedTopLevelFormKeys = Pick[keyof Pick]; type NotUnpackedTopLevelFormKeys = Pick; type TopLevelForm = NotUnpackedTopLevelFormKeys & UnpackedTopLevelFormKeys; type TopLevelValues = TopLevelForm; type BrandingCSSVarsForm = Omit; type LightBrandingCSSVarsValues = ReturnType['value'] & BrandingCSSVarsForm[keyof BrandingCSSVarsForm]; type addPrefixToObject = { [K in keyof T as K extends string ? `${P}${K}` : never]: T[K]; }; type DarkBrandingCSSVarsValues = addPrefixToObject; type BrandingCSSVarsValues = LightBrandingCSSVarsValues & DarkBrandingCSSVarsValues; type BrandingOptionsJson = TopLevelValues & { brandingCssVars?: BrandingCSSVarsValues & { [key: string]: any; }; } & Omit, 'brandingCssVars'> & { [key: string]: any; }; declare const brandingFormGroupTopLevelEntries: readonly ["cookieBanner", "genericApplicationOptions", "darkThemeAvailable", "messageBanner"]; declare const brandingFormGroupTopLevelEntriesToUnpack: readonly ["genericApplicationOptions"]; declare const numberBrandingVars: readonly ["brand-logo-img-height", "btn-border-radius-base"]; declare const colorBrandingVars: readonly ["brand-dark", "brand-light", "brand-primary", "c8y-brand-10", "c8y-brand-20", "c8y-brand-30", "c8y-brand-40", "c8y-brand-50", "c8y-brand-60", "c8y-brand-70", "c8y-brand-80", "palette-status-info", "palette-status-warning", "palette-status-success", "palette-status-danger", "palette-status-info-light", "palette-status-warning-light", "palette-status-success-light", "palette-status-danger-light", "palette-status-info-dark", "palette-status-warning-dark", "palette-status-success-dark", "palette-status-danger-dark", "body-background-color", "text-color", "text-muted", "link-color", "link-hover-color", "action-bar-background-default", "action-bar-color-actions-hover", "action-bar-color-actions", "action-bar-color-default", "action-bar-icon-color", "header-color", "header-text-color", "header-hover-color", "navigator-bg-color", "navigator-active-bg", "navigator-border-active", "navigator-header-bg", "navigator-title-color", "navigator-separator-color", "navigator-text-color", "navigator-color-active", "right-drawer-background-default", "right-drawer-text-color-default", "right-drawer-separator-color", "right-drawer-link-color", "right-drawer-link-color-hover", "right-drawer-text-color-muted"]; declare const stringBrandingVars: readonly ["brand-logo-img", "navigator-platform-logo", "login-platform-animation-img"]; declare const stringOrNumberBrandingVars: readonly ["navigator-platform-logo-height"]; declare const allBrandingCSSVars: readonly ["brand-logo-img-height", "btn-border-radius-base", "brand-logo-img", "navigator-platform-logo", "login-platform-animation-img", "brand-dark", "brand-light", "brand-primary", "c8y-brand-10", "c8y-brand-20", "c8y-brand-30", "c8y-brand-40", "c8y-brand-50", "c8y-brand-60", "c8y-brand-70", "c8y-brand-80", "palette-status-info", "palette-status-warning", "palette-status-success", "palette-status-danger", "palette-status-info-light", "palette-status-warning-light", "palette-status-success-light", "palette-status-danger-light", "palette-status-info-dark", "palette-status-warning-dark", "palette-status-success-dark", "palette-status-danger-dark", "body-background-color", "text-color", "text-muted", "link-color", "link-hover-color", "action-bar-background-default", "action-bar-color-actions-hover", "action-bar-color-actions", "action-bar-color-default", "action-bar-icon-color", "header-color", "header-text-color", "header-hover-color", "navigator-bg-color", "navigator-active-bg", "navigator-border-active", "navigator-header-bg", "navigator-title-color", "navigator-separator-color", "navigator-text-color", "navigator-color-active", "right-drawer-background-default", "right-drawer-text-color-default", "right-drawer-separator-color", "right-drawer-link-color", "right-drawer-link-color-hover", "right-drawer-text-color-muted"]; declare function createGenericBrandingForm(formBuilder: FormBuilder): _angular_forms.FormGroup<{ darkThemeAvailable: FormControl; cookieBanner: _angular_forms.FormGroup<{ cookieBannerTitle: FormControl; cookieBannerText: FormControl; cookieBannerDisabled: FormControl; policyUrl: FormControl; policyVersion: FormControl; }>; messageBanner: _angular_forms.FormGroup<{ messageBannerEnabled: FormControl; messageBannerContent: FormControl; messageBannerType: FormControl<"success" | "warning" | "danger" | "info" | "system">; messageBannerId: FormControl; }>; baseTypography: _angular_forms.FormGroup<{ 'font-url': FormControl; 'font-family-base': FormControl; }>; headingsAndNavigatorTypography: _angular_forms.FormGroup<{ 'font-family-headings': FormControl; 'navigator-font-family': FormControl; }>; genericApplicationOptions: _angular_forms.FormGroup<{ globalTitle: FormControl; faviconUrl: FormControl; }>; }>; declare function createBrandingForm(formBuilder: FormBuilder): _angular_forms.FormGroup<{ "navigator-platform-logo-height": FormControl; "brand-logo-img-height": FormControl; "btn-border-radius-base": FormControl; "brand-logo-img": FormControl; "navigator-platform-logo": FormControl; "login-platform-animation-img": FormControl; "brand-dark": FormControl; "brand-light": FormControl; "brand-primary": FormControl; "c8y-brand-10": FormControl; "c8y-brand-20": FormControl; "c8y-brand-30": FormControl; "c8y-brand-40": FormControl; "c8y-brand-50": FormControl; "c8y-brand-60": FormControl; "c8y-brand-70": FormControl; "c8y-brand-80": FormControl; "palette-status-info": FormControl; "palette-status-warning": FormControl; "palette-status-success": FormControl; "palette-status-danger": FormControl; "palette-status-info-light": FormControl; "palette-status-warning-light": FormControl; "palette-status-success-light": FormControl; "palette-status-danger-light": FormControl; "palette-status-info-dark": FormControl; "palette-status-warning-dark": FormControl; "palette-status-success-dark": FormControl; "palette-status-danger-dark": FormControl; "body-background-color": FormControl; "text-color": FormControl; "text-muted": FormControl; "link-color": FormControl; "link-hover-color": FormControl; "action-bar-background-default": FormControl; "action-bar-color-actions-hover": FormControl; "action-bar-color-actions": FormControl; "action-bar-color-default": FormControl; "action-bar-icon-color": FormControl; "header-color": FormControl; "header-text-color": FormControl; "header-hover-color": FormControl; "navigator-bg-color": FormControl; "navigator-active-bg": FormControl; "navigator-border-active": FormControl; "navigator-header-bg": FormControl; "navigator-title-color": FormControl; "navigator-separator-color": FormControl; "navigator-text-color": FormControl; "navigator-color-active": FormControl; "right-drawer-background-default": FormControl; "right-drawer-text-color-default": FormControl; "right-drawer-separator-color": FormControl; "right-drawer-link-color": FormControl; "right-drawer-link-color-hover": FormControl; "right-drawer-text-color-muted": FormControl; }>; declare class ApplyBrandingLocallyService { private options; private keysToRemove; constructor(options: OptionsService); applyBranding(optionsJson?: BrandingOptionsJson): void; resetBranding(): void; private applyApplicationOptions; private removeKeysFromOptions; private combineOptions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class BrandingShadesService { getShadeColorBrandingCssVars(newBrandPrimary: string): Record<`c8y-brand-${number}0`, string>; isValidShadeColor(color: string): boolean; hasCustomShadesSet(previousBrandPrimary: string, otherVars: Record): boolean; private shadesToObject; private generateShades; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Service for creating and manipulating branding versions. */ declare class BrandingVersionService { static readonly nameAndIterationSeparator = "-"; /** * Creates the initial branding version for a given name. * @param name The name of the branding. * @returns The initial branding version. */ createInitialBrandingVersion(name: T): `${T}-1`; /** * Splits a branding version into its name and iteration. * @param version The branding version to split. * @returns The name and iteration of the branding version. * * Errors are thrown if the version is not in the expected format. */ splitBrandingIntoNameAndIteration(version: string): { name: string; iteration: number; }; /** * Bumps the iteration of a branding version. * @param version The branding version to bump. * @returns The bumped branding version. * * Errors are thrown if the version is not in the expected format. */ bumpBrandingIteration(version: string): `${string}-${number}`; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class BrandingTrackingService { private gainsight; readonly prefix = "brandingManager"; constructor(gainsight: GainsightService); getStartedUsingBranding(): void; deleteAllBrandings(): void; exportBranding(): void; addNewVersion(): void; duplicateVersion(): void; applyToApps(apps: string[]): void; importBranding(): void; deleteBrandingVariant(): void; openPreviewForBranding(): void; private triggerEvent; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface BrandVersion { name: string; id: string; revision: number; version: string; tags: string[]; owner?: string; lastUpdated?: string; publicOptionsApp?: IApplication; } interface BrandingFileDetails { fileName: string; blob: Blob; jsonContent?: any; } interface BrandingFileDetailsLegacy { path: string; value: string; blob?: Blob; fileName: string; urlWrapped: boolean; } /** * Service to load and store the branding of the tenant. */ 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; 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; /** * 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; /** * Will create a the initial branding based on the currently applied CSS variables. */ getStartedUsingBranding(): Promise; getZipForBinary(binaryId: string, fileName?: string): Observable; /** * 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; /** * 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; /** * 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; /** * Returns the blob of a zip file containing the provided branding options (options.json) and the manifest (cumulocity.json). */ getBrandingZip(content?: Record): Promise; /** * 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; /** * Saves a new iteration of an already existing branding. */ saveExistingBranding(branding: Record, currentVersion: string, tagsOfCurrentVersion?: string[], newVersion?: string): Promise; /** * 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): 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; static ɵprov: i0.ɵɵInjectableDeclaration; } export { ApplyBrandingLocallyService, BrandingShadesService, BrandingTrackingService, BrandingVersionService, StoreBrandingService, allBrandingCSSVars, brandingFormGroupTopLevelEntries, brandingFormGroupTopLevelEntriesToUnpack, colorBrandingVars, createBrandingForm, createGenericBrandingForm, numberBrandingVars, stringBrandingVars, stringOrNumberBrandingVars }; export type { BrandVersion, BrandingCSSVarsForm, BrandingCSSVarsValues, BrandingFileDetails, BrandingFileDetailsLegacy, BrandingFormKeys, BrandingFormTopLevelKeys, BrandingFormTopLevelKeysToUnpack, BrandingFormValue, BrandingOptionsJson, DarkBrandingCSSVarsValues, LightBrandingCSSVarsValues, NotUnpackedTopLevelFormKeys, TopLevelForm, TopLevelFormKeysNotToUnpack, TopLevelValues, UnpackedTopLevelFormKeys }; //# sourceMappingURL=index.d.ts.map