decord/alpha/source/components_native/common/FastImage.tsx

105 lines
2.8 KiB
TypeScript
Raw Normal View History

// Module ID: 5892
// Function ID: 5893
// Name: FastImage
// Dependencies: [19, 17, 21, 4829, 5893, 1364, 2]
2026-07-20 16:05:17 +00:00
// Module 5892 (FastImage)
import FastImageNativeComponentDefault from "FastImageNativeComponent" /* 5893 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
class FastImageAndroid {
constructor(arg0) {
obj = {};
merged = Object.assign(global);
2026-07-29 08:29:29 +00:00
obj.defaultSource = global.placeholder;
obj.fadeDuration = 0;
2026-07-20 16:05:17 +00:00
return jsx(Image, obj);
}
}
get_ActivityIndicator = fn(17);
({ Image: c2, NativeModules: c3 } = get_ActivityIndicator);
const jsx = fn(21).jsx;
const createStyles = fn(4829);
let closure_5 = createStyles.createStyles({ base: { overflow: "hidden" } });
let merged = Object.assign(noop.memo((fade) => {
2026-07-20 16:05:17 +00:00
({ placeholder, enableAnimation } = fade);
let tmp2 = undefined === enableAnimation;
({ source, style } = fade);
if (!tmp2) {
tmp2 = enableAnimation;
}
fade = fade.fade;
let tmp3 = undefined === fade;
({ paused, manualPlayback } = fade);
if (!tmp3) {
tmp3 = fade;
}
const usesSmallCache = fade.usesSmallCache;
2026-08-04 21:03:28 +00:00
if (typeof source === "number") {
const obj2 = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(fade);
return <React2 />;
2026-07-20 16:05:17 +00:00
} else {
let assetSource = null;
if (null != placeholder) {
assetSource = React2.resolveAssetSource(placeholder);
2026-07-20 16:05:17 +00:00
}
const obj = {};
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(fade);
const items = [tmp.base, style];
2026-07-29 08:29:29 +00:00
obj.style = items;
2026-07-20 16:05:17 +00:00
let uri;
2026-07-29 08:29:29 +00:00
if (assetSource != null) {
2026-07-20 16:05:17 +00:00
uri = assetSource.uri;
}
2026-07-29 08:29:29 +00:00
obj.placeholder = uri;
obj.enableAnimation = tmp2;
obj.paused = paused;
obj.manualPlayback = manualPlayback;
obj.fade = tmp3;
obj.usesSmallCache = tmp4;
return jsx(FastImageNativeComponentDefault, {});
2026-07-20 16:05:17 +00:00
}
tmp = closure_5();
2026-07-23 10:11:24 +00:00
tmp4 = undefined !== usesSmallCache && usesSmallCache;
2026-07-20 16:05:17 +00:00
}), {
preload(arg0) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
const items = [
new Promise((arg0) => {
ImageManager = ImageManager.ImageManager;
ImageManager.preload(closure_0, arg0);
}),
];
const promise = new Promise((arg0) => {
ImageManager = ImageManager.ImageManager;
2026-07-29 08:29:29 +00:00
ImageManager.preload(closure_0, arg0);
2026-07-20 16:05:17 +00:00
});
items[1] = new Promise((arg0) => setTimeout(arg0, num));
2026-07-20 16:05:17 +00:00
return Promise.race(items);
}
});
FastImageAndroid.preload = (arg0, arg1) => {
2026-08-04 08:36:32 +00:00
closure_0 = arg1;
const catchPromise = React2.prefetch(arg0).catch(() => {
2026-07-20 16:05:17 +00:00
2026-08-04 08:36:32 +00:00
});
let racePromise = catchPromise;
if (null != arg1) {
const items = [catchPromise, ];
const promise = new Promise((arg0) => setTimeout(arg0, closure_0));
items[1] = promise;
racePromise = Promise.race(items);
}
return racePromise;
};
const PlatformUtils = fn(1364);
if (PlatformUtils.isAndroid()) {
2026-07-20 16:05:17 +00:00
merged = FastImageAndroid;
}
const size = fn(2);
const result = size.fileFinishedImporting("components_native/common/FastImage.tsx");
2026-07-20 16:05:17 +00:00
export default merged;