@enact/sandstone
Version:
Large-screen/TV support library for Enact, containing a variety of UI components.
61 lines (52 loc) • 1.73 kB
TypeScript
// Type definitions for sandstone/Image
import { SkinnableProps as sandstone_Skinnable_SkinnableProps } from "@enact/sandstone/Skinnable";
import { ImageProps as ui_Image_ImageProps } from "@enact/ui/Image";
import * as React from "react";
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
export interface ImageBaseProps extends ui_Image_ImageProps {
/**
* Called with a reference to the root component.
*
* When using , the `ref` prop is forwarded to this component
as `componentRef` .
*/
componentRef?: object | Function;
/**
* Customizes the component by mapping the supplied collection of CSS class names to the
corresponding internal elements and states of this component.
*
* The following classes are supported:
* * `image` - The root component class for Image
*/
css?: object;
}
/**
* A Sandstone-styled image component without any behavior
*/
export class ImageBase extends React.Component<
Merge<React.HTMLProps<HTMLElement>, ImageBaseProps>
> {}
export interface ImageDecoratorProps
extends sandstone_Skinnable_SkinnableProps {}
export function ImageDecorator<P>(
Component: React.ComponentType<P> | string,
): React.ComponentType<P & ImageDecoratorProps>;
export interface ImageProps
extends Merge<ImageBaseProps, ImageDecoratorProps> {}
/**
* A Sandstone-styled image component
* ```
<Image
src={{
'hd': 'https://dummyimage.com/64/e048e0/0011ff',
'fhd': 'https://dummyimage.com/128/e048e0/0011ff',
'uhd': 'https://dummyimage.com/256/e048e0/0011ff'
}}
>
```
*/
export class Image extends React.Component<
Merge<React.HTMLProps<HTMLElement>, ImageProps>
> {}
export default Image;