2026-08-24 06:08:38 +00:00
|
|
|
// Module ID: 9982
|
|
|
|
|
// Function ID: 9983
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: useAnnounceAsyncCompletion
|
2026-08-24 06:08:38 +00:00
|
|
|
// Dependencies: [19, 17, 1363, 500, 4727, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-08-24 06:08:38 +00:00
|
|
|
// Module 9982 (useAnnounceAsyncCompletion)
|
|
|
|
|
import closure_2 from "noop" /* 19 */;
|
|
|
|
|
import { AccessibilityInfo } from "get ActivityIndicator" /* 17 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
|
|
|
|
const require = arg1;
|
2026-08-24 06:08:38 +00:00
|
|
|
const result = require("set").fileFinishedImporting("modules/a11y/native/useAnnounceAsyncCompletion.native.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function useAnnounceAsyncCompletion() {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = React.useRef(null);
|
2026-07-20 16:05:17 +00:00
|
|
|
const effect = React.useEffect(() => () => {
|
2026-07-29 08:29:29 +00:00
|
|
|
const current = ref.current;
|
|
|
|
|
if (current != null) {
|
|
|
|
|
current();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
ref.current = null;
|
2026-07-20 16:05:17 +00:00
|
|
|
}, []);
|
|
|
|
|
return React.useCallback((intl, polite) => {
|
|
|
|
|
let str = polite;
|
|
|
|
|
if (polite === undefined) {
|
|
|
|
|
str = "assertive";
|
|
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
const AccessibilityAnnouncer = ref(closure_1_1[2]).AccessibilityAnnouncer;
|
2026-07-20 16:05:17 +00:00
|
|
|
AccessibilityAnnouncer.announce(intl, str);
|
|
|
|
|
if (obj.isIOS()) {
|
2026-07-29 08:29:29 +00:00
|
|
|
if (tmpResult.getIsScreenReaderEnabled()) {
|
|
|
|
|
let current = ref.current;
|
|
|
|
|
if (current != null) {
|
|
|
|
|
current();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
let resolved = new Promise((arg0) => {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = arg0;
|
2026-07-20 16:05:17 +00:00
|
|
|
const timeout = setTimeout(() => {
|
2026-07-29 08:29:29 +00:00
|
|
|
const current = ref.current;
|
2026-07-20 16:05:17 +00:00
|
|
|
let currentResult;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (current != null) {
|
|
|
|
|
currentResult = current();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return currentResult;
|
|
|
|
|
}, 1800);
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_2 = closure_2_3.addEventListener("announcementFinished", (announcement) => {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (tmp) {
|
2026-07-29 08:29:29 +00:00
|
|
|
const current = ref.current;
|
|
|
|
|
if (current != null) {
|
|
|
|
|
current();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-07-23 10:11:24 +00:00
|
|
|
closure_0.current = () => {
|
2026-07-20 16:05:17 +00:00
|
|
|
clearTimeout(closure_1);
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_2.remove();
|
2026-07-29 08:29:29 +00:00
|
|
|
ref.current = null;
|
|
|
|
|
ref();
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return resolved;
|
|
|
|
|
}
|
|
|
|
|
resolved = Promise.resolve();
|
|
|
|
|
}, []);
|
|
|
|
|
};
|