import * as i0 from '@angular/core';
import { OnDestroy, ElementRef, EventEmitter, ChangeDetectorRef, OnInit, AfterViewInit, AfterContentInit, QueryList } from '@angular/core';
import { FocusableOption } from '@angular/cdk/a11y';
import { Nullable } from '@fundamental-ngx/cdk/utils';

type ResizeDirection = 'vertical' | 'horizontal' | 'both';
declare const horizontalResizeStep = 320;
declare const verticalResizeStep = 16;
declare const gap = 16;
declare const horizontalResizeOffset = 160;
declare const verticalResizeOffset = 8;
type CardState = 1 | 0 | -1;
declare class ResizableCardItemComponent implements FocusableOption, OnDestroy {
    private readonly _cd;
    readonly elementRef: ElementRef;
    /** Card properties from the config */
    set config(config: ResizableCardItemConfig);
    get config(): ResizableCardItemConfig;
    /** set uinque id for the card */
    itemId: string;
    /** set title of the card */
    title: string;
    /**
     * Serial order of card.
     * cards are sorted based on ranks before displaying layout.
     * card with lower rank will be displayed first in layout than the card with higher rank.
     */
    set rank(rankValue: number);
    get rank(): number;
    /**
     * Number of column span card width takes.
     * It will be in step of 20rem.
     */
    set cardWidthColSpan(colSpan: number);
    get cardWidthColSpan(): number;
    /**
     * Number of row span, card height takes.
     * It will be in the step of 1rem.
     */
    set cardHeightRowSpan(rowSpan: number);
    get cardHeightRowSpan(): number;
    /**
     * Number of row span card mini header height takes.
     * Mini Header: The smallest representation of the card is the header.
     * The card can be collapsed to only its header height.
     */
    set cardMiniHeaderRowSpan(rowSpan: number);
    get cardMiniHeaderRowSpan(): number;
    /**
     * Number of row span card mini content height takes.
     * Mini Content: The minimum height for the card content depends on the card type,
     * and must be as high as the smallest representation of the content.
     */
    set cardMiniContentRowSpan(rowSpan: number);
    get cardMiniContentRowSpan(): number;
    /** Card can be set to resizable=false, to restrict card resize */
    resizable: boolean;
    /** Set left position for the card */
    left: Nullable<number>;
    /** Set right position for the card */
    right: Nullable<number>;
    /** Set top position for the card*/
    top: number;
    /** @hidden while resizing this value will change to a greater value */
    zIndex: number;
    /** @hidden */
    position: string;
    /** @hidden transition animation when layout re-draws */
    reDrawAnimation: boolean;
    /** Emits when card is still resizing */
    resizing: EventEmitter<ResizedEvent>;
    /** Emits when card resize is completed */
    resized: EventEmitter<ResizedEvent>;
    /** Emits when card height is reduced to show only header */
    miniHeaderReached: EventEmitter<ResizedEvent>;
    /** Emits when minimum height of card content area is reached */
    miniContentReached: EventEmitter<ResizedEvent>;
    /** show corner resize icon on hover over card */
    showingResizeIcon: boolean;
    /** show border when card is resizing */
    showBorder: boolean;
    /** starting column position of card. starts with 0 */
    startingColumnPosition: number;
    /** card width in px. Default value to 20rem */
    cardWidth: number;
    /** card height in px */
    cardHeight: number;
    /** Mini-header height of card */
    cardMiniHeaderHeight: number;
    /** Mini-content height of card to display minimum valid content */
    cardMiniContentHeight: number;
    /** Outer resize indication border width for the card */
    resizeIndicationBorderWidth: number;
    /**
     * Denotes if card is currently expanding or contracting horizontally.
     * +1 denotes increasing, -1 denotes decreasing and 0 denotes card-state has not changed horizontally.
     */
    cardState: CardState;
    /** Change in rank from previous value*/
    prevRank: number;
    /** @hidden Default width of card is 20rem ie. 1 column */
    private _cardWidthColSpan;
    /** @hidden */
    private _cardHeightRowSpan;
    /** @hidden helps in vertical step change event emit */
    private _prevCardHeightRowSpan;
    /** @hidden */
    private _cardMiniHeaderRowSpan;
    /** @hidden */
    private _cardMiniContentRowSpan?;
    /** @hidden config values for card */
    private _config;
    /** @hidden previous cursor x position */
    private _prevX;
    /** @hidden previous cursor y position */
    private _prevY;
    /** @hidden */
    private _prevCardWidth;
    /** @hidden */
    private _prevCardHeight;
    /** @hidden flag to control resize */
    private _resize;
    /** @hidden */
    private _resizeDirection;
    /** @hidden */
    private _maxColumn;
    /**
     * @hidden stores original width span of card.
     * It may reduce on small screen, so have to restore using this.
     */
    private _originalCardWidthSpan;
    /** @hidden */
    private _rank;
    /** @hidden */
    private _subscriptions;
    /** @hidden */
    private _rtlService;
    /** @hidden */
    constructor(_cd: ChangeDetectorRef, elementRef: ElementRef);
    /**
     * @hidden When mouse moves to resize the card.
     * using window:mousemove so, resize will happen smoothly
     * @param event {MouseEvent}
     */
    onMouseMove(event: MouseEvent): void;
    /**
     * when resizing of card stops
     */
    onMouseUp(): void;
    /** @hidden */
    ngOnDestroy(): void;
    /**
     * When resize handler is pressed and resizing may start.
     * @param event {MouseEvent}
     * @param resizeDirection which handler is pressed to resize
     */
    onMouseDown(event: MouseEvent, resizeDirection: ResizeDirection): void;
    /** Sets focus on the element */
    focus(): void;
    /** Shows resize icon */
    showResizeIcon(): void;
    /** Hides resize icon */
    hideResizeIcon(): void;
    /** Returns max width for card, based on layout size passed */
    getMaxColSpan(layoutSize: string): number;
    /** Update card width if it exceeds column span based on layout */
    verifyUpdateCardWidth(layoutSize: string): void;
    /** Returns ResizedEvent object to emit. */
    getResizedEventObject(): ResizedEvent;
    /** @hidden Return previous height row span of the card */
    get previousCardHeightRowSpan(): number;
    /** @hidden Set card properties using config received */
    private _initialSetup;
    /** @hidden Returns true when resize offset is crossed */
    private _horizontalResizeWithOffset;
    /**
     * @hidden make horizontal resize only on step of 20rem
     */
    private _horizontalStepResizing;
    /**
     * @hidden make vertical resize only on step of 1rem
     */
    private _verticalStepResizing;
    /**
     * @hidden Resize card horizontally by checking boundary condition
     * @param xPosition current x-position of cursor
     */
    private _horizontalResizing;
    /**
     * @hidden Resize card vertically.
     * takes care of mini-header height and mini-content height
     * @param yPosition current y-position of cursor
     */
    private _verticalResizing;
    /** @hidden reset involved variables while resizing */
    private _stopResizing;
    /** @hidden Returns cardWidth based on card column span */
    private _setCardWidth;
    /** @hidden Returns cardHeight based on card row span */
    private _setCardHeight;
    /** @hidden Returns card mini header height */
    private _setCardMiniHeaderHeight;
    /** @hidden Returns card mini content height */
    private _setCardMiniContentHeight;
    static ɵfac: i0.ɵɵFactoryDeclaration<ResizableCardItemComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ResizableCardItemComponent, "fd-resizable-card-item", never, { "config": { "alias": "config"; "required": false; }; "itemId": { "alias": "itemId"; "required": false; }; "title": { "alias": "title"; "required": false; }; "rank": { "alias": "rank"; "required": false; }; "cardWidthColSpan": { "alias": "cardWidthColSpan"; "required": false; }; "cardHeightRowSpan": { "alias": "cardHeightRowSpan"; "required": false; }; "cardMiniHeaderRowSpan": { "alias": "cardMiniHeaderRowSpan"; "required": false; }; "cardMiniContentRowSpan": { "alias": "cardMiniContentRowSpan"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "left": { "alias": "left"; "required": false; }; "right": { "alias": "right"; "required": false; }; "top": { "alias": "top"; "required": false; }; }, { "resizing": "resizing"; "resized": "resized"; "miniHeaderReached": "miniHeaderReached"; "miniContentReached": "miniContentReached"; }, never, ["*"], true, never>;
}
/** Config interface for card properties */
interface ResizableCardItemConfig {
    title?: string;
    rank?: number;
    cardWidthColSpan?: number;
    cardHeightRowSpan?: number;
    cardMiniHeaderRowSpan?: number;
    cardMiniContentRowSpan?: number;
    resizable?: boolean;
}
/** Object to emit on resize complete */
declare class ResizedEvent {
    card: ResizableCardItemComponent;
    prevCardWidth: number;
    prevCardHeight: number;
    cardWidth: number;
    cardHeight: number;
    cardWidthColSpan: number;
    cardHeightRowSpan: number;
    newCardWidthColSpan: number;
    newCardHeightRowSpan: number;
    /**
     * Object to emit on resize complete
     * @param card
     * @param prevCardWidth Previous card width
     * @param prevCardHeight Previous card height
     * @param cardWidth Current card width
     * @param cardHeight Current card height
     * @param cardWidthColSpan Current card width column span
     * @param cardHeightRowSpan Current card height row span
     * @param newCardWidthColSpan New card width column span
     * @param newCardHeightRowSpan New card height row span
     */
    constructor(card: ResizableCardItemComponent, prevCardWidth: number, prevCardHeight: number, cardWidth: number, cardHeight: number, cardWidthColSpan: number, cardHeightRowSpan: number, newCardWidthColSpan: number, newCardHeightRowSpan: number);
}

type LayoutSize = 'sm' | 'md' | 'lg' | 'xl';
type ResizableCardLayoutConfig = Array<ResizableCardItemConfig>;
declare class ResizableCardLayoutComponent implements OnInit, AfterViewInit, AfterContentInit, OnDestroy {
    private readonly _cd;
    readonly elementRef: ElementRef;
    /** Object for setting each card property */
    layoutConfig: ResizableCardLayoutConfig;
    /** Emits when card resize is reached to one new step in horizontal or vertical direction */
    stepChange: EventEmitter<ResizedEvent>;
    /** Emits when card is still resizing */
    resizing: EventEmitter<ResizedEvent>;
    /** Emits when card resize is completed */
    resized: EventEmitter<ResizedEvent>;
    /** Emits when card height is reduced to show only header */
    miniHeaderReached: EventEmitter<ResizedEvent>;
    /** Emits when minimum height of card content area is reached */
    miniContentReached: EventEmitter<ResizedEvent>;
    /** Emits when layout changes */
    layoutChange: EventEmitter<ResizableCardLayoutConfig>;
    /** @hidden */
    resizeCardItems: QueryList<ResizableCardItemComponent>;
    /** width for layout */
    layoutWidth: number;
    /** height for layout */
    layoutHeight: number;
    /** @hidden Number of columns in layout. considering 1 column width 20rem */
    private _columns;
    /** @hidden Layout padding. will be added to first card padding in every row */
    private _paddingLeft;
    /** @hidden Stores height of each column on card arrangement */
    private _columnsHeight;
    /** @hidden Available screen layout */
    private _layout;
    /** @hidden Stores sorted card before placing in layout */
    private _sortedCards;
    /** @hidden FocusKeyManager instance */
    private _keyboardEventsManager;
    /** @hidden */
    private readonly _destroyRef;
    /** @hidden */
    private _layoutShifted;
    /** @hidden */
    private _directionPosition;
    /** @hidden */
    private _rtlService;
    /** @hidden */
    constructor(_cd: ChangeDetectorRef, elementRef: ElementRef);
    /** @hidden handles keyboard accessibility */
    _handleKeydown(event: KeyboardEvent): void;
    /** @hidden */
    onResize(): void;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngAfterContentInit(): void;
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    ngOnDestroy(): void;
    /** Layout size. Available options are 'sm', 'md', 'lg' and 'xl' */
    set layoutSize(layoutSize: LayoutSize);
    get layoutSize(): LayoutSize;
    /**
     * Arranges cards in layout based on rank, width and height of card
     * @param cards Array of ResizableCardItemComponent
     */
    arrangeCards(cards: Array<ResizableCardItemComponent>): void;
    /**
     * Handles shifting of cards with animation, while card is still resizing.
     * @param event {ResizedEvent}
     */
    cardResizing(event: ResizedEvent): void;
    /**
     * Handles arrangement of cards in layout
     * @param event {ResizedEvent}
     */
    cardResizeComplete(event: ResizedEvent): void;
    /** @hidden */
    updateLayout(): void;
    /**
     * method to get screen width
     * @returns Window width in px
     */
    getWidthAvailable(): number;
    /** @hidden Subscribe to events from items */
    private _initialSetup;
    /** @hidden */
    private _accessibilitySetup;
    /** @hidden create layout based on layout size */
    private _createLayout;
    /** @hidden Emit layoutChange event with updated card dimensions */
    private _emitLayoutChange;
    /**
     * @hidden Sets number of column in layout, based on LayoutSize passed
     * @param layoutSize {'sm' | 'md' | 'lg' | 'xl'}
     */
    private _setLayoutColumns;
    /**
     * @hidden Method to handle card vertical resize and trigger the layout change
     * @param event {ResizedEvent}
     */
    private _handleVerticalResize;
    /**
     * @hidden Method to handle card horizontal resize and trigger the layout change
     * @param event {ResizedEvent}
     */
    private _handleHorizontalResize;
    /**
     * @hidden Method to move card down, when another card width is increasing
     * Method to loop till this._columns -1 positions and exchange the rank
     * @param currentCardIndex Index of current card
     */
    private _moveCardDown;
    /**
     * @hidden updates array with new column heights
     * @param card {ResizableCardItemComponent}
     */
    private _updateColumnsHeight;
    /**
     * @hidden Try to set card at available heights
     * @param card ResizableCardItemComponent
     * @param index value of card in array of ResizableCardItemComponent
     */
    private _setCardPositionValues;
    /**
     * @hidden try to set card at given height.
     * @param height height at which card is getting positioned.
     * @param card ResizableCardItemComponent
     * @returns It returns true when card position id found otherwise it returns false.
     */
    private _isPositionSetSuccess;
    /**
     * @hidden Try to start card position from left most fit position.
     * @param card ResizableCardItemComponent
     * @param columnPositions {Array<number>} Array of available positions for cards.
     * @param height {number} height at which fixing the card
     * @returns {number} returns starting column position where card will fit.
     */
    private _fitCardColumnPosition;
    /** @hidden returns sorted unique height of columns */
    private _getSortedUniqueHeights;
    /**
     * @hidden Comparator to sort card based on rank.
     * @param firstCard ResizableCardItemComponent
     * @param secondCard ResizableCardItemComponent
     * @returns : returns difference between first card rank and other card rank.
     */
    private _sortCards;
    static ɵfac: i0.ɵɵFactoryDeclaration<ResizableCardLayoutComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ResizableCardLayoutComponent, "fd-resizable-card-layout", never, { "layoutConfig": { "alias": "layoutConfig"; "required": false; }; }, { "stepChange": "stepChange"; "resizing": "resizing"; "resized": "resized"; "miniHeaderReached": "miniHeaderReached"; "miniContentReached": "miniContentReached"; "layoutChange": "layoutChange"; }, ["resizeCardItems"], ["*"], true, never>;
}

/**
 * @deprecated
 * Use direct imports of `ResizableCardLayoutComponent` and `ResizableCardItemComponent`.
 */
declare class ResizableCardLayoutModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<ResizableCardLayoutModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<ResizableCardLayoutModule, never, [typeof ResizableCardLayoutComponent, typeof ResizableCardItemComponent], [typeof ResizableCardLayoutComponent, typeof ResizableCardItemComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<ResizableCardLayoutModule>;
}

export { ResizableCardItemComponent, ResizableCardLayoutComponent, ResizableCardLayoutModule, ResizedEvent, gap, horizontalResizeOffset, horizontalResizeStep, verticalResizeOffset, verticalResizeStep };
export type { CardState, LayoutSize, ResizableCardItemConfig, ResizableCardLayoutConfig, ResizeDirection };
