js: add onAnimationEnd for image

This commit is contained in:
pengfei.zhou
2021-12-17 16:52:20 +08:00
committed by osborn
parent e4b27af938
commit e1b10b10bb
9 changed files with 35 additions and 1 deletions

View File

@@ -74,6 +74,10 @@ export declare class Image extends View {
right: number;
bottom: number;
};
/**
* Called if loaded image is animated and played end.
*/
onAnimationEnd?: () => void;
isAnimating(context: BridgeContext): Promise<boolean>;
startAnimating(context: BridgeContext): Promise<any>;
stopAnimating(context: BridgeContext): Promise<any>;

View File

@@ -116,6 +116,10 @@ __decorate([
Property,
__metadata("design:type", Object)
], Image.prototype, "stretchInset", void 0);
__decorate([
Property,
__metadata("design:type", Function)
], Image.prototype, "onAnimationEnd", void 0);
export function image(config) {
const ret = new Image;
ret.layoutConfig = layoutConfig().fit();