import React, { ReactNode } from 'react'; import { FlexProps } from '../flex'; import { DefineElement } from '../../types'; export type AnchorItem = { id: string; label?: ReactNode; /** 锚点的层级,主要影响缩进等级 */ level?: number; /** 是否激活的锚点,通常为自动判断 */ active?: boolean; }; export interface AnchorListProps extends FlexProps { anchors?: AnchorItem[]; renderAnchorItem?(item: AnchorItem, active: boolean): ReactNode; /** 缩进,默认为`24` */ indent?: number; /** 定义滚动容器,默认为`document` */ scroller?: DefineElement; /** hash跳转模式,仅`history`模式支持{@link offset}与{@link scrollBehavior},默认为`history` */ routeMode?: 'history' | 'location'; /** 目标元素距离顶部的偏移量,默认为`0` */ offset?: number; /** 滚动行为,传递至`scrollTo`方法,默认为`smooth` */ scrollBehavior?: ScrollBehavior; } export declare const AnchorList: React.MemoExoticComponent<({ anchors, renderAnchorItem, indent, scroller, routeMode, offset, scrollBehavior, ...props }: AnchorListProps) => import("@emotion/react/jsx-runtime").JSX.Element>;