feat:add PlcaeHolder and Error setting for Image
This commit is contained in:
65
doric-js/index.d.ts
vendored
65
doric-js/index.d.ts
vendored
@@ -473,30 +473,57 @@ declare module 'doric/lib/src/widget/text' {
|
||||
|
||||
declare module 'doric/lib/src/widget/image' {
|
||||
import { IView, View } from "doric/lib/src/ui/view";
|
||||
import { Color } from "doric/lib/src/util/color";
|
||||
export enum ScaleType {
|
||||
ScaleToFill = 0,
|
||||
ScaleAspectFit = 1,
|
||||
ScaleAspectFill = 2
|
||||
ScaleToFill = 0,
|
||||
ScaleAspectFit = 1,
|
||||
ScaleAspectFill = 2
|
||||
}
|
||||
export interface IImage extends IView {
|
||||
imageUrl?: string;
|
||||
imageBase64?: string;
|
||||
scaleType?: ScaleType;
|
||||
isBlur?: boolean;
|
||||
loadCallback?: (image: {
|
||||
width: number;
|
||||
height: number;
|
||||
} | undefined) => void;
|
||||
imageUrl?: string;
|
||||
imageBase64?: string;
|
||||
scaleType?: ScaleType;
|
||||
isBlur?: boolean;
|
||||
placeHolderImage?: string;
|
||||
placeHolderColor?: Color;
|
||||
errorImage?: string;
|
||||
errorColor?: Color;
|
||||
loadCallback?: (image: {
|
||||
width: number;
|
||||
height: number;
|
||||
} | undefined) => void;
|
||||
}
|
||||
export class Image extends View implements IImage {
|
||||
imageUrl?: string;
|
||||
imageBase64?: string;
|
||||
scaleType?: ScaleType;
|
||||
isBlur?: boolean;
|
||||
loadCallback?: (image: {
|
||||
width: number;
|
||||
height: number;
|
||||
} | undefined) => void;
|
||||
imageUrl?: string;
|
||||
imageBase64?: string;
|
||||
scaleType?: ScaleType;
|
||||
isBlur?: boolean;
|
||||
/**
|
||||
* Display while image is loading
|
||||
* Local file name
|
||||
*/
|
||||
placeHolderImage?: string;
|
||||
/**
|
||||
* Display while image is loading
|
||||
* Color
|
||||
* This priority is lower than placeHolderImage
|
||||
*/
|
||||
placeHolderColor?: Color;
|
||||
/**
|
||||
* Display while image is failed to load
|
||||
* It can be file name in local path
|
||||
*/
|
||||
errorImage?: string;
|
||||
/**
|
||||
* Display while image is failed to load
|
||||
* Color
|
||||
* This priority is lower than errorImage
|
||||
*/
|
||||
errorColor?: Color;
|
||||
loadCallback?: (image: {
|
||||
width: number;
|
||||
height: number;
|
||||
} | undefined) => void;
|
||||
}
|
||||
export function image(config: IImage): Image;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user