import type { FilterConfig, PivotTableState, Dimension, GroupConfig, MeasureConfig, AggregationType, Group, PaginationConfig, FieldInfo, LayoutSelection } from '@mindfiredigital/pivothead'; import type { EnhancedPivotEngine, PivotDataRecord, PivotOptions } from '../types/types'; import type { ConnectionOptions, FileConnectionResult } from '@mindfiredigital/pivothead'; export declare class PivotHeadElement extends HTMLElement { private engine; private _engineUnsubscribe; private _data; private _originalData; private _options; private _filters; private _rawFilters; private _processedFilters; private _rowGroups; private _columnGroups; private _pagination; private _showRawData; private _rawDataColumnOrder; private _processedColumnOrder; static get observedAttributes(): string[]; constructor(); set data(value: PivotDataRecord[]); get data(): PivotDataRecord[]; set options(value: PivotOptions); get options(): PivotOptions; set filters(value: FilterConfig[]); get filters(): FilterConfig[]; set pagination(value: PaginationConfig); get pagination(): PaginationConfig; /** * Get the underlying PivotEngine instance for advanced operations * like chart visualization with the analytics package */ get pivotEngine(): EnhancedPivotEngine | undefined; private handleEngineStateChange; private tryInitializeEngine; connectedCallback(): void; disconnectedCallback(): void; private parseAttributesIfNeeded; private parseOtherAttributes; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; private _renderSwitch; private renderFullUI; private setupControls; private updatePaginationInfo; private calculatePaginationForCurrentView; private updatePaginationForData; private getPaginatedData; private renderRawTable; private createSortIcon; private createProcessedSortIcon; private addDragListeners; private handleSortClick; private handleDrillDownClick; private draggedColumn; private draggedRow; getRawData(): PivotDataRecord[]; getPagination(): PaginationConfig; getState(): PivotTableState; refresh(): void; reset(): void; private clearFilterUI; sort(field: string, direction: 'asc' | 'desc'): void; setMeasures(measures: MeasureConfig[]): void; setDimensions(dimensions: Dimension[]): void; setGroupConfig(groupConfig: GroupConfig | null): void; setAggregation(type: AggregationType): void; formatValue(value: unknown, field: string): string; getGroupedData(): Group[]; getFilters(): FilterConfig[]; getData(): PivotDataRecord[]; getProcessedData(): unknown; exportToHTML(fileName?: string): void; exportToPDF(fileName?: string): void; exportToExcel(fileName?: string): void; openPrintDialog(): void; loadFromFile(file: File): Promise; loadFromUrl(url: string): Promise; connectToLocalCSV(options?: ConnectionOptions): Promise; connectToLocalJSON(options?: ConnectionOptions): Promise; connectToLocalFile(options?: ConnectionOptions): Promise; dragRow(fromIndex: number, toIndex: number): void; dragColumn(fromIndex: number, toIndex: number): void; swapRows(fromIndex: number, toIndex: number): void; swapColumns(fromIndex: number, toIndex: number): void; private swapRawDataColumns; setDragAndDropEnabled(enabled: boolean): void; isDragAndDropEnabled(): boolean; swapDataRowsByIndex(fromIndex: number, toIndex: number): void; swapDataColumnsByIndex(fromIndex: number, toIndex: number): void; previousPage(): void; nextPage(): void; setPageSize(pageSize: number): void; goToPage(page: number): void; setViewMode(mode: 'raw' | 'processed'): void; getViewMode(): 'raw' | 'processed'; updateFieldFormatting(field: string, format: import('../types/types').FormatOptions): void; getFieldAlignment(field: string): string; showFormatPopup(): void; /** * Returns all fields inferred from the engine's raw data. * Useful for building a UI for field selection. */ getAvailableFields(): FieldInfo[]; /** * Returns the list of supported aggregation types (e.g., 'sum', 'avg'). */ getSupportedAggregations(): AggregationType[]; /** * Changes the aggregation for a specific measure and refreshes the engine. * @param field The unique name of the measure field. * @param aggregation The new aggregation type. */ setMeasureAggregation(field: string, aggregation: AggregationType): void; /** * Builds and applies a complete layout (rows, columns, measures) from a selection object. * This is the primary method for updating the pivot table structure from a UI. * @param selection The layout selection object. */ buildLayout(selection: LayoutSelection): void; }