UNPKG

@iobroker/adapter-react

Version:

React classes to develop admin interfaces for ioBroker with react.

70 lines (69 loc) 1.82 kB
export default Image; export type ImageProps = { /** * The key to identify this component. */ key?: string; /** * The color. */ color?: string; /** * The source of the image. */ src?: string; /** * The image prefix (default: './files/') */ imagePrefix?: string; /** * The CSS class name. */ className?: string; /** * Show image errors (or just show no image)? */ showError?: boolean; }; /** * @typedef {object} ImageProps * @property {string} [key] The key to identify this component. * @property {string} [color] The color. * @property {string} [src] The source of the image. * @property {string} [imagePrefix] The image prefix (default: './files/') * @property {string} [className] The CSS class name. * @property {boolean} [showError] Show image errors (or just show no image)? * * @extends {React.Component<ImageProps>} */ declare class Image extends React.Component<ImageProps, any, any> { static getDerivedStateFromProps(props: any, state: any): { src: any; svg: any; created: boolean; color: any; showError: any; }; constructor(props: any); state: { svg: boolean; created: boolean; color: string; src: string; imgError: boolean; showError: boolean; }; svg: JSX.Element; getSvgFromData(src: any): JSX.Element; render(): JSX.Element; } declare namespace Image { namespace propTypes { const color: PropTypes.Requireable<string>; const src: PropTypes.Validator<string>; const className: PropTypes.Requireable<string>; const imagePrefix: PropTypes.Requireable<string>; } } import React from "react"; import PropTypes from "prop-types";