/**
 * pacem v0.51.10-faraday (https://js.pacem.it)
 * Copyright 2025 Pacem (https://pacem.it)
 * Licensed under Apache-2.0
 */
declare namespace Pacem.Components.Plus {
    type CarouselDataItem = {
        image: string;
        title?: string;
        content?: string;
        url?: string;
    };
    /** @deprecated*/
    class PacemCarouselElement extends UI.PacemAdaptedIterativeElement<CarouselDataItem> {
        adapter: UI.PacemAdapterElement;
        slideshow: UI.PacemSlideshowElement;
        interval: number;
        pausable: boolean;
    }
}
declare namespace Pacem.Components.Plus {
    abstract class PacemContextMenuItemElement extends PacemItemElement {
        connectedCallback(): void;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
        abstract createMenuItemElement(): Element;
    }
    class PacemContextMenuItemCommandElement extends PacemContextMenuItemElement {
        createMenuItemElement(): Element;
        commandName: string;
        caption: string;
        tooltip: string;
        iconGlyph: string;
        confirmationMessage: string;
        confirmationDialog: Pacem.Components.UI.PacemDialogBase;
        commandArgument: any;
    }
    class PacemContextMenuItemSeparatorElement extends PacemContextMenuItemElement {
        createMenuItemElement(): Element;
    }
    class PacemContextMenuElement extends PacemItemsContainerElement<PacemContextMenuItemElement> {
        #private;
        validate(item: PacemContextMenuItemElement): boolean;
        private _slot;
        commandArgument: any;
        /** @deprecated Provide your own content within the 'trigger' slot. */
        icon: string;
        private _dispatchCommand;
        private _ensureButton;
        private _lookForAButton;
        private _ensureBalloon;
        register(item: PacemContextMenuItemElement): boolean;
        unregister(item: PacemContextMenuItemElement): boolean;
        private _onCommand;
        private _slotchangeHandler;
        private _resetLayout;
        private _toggleBtn;
        private _toggleIcon;
        viewActivatedCallback(): void;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
        disconnectedCallback(): void;
        refresh(): void;
        private _attributeChangeHandler;
        private _mouseupHandler;
        private _disposeButton;
        private _disposeSlot;
        private _disposeBalloon;
        private _disposeBalloonChildren;
        private _refreshMenuItems;
    }
}
declare namespace Pacem.Components.Plus {
    enum EditMode {
        Text = "text",
        Html = "html",
        Image = "image",
        Markdown = "markdown"
    }
    class PacemEditElement extends PacemElement implements OnPropertyChanged, OnConnected, OnViewActivated, OnDisconnected {
        private _markdown;
        constructor(_markdown?: MarkdownService);
        private _button;
        private _textarea;
        private _contenteditable;
        private _editImage;
        private _dialog;
        key: string;
        type: EditMode;
        target: HTMLElement;
        private _state;
        private _content;
        private _addButton;
        private _removeButton;
        private _addDialog;
        private _removeDialog;
        private _addTextarea;
        private _removeTextarea;
        private _addContenteditable;
        private _removeContenteditable;
        private _addEditImage;
        private _removeEditImage;
        private _dialogPropertyChangedHandler;
        private _broadcastFetchRequestEventName;
        private _innerValueChangedHandler;
        private _editHandler;
        private _update;
        private _retrieve;
        private _setup;
        private _dialogPropertyChangedCallback;
        private get _target();
        connectedCallback(): void;
        viewActivatedCallback(): void;
        disconnectedCallback(): void;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
        edit(evt: Event): void;
        imageUploadUrl: string;
        imageSet: Scaffolding.PictureSet;
        maxImageWidth: number;
        maxImageHeight: number;
        allowSnapshot: boolean;
    }
}
declare namespace Pacem.Components.Plus {
    type GalleryDataItem = {
        image: string;
        caption?: string;
    };
    class PacemGalleryElement extends UI.PacemAdaptedIterativeElement<GalleryDataItem | any> {
        private _adapter;
        private _lightbox;
        private _slideshow;
        private _repeater;
        private _templateProxy;
        private _heroPlaceholderProxy;
        private _poppingUp;
        captionTemplate: HTMLTemplateElement | PacemTemplateProxyElement;
        captionProperty: string;
        imageProperty: string;
        viewActivatedCallback(): void;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
        disconnectedCallback(): void;
        private _disposeTemplate;
        private _setupWithCaptionTemplate;
        private _setupTemplate;
        private _templateChangeHandler;
        private _setupDefaultTemplate;
        private _databind;
        get adapter(): UI.PacemAdapterElement;
        private _heroAnimate;
        open(startIndex: number, heroFrom?: HTMLElement, src?: string): void;
    }
}
declare namespace Pacem.Components.Plus {
    class PacemModalFormElement extends UI.PacemDialogBase implements Pacem.Net.OAuthFetchable {
        #private;
        suddenValidation: boolean;
        okCaption: string;
        cancelCaption: string;
        method: Pacem.Net.HttpMethod;
        metadata: Pacem.Scaffolding.TypeMetadata | Scaffolding.PropertyMetadata[];
        action: string;
        loaderType: UI.LoaderType;
        success: boolean;
        fail: boolean;
        readonly: boolean;
        fetchHeaders: {
            [key: string]: string;
        };
        fetchCredentials: RequestCredentials;
        protected lightbox: UI.PacemLightboxElement;
        private _form;
        private _fetcher;
        private _emitter;
        get form(): Scaffolding.PacemFormElement;
        constructor();
        viewActivatedCallback(): void;
        disconnectedCallback(): void;
        private _keyupHandler;
        private _submit;
        private _onSubmit;
        open(state: any): any;
        open(state: any, keepStateOnCommit: boolean): any;
        open(state: any, keepStateOnCommit: boolean, setAsPristine: boolean): any;
        protected commit(btn: UI.DialogButton, evt: Event): void;
        private _cancel;
        private _broadcast;
        private _buttons;
        /** Gets the 'ok' and 'cancel' modal buttons. */
        get modalButtons(): {
            ok: Element;
            cancel: Element;
        };
    }
}
declare namespace Pacem.Components.Plus {
    class PacemRouterHashStateElement extends PacemEventTarget {
        #private;
        router: Pacem.Components.PacemRouterElement;
        default: {
            [key: string]: any;
        };
        state: {
            [key: string]: any;
        };
        normalizedState: {
            [key: string]: string;
        };
        viewActivatedCallback(): void;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
        disconnectedCallback(): void;
        private _setupRouterHandlers;
        private _disposeRouterHandlers;
        private _routerNavigatingHandler;
        private _routerNavigateHandler;
        private _currentBasePath;
        private _normalizePath;
        private _areStatesEquivalent;
        private _updateNormalizedState;
        private _updateStateFromURI;
        private _updateURIFromState;
        private _areSubstantiallyEquivalent;
        private _cleanupStateForURI;
        private _normalizeState;
        private _denormalizeState;
        set(obj: {
            [key: string]: any;
        }): void;
        set(key: string, value: any): void;
    }
}
declare namespace Pacem.Components.Plus {
    class PacemSearchElement extends PacemElement implements OnPropertyChanged {
        private _fetcher;
        datasource: any[];
        hint: string;
        url: string;
        method: Pacem.Net.HttpMethod;
        hintParameter: string;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
    }
}
declare namespace Pacem.Plus {
    export type DataCellMetadataContentFactory = (host: Element, metadata: DataColumnMetadata, item: any, index: number) => string | Node;
    export type DataCellMetadataCssClassFactory = (host: Element, metadata: DataColumnMetadata, item: any, index: number) => string[];
    export type DataCellMetadataCssFactory = (host: Element, metadata: DataColumnMetadata, item: any, index: number) => {
        [name: string]: string;
    };
    type CellStyleBase = {
        horizontalAlign?: 'left' | 'right' | 'center';
        verticalAlign?: 'top' | 'bottom' | 'middle';
        textEllipsis?: boolean;
    };
    type CellStyle = CellStyleBase & {
        css?: {
            [name: string]: string;
        };
        cssClass?: string[];
    };
    type CellStyleEnhanced = CellStyleBase & {
        css?: {
            [name: string]: string;
        } | DataCellMetadataCssFactory;
        cssClass?: string[] | DataCellMetadataCssClassFactory;
    };
    export type HeadCellDisplay = CellStyle & Pacem.Scaffolding.TooltipMetadata & {
        name?: string;
        description?: string;
        icon?: string;
    };
    export type DataCellDisplay = CellStyleEnhanced & {
        ui?: string;
        format?: string | Intl.DateTimeFormatOptions | Intl.NumberFormatOptions | DataCellMetadataContentFactory;
        null?: string;
        /** Default: true. */
        autoTooltip?: boolean;
        selectMode?: 'cell' | 'row' | 'none';
    };
    export type DataColumnMetadata = {
        /** Unique identifier for the datacolumn (might be the contextual property, but it's not mandatory). */
        prop: string;
        dataType?: string;
        /** Headcell content and styles. */
        headCell?: HeadCellDisplay;
        dataCell?: DataCellDisplay;
        /** Flex width or 'auto' */
        width?: number | 'auto';
        minPixelWidth?: number;
        maxPixelWidth?: number;
        isSortable?: boolean;
        defaultSort?: 'asc' | 'desc';
        /** Whether column is allowed to toggle between visibile and hidden state (default: false). */
        isTogglable?: boolean;
        isRescalable?: boolean;
        hide?: boolean;
        order?: number;
    };
    export {};
}
declare namespace Pacem.Components.Plus {
    type DataGridState = {
        sort?: {
            column?: string;
            dir?: 'asc' | 'desc';
        };
        /** Selected row indices. */
        selectedRows?: number[];
        /** Ordered column names (`prop`s). */
        orderedColumns: string[];
    };
    type DataColumnState = {
        hidden?: boolean;
        pixelWidth?: number;
    };
    abstract class PacemBaseCellElement extends PacemSafeContentElement {
        metadata: Pacem.Plus.DataColumnMetadata;
        state: DataColumnState;
        gridState: DataGridState;
        viewActivatedCallback(): void;
        protected updateColumnPosition(metadata?: Pacem.Plus.DataColumnMetadata, state?: DataGridState): void;
        protected updateVisibility(state?: DataColumnState): void;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
        protected abstract updateLayout(metadata: Pacem.Plus.DataColumnMetadata): any;
    }
}
declare namespace Pacem.Components.Plus {
    const DataRowSelectChangeEventName = "datarowselectchange";
    type DataRowSelectChangeEventArgs = {
        selectedRows: {
            item: any;
            index: number;
        }[];
    };
    class DataRowSelectChangeEvent extends CustomEvent<DataRowSelectChangeEventArgs> {
        constructor(detail: DataRowSelectChangeEventArgs);
    }
    class PacemDataCellElement extends PacemBaseCellElement {
        dataitem: any;
        rowindex: number;
        private _contentTooltip;
        private _content;
        protected updateLayout(metadata?: Pacem.Plus.DataColumnMetadata): void;
        connectedCallback(): void;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
        private _updateTooltipJustInCase;
        private _inflateContent;
        private _inflateCssClass;
        private _inflateCss;
        private _setup;
        private _updateSelection;
    }
}
declare namespace Pacem.Components.Plus {
    type DataGridOptions = {
        allowAdd?: boolean;
        allowEdit?: boolean;
        allowSelect?: boolean;
        allowDelete?: boolean;
        allowMultiSelect?: boolean;
        selectCaption?: string;
        selectIcon?: string;
        editCaption?: string;
        editIcon?: string;
        deleteCaption?: string;
        deleteIcon?: string;
    };
    type DataCellUIEventArgs = {
        datacell: PacemDataCellElement;
        dataitem: any;
        rowindex: number;
    };
    class DataCellUIEvent extends CustomUIEvent<DataCellUIEventArgs> {
        constructor(type: string, detail: DataCellUIEventArgs, orig?: MouseEvent | TouchEvent | KeyboardEvent);
    }
    class PacemDataColumnElement extends PacemItemElement {
        field: string;
        label: string;
        resizable: boolean;
        togglable: boolean;
        sortable: boolean;
        order: number;
        format: string | Intl.DateTimeFormatOptions | Intl.NumberFormatOptions;
        headcellCss?: {
            [name: string]: string;
        };
        headcellCssClass?: string[];
        datacellCss?: {
            [name: string]: string;
        };
        datacellCssClass?: string[];
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
    }
    class PacemDataGridElement extends PacemItemsContainerElement<PacemDataColumnElement> {
        private _key;
        constructor(_key?: string);
        validate(item: PacemDataColumnElement): boolean;
        metadata: Pacem.Plus.DataColumnMetadata[];
        options: DataGridOptions;
        state: Partial<DataGridState> | {
            selectedRows: {
                item: any;
                index: number;
            }[];
        };
        datasource: any[];
        viewActivatedCallback(): void;
        disconnectedCallback(): void;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
        register(item: PacemDataColumnElement): boolean;
        unregister(item: PacemDataColumnElement): boolean;
        private _tableContainer;
        private _adaptedColumnMetadata;
        private _columnState;
        private _gridState;
        /**
         * Sets the selected rows among the current ones.
         * @param args
         */
        setRowSelection(...args: number[]): void;
        private _setRowSelection;
        private _doSetRowSelection;
        /**
         * Merges and synchronizes grid states (public vs private).
         * @param state Partial state to be merged
         */
        private _mergeState;
        private _itemDataColumnRebuildHandler;
        private _itemDataColumnChangeHandler;
        private _memoizer;
        private _adaptColumnMetadata;
        private _getColumnMetadata;
        private _buildUpGrid;
        private _getColumnSizes;
        private _getColumnSize;
        private _onCommand;
        private _broadcastUiEvent;
        private _broadcastSortCommand;
        private _broadcastRescaleCommand;
        private _broadcastSelectCommand;
    }
}
declare namespace Pacem.Components.Plus {
    const DataColumnSortEventName = "datacolumnsort";
    type DataColumnSortEventArgs = {
        column: string;
        dir?: 'asc' | 'desc';
    };
    class DataColumnSortEvent extends CustomEvent<DataColumnSortEventArgs> {
        constructor(detail: DataColumnSortEventArgs);
    }
    const DataColumnRescaleEventName = "datacolumnrescale";
    type DataColumnRescaleEventArgs = {
        width: number;
    };
    class DataColumnRescaleEvent extends CustomEvent<DataColumnRescaleEventArgs> {
        constructor(detail: DataColumnRescaleEventArgs);
    }
    class PacemHeadCellElement extends PacemBaseCellElement {
        private _md;
        constructor(_md?: MarkdownService);
        connectedCallback(): void;
        propertyChangedCallback(name: string, old: any, val: any, first?: boolean): void;
        viewActivatedCallback(): void;
        disconnectedCallback(): void;
        private _sortButton;
        private _rescaler;
        private _rescaleContainer;
        private _balloon;
        protected updateLayout(metadata?: Pacem.Plus.DataColumnMetadata): void;
        private _sortButtonClickHandler;
        private _setupSortButton;
        private _disposeSortButton;
        private _updateSortButtonIconGlyph;
        private _columnBBox;
        private _rescaleHandler;
        private _rescaleStartHandler;
        private _rescaleEndHandler;
        private _ensureRescaler;
        private _setupRescaleContainer;
        private _disposeRescaleContainer;
        private _disposeRescaler;
        private _setup;
        private _normalizeTooltip;
        private _ensureBalloon;
        private _disposeBalloon;
    }
}
