import * as i0 from '@angular/core';
import { TemplateRef, ElementRef, OnDestroy, OnInit, DestroyRef, ChangeDetectorRef, Type, AfterViewInit, Injector, EventEmitter, Signal, ModuleWithProviders } from '@angular/core';
import { FdkAsyncProperty, Nullable, HasElementRef } from '@fundamental-ngx/cdk/utils';
import * as i1 from '@fundamental-ngx/platform/form';
import { BaseDynamicFormFieldItem, AnyDynamicFormFieldItem, DynamicFormItem, FormGeneratorComponent, FormGeneratorService, BaseDynamicFormGeneratorControl } from '@fundamental-ngx/platform/form';
import { ListAvatarConfig, ListIconConfig } from '@fundamental-ngx/platform/list';
import { Observable, BehaviorSubject, Subject } from 'rxjs';
import * as _fundamental_ngx_platform_settings_generator from '@fundamental-ngx/platform/settings-generator';
import { TabConfig, IconTabBarItem } from '@fundamental-ngx/platform/icon-tab-bar';

/**
 * Form generator control to render theme list.
 */
interface ThemeSelectorDynamicFormItem extends BaseDynamicFormFieldItem {
    type: 'theme-list';
}
type SettingsGeneratorDynamicFormItem<TAdditionalControlTypes extends BaseDynamicFormFieldItem = AnyDynamicFormFieldItem> = DynamicFormItem<Record<string, any>, ThemeSelectorDynamicFormItem | TAdditionalControlTypes>;
type SettingsModel<TAdditionalControlTypes extends BaseDynamicFormFieldItem = AnyDynamicFormFieldItem, TAdditionalLayoutType extends BaseSettingsModel<TAdditionalControlTypes> = BaseSettingsModel<TAdditionalControlTypes>> = SidebarSettingsModel<TAdditionalControlTypes> | TAdditionalLayoutType;
interface BaseSettingsModel<TAdditionalControlTypes extends BaseDynamicFormFieldItem> {
    /** Appearance type. */
    appearance: string;
    /** Settings items. */
    items: SettingsItem<TAdditionalControlTypes>[];
}
interface SidebarSettingsModel<TAdditionalControlTypes extends BaseDynamicFormFieldItem> extends BaseSettingsModel<TAdditionalControlTypes> {
    appearance: 'sidebar';
    /**
     * Sidebar width configuration.
     */
    sidebarWidth: string | SidebarWidthConfiguration;
}
interface SettingsFormTab<TAdditionalControlTypes extends BaseDynamicFormFieldItem = AnyDynamicFormFieldItem> {
    /** Title of the tab. */
    title: FdkAsyncProperty<string>;
    /** @hidden */
    template?: never;
    /** ID of the tab. Will be used as a key in resulting form object. */
    id: string;
    /** Items array. */
    items: SettingsGeneratorDynamicFormItem<TAdditionalControlTypes>[];
}
interface SettingsTemplateTab {
    /** Title of the tab. */
    title: FdkAsyncProperty<string>;
    /** @hidden */
    items?: never;
    /** @hidden */
    id?: never;
    /** Template Reference for tab content. */
    template: TemplateRef<any>;
}
interface BaseSettingsItem {
    /** Settings item title. */
    title: FdkAsyncProperty<string>;
    /** Settings item icon. */
    thumbnail?: ThumbnailSettingsItem;
    /** Settings item description. */
    description?: FdkAsyncProperty<string>;
    /** Settings section title. */
    sectionTitle?: FdkAsyncProperty<string>;
    /** Whether to wrap the title text in the main section content. By default, the text will be truncated. */
    wrapSectionTitle?: boolean;
}
interface IconBaseSettingsItem {
    /** Settings item icon configuration. */
    icon: Partial<ListIconConfig> | string | Observable<Partial<ListIconConfig> | string>;
    /** @hidden */
    avatar?: never;
}
interface AvatarBaseSettingsItem {
    /** Settings item avatar configuration. */
    avatar: Partial<ListAvatarConfig> | string | Observable<Partial<ListAvatarConfig> | string>;
    /** @hidden */
    icon?: never;
}
type ThumbnailSettingsItem = AvatarBaseSettingsItem | IconBaseSettingsItem;
type SettingsItem<TAdditionalControlTypes extends BaseDynamicFormFieldItem = AnyDynamicFormFieldItem> = FormSettingsItem<TAdditionalControlTypes> | TemplateSettingsItem | GroupedFormSettingsItem<TAdditionalControlTypes> | GroupedTemplateSettingsItem;
interface FormSettingsItem<TAdditionalControlTypes extends BaseDynamicFormFieldItem = AnyDynamicFormFieldItem> extends BaseSettingsItem {
    /** Settings item form controls. */
    items: SettingsGeneratorDynamicFormItem<TAdditionalControlTypes>[];
    /** @hidden */
    template?: never;
    /** ID Of the section. Will be used as a key in resulting form object. */
    id: string;
}
interface GroupedFormSettingsItem<TAdditionalControlTypes extends BaseDynamicFormFieldItem = AnyDynamicFormFieldItem> extends BaseSettingsItem {
    /** @hidden */
    items?: never;
    /** @hidden */
    template?: never;
    /** ID if the group. Will be used as a key in resulting form object. */
    id: string;
    /** Groups array. */
    groups: SettingsFormTab<TAdditionalControlTypes>[];
}
interface TemplateSettingsItem extends BaseSettingsItem {
    /** @hidden */
    items?: never;
    /** @hidden */
    id?: string;
    /** Template reference to be rendered as section content. */
    template: TemplateRef<any>;
}
interface GroupedTemplateSettingsItem extends BaseSettingsItem {
    /** @hidden */
    id?: string;
    /** @hidden */
    items?: never;
    /** @hidden */
    template?: never;
    /** Groups array. */
    groups: SettingsTemplateTab[];
}
interface SidebarWidthConfiguration {
    /** Min width. */
    minWidth?: string;
    /** Max width. */
    maxWidth?: string;
    /** Width. */
    width?: string;
    /** Whether to wrap the title text in the sidebar. By default, the text will truncate. */
    wrapSidebarTitle?: boolean;
    /** Whether to wrap the description text in the sidebar. By default, the text will truncate. */
    wrapSidebarDescription?: boolean;
}

