import * as i0 from '@angular/core';
import { TemplateRef, AfterViewInit, OnChanges, OnDestroy, EventEmitter, QueryList, ElementRef, SimpleChanges } from '@angular/core';
import { FocusableOption } from '@angular/cdk/a11y';
import { CdkDrag, CdkDragStart, CdkDragEnter, CdkDragDrop } from '@angular/cdk/drag-drop';
import { Direction } from '@angular/cdk/bidi';
import { NumberInput } from '@angular/cdk/coercion';
import { Nullable } from '@fundamental-ngx/cdk/utils';

declare class FixedCardLayoutItemComponent implements FocusableOption {
    /** Card title ID for aria-labelledby, or undefined if no title is present */
    readonly cardTitleId: i0.WritableSignal<string | undefined>;
    /** @hidden */
    private _elementRef;
    /** @hidden */
    constructor();
    /** Set focus on the element. */
    focus(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<FixedCardLayoutItemComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FixedCardLayoutItemComponent, "fd-fixed-card-layout-item", never, {}, {}, never, ["*"], true, never>;
}

declare class CardDefinitionDirective {
    template: TemplateRef<any>;
    /**
     * Behaves like rank of card.
     * Useful in creating layout again after drag and drop.
     */
    set fdCardDef(value: NumberInput);
    get fdCardDef(): number;
    /** @hidden */
    private _fdCardDef;
    /** @hidden */
    constructor(template: TemplateRef<any>);
    static ɵfac: i0.ɵɵFactoryDeclaration<CardDefinitionDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<CardDefinitionDirective, "[fdCardDef]", never, { "fdCardDef": { "alias": "fdCardDef"; "required": false; }; }, {}, never, never, true, never>;
}
interface Layout {
    numberOfColumns?: number;
    screenSize: number;
}
interface CardDropped {
    previousIndex: number;
    currentIndex: number;
    layoutColumns: number;
    items: CardDefinitionDirective[];
}
type Columns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
type ColumnsWidthConfig = {
    [C in Columns]?: number;
};
type CardColumn = CardDefinitionDirective[];
declare class FixedCardLayoutComponent implements AfterViewInit, OnChanges, OnDestroy {
    /** Drag drop behavior can be disabled */
    disableDragDrop: boolean;
    /** Drag start delay in milliseconds, default to 200ms for safe scrolling on mobile with touchscreen */
    dragStartDelay: number;
    /** Card's minimum width in pixels. */
    set cardMinimumWidth(value: NumberInput);
    get cardMinimumWidth(): number;
    /** Config with the width ratios that should take every column. Flex-grow principe. Missed values set to 0. s*/
    columnsWidthConfig: ColumnsWidthConfig;
    /** Limit the number of columns. Default is 10. */
    maxColumns: number;
    /** Event to emit, when layout changes */
    layoutChange: EventEmitter<Layout>;
    /** Event to emit on Card dragged and dropped */
    cardDraggedDropped: EventEmitter<CardDropped>;
    /** @hidden */
    _cards: QueryList<CardDefinitionDirective>;
    /** @hidden */
    _cardContainers: QueryList<FixedCardLayoutItemComponent>;
    /** @hidden */
    _dragList: QueryList<CdkDrag>;
    /** @hidden */
    _layout: ElementRef<HTMLElement>;
    /** @hidden */
    _cardsArray: CardDefinitionDirective[];
    /** @hidden Number of Columns in layout */
    _numberOfColumns: number;
    /** @hidden */
    _cardColumns: CardColumn[];
    /** @hidden*/
    _containerHeight: number;
    /** @hidden handles rtl service */
    readonly dir: i0.Signal<Direction>;
    /** @hidden first number is the CardDefinition rank, i.e. id */
    _groupIndexes: Map<number, number>;
    /** @hidden first number is the CardDefinition rank, i.e. id */
    _itemIndexes: Map<number, number>;
    /** @hidden first number is the CardDefinition rank, i.e. id */
    _singleItemColumns: Set<number>;
    /** @hidden */
    _columnsWidth: Map<number, number>;
    /** @hidden Return available width for fixed card layout */
    get _availableWidth(): number;
    /** @hidden */
    _placeholderMargin: boolean;
    /** @hidden */
    _listenResize: boolean;
    /** @hidden */
    _hiddenCard: Nullable<CardDefinitionDirective>;
    /** @hidden FocusKeyManager instance */
    private _keyboardEventsManager;
    /** @hidden */
    private _cardMinimumWidth;
    /** @hidden */
    private _cardsSizeChangeSubscription;
    /** @hidden  */
    private readonly _destroyRef;
    /** @hidden */
    private readonly _changeDetector;
    /** @hidden */
    private readonly _rtlService;
    /** @hidden */
    handleKeydown(event: KeyboardEvent): void;
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    ngOnChanges(changes: SimpleChanges): void;
    /** @hidden */
    ngOnDestroy(): void;
    /** Distribute cards on window resize */
    updateLayout(): void;
    /** @hidden */
    _onDragStarted(event: CdkDragStart): void;
    /** @hidden */
    _onDropListEntered(event: CdkDragEnter): void;
    /** @hidden */
    _onDragDropped(event: CdkDragDrop<number, number>): void;
    /** @hidden */
    _sortPredicateFn: (index: number) => boolean;
    /** @hidden For the keyboard drag&drop directive */
    _customMoveFn: (group: CardColumn, indexFrom: number, indexTo: number) => void;
    /** @hidden For the keyboard drag&drop directive */
    _customTransferFn: (prevGroup: CardColumn, nextGroup: CardColumn, indexFrom: number, indexTo: number) => void;
    /** @hidden Arranges cards on drop of dragged card */
    private _processDragDrop;
    /** @hidden */
    private _accessibilitySetup;
    /** @hidden Listen window resize and distribute cards on column change */
    private _listenOnResize;
    /** @hidden Listen card change and distribute cards on column change */
    private _listenOnCardsChange;
    /** @hidden */
    private _processCards;
    /** @hidden Distribute cards among columns to arrange them in "Z" flow */
    private _setCardColumns;
    /** @hidden */
    private _setCardColumnsWidth;
    /**
     * @hidden
     * Calculate container height accordingly to the the card columns height
     * Parameters used to increase the height of the column where drag'n'drop placeholder currently is
     */
    private _setContainerHeight;
    /** @hidden */
    private _listenOnCardsHeightChange;
    static ɵfac: i0.ɵɵFactoryDeclaration<FixedCardLayoutComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FixedCardLayoutComponent, "fd-fixed-card-layout", never, { "disableDragDrop": { "alias": "disableDragDrop"; "required": false; }; "dragStartDelay": { "alias": "dragStartDelay"; "required": false; }; "cardMinimumWidth": { "alias": "cardMinimumWidth"; "required": false; }; "columnsWidthConfig": { "alias": "columnsWidthConfig"; "required": false; }; "maxColumns": { "alias": "maxColumns"; "required": false; }; }, { "layoutChange": "layoutChange"; "cardDraggedDropped": "cardDraggedDropped"; }, ["_cards"], never, true, never>;
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class FixedCardLayoutModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FixedCardLayoutModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FixedCardLayoutModule, never, [typeof FixedCardLayoutComponent, typeof CardDefinitionDirective, typeof FixedCardLayoutItemComponent], [typeof FixedCardLayoutComponent, typeof CardDefinitionDirective, typeof FixedCardLayoutItemComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FixedCardLayoutModule>;
}

export { CardDefinitionDirective, FixedCardLayoutComponent, FixedCardLayoutItemComponent, FixedCardLayoutModule };
export type { CardDropped, ColumnsWidthConfig, Layout };
