60 lines
1.5 KiB
JavaScript
60 lines
1.5 KiB
JavaScript
// Metro module 1798 (f1799).
|
|
import { KeyboardEvents, KeyboardControllerNative } from "./Module1596";
|
|
let c1522_0;
|
|
let env1521 = {};
|
|
env1521[2] = true;
|
|
env1521[3] = {
|
|
height: 0,
|
|
duration: 0,
|
|
timestamp: new Date().getTime(),
|
|
target: -1,
|
|
type: "default",
|
|
appearance: "light"
|
|
};
|
|
KeyboardEvents.addListener("keyboardDidHide", (a0) => {
|
|
env1521[2] = true;
|
|
env1521[3] = a0;
|
|
});
|
|
KeyboardEvents.addListener("keyboardWillShow", (a0) => {
|
|
env1521[2] = false;
|
|
env1521[3] = a0;
|
|
});
|
|
c1522_0 = void 0;
|
|
c1522_0 = async (c24680_0) => {
|
|
const keepFocus3 = c24680_0?.keepFocus;
|
|
let keepFocus = keepFocus3;
|
|
if (keepFocus3 == null) {
|
|
keepFocus = false;
|
|
}
|
|
const keepFocus2 = keepFocus;
|
|
let animated = c24680_0?.animated;
|
|
if (animated == null) {
|
|
animated = true;
|
|
}
|
|
const animated2 = animated;
|
|
return new Promise((resolve) => {
|
|
let c31250_1;
|
|
if (env1521[2]) {
|
|
resolve();
|
|
} else {
|
|
c31250_1 = KeyboardEvents.addListener("keyboardDidHide", () => {
|
|
resolve(void 0);
|
|
c31250_1.remove();
|
|
});
|
|
KeyboardControllerNative.dismiss(keepFocus2, animated2);
|
|
}
|
|
});
|
|
};
|
|
export const KeyboardController = {
|
|
setDefaultMode: KeyboardControllerNative.setDefaultMode,
|
|
setInputMode: KeyboardControllerNative.setInputMode,
|
|
setFocusTo: KeyboardControllerNative.setFocusTo,
|
|
preload: KeyboardControllerNative.preload,
|
|
dismiss: function dismiss(a0) {
|
|
const apply = c1522_0.apply;
|
|
return c1522_0.apply(this, arguments);
|
|
},
|
|
isVisible: () => !env1521[2],
|
|
state: () => env1521[3]
|
|
};
|