import * as React from 'react'; import { InputProps } from '../Input'; import { ImageProps } from '../Image'; import { TooltipCommonProps } from '../common'; export interface ImageViewerProps { /** Links to image asset source (URL). Leave it blank when image isn't uploaded yet. */ imageUrl?: string; /** * Specifies image fit mode inside a box by setting the CSS `object-fit` property. * @default `cover` */ fit?: 'cover' | 'contain'; /** * Specifies an alt text for an image. If not provided, it is set to empty and treated as decorative. * @default '' */ alt?: string; /** Displays the image in an error state. * @deprecated Use `status` instead. */ error?: boolean; /** Sets the message shown in the error state. * @deprecated Use `statusMessage` instead. */ errorMessage?: string; /** Allows to pass all common tooltip props. * @linkTypeTo Tooltip * @setTypeName TooltipCommonProps */ tooltipProps?: TooltipCommonProps; /** Specifies whether the update button is visible. * @default true */ showUpdateButton?: boolean; /** Specifies whether the download button is visible. * @default false */ showDownloadButton?: boolean; /** Specifies whether the remove button is visible. * @default true */ showRemoveButton?: boolean; /** Defines a click handler, which is called every time a user clicks on an empty viewer (when no `imageUrl` is provided). */ onAddImage?: React.MouseEventHandler; /** Defines a handler function, which is called every time user clicks on the 'Update image' button. */ onUpdateImage?: React.MouseEventHandler; /** Defines a handler function, which is called every time user clicks on the download button. */ onDownloadImage?: React.MouseEventHandler; /** Defines a handler function, which is called every time user clicks on the 'Remove image' button. */ onRemoveImage?: React.MouseEventHandler; /** Defines a handler function which is called right after image loads. */ onImageLoad?: React.ReactEventHandler; /** Specifies a message to display in a tooltip when no image is uploaded yet. * @default 'Add Image' */ addImageInfo?: string; /** Defines a message to display in a tooltip when 'Update' action button is hovered. * @default 'Update' */ updateImageInfo?: string; /** Defines a message to display in a tooltip when 'Download' action button is hovered. * @default 'Download' */ downloadImageInfo?: string; /** Defines a message to display in a tooltip, when 'remove' action button is hovered. * @default 'Remove' */ removeImageInfo?: string; /** Defines a message to display in a tooltip when the 'More' action button is hovered. Relevant only when all buttons are visible. * @default 'More actions' */ moreImageInfo?: string; /** Removes default border radius. */ removeRoundedBorders?: boolean; /** Sets the width of the viewer box. */ width?: number | string; /** Sets the height of the viewer box. */ height?: number | string; /** Specifies whether the component is disabled. */ disabled?: boolean; /** Specifies the status of a viewer. */ status?: InputProps['status']; /** Defines the message to display on status icon hover. If not given or empty, no tooltip is displayed. */ statusMessage?: InputProps['statusMessage']; /** Applies a data-hook HTML attribute that can be used in the tests. */ dataHook?: string; /** Specifies a CSS class name to be appended to the component's root element. * @internal */ className?: string; /** Additional props to pass to the Image component (borderRadius, position, showBorder, transparent, etc.). * @linkTypeTo Image */ imageProps?: Pick< ImageProps, | 'alt' | 'borderRadius' | 'height' | 'position' | 'showBorder' | 'style' | 'transparent' | 'width' >; /** Defines a string value that labels the update button element. */ updateButtonAriaLabel?: string; /** Defines a string value that labels the remove button element. */ removeButtonAriaLabel?: string; } export class ImageViewer extends React.Component { focus: () => void; }