feat: update ts type

pull/5147/head
tangjinzhou 2022-01-09 22:50:29 +08:00
parent 3297f7aa58
commit 7dda6e8e07
3 changed files with 18 additions and 15 deletions

View File

@ -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');
@ -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,

View File

@ -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 };
@ -195,6 +196,8 @@ type TablePaginationPosition =
export interface TablePaginationConfig extends PaginationProps {
position?: TablePaginationPosition[];
class?: string;
style?: CSSProperties;
}
export interface TransformCellTextProps {

View File

@ -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;
@ -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[],