import type { ReactNode } from 'react'; export interface AnchorInfo { title: string; key: string; } export interface OffsetTopType { id: string; offsetTop: number; } export interface HeadAnchorProps { /** * 节点列表 */ list: AnchorInfo[]; /** * 该 id 要使用滚动区域的容器 ID */ getContainer?: () => HTMLElement; /** * 内容区域 */ getContent: () => HTMLElement; /** * 偏移量 */ offsetTop?: number; /** * 自定义锚点样式 */ renderAnchorItem?: (anchorInfo: AnchorInfo, onClick: () => void, isActive: boolean) => ReactNode; }