Skip to content

Commit

Permalink
feat: update ts type
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Jan 9, 2022
1 parent 3297f7a commit 7dda6e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
24 changes: 12 additions & 12 deletions components/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ export type { ListItemMetaProps } from './ItemMeta';

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

export const ListGridType = {
gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(Number)]),
column: PropTypes.number,
xs: PropTypes.number,
sm: PropTypes.number,
md: PropTypes.number,
lg: PropTypes.number,
xl: PropTypes.number,
xxl: PropTypes.number,
xxxl: PropTypes.number,
};
export type ColumnCount = number;
export interface ListGridType {
gutter?: number;
column?: ColumnCount;
xs?: ColumnCount;
sm?: ColumnCount;
md?: ColumnCount;
lg?: ColumnCount;
xl?: ColumnCount;
xxl?: ColumnCount;
}

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

Expand All @@ -43,7 +43,7 @@ export const listProps = {
bordered: PropTypes.looseBool,
dataSource: PropTypes.array,
extra: PropTypes.any,
grid: PropTypes.shape(ListGridType).loose,
grid: { type: Object as PropType<ListGridType>, default: undefined },
itemLayout: PropTypes.oneOf(tuple('horizontal', 'vertical')),
loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])),
loadMore: PropTypes.any,
Expand Down
3 changes: 3 additions & 0 deletions components/table/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type { Breakpoint } from '../_util/responsiveObserve';
import type { INTERNAL_SELECTION_ITEM } from './hooks/useSelection';
import type { VueNode } from '../_util/type';
import { tuple } from '../_util/type';
import type { CSSProperties } from 'vue';
// import { TableAction } from './Table';

export type { GetRowKey, ExpandableConfig };
Expand Down Expand Up @@ -195,6 +196,8 @@ type TablePaginationPosition =

export interface TablePaginationConfig extends PaginationProps {
position?: TablePaginationPosition[];
class?: string;
style?: CSSProperties;
}

export interface TransformCellTextProps {
Expand Down
6 changes: 3 additions & 3 deletions components/vc-table/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* - onFilterDropdownVisibleChange
*/

import type { CSSProperties, DefineComponent, FunctionalComponent, HTMLAttributes, Ref } from 'vue';
import type { CSSProperties, HTMLAttributes, Ref } from 'vue';

export type Key = number | string;

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

type Component<P> = DefineComponent<P> | FunctionalComponent<P> | string;
// type Component<P> = DefineComponent<P> | FunctionalComponent<P> | string;

export type CustomizeComponent = Component<any>;
export type CustomizeComponent = any;

export type CustomizeScrollBody<RecordType> = (
data: readonly RecordType[],
Expand Down

0 comments on commit 7dda6e8

Please sign in to comment.