Files
discord-decomp/_bundle/_default_1817.js
T
2026-11-01 12:12:55 +02:00

58 lines
1.7 KiB
JavaScript

// Metro module 1817 (f1818).
import { useCallback, useEffect } from "react";
import { useSharedValue, useEvent } from "./Module1606";
import { useEventHandlerRegistration } from "./Module1795";
const _excluded = ["onScroll", "onScrollBeginDrag", "onScrollEndDrag", "onMomentumScrollBegin", "onMomentumScrollEnd"];
const __initData = {
code: "function pnpm_useScrollStateTs1(event){const{offset,layout,size}=this.__closure;offset.value=event.contentOffset.y;layout.value=event.layoutMeasurement;size.value=event.contentSize;}"
};
export default (a0) => {
let event;
const sharedValue = useSharedValue(0);
const sharedValue2 = useSharedValue({
width: 0,
height: 0
});
const sharedValue3 = useSharedValue({
width: 0,
height: 0
});
const eventHandlerRegistration = useEventHandlerRegistration(a0);
const l = function l(a0) {
sharedValue.value = a0.contentOffset.y;
sharedValue2.value = a0.layoutMeasurement;
sharedValue3.value = a0.contentSize;
};
l.__closure = {
offset: sharedValue,
layout: sharedValue2,
size: sharedValue3
};
l.__workletHash = 10534434800111;
l.__initData = __initData;
event = useEvent(l, _excluded);
useEffect(() => {
let c24687_0 = eventHandlerRegistration(event);
return () => {
c24687_0();
};
}, []);
return {
offset: sharedValue,
layout: sharedValue2,
size: sharedValue3,
onLayout: useCallback((a0) => {
sharedValue2.value = {
width: a0.nativeEvent.layout.width,
height: a0.nativeEvent.layout.height
};
}, [sharedValue2]),
onContentSizeChange: useCallback((a0, a1) => {
sharedValue3.value = {
width: a0,
height: a1
};
}, [sharedValue3])
};
};