import CSS from 'csstype';
import { CSSProperties, ReactNode } from 'react';
import { TimeZone } from './timeZones';
import { GeoLayerConfig } from './geo';
export interface PlotDimensions {
    height: number;
    width: number;
}
export declare type SizedConfig = Config & {
    width: number;
    height: number;
};
export interface Config {
    width?: number;
    height?: number;
    interactionHandlers?: InteractionHandlers;
    gridColor?: string;
    gridOpacity?: number;
    cursor?: string;
    showAxes?: boolean;
    axisColor?: string;
    axisOpacity?: number;
    xTicks?: number[];
    xTickStart?: number;
    xTickStep?: number;
    xTotalTicks?: number;
    yTicks?: Array<number | string>;
    yTickStart?: number;
    yTickStep?: number;
    yTotalTicks?: number;
    tickFont?: string;
    tickFontColor?: string;
    valueFormatters?: {
        [colKey: string]: Formatter;
    };
    xAxisLabel?: string;
    yAxisLabel?: string;
    xScale?: string;
    yScale?: string;
    table?: Table;
    fluxResponse?: string;
    layers: LayerConfig[];
    xDomain?: number[];
    onSetXDomain?: (xDomain: number[]) => void;
    onResetXDomain?: () => void;
    yDomain?: number[];
    onSetYDomain?: (yDomain: number[]) => void;
    onResetYDomain?: () => void;
    legendBackgroundColor?: string;
    legendBorder?: string;
    legendColorizeRows?: boolean;
    legendColumns?: string[];
    legendCrosshairColor?: string;
    legendFont?: string;
    legendFontBrightColor?: string;
    legendFontColor?: string;
    legendHide?: boolean;
    legendMessage?: string;
    legendOpacity?: number;
    legendOrientationThreshold?: number;
    staticLegend?: StaticLegend;
    yColumnType?: ColumnType;
}
export declare enum LegendPropertyNames {
    backgroundColor = "legendBackgroundColor",
    border = "legendBorder",
    colorizeRows = "legendColorizeRows",
    columns = "legendColumns",
    crosshairColor = "legendCrosshairColor",
    font = "legendFont",
    fontBrightColor = "legendFontBrightColor",
    fontColor = "legendFontColor",
    hide = "legendHide",
    message = "legendMessage",
    opacity = "legendOpacity",
    orientationThreshold = "legendOrientationThreshold"
}
export interface StaticLegend {
    backgroundColor?: string;
    border?: string;
    colorizeRows?: boolean;
    columns?: string[];
    crosshairColor?: string;
    cursor?: string;
    font?: string;
    fontBrightColor?: string;
    fontColor?: string;
    heightRatio?: number;
    hide?: boolean;
    layer?: number;
    message?: string;
    opacity?: number;
    orientationThreshold?: number;
    style?: CSSProperties;
    valueAxis?: 'x' | 'y';
    widthRatio?: number;
}
export interface InteractionHandlerArguments {
    clampedValueX: number;
    hoverX: number;
    hoverY: number;
    valueX: number | string;
    valueY: number | string;
    xDomain: number[];
    yDomain: number[];
    resetDomains: () => void;
}
export interface InteractionHandlers {
    doubleClick?: (plotInteraction: InteractionHandlerArguments) => void;
    singleClick?: (plotInteraction: InteractionHandlerArguments) => void;
    hover?: (plotInteraction: InteractionHandlerArguments) => void;
    onXBrush?: (beginning: number | string, end: number | string) => void;
}
export declare enum FormatterType {
    Time = "TIME",
    BinaryPrefix = "BINARY_PREFIX",
    SIPrefix = "SI_PREFIX"
}
export interface Formatter {
    (val: any, options?: object): string;
    readonly _GIRAFFE_FORMATTER_TYPE?: FormatterType;
}
export interface Table {
    getColumn: GetColumn;
    getColumnName: (columnKey: string) => string | null;
    getColumnType: (columnKey: string) => ColumnType | null;
    getOriginalColumnType: (columnKey: string) => FluxDataType | null;
    columnKeys: string[];
    length: number;
    addColumn: (columnKey: string, fluxDataType: FluxDataType, type: ColumnType, data: ColumnData, name?: string) => Table;
}
export interface GetColumn {
    (columnKey: string): ColumnData | null;
    (columnKey: string, type: 'number'): NumericColumnData | null;
    (columnKey: string, type: 'time'): NumericColumnData | null;
    (columnKey: string, type: 'string'): string[] | null;
    (columnKey: string, type: 'boolean'): boolean[] | null;
}
export declare type NumericColumnData = number[] | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Float32Array | Float64Array;
export declare type ColumnData = NumericColumnData | string[] | boolean[];
export declare type ColumnType = 'number' | 'string' | 'time' | 'boolean';
export declare type FluxDataType = 'boolean' | 'unsignedLong' | 'long' | 'double' | 'string' | 'dateTime:RFC3339' | 'system';
export declare enum LayerTypes {
    RawFluxDataTable = "flux data table",
    Gauge = "gauge",
    Custom = "custom",
    Annotation = "annotation",
    SingleStat = "single stat",
    Heatmap = "heatmap",
    Histogram = "histogram",
    Line = "line",
    Band = "band",
    Scatter = "scatter",
    Mosaic = "mosaic",
    Table = "table",
    Geo = "geo"
}
export declare type LayerConfig = CustomLayerConfig | AnnotationLayerConfig | RawFluxDataTableLayerConfig | GaugeLayerConfig | SingleStatLayerConfig | HeatmapLayerConfig | HistogramLayerConfig | LineLayerConfig | BandLayerConfig | ScatterLayerConfig | MosaicLayerConfig | TableGraphLayerConfig | GeoLayerConfig;
export interface CustomLayerConfig {
    type: 'custom';
    render: (p: CustomLayerRenderProps) => JSX.Element;
}
export interface AnnotationLayerConfig {
    type: 'annotation';
    x: string;
    y: string;
    annotations: AnnotationMark[];
    fill: string[];
    hoverDimension?: LineHoverDimension | 'auto';
    hoverMargin?: number;
    svgAttributes?: SVGAttributes;
    svgStyle?: CSS.Properties;
    lineWidth?: number;
    handleAnnotationClick?: (id: string) => void;
}
export interface CustomLayerRenderProps {
    key: string | number;
    xScale: Scale<number, number>;
    yScale: Scale<number, number>;
    xDomain: number[];
    yDomain: number[];
    width: number;
    height: number;
    innerWidth: number;
    innerHeight: number;
    yColumnType: ColumnType;
    columnFormatter: (colKey: string) => (x: any) => string;
}
export interface RawFluxDataTableLayerConfig {
    type: 'flux data table';
    files: string[];
    width: number;
    height: number;
    disableVerticalScrolling?: boolean;
    parseObjects?: boolean;
}
export interface GaugeLayerConfig {
    type: 'gauge';
    prefix?: string;
    suffix?: string;
    tickPrefix?: string;
    tickSuffix?: string;
    decimalPlaces?: DecimalPlaces;
    gaugeColors: Color[];
    gaugeSize?: number;
    gaugeTheme?: Partial<GaugeTheme>;
}
export interface GaugeTheme {
    lineCount: number;
    smallLineCount: number;
    lineColor: string;
    labelColor: string;
    labelFontSize: number;
    lineStrokeSmall: number;
    lineStrokeLarge: number;
    tickSizeSmall: number;
    tickSizeLarge: number;
    minFontSize: number;
    minLineWidth: number;
    valueColor: string;
    valuePositionXOffset: number;
    valuePositionYOffset: number;
    needleColor0: string;
    needleColor1: string;
    overflowDelta: number;
}
export interface SingleStatLayerConfig {
    type: 'single stat';
    prefix: string;
    suffix: string;
    decimalPlaces: DecimalPlaces;
    textColor: string;
    textOpacity?: number;
    backgroundColor?: string;
    testID?: string;
    style?: CSS.Properties;
    resizerStyle?: CSS.Properties;
    svgAttributes?: SVGAttributes;
    svgStyle?: CSS.Properties;
    svgTextAttributes?: SVGAttributes;
    svgTextStyle?: CSS.Properties;
}
export declare type SVGAttributeFunction = (stat: string) => string;
export interface SVGAttributes {
    [attributeName: string]: string | SVGAttributeFunction;
}
export interface HeatmapLayerConfig {
    type: 'heatmap';
    x: string;
    y: string;
    binSize?: number;
    colors?: string[];
    fillOpacity?: number;
    strokeOpacity?: number;
    strokeWidth?: number;
    strokePadding?: number;
}
export interface HistogramLayerConfig {
    type: 'histogram';
    x: string;
    position?: HistogramPosition;
    binCount?: number;
    fill?: string[];
    colors?: string[];
    fillOpacity?: number;
    strokeOpacity?: number;
    strokeWidth?: number;
    strokePadding?: number;
}
export interface MosaicLayerConfig {
    type: 'mosaic';
    x: string;
    y: string[];
    yLabelColumns?: string[];
    yLabelColumnSeparator?: string;
    fill: string[];
    hoverDimension?: MosaicHoverDimension | 'auto';
    colors?: string[];
    strokeWidth?: number;
    strokePadding?: number;
    strokeOpacity?: number;
    fillOpacity?: number;
}
export declare type RectLayerConfig = HeatmapLayerConfig | HistogramLayerConfig;
export interface LineLayerConfig {
    type: 'line';
    x: string;
    y: string;
    fill?: string[];
    position?: LinePosition;
    hoverDimension?: LineHoverDimension | 'auto';
    maxTooltipRows?: number;
    interpolation?: LineInterpolation;
    lineWidth?: number;
    colors?: string[];
    shadeBelow?: boolean;
    shadeBelowOpacity?: number;
}
export interface BandLayerConfig {
    type: 'band';
    x: string;
    y: string;
    fill: string[];
    position?: LinePosition;
    hoverDimension?: LineHoverDimension | 'auto';
    maxTooltipRows?: number;
    interpolation?: LineInterpolation;
    lineWidth?: number;
    lineOpacity?: number;
    colors?: string[];
    shadeOpacity?: number;
    mainColumnName: string;
    upperColumnName?: string;
    lowerColumnName?: string;
}
export interface ScatterLayerConfig {
    type: 'scatter';
    x: string;
    y: string;
    fill?: string[];
    colors?: string[];
    symbol?: string[];
}
export interface TableGraphLayerConfig {
    type: 'table';
    tables?: FluxTable[];
    timeZone: TimeZone;
    tableTheme?: Theme;
    properties: TableViewProperties;
}
export interface DashboardQuery {
    text?: string;
    editMode?: QueryEditMode;
    name?: string;
    builderConfig?: BuilderConfig;
}
export declare type QueryEditMode = 'builder' | 'advanced';
export interface BuilderConfig {
    buckets?: string[];
    tags?: BuilderTagsType[];
    functions?: BuilderFunctionsType[];
    aggregateWindow?: {
        period?: string;
    };
}
export interface BuilderTagsType {
    key?: string;
    values?: string[];
    aggregateFunctionType?: BuilderAggregateFunctionType;
}
export declare type BuilderAggregateFunctionType = 'filter' | 'group';
export interface BuilderFunctionsType {
    name?: string;
}
export interface RenamableField {
    readonly internalName?: string;
    displayName?: string;
    visible?: boolean;
}
export * from './timeZones';
export declare type Theme = 'light' | 'dark';
export interface TableViewProperties {
    type?: string;
    shape?: string;
    note?: string;
    showNoteWhenEmpty?: boolean;
    queries?: DashboardQuery[];
    colors: Color[];
    tableOptions: {
        wrapping?: 'truncate' | 'wrap' | 'single-line';
        fixFirstColumn?: boolean;
        verticalTimeAxis?: boolean;
        sortBy?: RenamableField;
    };
    fieldOptions: RenamableField[];
    timeFormat: string;
    decimalPlaces: DecimalPlaces;
}
export interface ColumnWidths {
    totalWidths: number;
    widths: {
        [x: string]: number;
    };
}
export interface TransformTableDataReturnType {
    transformedData: string[][];
    sortedTimeVals: string[];
    columnWidths: ColumnWidths;
    resolvedRenamableFields: RenamableField[];
    sortOptions: SortOptions;
}
export interface SortOptions {
    field: string;
    direction: string;
}
export interface TimeField {
    internalName: string;
    displayName: string;
    visible: boolean;
}
export interface FluxTable {
    id: string;
    name: string;
    data: string[][];
    result: string;
    groupKey: {
        [columnName: string]: string;
    };
    dataTypes: {
        [columnName: string]: string;
    };
}
export declare type LayerSpec = AnnotationLayerSpec | LineLayerSpec | BandLayerSpec | ScatterLayerSpec | RectLayerSpec | MosaicLayerSpec;
export declare enum SpecTypes {
    Annotation = "annotation",
    Line = "line",
    Band = "band",
    Scatter = "scatter",
    Rect = "rect",
    Mosaic = "mosaic",
    Table = "table"
}
export interface AnnotationLayerSpec {
    type: 'annotation';
    table: Table;
    annotationData: AnnotationMark[];
    xColumnKey: string;
    yColumnKey: string;
    xColumnType: ColumnType;
    yColumnType: ColumnType;
    xDomain: number[];
    yDomain: number[];
}
export interface MosaicLayerSpec {
    type: 'mosaic';
    inputTable: Table;
    table: Table;
    xDomain: number[];
    yDomain: number[];
    xColumnKey: string;
    xColumnType: ColumnType;
    yColumnType: ColumnType;
    yColumnsName: string;
    scales: {
        fill: Scale<number, string>;
    };
    columnGroupMaps: {
        fill: ColumnGroupMap;
    };
    ySeries: Array<string>;
    yTicks: Array<string>;
}
export interface LineLayerSpec {
    type: 'line';
    inputTable: Table;
    table: Table;
    lineData: LineData;
    xDomain: number[];
    yDomain: number[];
    xColumnKey: string;
    yColumnKey: string;
    xColumnType: ColumnType;
    yColumnType: ColumnType;
    scales: {
        fill: Scale<number, string>;
    };
    columnGroupMaps: {
        fill: ColumnGroupMap;
        latestIndices: LatestIndexMap;
    };
    stackedDomainValueColumn?: NumericColumnData;
}
export interface BandLayerSpec {
    type: 'band';
    bandIndexMap: BandIndexMap;
    bandName: string;
    upperColumnName: string;
    lowerColumnName: string;
    inputTable: Table;
    table: Table;
    lineData: LineData;
    xDomain: number[];
    yDomain: number[];
    xColumnKey: string;
    yColumnKey: string;
    xColumnType: ColumnType;
    yColumnType: ColumnType;
    scales: {
        fill: Scale<number, string>;
    };
    columnGroupMaps: {
        fill: ColumnGroupMap;
        latestIndices: LatestIndexMap;
    };
}
export interface ScatterLayerSpec {
    type: 'scatter';
    inputTable: Table;
    table: Table;
    xDomain: number[];
    yDomain: number[];
    xColumnKey: string;
    yColumnKey: string;
    xColumnType: ColumnType;
    yColumnType: ColumnType;
    scales: {
        fill: Scale<number, string>;
        symbol: Scale<number, SymbolType>;
    };
    columnGroupMaps: {
        fill: ColumnGroupMap;
        symbol: ColumnGroupMap;
    };
}
export interface RectLayerSpec {
    type: 'rect';
    inputTable: Table;
    table: Table;
    binDimension: 'xy' | 'x';
    xDomain: number[];
    yDomain: number[];
    xColumnKey: string;
    yColumnKey: string;
    xColumnType: ColumnType;
    yColumnType: ColumnType;
    scales: {
        fill: Scale<number, string>;
    };
    columnGroupMaps: {
        fill?: ColumnGroupMap;
    };
}
export interface LayerProps {
    xScale: Scale<number, number>;
    yScale: Scale<number, number>;
    width: number;
    height: number;
    spec: LayerSpec;
    config: LayerConfig;
    plotConfig: SizedConfig;
    yColumnType: ColumnType;
    columnFormatter: (colKey: string) => (x: any) => string;
    hoverX: number | null;
    hoverY: number | null;
}
export interface Scale<D = any, R = any> {
    (x: D): R;
    invert?: (y: R) => D;
}
export declare type ScaleFactory = (domainStart: number, domainStop: number, rangeStart: number, rangeStop: number) => Scale<number, number>;
export interface DecimalPlaces {
    isEnforced?: boolean;
    digits?: number;
}
export interface Margins {
    top: number;
    right: number;
    bottom: number;
    left: number;
}
export interface Color {
    id: string;
    type: 'min' | 'max' | 'threshold' | 'scale' | 'text' | 'background';
    hex: string;
    name: string;
    value: number;
}
export interface LegendColumn {
    key: string;
    name: string;
    type: ColumnType;
    values: string[];
    colors: string[] | null;
}
export declare type LegendData = LegendColumn[];
export interface TooltipPosition {
    x: number;
    y: number;
}
export interface AnnotationTooltipOptions {
    dimension: AnnotationDimension;
    position: TooltipPosition;
    xOffset: number;
    yOffset: number;
}
export interface AnnotationTooltipData {
    title: string;
    description: string;
    fontColor: string;
    position: TooltipPosition;
}
export declare type LineInterpolation = 'linear' | 'monotoneX' | 'monotoneY' | 'cubic' | 'step' | 'stepBefore' | 'stepAfter' | 'natural';
export declare type LineHoverDimension = 'x' | 'y' | 'xy';
export declare type LinePosition = 'overlaid' | 'stacked';
export declare type HistogramPosition = 'overlaid' | 'stacked';
export declare type MosaicPosition = 'stacked';
export declare type MosaicHoverDimension = 'x' | 'y' | 'xy';
export declare type SymbolType = 'circle' | 'triangle' | 'square' | 'plus' | 'tritip' | 'ex';
export interface ColumnGroupMap {
    columnKeys: string[];
    mappings: Array<{
        [columnKey: string]: any;
    }>;
}
export interface LatestIndexMap {
    [columnKey: string]: number;
}
export declare type LineData = {
    [groupID: number]: {
        xs: number[];
        ys: number[];
        fill: string;
    };
};
export declare type CumulativeValuesByTime = {
    [time: number]: {
        [groupID: number]: number;
    };
};
export declare enum ErrorName {
    UnknownColumnTypeError = "UnknownColumnTypeError",
    SchemaMismatchError = "SchemaMismatchError"
}
export declare enum DomainLabel {
    X = "xs",
    Y = "ys"
}
export declare type AxisTicks = Date[] | number[];
export interface BandBorder {
    xs: Array<number>;
    ys: Array<number>;
    fill: string;
}
export interface Band {
    lower?: BandBorder;
    upper?: BandBorder;
    xs: Array<number>;
    ys: Array<number>;
    fill: string;
}
export interface BandIndexMap {
    rowIndices: number[];
    lowerIndices: number[];
    upperIndices: number[];
}
export interface StandardFunctionProps {
    id?: string;
    style?: CSSProperties;
    testID?: string;
    children?: ReactNode;
    className?: string;
}
export declare type AnnotationDimension = 'x' | 'y';
export declare type AnnotationPinType = 'none' | 'circle' | 'start' | 'stop';
export interface AnnotationMark {
    title: string;
    description: string;
    color: string;
    startValue: number;
    stopValue: number;
    dimension: AnnotationDimension;
    pin: AnnotationPinType;
    id?: string;
}
