62 lines
2.0 KiB
JavaScript
62 lines
2.0 KiB
JavaScript
// Metro module 1754 (f1755).
|
|
import { useEffect, useRef } from "react";
|
|
import { makeMutable, subscribeForKeyboardEvents, unsubscribeFromKeyboardEvents } from "./Module1650";
|
|
import { KeyboardState } from "./Module1631";
|
|
const __initData = {
|
|
code: "function pnpm_useAnimatedKeyboardTs1(state,height){const{keyboardEventData}=this.__closure;keyboardEventData.state.value=state;keyboardEventData.height.value=height;}"
|
|
};
|
|
const __initData2 = {
|
|
code: "function pnpm_useAnimatedKeyboardTs2(state,height){const{_keyboardEventData}=this.__closure;_keyboardEventData.state.value=state;_keyboardEventData.height.value=height;}"
|
|
};
|
|
export function useAnimatedKeyboard(r13 = {
|
|
isStatusBarTranslucentAndroid: void 0,
|
|
isNavigationBarTranslucentAndroid: void 0
|
|
}) {
|
|
let c13203_4;
|
|
let c13203_0 = r13;
|
|
c13203_4 = void 0;
|
|
const ref = useRef(null);
|
|
const ref2 = useRef(-1);
|
|
const ref3 = useRef(false);
|
|
if (ref.current === null) {
|
|
const keyboardEventData = {
|
|
state: makeMutable(KeyboardState.UNKNOWN),
|
|
height: makeMutable(0)
|
|
};
|
|
c13203_4 = keyboardEventData;
|
|
const c = function c(a0, a1) {
|
|
c13203_4.state.value = a0;
|
|
c13203_4.height.value = a1;
|
|
};
|
|
c.__closure = {
|
|
keyboardEventData
|
|
};
|
|
c.__workletHash = 4393537867728;
|
|
c.__initData = __initData;
|
|
ref2.current = subscribeForKeyboardEvents(c, r13);
|
|
ref.current = keyboardEventData;
|
|
ref3.current = true;
|
|
}
|
|
useEffect(() => {
|
|
if (ref3.current === false && ref.current !== null) {
|
|
const current = ref.current;
|
|
const u = function u(a0, a1) {
|
|
current.state.value = a0;
|
|
current.height.value = a1;
|
|
};
|
|
u.__closure = {
|
|
_keyboardEventData: current
|
|
};
|
|
u.__workletHash = 5041909921996;
|
|
u.__initData = __initData2;
|
|
ref2.current = subscribeForKeyboardEvents(u, c13203_0);
|
|
ref3.current = true;
|
|
}
|
|
return () => {
|
|
unsubscribeFromKeyboardEvents(ref2.current);
|
|
ref3.current = false;
|
|
};
|
|
}, []);
|
|
return ref.current;
|
|
}
|