Skip to content

Commit 7dda6e8

Browse files
committed
feat: update ts type
1 parent 3297f7a commit 7dda6e8

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

components/list/index.tsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ export type { ListItemMetaProps } from './ItemMeta';
2323

2424
export type ColumnType = 'gutter' | 'column' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
2525

26-
export const ListGridType = {
27-
gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(Number)]),
28-
column: PropTypes.number,
29-
xs: PropTypes.number,
30-
sm: PropTypes.number,
31-
md: PropTypes.number,
32-
lg: PropTypes.number,
33-
xl: PropTypes.number,
34-
xxl: PropTypes.number,
35-
xxxl: PropTypes.number,
36-
};
26+
export type ColumnCount = number;
27+
export interface ListGridType {
28+
gutter?: number;
29+
column?: ColumnCount;
30+
xs?: ColumnCount;
31+
sm?: ColumnCount;
32+
md?: ColumnCount;
33+
lg?: ColumnCount;
34+
xl?: ColumnCount;
35+
xxl?: ColumnCount;
36+
}
3737

3838
export const ListSize = tuple('small', 'default', 'large');
3939

@@ -43,7 +43,7 @@ export const listProps = {
4343
bordered: PropTypes.looseBool,
4444
dataSource: PropTypes.array,
4545
extra: PropTypes.any,
46-
grid: PropTypes.shape(ListGridType).loose,
46+
grid: { type: Object as PropType<ListGridType>, default: undefined },
4747
itemLayout: PropTypes.oneOf(tuple('horizontal', 'vertical')),
4848
loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
4949
loadMore: PropTypes.any,

components/table/interface.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type { Breakpoint } from '../_util/responsiveObserve';
1212
import type { INTERNAL_SELECTION_ITEM } from './hooks/useSelection';
1313
import type { VueNode } from '../_util/type';
1414
import { tuple } from '../_util/type';
15+
import type { CSSProperties } from 'vue';
1516
// import { TableAction } from './Table';
1617

1718
export type { GetRowKey, ExpandableConfig };
@@ -195,6 +196,8 @@ type TablePaginationPosition =
195196

196197
export interface TablePaginationConfig extends PaginationProps {
197198
position?: TablePaginationPosition[];
199+
class?: string;
200+
style?: CSSProperties;
198201
}
199202

200203
export interface TransformCellTextProps {

components/vc-table/interface.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* - onFilterDropdownVisibleChange
1616
*/
1717

18-
import type { CSSProperties, DefineComponent, FunctionalComponent, HTMLAttributes, Ref } from 'vue';
18+
import type { CSSProperties, HTMLAttributes, Ref } from 'vue';
1919

2020
export type Key = number | string;
2121

@@ -139,9 +139,9 @@ export type GetComponentProps<DataType> = (
139139
column?: ColumnType<any>,
140140
) => Omit<HTMLAttributes, 'style'> & { style?: CSSProperties };
141141

142-
type Component<P> = DefineComponent<P> | FunctionalComponent<P> | string;
142+
// type Component<P> = DefineComponent<P> | FunctionalComponent<P> | string;
143143

144-
export type CustomizeComponent = Component<any>;
144+
export type CustomizeComponent = any;
145145

146146
export type CustomizeScrollBody<RecordType> = (
147147
data: readonly RecordType[],

0 commit comments

Comments
 (0)