Skip to content

Commit 68aa2fe

Browse files
committed
fix types
1 parent d670bfb commit 68aa2fe

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/Options.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { SelectProps } from 'rc-select';
22
import type { OptionProps } from 'rc-select/es/Option';
33
import KEYCODE from 'rc-util/lib/KeyCode';
44
import React from 'react';
5-
import type { PaginationLocale } from './interface';
5+
import type { PaginationLocale, PaginationProps } from './interface';
66

77
interface InternalSelectProps extends SelectProps {
88
/**
@@ -25,7 +25,7 @@ interface OptionsProps {
2525
selectComponentClass: React.ComponentType<Partial<InternalSelectProps>> & {
2626
Option?: React.ComponentType<Partial<OptionProps>>;
2727
};
28-
showSizeChanger: SelectProps,
28+
showSizeChanger: PaginationProps['showSizeChanger'];
2929
}
3030

3131
const defaultPageSizeOptions = ['10', '20', '50', '100'];

src/interface.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type React from 'react';
2+
import type { SelectProps } from 'rc-select';
23

34
export interface PaginationLocale {
45
// Options
@@ -17,12 +18,6 @@ export interface PaginationLocale {
1718
page_size?: string;
1819
}
1920

20-
type ShowSizeChanger = boolean | {
21-
options?: string[] | number[];
22-
showSearch?: boolean;
23-
onChange?: (size: number) => void;
24-
}
25-
2621
export interface PaginationData {
2722
className: string;
2823
selectPrefixCls: string;
@@ -38,7 +33,7 @@ export interface PaginationData {
3833

3934
hideOnSinglePage: boolean;
4035
align: 'start' | 'center' | 'end';
41-
showSizeChanger: ShowSizeChanger;
36+
showSizeChanger: boolean | SelectProps;
4237
showLessItems: boolean;
4338
showPrevNextJumpers: boolean;
4439
showQuickJumper: boolean | object;
@@ -68,7 +63,6 @@ export interface PaginationProps
6863
element: React.ReactNode,
6964
) => React.ReactNode;
7065
showTotal?: (total: number, range: [number, number]) => React.ReactNode;
71-
7266
// WAI-ARIA
7367
role?: React.AriaRole | undefined;
7468
}

0 commit comments

Comments
 (0)