import { OverflowPriority, CssClassBuilder, Nullable, ResizeObserverService } from '@fundamental-ngx/cdk/utils';
import * as i0 from '@angular/core';
import { InjectionToken, AfterViewInit, AfterViewChecked, AfterContentInit, ElementRef, ChangeDetectorRef, DestroyRef, Injector } from '@angular/core';
import { HeadingLevel, DynamicPageHeader } from '@fundamental-ngx/core/shared';
import * as i1 from '@fundamental-ngx/core/content-density';
import { ContentDensityObserver } from '@fundamental-ngx/core/content-density';
import { TitleToken } from '@fundamental-ngx/core/title';
import { Observable } from 'rxjs';

declare abstract class ToolbarItem {
    abstract element: HTMLElement;
    abstract isSpacer: boolean;
    abstract width: number;
    abstract priority: OverflowPriority;
    abstract group: number;
}

declare const FD_TOOLBAR: InjectionToken<unknown>;

declare class ToolbarItemDirective implements ToolbarItem {
    /** The priority of the item. */
    fdOverflowPriority: OverflowPriority;
    /** The group number of the item. */
    fdOverflowGroup: number;
    /** @hidden */
    get group(): number;
    /** @hidden */
    get priority(): OverflowPriority;
    /** @hidden */
    get element(): HTMLElement;
    /** @hidden */
    get isSpacer(): boolean;
    /** @hidden */
    get width(): number;
    /** @hidden */
    private lastWidth;
    /** @hidden */
    private readonly _elementRef;
    static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarItemDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<ToolbarItemDirective, "[fd-toolbar-item], [fdOverflowGroup], [fdOverflowPriority]", never, { "fdOverflowPriority": { "alias": "fdOverflowPriority"; "required": false; }; "fdOverflowGroup": { "alias": "fdOverflowGroup"; "required": false; }; }, {}, never, never, true, never>;
}

declare class ToolbarFormLabelDirective extends ToolbarItemDirective {
    static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarFormLabelDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<ToolbarFormLabelDirective, "[fd-toolbar-form-label]", never, {}, {}, never, never, true, never>;
}

declare class ToolbarLabelDirective extends ToolbarItemDirective {
    static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarLabelDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<ToolbarLabelDirective, "[fd-toolbar-label]", never, {}, {}, never, never, true, never>;
}

declare class ToolbarOverflowButtonMenuDirective extends ToolbarItemDirective {
    static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarOverflowButtonMenuDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<ToolbarOverflowButtonMenuDirective, "[fdToolbarOverflowButtonMenu], [fd-toolbar-overflow-button-menu]", never, {}, {}, never, never, true, never>;
}

declare class ToolbarOverflowButtonDirective extends ToolbarItemDirective {
    static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarOverflowButtonDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<ToolbarOverflowButtonDirective, "[fdToolbarOverflowButton], [fd-toolbar-overflow-button]", never, {}, {}, never, never, true, never>;
}

declare class ToolbarSeparatorComponent {
    static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarSeparatorComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarSeparatorComponent, "fd-toolbar-separator", never, {}, {}, never, never, true, never>;
}

declare class ToolbarSpacerDirective {
    /** Determines the width of spacer when fixed property is set to true
     * Allowed values: absolute and relative metrics
     * Default value: 0px
     */
    width: string;
    /** Property allows user to pass additional class
     */
    class: string;
    /** Determines if spacer should take only size taken from width property
     * Default value: false
     * Default behaviour: spacer takes remaining space automatically
     */
    fixed: boolean;
    /** @hidden */
    get css(): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarSpacerDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<ToolbarSpacerDirective, "fd-toolbar-spacer", never, { "width": { "alias": "width"; "required": false; }; "class": { "alias": "class"; "required": false; }; "fixed": { "alias": "fixed"; "required": false; }; }, {}, never, never, true, never>;
}

