import BigNumber from 'bignumber.js';
import Konva from 'konva';
import { PMMModel } from '@dodoex/api';
export declare function colorRgb(str: string): string;
export type EvaluatedPoint = {
    side: 'bid' | 'ask' | 'no-one';
    vert: BigNumber;
    base: BigNumber;
    quote: BigNumber;
};
export type BaseMinAndZoomMultiples = {
    baseMin: BigNumber;
    zoomMultiples: number;
    /** Price impact point active display hover */
    targetMarginPriceX: number;
};
export declare function evalPoint({ val, model, }: {
    val: BigNumber;
    model: PMMModel;
    midPrice: BigNumber;
}): EvaluatedPoint;
/**
 * Returns two vertical coordinates, buyBaseVert on the left and sellBaseVert on the right.
 * @param param0
 */
export declare function computeBaseVert({ midPrice, q, q0, pmmModel, }: {
    midPrice: BigNumber;
    q: number;
    q0: number;
    pmmModel: PMMModel;
}): {
    buyBaseVert: BigNumber;
    sellBaseVert: BigNumber;
};
/**
 * // 1000/800 The price represented by one pixel
  // Maximum value on the right side of the middle price = middle price * 10 = middle price * 10^1
  // Calculate the x-axis coordinate (price): middle price*10^(xPortion*x)+middle price; x is the number of equal parts that divide the right half into 50 parts
 * @param chartWidth icon width
 * @param zoomMultiples magnification factors
 * @returns
 */
export declare function computeXPortion(chartWidth: number, zoomMultiples?: number): BigNumber;
export declare function updateTooltip({ tooltip, x, chartWidth, chartHeight, buyBaseVert, sellBaseVert, pmmModel, midPrice, baseTokenSymbol, quoteTokenSymbol, t, baseMinAndZoomMultiples, isHover, color, leftColor, rightColor, }: {
    x: number;
    tooltip: Konva.Layer;
    chartWidth: number;
    chartHeight: number;
    buyBaseVert: BigNumber;
    sellBaseVert: BigNumber;
    pmmModel: PMMModel;
    midPrice: BigNumber;
    baseTokenSymbol: string;
    quoteTokenSymbol: string;
    t: any;
    baseMinAndZoomMultiples: BaseMinAndZoomMultiples;
    isHover?: boolean;
    color?: string;
    leftColor?: string;
    rightColor?: string;
}): void;
/**
 * Calculate the minimum value on the left by pulling distance or button click
 */
export declare function computeBaseMinByDistance({ dragDistance, prevBaseMin, chartWidth, zoomMultiples, }: {
    dragDistance: number;
    prevBaseMin: BigNumber;
    chartWidth: number;
    zoomMultiples: number;
}): BigNumber;
export declare const baseZoomMultiples = 1;
export declare function computeZoomMultiplesWhenZoom({ prevZoomMultiples, zoomIn, }: {
    prevZoomMultiples: number;
    zoomIn: boolean;
}): number;
/**
 * Given a price target corresponding to the abscissa, calculate the abscissa of the point
 * The buying impact point is at the left 1/4 position
 * The selling impact point is 3/4 on the right
 *
 * Returns a coordinate point, baseMin and zoomMultiples
 *
 * Take the initial state as the starting point, that is, midPrice * 10 ^ -1 as the starting point of the horizontal axis, and it is a left-right symmetrical state, that is, the logarithm of the horizontal axis is from -1 -> 0 -> 1
 *
 * type === 'sell'
 * targetPrice = midPrice * 10 ^ n
 * n = Math.log10(targetPrice / midPrice)
 * n = maxN * (3 / 4)
 *
 * If the new price is within the existing range, the zoom factor will not be adjusted (the price impact will not change the shape of the graph after graph scaling or translation)
 * If it is not within the current interval, check whether it is midPrice * 10 ^-1 and midPrice * 10^1. If you still do not adjust the zoom factor, hit the specified point directly, otherwise you need to adjust the zoom factor (avoid inputting extremely small values) The value cannot be scaled to the specified range, resulting in stuck)
 */
export declare function computeTargetXByTargetPrice({ type, targetPrice, midPrice, width, }: {
    type: 'buy' | 'sell';
    targetPrice: BigNumber;
    midPrice: BigNumber;
    width: number;
}): {
    zoomMultiples: BigNumber;
    targetX: number;
};
/**
 * If the new price is within the existing range, the zoom factor will not be adjusted (the price impact will not change the shape of the graph after graph scaling or translation)
 * If it is not within the current interval, check whether it is midPrice * 10 ^-1 and midPrice * 10^1. If it is within the range, adjust the zoom factor to 1, and then impact to the specified point, otherwise you need to adjust the zoom factor ( Avoid entering extremely small values ​​that may result in inability to scale to the specified range and cause stucks)
 *
 * Returns an abscissa and a flag indicating whether to skip
 */
export declare function beforePriceImpactEffect({ currentBaseMinAndZoomMultiples, targetPrice, midPrice, width, }: {
    currentBaseMinAndZoomMultiples: BaseMinAndZoomMultiples;
    targetPrice: BigNumber;
    midPrice: BigNumber;
    width: number;
}): {
    isSkip: boolean;
    targetX: number;
    baseMin: BigNumber;
    zoomMultiples: number;
};
/**
 * Recalculate baseMin after the zoom factor changes
 */
export declare function computeBaseAfterZoom({ midPrice, zoomMultiples, }: {
    midPrice: BigNumber;
    zoomMultiples: number;
}): BigNumber;