interface BaseSettingsGeneratorConfig<TAdditionalLayouts extends string = string> {
    defaultLayout?: TAdditionalLayouts;
}
interface SidebarSettingsGeneratorConfig extends BaseSettingsGeneratorConfig<'sidebar'> {
    /**
     * Sidebar configuration.
     */
    sidebar: {
        /**
         * Maximum width in pixels of Settings Generator Component, when sidebar should be rendered as toggleable with absolute positioning.
         */
        mobileBreakpoint: number;
        /**
         * Sidebar width configuration.
         */
        width: string | SidebarWidthConfiguration;
    };
}
type SettingsConfig<TAdditionalLayouts extends string = string, TAdditionalProperties extends Record<string, unknown> = Record<string, unknown>> = SidebarSettingsGeneratorConfig | (BaseSettingsGeneratorConfig<TAdditionalLayouts> & TAdditionalProperties);

interface SettingsGenerator {
    elementRef: ElementRef;
}

type SettingsGeneratorReturnValue = Record<string, unknown>;
declare class SettingsGeneratorService implements OnDestroy {
    /**
     * Settings configuration subject.
     */
    readonly settings: BehaviorSubject<Nullable<SettingsModel>>;
    /**
     * Stream emitted when user clicked on message popover error entry.
     */
    readonly onItemFocus: Subject<{
        path: string;
        element: ElementRef<HTMLElement>;
    }>;
    /**
     * Stream emitted when mobile state has been changed.
     */
    readonly mobileState$: BehaviorSubject<boolean>;
    /**
     * @hidden
     * Form generators collected from all items and groups.
     */
    private readonly _formGenerators;
    /** @hidden */
    private readonly _messagePopover;
    /** @hidden */
    private readonly _destroyRef;
    /** @hidden */
    constructor();
    /** @hidden */
    _addFormGenerator(path: string[], formGenerator: FormGeneratorComponent): void;
    /** @hidden */
    _removeFormGenerator(path: string[]): void;
    /**
     * Submits registered forms and emits result if submission status was successful (no errors).
     */
    submit(): Observable<SettingsGeneratorReturnValue>;
    /**
     * Sets mobile state.
     * @param isMobile Whether mobile state should be applied.
     */
    setMobileState(isMobile: boolean): void;
    /** @hidden */
    ngOnDestroy(): void;
    /**
     * @hidden
     * Subscribes to click events from message popover and tries to open the section where invalid input is located.
     */
    private _listenToMessagePopoverItemClick;
    static ɵfac: i0.ɵɵFactoryDeclaration<SettingsGeneratorService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SettingsGeneratorService>;
}

