zarm
Version:
基于 React 的移动端UI库
26 lines (25 loc) • 968 B
TypeScript
import React from 'react';
export declare const IMAGE_STATUS: {
PENDING: string;
LOADING: string;
LOADED: string;
FAILED: string;
};
export interface ImageCssVars {
'--background'?: React.CSSProperties['background'];
'--text-color'?: React.CSSProperties['color'];
'--font-size'?: React.CSSProperties['fontSize'];
'--radius'?: React.CSSProperties['borderRadius'];
'--width'?: React.CSSProperties['width'];
'--height'?: React.CSSProperties['height'];
}
export interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'placeholder'> {
placeholder?: React.ReactNode | boolean;
fallback?: React.ReactNode | boolean;
fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
shape?: 'rect' | 'radius' | 'round' | 'circle';
preview?: boolean;
lazy?: boolean;
}
declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
export default Image;