import type { ResolvedOptions } from "../types.js"; /** 邏輯 run 中之單一字元來源位置。 */ export interface CharPos { textNode: Text; offset: number; } /** 一段邏輯文本:剝離樣式後之連續字元,及其逐字回映射。 */ export interface LogicalRun { text: string; map: CharPos[]; } /** pill 鄰接之邏輯鄰字。 */ export interface AdjacentChar { textNode: Text; offset: number; ch: string; } export declare class Finder { private readonly opts; private readonly styleSet; private readonly blockSet; private readonly skipSet; private readonly pillSelector; private readonly avoidSelector; private readonly includeSelector; private readonly skipAttr; private readonly userIsSkipped; private readonly featureCache; constructor(opts: ResolvedOptions); /** 該元素是否匹配 pill 選擇器(行內塊,如 code/kbd)。 */ pillMatches(el: Element): boolean; /** 節點是否處於 avoid 子樹(內建 skip 名單 / SVG / contentEditable / * data-jz-skip / 使用者 avoid 選擇器 / skipAttribute / isSkipped)。 */ isAvoided(node: Node): boolean; /** scope.include 啟用判定:未設則恆 true;設則須有命中祖先(opt-in)。 */ inScope(node: Node): boolean; /** 走訪 root 下所有「可處理」文本節點(已過濾 avoid / 非作用域)。 */ eachTextNode(root: Element, cb: (node: Text) => void): void; /** 走訪 root 下所有 block 元素(含 root 本身若為 block)。 */ eachBlock(root: Element, cb: (block: Element) => void): void; /** * 收集 block 之邏輯文本 run(架構 §4.1,I7):樣式行內元素與 wrap 類 * jz-* 透明穿越;block/pill/avoid/間隙 marker(jz-hws)中斷 run。 * 回傳 text.length >= 2 之 run(短於 2 無間隙可言)。 */ collectRuns(block: Element): LogicalRun[]; /** * pill 之邏輯鄰字(架構 §4.1):經樣式鏈遞迴,遇 pill/block/avoid/間隙 * marker 即止。direction = -1 取前鄰字,+1 取後鄰字。 */ adjacentLogicalChar(el: Element, direction: -1 | 1): AdjacentChar | null; /** * 解析節點對某功能之有效啟用狀態(§3.6,per-node 閘)。向上找最近帶 * 功能指令之祖先(data-juzhen 白名單 / data-juzhen-off 黑名單 / 命中 * blocks 選擇器),無則回退全域 features。結果以元素為鍵快取。 */ featureEnabledFor(node: Node, name: string): boolean; private globalFeature; private resolveFeature; }