type ToolbarType = 'solid' | 'transparent' | 'auto' | 'info';
declare const enum OverflowPriorityEnum {
    ALWAYS = "always",
    NEVER = "never",
    LOW = "low",
    HIGH = "high",
    DISAPPEAR = "disappear"
}
declare class ToolbarComponent implements AfterViewInit, AfterViewChecked, CssClassBuilder, AfterContentInit {
    private _cd;
    readonly _contentDensityObserver: ContentDensityObserver;
    private readonly _destroyRef;
    private resizeObserverService;
    private readonly _injector;
    private _dynamicPageHeader?;
    /**
     * The ID of the toolbar title
     * */
    titleId: string;
    /** Property allows user to pass additional class
     */
    class: string;
    /** Determines if overflow button should be visible
     * Default value: false
     */
    set shouldOverflow(val: boolean);
    get shouldOverflow(): boolean;
    /** Determines the type of toolbar
     * Available options: 'solid' | 'transparent' | 'auto' | 'info'
     * Default value: 'solid'
     */
    fdType: ToolbarType;
    /** The title for the toolbar. */
    title: string;
    /** Determines if toolbar should has active state (only when fdType == 'info')
     * Default value: false
     */
    active: boolean;
    /** Determines if toolbar should clear border bottom
     * Default value: false
     */
    clearBorder: boolean;
    /** Whether all items should be inside overflow */
    forceOverflow: boolean;
    /** Tabindex of the toolbar element, to be used when fdType="info" */
    tabindex: number;
    /**
     * Heading level of the toolbar title.
     */
    set headingLevel(level: Nullable<HeadingLevel>);
    /** Toolbar Aria-label attribute. */
    ariaLabel: string;
    /** Toolbar Aria-labelledby attribute. */
    ariaLabelledBy: string;
    /** @hidden */
    titleElement: ElementRef<HTMLHeadElement>;
    /** @hidden */
    protected readonly _role = "toolbar";
    /** @hidden */
    readonly toolbarItems: i0.Signal<readonly ToolbarItem[]>;
    /** @hidden */
    set titleComponent(title: TitleToken | null);
    get titleComponent(): TitleToken | null;
    /** @hidden */
    overflowItems$: Observable<ToolbarItem[]>;
    /** @hidden */
    overflownItems: ToolbarItem[];
    /** @hidden */
    spacerUsed: i0.WritableSignal<boolean>;
    /** @hidden */
    spacerDirectives: i0.Signal<readonly ToolbarSpacerDirective[]>;
    /** @hidden */
    separatorDirectives: i0.Signal<readonly ToolbarSeparatorComponent[]>;
    /** @hidden */
    _headingLevel: number;
    /** HTML Element Reference. */
    readonly elementRef: ElementRef<any>;
    /** @hidden */
    private _titleComponent$;
    /** @hidden */
    private _refreshOverflow$;
    /** @hidden */
    private get _toolbarWidth();
    /** @hidden */
    private _shouldOverflow;
    /** @hidden */
    private shouldOverflow$;
    /** @hidden */
    constructor(_cd: ChangeDetectorRef, _contentDensityObserver: ContentDensityObserver, _destroyRef: DestroyRef, resizeObserverService: ResizeObserverService, _injector: Injector, _dynamicPageHeader?: DynamicPageHeader | undefined);
    /** @hidden */
    buildComponentCssClass(): string[];
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    ngAfterViewChecked(): void;
    /** @hidden */
    ngAfterContentInit(): void;
    /** Change detection reference */
    detectChanges(): void;
    /** Method triggering collapsible toolbar  */
    updateCollapsibleItems(): void;
    /** @hidden */
    private _updateSpacerUsed;
    /** @hidden Get group number with the lowest priority.
     *  Uses for detecting a group of elements which would be hidden from the toolbar.
     *  */
    private _getLowestPriorityFromGroup;
    /** @hidden */
    private _getElementsFromCurrentGroup;
    /** @hidden Get the object with grouped arrays of elements. */
    private _getGroupedCollection;
    /** @hidden Get the object with the highest priority for each group of elements. */
    private _getGroupedCollectionPriority;
    /** @hidden Sort priorities of elements/groups. */
    private _sortPriorities;
    /** @hidden Sort by group and priority and initial position */
    private _getSortedByPriorityAndGroupItems;
    static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarComponent, [null, null, null, null, null, { optional: true; skipSelf: true; }]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarComponent, "fd-toolbar", never, { "titleId": { "alias": "titleId"; "required": false; }; "class": { "alias": "class"; "required": false; }; "shouldOverflow": { "alias": "shouldOverflow"; "required": false; }; "fdType": { "alias": "fdType"; "required": false; }; "title": { "alias": "title"; "required": false; }; "active": { "alias": "active"; "required": false; }; "clearBorder": { "alias": "clearBorder"; "required": false; }; "forceOverflow": { "alias": "forceOverflow"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "headingLevel": { "alias": "headingLevel"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; }, {}, ["toolbarItems", "spacerDirectives", "separatorDirectives", "titleComponent"], ["*"], true, never>;
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class ToolbarModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<ToolbarModule, never, [typeof i1.ContentDensityModule, typeof ToolbarComponent, typeof ToolbarItemDirective, typeof ToolbarSpacerDirective, typeof ToolbarSeparatorComponent, typeof ToolbarFormLabelDirective, typeof ToolbarLabelDirective, typeof ToolbarOverflowButtonDirective, typeof ToolbarOverflowButtonMenuDirective], [typeof ToolbarComponent, typeof ToolbarItemDirective, typeof ToolbarSpacerDirective, typeof ToolbarSeparatorComponent, typeof ToolbarFormLabelDirective, typeof ToolbarLabelDirective, typeof ToolbarOverflowButtonDirective, typeof ToolbarOverflowButtonMenuDirective, typeof i1.ContentDensityModule]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<ToolbarModule>;
}

export { FD_TOOLBAR, OverflowPriorityEnum, ToolbarComponent, ToolbarFormLabelDirective, ToolbarItem, ToolbarItemDirective, ToolbarLabelDirective, ToolbarModule, ToolbarOverflowButtonDirective, ToolbarOverflowButtonMenuDirective, ToolbarSeparatorComponent, ToolbarSpacerDirective };
export type { ToolbarType };
