Skip to content

Commit

Permalink
type(@uiw/react-back-top):修复类型问题 (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
SunLxy committed Apr 12, 2022
1 parent a62e924 commit c9625d8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/react-back-top/src/index.tsx
Expand Up @@ -3,7 +3,13 @@ import { IProps, HTMLDivProps } from '@uiw/utils';
import { getScrollPercent, getScrollTop, scrollToAnimate } from './utils';
import './style/index.less';

export interface BackTopProps extends IProps, HTMLDivProps {
export interface ChildrenFunction {
scrollToTop: () => void;
percent: number;
current: number;
}

export interface BackTopProps extends IProps, Omit<HTMLDivProps, 'children'> {
offsetTop?: number;
clickable?: boolean;
content?: JSX.Element | string;
Expand All @@ -13,6 +19,7 @@ export interface BackTopProps extends IProps, HTMLDivProps {
*/
showBelow?: number;
speed?: number;
children?: React.ReactNode | ((props: ChildrenFunction) => React.ReactNode);
}

export interface IBackTopState {
Expand Down

0 comments on commit c9625d8

Please sign in to comment.