import { useEffect, useState } from 'react'; import { getGamepadNavigationTrees } from '../utils'; function getQuickAccessWindow(): Window | null { const navTrees = getGamepadNavigationTrees(); return ( navTrees.find((tree: any) => tree?.id === 'QuickAccess-NA')?.m_Root?.m_element?.ownerDocument.defaultView ?? null ); } /** * Returns state indicating the visibility of quick access menu. * * @deprecated moved to @decky/api * * @returns `true` if quick access menu is visible and `false` otherwise. * * @example * import { FC, useEffect } from "react"; * import { useQuickAccessVisible } from "@decky/ui"; * * export const PluginPanelView: FC<{}> = ({ }) => { * const isVisible = useQuickAccessVisible(); * * useEffect(() => { * if (!isVisible) { * return; * } * * const interval = setInterval(() => console.log("Hello world!"), 1000); * return () => { * clearInterval(interval); * } * }, [isVisible]) * * return ( *