import { FC, ReactNode } from 'react'; export type AnchorScrollLayoutSectionItem = { className?: string; id: string; title: ReactNode | string; content: ReactNode; anchor?: ReactNode; }; export interface AnchorScrollLayoutProps { titleRender?: (title: ReactNode | string) => ReactNode; sections: AnchorScrollLayoutSectionItem[]; anchorMode?: 'sidebar' | 'absolute'; anchorAbsoluteOffset?: Partial<{ top: number | string; right: number; bottom: number; left: number; }>; anchorItemRender?: (section: AnchorScrollLayoutProps['sections'][number], active: boolean) => ReactNode; /** * 滚动监听目标: * - 'container':仅监听左侧容器滚动 * - 'container+window':同时监听容器与 window 的滚动(默认建议 container+window) */ scrollListenTarget?: 'container' | 'container+window'; /** * 当 scrollListenTarget 为 'container+window' 时用于调整“判定基准线”的偏移(单位 px) */ activeDetectOffset?: number; /** * absolute 模式下,Affix 的 offsetTop(视口吸附阈值) */ affixOffsetTop?: number; /** * absolute 模式下,Affix 的滚动容器: * - 'window'(默认) * - 'container'(使用左侧滚动容器) */ affixTarget?: 'window' | 'container'; } declare const AnchorScrollLayout: FC; export default AnchorScrollLayout;