declare abstract class BaseSettingsGeneratorLayout implements OnInit {
    /**
     * Subject to notify subscriptions to unsubscribe when component destroys.
     */
    protected abstract _destroyRef: DestroyRef;
    /**
     * Method for focusing inner form control.
     * It is responsible for activating the section and placing focus on the element.
     * @param path path of the control joined by dot(.). Usually represents section ID and inner group ID.
     * @param element ElementRef of native element to focus.
     */
    abstract focusElementByPath(path: string, element: ElementRef<HTMLElement>): void;
    /**
     * Settings schema.
     */
    settings: Nullable<SettingsModel>;
    /**
     * Settings generator service.
     */
    protected readonly _settingsGeneratorService: SettingsGeneratorService;
    /**
     * Change detector ref.
     */
    protected readonly _cdr: ChangeDetectorRef;
    /**
     * Settings generator component ref.
     */
    protected _settingsGenerator: _fundamental_ngx_platform_settings_generator.SettingsGenerator;
    /** @hidden */
    ngOnInit(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<BaseSettingsGeneratorLayout, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<BaseSettingsGeneratorLayout, never, never, {}, {}, never, never, true, never>;
}

/**
 * Service, used as a registry of the available layouts for Settings Generator Component.
 */
declare class SettingsGeneratorLayoutAccessorService {
    /** @hidden */
    private readonly _layouts;
    /**
     * Adds custom layout component to layouts registry for later usage with Settings Generator component.
     * @param layoutName Name of the Layout
     * @param layoutComponent Component type to be used for defined layout.
     */
    addLayout(layoutName: string, layoutComponent: Type<BaseSettingsGeneratorLayout>): void;
    /**
     * Gets Component type for defined layout.
     * @param layoutName
     */
    getLayout(layoutName: string): Nullable<Type<BaseSettingsGeneratorLayout>>;
    static ɵfac: i0.ɵɵFactoryDeclaration<SettingsGeneratorLayoutAccessorService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SettingsGeneratorLayoutAccessorService>;
}

declare class SettingsGeneratorComponent implements SettingsGenerator, AfterViewInit, OnDestroy, HasElementRef {
    private readonly _fgService;
    private readonly _settingsLayoutService;
    private readonly _injector;
    private readonly _cdr;
    private readonly _destroyRef;
    private readonly _config;
    /** @hidden */
    private readonly _initialClass;
    /** @hidden */
    private readonly _viewRef;
    /**
     * Settings Generator Element Ref.
     */
    readonly elementRef: ElementRef<HTMLElement>;
    /**
     * Settings configuration.
     */
    set settings(value: Nullable<SettingsModel>);
    get settings(): Nullable<SettingsModel>;
    /**
     * Container height.
     */
    height: i0.InputSignal<string | undefined>;
    /**
     * Container width.
     */
    width: i0.InputSignal<string | undefined>;
    /** @hidden */
    private _settings;
    /** @hidden */
    private readonly _settingsGeneratorService;
    /** @hidden */
    private _currentLayout;
    /** @hidden */
    private readonly _viewReady;
    /** @hidden */
    private _viewReadySub;
    /** @hidden */
    private _layoutComponentRef;
    /** @hidden */
    constructor(_fgService: FormGeneratorService, _settingsLayoutService: SettingsGeneratorLayoutAccessorService, _injector: Injector, _cdr: ChangeDetectorRef, _destroyRef: DestroyRef, _config: SettingsConfig);
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    ngOnDestroy(): void;
    /**
     * Programmatically submit inner forms of the settings generator.
     * @returns Observable with settings value grouped by main sections and inner sections.
     */
    submit(): Observable<SettingsGeneratorReturnValue>;
    /** @hidden */
    private _setLayout;
    static ɵfac: i0.ɵɵFactoryDeclaration<SettingsGeneratorComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SettingsGeneratorComponent, "fdp-settings-generator", never, { "settings": { "alias": "settings"; "required": false; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class SettingsGeneratorSidebarLayoutComponent extends BaseSettingsGeneratorLayout implements OnInit, AfterViewInit {
    /** @hidden */
    _isMobile: boolean;
    /** @hidden */
    private readonly _initialClass;
    /** @hidden */
    private readonly _settingsGeneratorContent;
    /** @hidden */
    private _listElement;
    /** @hidden */
    searchTerm: string;
    /**
     * Selected settings section.
     */
    _selectedIndex: number;
    /** @hidden */
    _sidebarWidth: SidebarWidthConfiguration;
    /** @hidden */
    protected _destroyRef: DestroyRef;
    /** @hidden */
    private readonly _config;
    /** @hidden */
    private _sidebarVisible;
    /** @hidden */
    private _initialSelectedItemSet;
    /** @hidden */
    get _mobileSidebarVisible(): boolean;
    /** @hidden */
    constructor();
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    focusElementByPath(path: string, element: ElementRef<HTMLElement>): void;
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    _displaySettingsSearchInput(): boolean;
    /** @hidden */
    _setSelectedIndex(index: number): void;
    /** @Hidden */
    _goBack(): void;
    /** @hidden */
    private _getNormalizedSidebarWidth;
    /** @hidden */
    private _isSidebarSettings;
    /** @hidden */
    private _isFormGeneratorSection;
    static ɵfac: i0.ɵɵFactoryDeclaration<SettingsGeneratorSidebarLayoutComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SettingsGeneratorSidebarLayoutComponent, "fdp-settings-generator-sidebar-layout", never, {}, {}, never, never, true, never>;
}

declare class SettingsGeneratorContentComponent {
    /** @hidden */
    set settings(value: Nullable<SettingsItem>);
    get settings(): Nullable<SettingsItem>;
    /** Whether to render content component in mobile view. */
    mobile: boolean;
    /** Event emits when user needs to be moved back to navigation screen. */
    goBack: EventEmitter<void>;
    /** @hidden */
    private readonly _initialClass;
    /** @hidden */
    private readonly _tabPanels;
    /** Optional alternative text for the settings generator dialog back button. */
    backButtonLabel: i0.InputSignal<string | undefined>;
    /** @hidden */
    _id: Nullable<string>;
    /** @hidden */
    _renderer$: Signal<"form" | "template">;
    /** @hidden */
    _contentLayout$: Signal<"form" | "tabs">;
    /** @hidden */
    _groups$: Signal<(SettingsTemplateTab | SettingsFormTab)[]>;
    /** @hidden */
    _tabs$: Signal<TabConfig[]>;
    /** @hidden */
    _index: number;
    /** @hidden */
    readonly _activeTab$: i0.WritableSignal<number>;
    /** @hidden */
    readonly _settings$: i0.WritableSignal<Nullable<SettingsItem>>;
    /** @hidden */
    private _settings;
    /** @hidden */
    isTemplateLayout(settings: Nullable<SettingsItem>): settings is TemplateSettingsItem;
    /** @hidden */
    isGroupedSettings(settings: any): settings is GroupedFormSettingsItem | GroupedTemplateSettingsItem;
    /** @hidden */
    changeTab(item: IconTabBarItem): void;
    /**
     * Activates tab by group ID.
     * @param id ID of the group.
     */
    setActiveTab(id: string): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SettingsGeneratorContentComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SettingsGeneratorContentComponent, "fdp-settings-generator-content", never, { "settings": { "alias": "settings"; "required": false; }; "mobile": { "alias": "mobile"; "required": false; }; "backButtonLabel": { "alias": "backButtonLabel"; "required": false; "isSignal": true; }; }, { "goBack": "goBack"; }, never, never, true, never>;
}

type SettingsSectionItemsModel = SettingsTemplateTab | SettingsFormTab | SettingsItem;
declare class SettingsGeneratorSectionComponent {
    /**
     * Group name. Used to define full path of the inner form.
     */
    groupName: Nullable<string>;
    /**
     * Section items.
     * @param value {Nullable<SettingsSectionItemsModel>} Can be either a template Ref, or Form generator items.
     */
    set items(value: Nullable<SettingsSectionItemsModel>);
    get items(): Nullable<SettingsSectionItemsModel>;
    /** @hidden */
    _renderer: 'form' | 'template';
    /** @hidden */
    _templateRef: TemplateRef<any> | null;
    /** @hidden */
    _formItems: DynamicFormItem[];
    /** @hidden */
    private readonly _settingsGeneratorService;
    /** @hidden */
    private _items;
    /** @hidden */
    private set _formGeneratorCmp(value);
    /** @hidden */
    _isTemplateLayout(settings: any): settings is TemplateSettingsItem;
    static ɵfac: i0.ɵɵFactoryDeclaration<SettingsGeneratorSectionComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SettingsGeneratorSectionComponent, "fdp-settings-generator-section", never, { "groupName": { "alias": "groupName"; "required": false; }; "items": { "alias": "items"; "required": false; }; }, {}, never, never, true, never>;
}

declare class ThemeSelectorListComponent extends BaseDynamicFormGeneratorControl implements OnInit {
    /** @hidden */
    currentTheme: string;
    /** @hidden */
    private readonly _themingService;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    setTheme(value: string): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ThemeSelectorListComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ThemeSelectorListComponent, "fdp-theme-selector-list", never, {}, {}, never, never, true, never>;
}
declare class ThemeSelectorListIconComponent {
    /** @hidden */
    size: number;
    static ɵfac: i0.ɵɵFactoryDeclaration<ThemeSelectorListIconComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ThemeSelectorListIconComponent, "fdp-theme-selector-list-icon", never, { "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
}

declare class SettingsGeneratorSidebarIconComponent {
    /** Thumbnail configuration. */
    set thumbnail(value: ThumbnailSettingsItem);
    get thumbnail(): ThumbnailSettingsItem;
    /** @hidden */
    _avatarConfig: ListAvatarConfig | undefined;
    /** @hidden */
    _iconConfig: ListIconConfig | undefined;
    /** @hidden */
    private _thumbnail;
    /** @hidden */
    private readonly _destroyRef;
    /** @hidden */
    private readonly _cdr;
    /** @hidden */
    private _transformAvatarConfig;
    /** @Hidden */
    private _transformIconConfig;
    /** @hidden */
    private _getConfigFromObservable;
    static ɵfac: i0.ɵɵFactoryDeclaration<SettingsGeneratorSidebarIconComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SettingsGeneratorSidebarIconComponent, "fdp-settings-generator-sidebar-icon", never, { "thumbnail": { "alias": "thumbnail"; "required": false; }; }, {}, never, never, true, never>;
}

declare class SettingsGeneratorModule {
    /**
     * Allows configuring module on a global level with custom configuration.
     * @param config User's custom configuration.
     */
    static withConfig(config: Partial<SettingsConfig>): ModuleWithProviders<SettingsGeneratorModule>;
    static ɵfac: i0.ɵɵFactoryDeclaration<SettingsGeneratorModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<SettingsGeneratorModule, never, [typeof i1.PlatformFormGeneratorModule, typeof SettingsGeneratorComponent, typeof SettingsGeneratorSidebarLayoutComponent, typeof SettingsGeneratorContentComponent, typeof SettingsGeneratorSectionComponent, typeof ThemeSelectorListComponent, typeof ThemeSelectorListIconComponent, typeof SettingsGeneratorSidebarIconComponent], [typeof SettingsGeneratorComponent, typeof SettingsGeneratorSidebarLayoutComponent, typeof SettingsGeneratorContentComponent, typeof SettingsGeneratorSectionComponent, typeof ThemeSelectorListIconComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<SettingsGeneratorModule>;
}

declare const FDP_SETTINGS_GENERATOR_DEFAULT_CONFIG: SidebarSettingsGeneratorConfig;

export { BaseSettingsGeneratorLayout, FDP_SETTINGS_GENERATOR_DEFAULT_CONFIG, SettingsGeneratorComponent, SettingsGeneratorContentComponent, SettingsGeneratorLayoutAccessorService, SettingsGeneratorModule, SettingsGeneratorSectionComponent, SettingsGeneratorService, SettingsGeneratorSidebarIconComponent, SettingsGeneratorSidebarLayoutComponent, ThemeSelectorListComponent, ThemeSelectorListIconComponent };
export type { AvatarBaseSettingsItem, BaseSettingsGeneratorConfig, BaseSettingsItem, BaseSettingsModel, FormSettingsItem, GroupedFormSettingsItem, GroupedTemplateSettingsItem, IconBaseSettingsItem, SettingsConfig, SettingsFormTab, SettingsGenerator, SettingsGeneratorDynamicFormItem, SettingsGeneratorReturnValue, SettingsItem, SettingsModel, SettingsSectionItemsModel, SettingsTemplateTab, SidebarSettingsGeneratorConfig, SidebarSettingsModel, SidebarWidthConfiguration, TemplateSettingsItem, ThemeSelectorDynamicFormItem, ThumbnailSettingsItem };
