import * as React from "react"; import { ConfigConsumerProps } from "../Config"; interface IBacktopProps { /** * 自定义组件类名 * * @default "" **/ className?: string; /** * 返回顶部按钮内容 * * **/ children: React.ReactNode; /** * 滚动高度超过该值时,渲染组件 * * @default 400 **/ displayHeight?: number | undefined; /** * 滚动时长 单位毫秒 * * @default 1000 **/ duration?: number; /** * 点击返回顶部时的回调函数 * * @default (e: Event) => void **/ onClick?: (e: Event) => void; /** * 组件切换显示或者隐藏时的回调函数 * * @default (isShow: boolean) => void **/ onToggle?: (isShow: boolean) => void; /** * 是否使用平滑滚动 * * @default true **/ smooth?: boolean; /** * 默认前缀 * * @default 'lg' **/ prefixCls?: string; /** * 指定滚动的容器 * * @default () => window **/ getContainer?: () => HTMLElement | Window; /** * 自定义样式 * * @default **/ style?: React.CSSProperties; } interface IBacktopState { show: boolean; } declare class Backtop extends React.PureComponent { scrollEvent: any; private scrollContainer; static defaultProps: { className: string; displayHeight: number; duration: number; onClick: () => null; onToggle: () => null; smooth: boolean; style: {}; getContainer: () => Window & typeof globalThis; }; constructor(props: IBacktopProps); componentDidMount(): void; componentWillUnmount(): void; handleScroll(): void; handleClick(e: any): void; renderBacktop: ({ getPrefixCls }: ConfigConsumerProps) => false | JSX.Element; render(): JSX.Element; } export default Backtop;