import * as React from 'react'; import { IconType } from '../icon'; import { IStyledComponentProps } from '../styled'; import { AvatarSize, AvatarVariant } from './avatar-context'; import { IAvatarImageProps } from './use-avatar-image'; import { AvatarClasses } from './avatar-classes'; import { ColorName } from '../theme/colors'; export type IAvatarProps = IStyledComponentProps<{ props: IAvatarImageProps & { color?: 'default' | 'primary' | 'warning' | 'danger' | 'success' | 'info' | ColorName; /** Provides an alt attribute for the rendered `img` element. */ alt?: string; /** Used to render icon or text elements inside the Avatar if `src` is not set. */ children?: React.ReactNode; /** classes to override styles */ classes?: Partial; /** specifies the image object-fit type */ imgFit?: 'contain' | 'cover'; /** Attributes applied to the `img` element if the component is used to display an image. */ imgProps?: IStyledComponentProps<{ props: { 'data-testid'?: string; }; defaultComponent: 'img'; }>; /** Adds padding around image. Only works when type === "logo". */ includePadding?: boolean; /** displays border around the avatar */ showBorder?: boolean; /** The size of the avatar */ size?: AvatarSize; /** Fallback icon to display instead of default if set. */ fallbackIconOverride?: IconType; /** The shape of the avatar. */ variant?: AvatarVariant; /** initials to be used as a fallback if src fails to load. Only used for user type */ initials?: string; /** instructs the avatar where it is being rendered */ placement?: 'default' | 'badge'; }; defaultComponent: 'div'; }>; export interface IAvatarImgOwnerState { imgFit?: IAvatarProps['imgFit']; } export declare const Avatar: React.ForwardRefExoticComponent; /** specifies the image object-fit type */ imgFit?: "contain" | "cover"; /** Attributes applied to the `img` element if the component is used to display an image. */ imgProps?: IStyledComponentProps<{ props: { "data-testid"?: string; }; defaultComponent: "img"; }>; /** Adds padding around image. Only works when type === "logo". */ includePadding?: boolean; /** displays border around the avatar */ showBorder?: boolean; /** The size of the avatar */ size?: AvatarSize; /** Fallback icon to display instead of default if set. */ fallbackIconOverride?: IconType; /** The shape of the avatar. */ variant?: AvatarVariant; /** initials to be used as a fallback if src fails to load. Only used for user type */ initials?: string; /** instructs the avatar where it is being rendered */ placement?: "default" | "badge"; } & Omit, HTMLDivElement>, "ref" | "color" | "size" | "children" | "alt" | "classes" | "variant" | "imgProps" | "placement" | keyof IAvatarImageProps | "imgFit" | "includePadding" | "showBorder" | "fallbackIconOverride" | "initials"> & import("../styled").IStyledCommonProps & React.RefAttributes>;