"use strict";
/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Hooks
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.useUiVisibility = void 0;
const react_1 = require("react");
const UiFramework_1 = require("../UiFramework");
/** @internal */
// istanbul ignore next
function useUiVisibility() {
    const [uiIsVisible, setUiIsVisible] = (0, react_1.useState)(UiFramework_1.UiFramework.getIsUiVisible());
    (0, react_1.useEffect)(() => {
        const handleUiVisibilityChanged = (args) => setUiIsVisible(args.visible);
        UiFramework_1.UiFramework.onUiVisibilityChanged.addListener(handleUiVisibilityChanged);
        return () => {
            UiFramework_1.UiFramework.onUiVisibilityChanged.removeListener(handleUiVisibilityChanged);
        };
    }, []);
    return uiIsVisible;
}
exports.useUiVisibility = useUiVisibility;
//# sourceMappingURL=useUiVisibility.js.map