/**
 * TextViewerWithSwitcher - Tree-structured text viewer with expand/collapse
 * Displays task names with tree hierarchy, expand/collapse buttons,
 * task icons, child count badges, and error/warning indicators
 */
import type { CellViewer, ViewerRenderContext, TextViewerWithSwitcherData } from './types';
/**
 * TextViewerWithSwitcher renders task names with tree hierarchy
 * Supports expand/collapse, task icons, child count, error indicators
 */
declare class TextViewerWithSwitcher implements CellViewer<TextViewerWithSwitcherData> {
    readonly type = "text-with-switcher";
    private imageManager;
    private arrowImage;
    private totalNumImage;
    private iomcImages;
    private iomcColoredCanvases;
    private iomcColoredColors;
    private downstreamImage;
    private downstreamColoredCanvas;
    private loadingAngle;
    private lastLayoutBounds;
    private _sm;
    private arrowColoredCanvas;
    private arrowColoredColor;
    constructor();
    /**
     * Preload SVG icons
     */
    private preloadIcons;
    /**
     * Main draw method
     */
    /**
     * Live-refresh iconFile & tapdHighlight from rowData (overlay Proxy).
     * transformTextWithSwitcherValue snapshots these values at preprocess time,
     * but the underlying proxyedData may be updated asynchronously (e.g. updateTableTaskByNode).
     * Reading from data.extra.rowData triggers the overlay Proxy get handler,
     * which falls back to proxyedData for the latest value.
     */
    private refreshDataFromRowData;
    /**
     * Extract tooltip text from raw iconFile name.
     * Mirrors DOM textViewerWithSwitcher.getIconToolTip logic.
     * e.g. 'icon_entity.outsourced.svg' → TASK_ICON_MINING_TIP['icon_entity']['outsourced'] → '在外部协作页面'
     */
    private extractTooltipFromIconFile;
    draw(context: ViewerRenderContext, data: TextViewerWithSwitcherData): void;
    /**
     * Draw tree indent lines
     * Only draws vertical dashed lines for each indent level (no horizontal connectors).
     * - isLastLeafArr[i] === true: ancestor at level i still has siblings -> full height line
     * - isLastLeafArr[i] === false: ancestor at level i is the last child -> half height line (top to middle)
     * @returns New X position
     */
    private drawIndentLines;
    /**
     * Draw expand/collapse arrow or loading indicator
     * @returns New X position
     */
    private drawExpandArrow;
    /**
     * Draw loading spinner animation
     */
    private drawLoadingSpinner;
    /**
     * Draw vertical dashed line below the expand icon (when node is expanded)
     * This connects the expand arrow to its child nodes below.
     * Mirrors DOM's .switch-icon-down-expand-line behavior.
     */
    private drawExpandDownLine;
    /**
     * Get themed arrow image: returns a recolored canvas for non-default themes,
     * or the raw SVG image for the default (light) theme.
     */
    private getThemedArrowImage;
    /**
     * Draw fallback triangle arrow (when SVG fails to load)
     */
    private drawFallbackArrow;
    /**
     * Draw task icon and optional link icon
     * @returns New X position
     */
    private drawIcon;
    /**
     * Recolor an IOMC icon to the specified color using offscreen canvas.
     * SVG icons have fill="white" or no fill (black), so we need to apply
     * the correct color using source-in composite operation.
     */
    private recolorIomcIcon;
    /**
     * Recolor an icon image to the specified color using offscreen canvas.
     */
    private recolorIcon;
    /**
     * Draw IOMC order state icon (已提单/未提单/已驳回)
     * Renders before text, after task icon.
     * @returns New X position
     */
    private drawIomcIcon;
    /**
     * Draw task name text with truncation, strikethrough, weaken, and markdown link support
     * @returns New X position after text
     */
    private drawText;
    /**
     * Calculate right reserved width for totalNum, downstream, and error icons
     */
    private calcRightReservedWidth;
    /**
     * Draw right area: totalNum icon, downstream indicator, error/warning icon
     */
    private drawRightArea;
    /**
     * 绘制商业化单子数角标（圆角矩形背景 + 数字文本）
     * @returns New right X position (moving leftward)
     */
    private drawBusinessOrderCount;
    /**
     * Draw totalNum icon and count
     * @returns New right X position (moving leftward)
     */
    private drawTotalNum;
    /**
     * Draw downstream node indicator (icon_history1.svg, colored #ffb74d, 16x16)
     * @returns New right X position (moving leftward)
     */
    private drawDownstreamIcon;
    /**
     * Draw error or warning icon
     * @returns New right X position (moving leftward)
     */
    private drawErrorIcon;
    /**
     * Get display text from data
     * 方案B：当 value 为空且有 _proxyedDataRef 时，实时从 proxyedData 读取最新值
     */
    private getDisplayText;
    /**
     * Extract plain text from HTML/rich text
     */
    private extractPlainText;
    /**
     * Truncate text with ellipsis if exceeds max width
     */
    private truncateText;
    /**
     * Calculate layout bounds for a given data set (used by onClick/getInteractiveCursor)
     */
    private calcLayoutBounds;
    /**
     * Hit-test whether the given local coordinate lands on an interactive hot area.
     * Pure query, no side effects. Used by Row.mouseDown to decide whether selectCell
     * should skip horizontal auto-scroll (so the subsequent click event still hits
     * the same hot area instead of drifting to a blank region after the scroll).
     *
     * Covered hot areas (MUST stay in sync with onClick):
     *   - expand area (tree expand/collapse)
     *   - task icon area (onClickIcon jump)
     *   - text area (精确到 actualTextWidth，与 onClick 一致)
     *   - totalNum area (child count badge)
     */
    hitTest(context: ViewerRenderContext, data: TextViewerWithSwitcherData, localX: number, localY: number): boolean;
    /**
     * 判断 localY 是否落在文字的垂直命中区域内。
     * 文字以 textBaseline='middle' 绘制在单元格垂直中线 (height/2)，
     * 命中区为 [mid - fontSize/2 - buffer, mid + fontSize/2 + buffer]，
     * 避免点击文字上下空白区域时误触发文字点击回调。
     */
    private isInsideTextVerticalRange;
    /**
     * Handle click events on the cell
     */
    onClick(context: ViewerRenderContext, data: TextViewerWithSwitcherData, localX: number, localY: number): boolean;
    /**
     * Handle double-click: suppress editing when dblclick lands on the expand/collapse area.
     * Without this, rapidly toggling expand/collapse triggers a dblclick that enters edit mode.
     */
    onDblClick(context: ViewerRenderContext, data: TextViewerWithSwitcherData, localX: number, _localY: number): boolean;
    /**
     * Get interactive cursor for hover areas
     */
    getInteractiveCursor(context: ViewerRenderContext, data: TextViewerWithSwitcherData, localX: number, localY: number): string | null;
    /**
     * Get tooltip text when mouse hovers over task icon or IOMC order state icon.
     * - Task icon: returns data.iconTooltip (pre-computed from iconFile by AssetMatrix)
     * - IOMC icon: returns IOMC_STATE_CONFIG[state].tip (e.g. '提单成功', '暂未提单', '提单驳回')
     */
    getTooltip(context: ViewerRenderContext, data: TextViewerWithSwitcherData, localX: number, _localY: number): {
        text: string;
        iconCenterX: number;
    } | null;
    /**
     * 计算文字实际渲染宽度（用于精确判定文字区域的点击和光标）
     * @returns 文字实际占用的像素宽度
     */
    private calcActualTextWidth;
}
export default TextViewerWithSwitcher;
