import { SetOptions } from "@sheetxl/common";
import { ListenerEvent, IListenerSource } from "../listener";
import { ITransactionStack } from "../transaction";
import { RunCoords } from "../run/RunUtils";
import { ISheetStyle, ICellHeader, CellHeaderJSON, CellsHeaderAddressValuePair, CellHeaderUpdate, CellHeaderRangeAddress, HeaderOrientation, AutoFitOptions, ICellHeaderRange } from "../cell";
import { ISheetModel } from "./ISheetModel";
/**
 * Run of headers with min/max embedded. (This prevents rows/columns from having min/max fields but makes persisted json a bit cleaner)
 */
export interface SheetHeaderJSON<P extends CellHeaderJSON> {
    headers: P[];
}
export interface SheetHeadersEvent extends ListenerEvent<ISheetHeadersModel<any, any, any>> {
    runs: RunCoords[];
}
export declare enum SheetHeadersListenerType {
    Header = "header",
    HeaderSize = "headerSize"
}
export interface SetHeaderOptions extends SetOptions {
}
export interface ISheetHeadersModel<T extends ICellHeader, P extends CellHeaderJSON, U extends CellHeaderUpdate> extends ITransactionStack, IListenerSource<SheetHeadersEvent> {
    /**
     * Sets the headers. This supports setting values as a batch.
     * Note -
     * When setting headers the cells references by this sheet will not update. To ensure they are updated you must also
     * call setCellPairs with the range of the header.
     */
    setHeaderPairs(pairs: CellsHeaderAddressValuePair<U>[], options?: SetHeaderOptions): RunCoords[] | null;
    /**
     * Returns a range of cells for the specified range.
     * These allow for interaction with the cells.
     *
     * @remarks
     * If no address is specified then this will use the intersection of the cell
     * bounds and the selection bounds.
     * @see {@link ISheetHeaderRange}
     */
    getRange(address?: CellHeaderRangeAddress): ISheetHeaderRange<U>;
    /**
     * Simplified api provided  to be similar to range update.
     * @remarks
     * This only supports one range at a time but offers a few flavors
     * * sheetXl.getWorkbook().getSheet().getColumnHeaders().update(5, { size: '100px' }); // 0-based index
     * * sheetXl.getWorkbook().getSheet().getColumnHeaders().update({ min: 3, max: 4 }, { size: '100px' }); // 0-based index
     * * sheetXl.getWorkbook().getSheet().getColumnHeaders().update('e:f', { size: '100px' }); // 1-based a1 style
     * * sheetXl.getWorkbook().getSheet().getColumnHeaders().update({ colStart: 3, colEnd: 4 }, { size: '100px' }); // 0-based index
     * * sheetXl.getWorkbook().getSheet().getRowHeaders().update('5:7', { size: '100px' }); // 1-based a1 style
     * * sheetXl.getWorkbook().getSheet().getRowHeaders().update({ rowStart: 3, rowEnd: 4 }, { size: '100px' }); // 0-based index
     */
    update(address: CellHeaderRangeAddress, update: ICellHeader | U | null, options?: SetHeaderOptions): void;
    /**
     * Returns the header at a given offset. Will only return null for invalid header offset. To get a list of headers use @see {@link getRange}
     */
    getHeader(offset: number): T;
    /**
     * Returns a displayable title for the given index.
     * @param index
     */
    getHeaderText(index: number): string;
    /**
     * Return the bounds for headers that contain styling.
     * @remarks
     * * This is NOT the last cell that may have data or has been resized.
     * * This also has nothing to do with the selection bounds.
     */
    getHeaderBounds(): RunCoords;
    /**
     * The maximum cell bounds allowed for the header.
     * @remarks
     */
    getMaxHeaderBounds(): RunCoords;
    /**
     * Set the header size to the 'best fit' based on the data.
     * If the span has no data then the defaultSize will be used.
     * @param addresses
     * @param options
     */
    autoFit(addresses: CellHeaderRangeAddress[] | CellHeaderRangeAddress, options?: AutoFitOptions): void;
    /**
     * Returns if the header is readonly.
     * @defaultValue false
     */
    isProtected(): boolean;
    /**
     * All header sizes are returned in pixels. This is done
     * by multiplying the scaleFactor by the size on the cellHeader.
     */
    scaleFactor(): number;
    /**
     * Finds the offset in pixels for the given header index
     * @param index
     */
    findOffset(index: number): number;
    /**
     * Finds the index for the given header offset
     * @param offset
     */
    findIndex(offset: number): number;
    /**
     * Returns the size of the header in pixels. If a second argument is passed it
     * will be the size of all the headers within the range.
     * Note - It is expected that indexFrom will always be less than or equal to indexTo
     */
    getHeaderSize(indexFrom: number, indexTo?: number): number;
    /**
     * The default header size if not adjusted.
     */
    getDefaultHeaderSize(): number;
    /**
     * The maximum size of the header in native units.
     * @defaultValue unbounded
     */
    getMaxHeaderSize(): number;
    /**
     * The minimum size of the header in native units.
     * @defaultValue 0.
     */
    getMinHeaderSize(): number;
    /**
     * This is a very specific optimization function. When
     * hiding many headers instead of scanning we can just skip.
     * If this returns zero there are no hidden headers immediately
     * following this one. If a count of 1 then only this header is hidden
     * @param index
     * @param forward searches forward. defaults to true
     * @returns count
     */
    hiddenHeadersAt(index: number, forward?: boolean): number;
    /**
     * Insert new blank headers at the given index
     * @param index
     * @param amount
     */
    insertHeaders(index: number, amount: number): void;
    /**
     * Remove headers at the given index
     * @param index
     * @param amount
     */
    removeHeaders(index: number, amount: number): void;
    /**
     * Will return true if any of the headers have the isCustomFormats flag set to true
     */
    hasCustomFormats(): boolean;
    /**
     * Will return true if any of the headers have a custom style (not Normal)
     */
    hasCustomStyles(): boolean;
    /**
     * Returns the sheet style used for the header.
     */
    sheetStyle(): ISheetStyle;
    /**
     * Returns the sheet model used for the header.
     */
    sheet(): ISheetModel;
    /**
     * The direction of the headers
     */
    orientation(): HeaderOrientation;
    toJSON(): SheetHeaderJSON<P>;
    fromJSON(json: SheetHeaderJSON<P>): void;
    close(): void;
}
export interface ISheetHeaderRange<U extends CellHeaderUpdate> extends ICellHeaderRange {
    /**
     * Provides a convenient method for setting values with a range of calls.
     * @remarks
     * If an array is passed the values will be in row-major order and will
     * repeat if the range is larger than the array
     */
    update(values: ICellHeader | U | null, options?: SetHeaderOptions): void;
    /**
     * @see {@link ISheetHeadersModel.autoFit}
     */
    autoFit(options?: AutoFitOptions): void;
    /**
     * Used for runtime reflection.
     */
    readonly isSheetHeaderRange: true;
}
//# sourceMappingURL=ISheetHeadersModel.d.ts.map