Skip to content

Commit

Permalink
Fix #2974: Badge/Avatar/Card/Chip typescript inheritance (#2993)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Jun 16, 2022
1 parent f878208 commit 46e5ae6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion components/lib/avatar/Avatar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type AvatarShapeType = 'square' | 'circle';

type AvatarTemplateType = React.ReactNode | ((props: AvatarProps) => React.ReactNode);

export interface AvatarProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
export interface AvatarProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
label?: string;
icon?: IconType<AvatarProps>;
image?: string;
Expand Down
2 changes: 1 addition & 1 deletion components/lib/badge/Badge.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type BadgeSeverityType = 'success' | 'info' | 'warn' | 'error' | (string & {});

type BadgeSizeType = 'normal' | 'large' | 'xlarge';

export interface BadgeProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, 'ref'> {
export interface BadgeProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, 'ref'> {
value?: any;
severity?: BadgeSeverityType;
size?: BadgeSizeType;
Expand Down
5 changes: 1 addition & 4 deletions components/lib/card/Card.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import * as React from 'react';

type CardTemplateTypes = React.ReactNode | ((props: CardProps) => React.ReactNode);

export interface CardProps {
id?: string;
export interface CardProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
header?: CardTemplateTypes;
footer?: CardTemplateTypes;
title?: CardTemplateTypes;
subTitle?: CardTemplateTypes;
style?: object;
className?: string;
children?: React.ReactNode;
}

Expand Down
4 changes: 1 addition & 3 deletions components/lib/chip/Chip.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import * as React from 'react';
import { IconType, TemplateType } from '../utils';

export interface ChipProps {
export interface ChipProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'ref'> {
label?: string;
icon?: IconType<ChipProps>;
image?: string;
removable?: boolean;
removeIcon?: string;
className?: string;
style?: object;
template?: TemplateType<ChipProps>;
imageAlt?: string;
onImageError?(event: React.SyntheticEvent): void;
Expand Down

0 comments on commit 46e5ae6

Please sign in to comment.