///
import * as Icons from '@alipay/sofa-icons';
export interface BackToProps {
/**
* 回到顶部的图标
* @type { keyof typeof Icons | React.ReactElement }
* @default 'ChevronUp'
*/
topIcon?: keyof typeof Icons | React.ReactElement;
/**
* 回到底部的图标
* @type { keyof typeof Icons | React.ReactElement }
* @default 'ChevronDown'
*/
bottomIcon?: keyof typeof Icons | React.ReactElement;
/**
* 是否启用回到顶部
* @type { boolean }
* @default true
*/
enableTop?: boolean;
/**
* 是否启用回到底部
* @type { boolean }
* @default true
*/
enableBottom?: boolean;
/**
* 自定义类名
* @type { string }
* @default undefined
*/
className?: string;
/**
* 自定义样式
* @type { React.CSSProperties }
* @default undefined
*/
style?: React.CSSProperties;
/**
* 回到顶部的回调
* @type { () => void }
* @default undefined
*/
onBackToTop?: () => void;
/**
* 回到底部的回调
* @type { () => void }
* @default undefined
*/
onBackToBottom?: () => void;
/**
* 自动隐藏阈值(距离顶部/底部多少px时隐藏对应按钮),默认30
* @type { number | { top: number; bottom: number } | false }
* @default 30
*/
autoHideThreshold?: number | {
top: number;
bottom: number;
} | false;
/**
* 加载状态
* @type { boolean }
* @default false
*/
loading?: boolean | {
top: boolean;
bottom: boolean;
};
/**
* 滚动容器,可以是 DOM 元素引用或 CSS 选择器字符串
* 如果不提供,则使用 window/document(全局滚动)
* @type { HTMLElement | React.RefObject | string }
* @default undefined
*/
container?: HTMLElement | React.RefObject | string;
/**
* 位置,默认 fixed
* @type { 'fixed' | 'absolute' }
* @default 'fixed'
*/
position?: 'fixed' | 'absolute';
}