import ZRText, { TextStyleProps } from 'zrender/lib/graphic/Text'; import Element, { ElementTextConfig } from 'zrender/lib/Element'; import Model from '../model/Model'; import { LabelOption, DisplayState, TextCommonOption, ParsedValue, CallbackDataParams, StatesOptionMixin, DisplayStateNonNormal, ColorString, ZRStyleProps } from '../util/types'; import GlobalModel from '../model/Global'; import List from '../data/List'; import SeriesModel from '../model/Series'; declare type TextCommonParams = { disableBox?: boolean; inheritColor?: ColorString; defaultOpacity?: number; defaultOutsidePosition?: LabelOption['position']; textStyle?: ZRStyleProps; }; interface SetLabelStyleOpt extends TextCommonParams { defaultText?: string | ((labelDataIndex: LDI, opt: SetLabelStyleOpt, overrideValue?: ParsedValue | ParsedValue[]) => string); labelFetcher?: { getFormattedLabel: (labelDataIndex: LDI, status: DisplayState, dataType?: string, labelDimIndex?: number, formatter?: string | ((params: object) => string), extendParams?: Partial) => string; }; labelDataIndex?: LDI; labelDimIndex?: number; enableTextSetter?: boolean; } declare type LabelModel = Model string); showDuringLabel?: boolean; }>; declare type LabelModelForText = Model & { formatter?: string | ((params: any) => string); }>; declare type LabelStatesModels = Partial> & { normal: LabelModel; }; export declare function setLabelText(label: ZRText, labelTexts: Record): void; export declare function getLabelText(opt: SetLabelStyleOpt, stateModels?: LabelStatesModels, overrideValue?: ParsedValue | ParsedValue[]): Record; declare function setLabelStyle(targetEl: ZRText, labelStatesModels: LabelStatesModels, opt?: SetLabelStyleOpt, stateSpecified?: Partial>): void; declare function setLabelStyle(targetEl: Element, labelStatesModels: LabelStatesModels, opt?: SetLabelStyleOpt, stateSpecified?: Partial>): void; export { setLabelStyle }; export declare function getLabelStatesModels(itemModel: Model & Partial>>, labelName?: LabelName): Record; export declare function createTextStyle(textStyleModel: Model, specifiedTextStyle?: TextStyleProps, opt?: Pick, isNotNormal?: boolean, isAttached?: boolean): TextStyleProps; export declare function createTextConfig(textStyleModel: Model, opt?: Pick, isNotNormal?: boolean): ElementTextConfig; export declare function getFont(opt: Pick, ecModel: GlobalModel): string; export declare const labelInner: (hostObj: ZRText) => { prevValue?: string | number | (string | number)[]; value?: string | number | (string | number)[]; valueAnimation?: boolean; precision?: LineAndPositionSetting; statesModels?: LabelStatesModels; defaultInterpolatedText?: (value: string | number | (string | number)[]) => string; setLabelText?(overrideValue?: string | number | (string | number)[]): void; }; export declare function setLabelValueAnimation(label: ZRText, labelStatesModels: LabelStatesModels, value: ParsedValue | ParsedValue[], getDefaultText: (value: ParsedValue[] | ParsedValue) => string): void; export declare function animateLabelValue(textEl: ZRText, dataIndex: number, data: List, seriesModel: SeriesModel): void;