decord/source/6516_useComposedGesture.js
2026-08-24 06:08:38 +00:00

69 lines
2.7 KiB
JavaScript

// Module ID: 6516
// Function ID: 6517
// Name: useComposedGesture
// Dependencies: [6476, 6413, 6451]
// Module 6516 (useComposedGesture)
const require = arg1;
const dependencyMap = arg6;
arg5.useComposedGesture = function useComposedGesture(arg0) {
const substr = [...arguments].slice();
const flatMapResult = substr.flatMap((handlerTags) => {
if (obj.isComposedGesture(handlerTags)) {
handlerTags = handlerTags.handlerTags;
} else {
handlerTags = [handlerTags.handlerTag];
}
return handlerTags;
});
let obj = substr(6476);
if (obj.containsDuplicates(flatMapResult)) {
const _Error2 = Error;
let tmp2Result = tmp2(6413);
error = new Error(tmp2Result.tagMessage("Each gesture can be used only once in the gesture composition."));
throw error;
} else {
obj = { shouldUseReanimatedDetector: null, dispatchesAnimatedEvents: null };
obj[0] = substr.some((config) => config.config.shouldUseReanimatedDetector);
obj[1] = substr.some((config) => config.config.dispatchesAnimatedEvents);
if (obj.shouldUseReanimatedDetector) {
if (obj.dispatchesAnimatedEvents) {
const _Error = Error;
tmp2Result = tmp2(6413);
const error1 = new Error(tmp2Result.tagMessage("Composed gestures cannot use both Reanimated and Animated events at the same time."));
throw error1;
}
}
const Reanimated = tmp2(6451).Reanimated;
let composedEventHandler;
if (Reanimated != null) {
composedEventHandler = Reanimated.useComposedEventHandler(substr.map((detectorCallbacks) => detectorCallbacks.detectorCallbacks.reanimatedEventHandler || null));
}
const found = substr.filter((detectorCallbacks) => undefined !== detectorCallbacks.detectorCallbacks.animatedEventHandler);
let animatedEventHandler;
if (found.length > 0) {
animatedEventHandler = found[0].detectorCallbacks.animatedEventHandler;
}
obj = { handlerTags: null, type: null, config: null, detectorCallbacks: null, externalSimultaneousHandlers: null, gestures: null };
obj[0] = flatMapResult;
obj[1] = arg0;
obj[2] = obj;
obj1 = { jsEventHandler: null, reanimatedEventHandler: null, animatedEventHandler: null };
obj1[0] = function jsEventHandler(arg0, arg1) {
for (const item10007 of substr) {
if (item10007.detectorCallbacks.jsEventHandler) {
let tmp2 = item10007;
let detectorCallbacks = tmp.detectorCallbacks;
let jsEventHandlerResult = detectorCallbacks.jsEventHandler(arg0);
}
continue;
}
};
obj1[1] = composedEventHandler;
obj1[2] = animatedEventHandler;
obj[3] = obj1;
obj[4] = [];
obj[5] = substr;
return obj;
}
};