shineout
Version:
Shein 前端组件库
47 lines (46 loc) • 2.25 kB
TypeScript
/// <reference types="node" />
import React from 'react';
import { PaginationProps } from '../Pagination/Props';
import { GetPagableProps } from './Props';
interface PagableProps {
data?: any;
loading?: any;
}
interface PagableState {
current: number;
pageSize: number;
}
export default function <U extends PagableProps>(Component: React.ComponentType<U>): {
new (props: GetPagableProps<U>): {
getProp(key: 'current' | 'pageSize'): number;
getPager(data: any, pagination: PaginationProps): PaginationProps & Required<Pick<PaginationProps, 'current' | 'pageSize' | 'total'>>;
handleChange(current: number, pageSize: number): void;
render(): JSX.Element[];
$isMounted: boolean;
forceUpdateTimer: NodeJS.Timeout;
componentDidMount(): void;
componentWillUnmount(): void;
setState(...args: any[]): void;
forceUpdate(): void;
context: any;
readonly props: Readonly<GetPagableProps<U>> & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<PagableState>;
refs: {
[key: string]: React.ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly<GetPagableProps<U>>, nextState: Readonly<PagableState>, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<GetPagableProps<U>>, prevState: Readonly<PagableState>): any;
componentDidUpdate?(prevProps: Readonly<GetPagableProps<U>>, prevState: Readonly<PagableState>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<GetPagableProps<U>>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<GetPagableProps<U>>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<GetPagableProps<U>>, nextState: Readonly<PagableState>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<GetPagableProps<U>>, nextState: Readonly<PagableState>, nextContext: any): void;
};
contextType?: React.Context<any> | undefined;
};
export {};