mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 20:49:14 +08:00
type: LiteralUnion optimization (#39871)
This commit is contained in:
parent
4f16966e28
commit
dedbbda5f2
@ -1,2 +1,2 @@
|
||||
/** https://github.com/Microsoft/TypeScript/issues/29729 */
|
||||
export type LiteralUnion<T extends U, U> = T | (U & {});
|
||||
export type LiteralUnion<T extends string> = T | (string & {});
|
||||
|
@ -13,7 +13,7 @@ export interface RibbonProps {
|
||||
prefixCls?: string;
|
||||
style?: React.CSSProperties; // style of ribbon element, not the wrapper
|
||||
text?: React.ReactNode;
|
||||
color?: LiteralUnion<PresetColorType, string>;
|
||||
color?: LiteralUnion<PresetColorType>;
|
||||
children?: React.ReactNode;
|
||||
placement?: RibbonPlacement;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ export interface BadgeProps {
|
||||
scrollNumberPrefixCls?: string;
|
||||
className?: string;
|
||||
status?: PresetStatusColorType;
|
||||
color?: LiteralUnion<PresetColorType, string>;
|
||||
color?: LiteralUnion<PresetColorType>;
|
||||
text?: React.ReactNode;
|
||||
size?: 'default' | 'small';
|
||||
offset?: [number | string, number | string];
|
||||
|
@ -15,7 +15,7 @@ export type { CheckableTagProps } from './CheckableTag';
|
||||
export interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
color?: LiteralUnion<PresetColorType | PresetStatusColorType, string>;
|
||||
color?: LiteralUnion<PresetColorType | PresetStatusColorType>;
|
||||
closable?: boolean;
|
||||
closeIcon?: React.ReactNode;
|
||||
/** @deprecated `visible` will be removed in next major version. */
|
||||
|
@ -71,7 +71,7 @@ interface LegacyTooltipProps
|
||||
export interface AbstractTooltipProps extends LegacyTooltipProps {
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
color?: LiteralUnion<PresetColorType, string>;
|
||||
color?: LiteralUnion<PresetColorType>;
|
||||
placement?: TooltipPlacement;
|
||||
builtinPlacements?: typeof Placements;
|
||||
openClassName?: string;
|
||||
|
Loading…
Reference in New Issue
Block a user