import { IGridCanvas, IGridImageOptions } from "./GridCanvas";
import { IPageColumnDefs } from "../Page/Page";
import { IGridCell } from "./GridCell";
import { IGridPage, IGridPageContent } from "./GridPage";
import { IPageContent, IPageContentCellIndex } from "../Page/Content";
import { IActionsButton } from "../Actions/Buttons";
import { IGridEvents, IGridEventCellSelected } from "./GridEvents";
import { ITrackingData } from "../Tracking";
import { IPageSchema } from "../Page/Schema";
import { IActionsStyleConditionStyle } from "../Actions/Styles";
export interface IGridContentStyles extends Array<any> {
    [index: number]: IActionsStyleConditionStyle[];
}
export declare enum IGridFieldType {
    STRING = "string",
    NUMBER = "number",
    DATE = "date"
}
export declare enum IGridSortDirection {
    ASC = "asc",
    DESC = "desc"
}
export interface IGridSorting {
    enabled: boolean;
    field: string;
    direction: IGridSortDirection;
    col: number;
    type: IGridFieldType;
    dateFormat?: string;
    [key: string]: any;
}
export interface IGridFilter {
    col: number;
    field?: string;
    enabled?: boolean;
    exp: string;
    type: IGridFieldType;
    value: string;
    dateFormat?: string;
    name?: string;
}
export interface IGridState {
    filters: IGridFilter[];
    hiddenColumns: number[];
    sorting: IGridSorting;
}
export interface IGrid {
    columnFilters: boolean;
    structured: boolean;
    fit: string;
    contrast: string;
    freezeRow: number;
    freezeCol: number;
    minVisibleRows: number;
    highlights: boolean;
    tracking: boolean;
    disallowSelection: boolean;
    hoverHighlights: boolean;
    canEdit: boolean;
    gridlines: boolean;
    userId: number;
    height: number;
    width: number;
    content: IGridPageContent;
    destroy(): void;
    getContentHtml(type?: string): string;
    getSelectedCells(): IGridCells;
    setContent(content: IPageContent, state?: IGridState): void;
    setDeltaContent(content: any): void;
    setFreeze(row: number, col: number, headings?: boolean): void;
    setFit(fit: string): void;
    setContrast(which: string): void;
    setHiddenColumns(columns: number[]): void;
    update(refresh?: boolean): void;
    updateButtons(buttons?: IActionsButton[]): void;
    updateRanges(ranges: any, userId?: number): void;
    updateState(state: IGridState, internal?: boolean): void;
    updateColumnDefs(columnDefs: IPageColumnDefs[]): void;
    updateFreeze(row: number, col: number, headings?: boolean): void;
    updateFit(fit: string): void;
    updateTrackingData(trackingData: ITrackingData[]): void;
    updateStyles(styles?: IGridContentStyles): void;
    updateColWidth(colIndex: number, cellSize: number): void;
    updateTrackingData(trackingData: ITrackingData[]): void;
    clearTrackingData(): void;
    setSelectorByRef(str: string): void;
    setSelectorByIndex(from: IPageContentCellIndex, to?: IPageContentCellIndex): void;
    clearColumnFilters(): void;
    image(options?: IGridImageOptions): string;
    createSchema(columnKeys: number[], hiddenColumns: number[]): IPageSchema;
    blur(): void;
    focus(): void;
    [key: string]: any;
}
export interface IGridOptions {
    fit?: string;
    headings?: boolean;
    gridlines?: boolean;
    highlights?: boolean;
    tracking?: boolean;
    contrast?: string;
    disallowSelection?: boolean;
    canEdit?: boolean;
    [key: string]: any;
}
export interface IGridSelection {
    from?: IGridCell;
    to?: IGridCell;
    last?: IGridCell;
    selected: boolean;
    rowFrom: number;
    rowTo: number;
    colFrom: number;
    colTo: number;
    heading: boolean;
    inside: boolean;
    keyboard: boolean;
    type: string;
    [key: string]: any;
}
export interface IGridCells extends Array<any> {
    [index: number]: IGridCell[];
}
export declare class Grid implements IGrid {
    ref: string | HTMLDivElement;
    contrast: string;
    freezeRow: number;
    freezeRowTop: number;
    freezeColLeft: number;
    freezeCol: number;
    minVisibleRows: number;
    highlights: boolean;
    isFocus: boolean;
    disallowSelection: boolean;
    canEdit: boolean;
    userId: number;
    height: number;
    width: number;
    content: IGridPageContent;
    rowsToHide: number[];
    hoverType: string;
    state: IGridState;
    Events: IGridEvents;
    Page: IGridPage;
    Canvas: IGridCanvas;
    private initialized;
    private rendering;
    private scrollTop;
    private visibleRows;
    private _fit;
    private _editing;
    private _hasFocus;
    private _gridlines;
    private _headings;
    private _hoverHighlights;
    private _underlineLinks;
    private doubleClicked;
    private clickedAt;
    private historyClick;
    private parameterClick;
    private filterClick;
    private rightClick;
    private _optimisedScrolling;
    private uuid;
    private forceUpdate;
    private dirty;
    private rowChecked;
    private scale;
    private pinchDistance;
    private pinchScale;
    tracking: boolean;
    trackingData: ITrackingData[] | undefined;
    private trackingUsers;
    popperParent: HTMLDivElement;
    private pageEl;
    private editEl;
    private pageElRect;
    private scaleEl;
    private mainEl;
    private freezeRowEl;
    private freezeCornerEl;
    private freezeColEl;
    private headingRow;
    private scrollEl;
    private noMatchesEl;
    private containerEl;
    private boxEl;
    private boxColEl;
    private boxRowEl;
    private selectorWrapperEl;
    private selectorEl;
    private columnsEl;
    private columnSplitEl;
    private selectorBoxEl;
    private rowFragments;
    private styleSheet;
    private rowStyle;
    private colStyles;
    private sortStyles;
    private input;
    private sortWrapperEl;
    private sortEl;
    private gridCells;
    private gridFilterCells;
    private gridCornerHeading;
    private gridRowHeading;
    private gridRowFilters;
    private gridCornerRowFilters;
    private gridCornerHeadingCell;
    private gridRowHeadingCells;
    private gridColumnHeadingCells;
    private rows;
    private colRows;
    private cornerRows;
    private rowRemovalInterval;
    private selection;
    private buttons;
    private styles;
    private accessRanges;
    private found;
    private ctrlDown;
    private shiftDown;
    private arrowKeyDown;
    private keyValue;
    private hammer;
    private editingCell;
    private buttonPopper;
    private editValue;
    private editDone;
    private sortColLeft;
    private sortColWidth;
    private sortColScroll;
    private sortColMoveTo;
    constructor(ref: string | HTMLDivElement, options?: IGridOptions);
    image(options: IGridImageOptions): string;
    structured: boolean;
    columnFilters: boolean;
    hoverHighlights: boolean;
    underlineLinks: boolean;
    gridlines: boolean;
    headings: boolean;
    hasFocus: boolean;
    fit: string;
    softMerges: boolean;
    private editing;
    optimiseScrolling: boolean;
    destroy(): void;
    setContent(content: IGridPageContent, state?: IGridState, columnDefs?: IPageColumnDefs[]): void;
    setDeltaContent(content: IPageContent): void;
    setFreeze(row: number, col: number): void;
    setFit(fit: string): void;
    setContrast(which: string): void;
    setHiddenColumns(columns: number[]): void;
    update(refresh?: boolean): void;
    updateState(state: IGridState, internal?: boolean): void;
    updateColumnDefs(columnDefs: IPageColumnDefs[]): void;
    updateHeadings(headings: boolean): void;
    updateColumnFilters(n: boolean): void;
    updateFreeze(row: number, col: number): void;
    updateFit(fit: string): void;
    updateButtons(buttons?: IActionsButton[]): void;
    updateStyles(styles?: IGridContentStyles): void;
    updateColWidth(colIndex: number, cellSize: number): void;
    updateRanges(ranges: any, userId?: number): void;
    getContentHtml(type?: string): string;
    find(query: string): void;
    clearFound(): void;
    createSchema(columnKeys: number[], hiddenColumns: number[]): IPageSchema;
    private applyStyles;
    private applyButtons;
    private applyRanges;
    private applyCellUpdate;
    hideSelector(): void;
    clearSelector(): void;
    setSelectorByRef(str: string): void;
    setSelectorByIndex(fromIndex: IPageContentCellIndex, toIndex?: IPageContentCellIndex): void;
    getSelection(event?: any): IGridEventCellSelected;
    editCell(row: number, col: number, value?: string, click?: boolean): void;
    getSelectedCells(): IGridCells;
    getGridCell(rowIndex: number, colIndex: number, ignore?: boolean): IGridCell | null;
    private init;
    private reset;
    private createListeners;
    private destroyListeners;
    private dom;
    private getScrollbarWidth;
    private updateElSizes;
    private updateSelector;
    private scrollSelector;
    private keepSelectorInView;
    private scrollTo;
    private applyState;
    private applyColWidth;
    private applySortIndicator;
    private applyFilters;
    private applySorting;
    private onScrollFreezeCol;
    private onScroll;
    private applyMergeWidths;
    private onCell;
    private setToCell;
    private render;
    private resizeTimer;
    private onResize;
    private onKeydown;
    private onKeyup;
    private onMouseDown;
    private onMouseMove;
    private onMouseUp;
    private emitDelete;
    blur(): void;
    focus(): void;
    private defocus;
    private getGridCellTarget;
    private onCtrlNavigate;
    private selectNextCell;
    private jumpToCell;
    private gotoNextCell;
    private emitCellSelected;
    private getScrollTop;
    private getScrollLeft;
    private getTouchDistance;
    private isRightClick;
    private destroyPopper;
    clearTrackingData(): void;
    updateTrackingData(trackingData: ITrackingData[]): void;
    clearColumnFilters(): void;
    private updateHistoryCells;
    private getTrackingUser;
    private applyScale;
    private applyFilterValues;
    getDefaultState(): IGridState;
    private getRowValues;
    private getColValues;
    private getNextIndex;
    private getNextPageIndex;
    private getNextMappingIndex;
}
