import ZRText, { TextStyleProps } from 'zrender/lib/graphic/Text.js';
import Element, { ElementTextConfig } from 'zrender/lib/Element.js';
import Model from '../model/Model.js';
import { LabelOption, DisplayState, TextCommonOption, StatesOptionMixin, DisplayStateNonNormal, ColorString, ZRStyleProps, AnimationOptionMixin, InterpolatableValue, LabelCommonOption, TextCommonOptionNuanceBase, TextCommonOptionNuanceDefault, NullUndefined } from '../util/types.js';
import GlobalModel from '../model/Global.js';
import SeriesData from '../data/SeriesData.js';
declare type TextCommonParams = {
    /**
     * Whether disable drawing box of block (outer most).
     */
    disableBox?: boolean;
    /**
     * Specify a color when color is 'inherit',
     * If inheritColor specified, it is used as default textFill.
     */
    inheritColor?: ColorString;
    /**
     * Specify a opacity when opacity is not given.
     */
    defaultOpacity?: number;
    defaultOutsidePosition?: LabelOption['position'];
    /**
     * If support legacy 'auto' for 'inherit' usage.
     */
    textStyle?: ZRStyleProps;
    defaultTextMargin?: number | number[];
    autoOverflowArea?: ElementTextConfig['autoOverflowArea'];
    layoutRect?: ElementTextConfig['layoutRect'];
};
interface SetLabelStyleOpt<TLabelDataIndex> extends TextCommonParams {
    defaultText?: string | ((labelDataIndex: TLabelDataIndex, opt: SetLabelStyleOpt<TLabelDataIndex>, interpolatedValue?: InterpolatableValue) => string);
    labelFetcher?: {
        getFormattedLabel: (labelDataIndex: TLabelDataIndex, status: DisplayState, dataType?: string, labelDimIndex?: number, formatter?: string | ((params: object) => string), extendParams?: {
            interpolatedValue: InterpolatableValue;
        }) => string;
    };
    labelDataIndex?: TLabelDataIndex;
    labelDimIndex?: number;
    /**
     * Inject a setter of text for the text animation case.
     */
    enableTextSetter?: boolean;
}
declare type LabelModel = Model<LabelOption & {
    formatter?: string | ((params: any) => string);
    showDuringLabel?: boolean;
}>;
declare type LabelModelForText = Model<Omit<LabelOption, 'position' | 'rotate'> & {
    formatter?: string | ((params: any) => string);
}>;
declare type LabelStatesModels<LabelModel> = Partial<Record<DisplayStateNonNormal, LabelModel>> & {
    normal: LabelModel;
};
declare type LabelCommonModel<TNuance extends TextCommonOptionNuanceBase = TextCommonOptionNuanceDefault> = Model<LabelCommonOption<TNuance>>;
export declare function setLabelText(label: ZRText, labelTexts: Record<DisplayState, string>): void;
/**
 * Set normal styles and emphasis styles about text on target element
 * If target is a ZRText. It will create a new style object.
 * If target is other Element. It will create or reuse ZRText which is attached on the target.
 * And create a new style object.
 *
 * NOTICE: Because the style on ZRText will be replaced with new(only x, y are keeped).
 * So please update the style on ZRText after use this method.
 */
declare function setLabelStyle<TLabelDataIndex>(targetEl: ZRText, labelStatesModels: LabelStatesModels<LabelModelForText>, opt?: SetLabelStyleOpt<TLabelDataIndex>, stateSpecified?: Partial<Record<DisplayState, TextStyleProps>>): void;
declare function setLabelStyle<TLabelDataIndex>(targetEl: Element, labelStatesModels: LabelStatesModels<LabelModel>, opt?: SetLabelStyleOpt<TLabelDataIndex>, stateSpecified?: Partial<Record<DisplayState, TextStyleProps>>): void;
export { setLabelStyle };
export declare function getLabelStatesModels<LabelName extends string = 'label'>(itemModel: Model<StatesOptionMixin<any, any> & Partial<Record<LabelName, any>>>, labelName?: LabelName): Record<DisplayState, LabelModel>;
/**
 * Set basic textStyle properties.
 */
export declare function createTextStyle<TNuance extends TextCommonOptionNuanceBase = TextCommonOptionNuanceDefault>(textStyleModel: LabelCommonModel<TNuance>, specifiedTextStyle?: TextStyleProps, // Fixed style in the code. Can't be set by model.
opt?: Parameters<typeof setTextStyleCommon>[2], isNotNormal?: boolean, isAttached?: boolean): TextStyleProps;
export declare function createTextConfig(textStyleModel: Model<LabelOption<{
    positionExtra: 'outside';
}>>, opt?: Pick<TextCommonParams, 'defaultOutsidePosition' | 'inheritColor' | 'autoOverflowArea' | 'layoutRect'>, isNotNormal?: boolean): ElementTextConfig;
/**
 * The uniform entry of set text style, that is, retrieve style definitions
 * from `model` and set to `textStyle` object.
 *
 * Never in merge mode, but in overwrite mode, that is, all of the text style
 * properties will be set. (Consider the states of normal and emphasis and
 * default value can be adopted, merge would make the logic too complicated
 * to manage.)
 */
declare function setTextStyleCommon<TNuance extends TextCommonOptionNuanceBase = TextCommonOptionNuanceDefault>(textStyle: TextStyleProps, textStyleModel: LabelCommonModel<TNuance>, opt?: Pick<TextCommonParams, 'inheritColor' | 'defaultOpacity' | 'disableBox' | 'defaultTextMargin'>, isNotNormal?: boolean, isAttached?: boolean): void;
export declare function getFont(opt: Pick<TextCommonOption, 'fontStyle' | 'fontWeight' | 'fontSize' | 'fontFamily'>, ecModel: GlobalModel): string;
export declare const labelInner: (hostObj: ZRText) => {
    /**
     * Previous target value stored used for label.
     * It's mainly for text animation
     */
    prevValue?: InterpolatableValue;
    /**
     * Target value stored used for label.
     */
    value?: InterpolatableValue;
    /**
     * Current value in text animation.
     */
    interpolatedValue?: InterpolatableValue;
    /**
     * If enable value animation
     */
    valueAnimation?: boolean;
    /**
     * Label value precision during animation.
     */
    precision?: number | 'auto';
    /**
     * If enable value animation
     */
    statesModels?: LabelStatesModels<LabelModelForText>;
    /**
     * Default text getter during interpolation
     */
    defaultInterpolatedText?: (value: InterpolatableValue) => string;
    /**
     * Change label text from interpolated text during animation
     */
    setLabelText?: (interpolatedValue?: InterpolatableValue) => void;
};
export declare function setLabelValueAnimation(label: ZRText, labelStatesModels: LabelStatesModels<LabelModelForText>, value: InterpolatableValue, getDefaultText: (value: InterpolatableValue) => string): void;
export declare function animateLabelValue(textEl: ZRText, dataIndex: number, data: SeriesData, animatableModel: Model<AnimationOptionMixin>, labelFetcher: SetLabelStyleOpt<number>['labelFetcher']): void;
/**
 * PENDING: Temporary impl. unify them?
 * @see {LabelCommonOption['textMargin']}
 * @see {LabelCommonOption['minMargin']}
 */
export declare const LabelMarginType: {
    readonly minMargin: 1;
    readonly textMargin: 2;
};
export declare type LabelMarginType = (typeof LabelMarginType)[keyof typeof LabelMarginType];
export interface LabelExtendedTextStyle extends TextStyleProps {
    margin: number[] | NullUndefined;
    __marginType?: LabelMarginType | NullUndefined;
}
