import { TemplateResult } from 'lit';
import { type ISplitItem, SplitItem } from './SplitItem.js';
import { IPanelObject, PanelState, SplitCloseDirection, SplitDirection, SplitItemRenderCallback, SplitLayoutAddOptions, SplitPanelRemoveItemOptions, SplitPanelSplitOptions, SplitRegion } from './type.js';
import { SplitLayout } from './SplitLayout.js';
import '../../define/layout/split-view.js';
export interface ISplitPanel {
    /**
     * If already generated, the key of the panel.
     */
    key?: string;
    layout: SplitDirection;
    items?: IPanelObject[];
    /**
     * The item being rendered in the panel.
     * Note, this is the `key` of the item and not the `id` of the item.
     */
    selected?: string;
}
/**
 * The class represents a panel model for the split layout.
 * A panel can only hold other panels or layout items. When a panel
 * defines both, items are ignored.
 *
 * A panel can render ony one item at a time. TO view more items
 * the application needs to add panels to this panel and distribute items among them.
 */
export declare class SplitPanel {
    manager: SplitLayout;
    /**
     * The key used as an internal reference to the definitions map.
     */
    key: string;
    layout: SplitDirection;
    items: IPanelObject[];
    /**
     * The item being rendered in the panel.
     * Note, this is the `key` of the item and not the `id` of the item.
     */
    selected?: string;
    /**
     * The current state of the panel.
     */
    state: PanelState;
    get hasPanels(): boolean;
    get hasItems(): boolean;
    static fromLayout(manager: SplitLayout, layout?: SplitDirection): SplitPanel;
    /**
     * @param manager A reference to the manager.
     * @param parentPanel A reference to a parent panel.
     */
    constructor(manager: SplitLayout, schema?: ISplitPanel);
    new(schema: ISplitPanel): void;
    toJSON(): ISplitPanel;
    getParent(): SplitPanel | undefined;
    /**
     * @returns True when the panel accepts drop events.
     */
    canDrop(): boolean;
    /**
     * @returns Returns a **copy** of the items array sorted by index.
     */
    sortedItems(): SplitItem[];
    /**
     * Finds an index where to put an item.
     * This finds "holes" in items where an index is not set for a given position.
     * In this case the resulting index is the missing index.
     * Otherwise it returns next after the highest index.
     *
     * @returns The index of the next item
     */
    nextIndex(): number;
    /**
     * Checks whether this panel contains an item
     * @param key The key of the item to test.
     * @returns true if the panel contains an item
     */
    hasItem(key: string): boolean;
    /**
     * Adds an item to the layout.
     *
     * @param item The item to add
     * @param opts Layout adding item options
     * @returns Whether a new item was added to the layout. false when the item is already in the layout panel.
     */
    addItem(item: ISplitItem | SplitItem, opts?: SplitLayoutAddOptions): SplitItem;
    protected splitByRegion(region: SplitRegion): SplitPanel;
    /**
     * Splits this panel into 2 panels.
     * This to be used when the panel has no other panels. Only items are allowed.
     * It produces 2 new panels and moves the items to the first one leaving the other one available.
     */
    split(opts?: SplitPanelSplitOptions): SplitPanel[];
    unsplit(): void;
    /**
     * Decreases items index by 1 to all items with index at least equal to `fromIndex`.
     * @param fromIndex The minimal index to affect.
     */
    decreaseIndex(fromIndex: number): void;
    /**
     * Increases items index by 1 to all items with index at least equal to `fromIndex`.
     * @param fromIndex The minimal index to affect.
     */
    increaseIndex(fromIndex: number): void;
    removeChildItem(item: SplitItem, opts?: SplitPanelRemoveItemOptions): SplitItem | undefined;
    /**
     * Removes an item from the layout
     * @param key The `key` of the item.
     * @returns The removed item, if any.
     */
    removeItem(key: string, opts?: SplitPanelRemoveItemOptions): SplitItem | undefined;
    /**
     * @param key The key of the item to perform a relative operation from.
     * @param dir The direction to which close other items. Default to both directions leaving only the `key` item
     */
    removeRelative(key: string, dir?: SplitCloseDirection): void;
    removePanel(id: string, opts?: SplitPanelRemoveItemOptions): void;
    clearItems(opts?: SplitPanelRemoveItemOptions): void;
    /**
     * Moves an item to a new index.
     *
     * @param key The item key
     * @param toIndex The new index. When not set it moves the item to the end.
     */
    moveItem(key: string, opts?: SplitLayoutAddOptions): void;
    moveToRegion(item: SplitItem, region: SplitRegion): void;
    moveToIndex(item: SplitItem, index: number): void;
    moveToEnd(item: SplitItem): void;
    updateView(): void;
    addPanel(layout?: SplitDirection): SplitPanel;
    panelTemplate(panel: SplitPanel, itemCallback: SplitItemRenderCallback): TemplateResult | undefined;
    itemTemplate(item: SplitItem, visible: boolean, itemCallback: SplitItemRenderCallback): TemplateResult;
    render(itemCallback: SplitItemRenderCallback): TemplateResult | undefined;
}
//# sourceMappingURL=SplitPanel.d.ts.map