mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
parent
f9b8bf7e4d
commit
82b721a432
3
components/_util/type.ts
Normal file
3
components/_util/type.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export type Diff<T extends string, U extends string> = ({ [P in T]: P } &
|
||||
{ [P in U]: never } & { [x: string]: never })[T];
|
||||
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
|
@ -7,6 +7,7 @@ import Meta from './Meta';
|
||||
import Tabs from '../tabs';
|
||||
import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame';
|
||||
import warning from '../_util/warning';
|
||||
import { Omit } from '../_util/type';
|
||||
|
||||
export { CardGridProps } from './Grid';
|
||||
export { CardMetaProps } from './Meta';
|
||||
@ -18,7 +19,7 @@ export interface CardTabListType {
|
||||
tab: React.ReactNode;
|
||||
}
|
||||
|
||||
export interface CardProps {
|
||||
export interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
||||
prefixCls?: string;
|
||||
title?: React.ReactNode;
|
||||
extra?: React.ReactNode;
|
||||
|
@ -8,6 +8,7 @@ import omit from 'omit.js';
|
||||
import warning from '../_util/warning';
|
||||
import FormItem from './FormItem';
|
||||
import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';
|
||||
import { Omit } from '../_util/type';
|
||||
|
||||
export interface FormCreateOption<T> {
|
||||
onFieldsChange?: (props: T, fields: Array<any>) => void;
|
||||
@ -113,10 +114,6 @@ export interface FormComponentProps {
|
||||
form: WrappedFormUtils;
|
||||
}
|
||||
|
||||
export type Diff<T extends string, U extends string> =
|
||||
({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
|
||||
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
|
||||
|
||||
export interface ComponentDecorator {
|
||||
<P extends FormComponentProps>(
|
||||
component: React.ComponentClass<P> | React.SFC<P>,
|
||||
|
Loading…
Reference in New Issue
Block a user