Files
NapCatQQ/.pnpm-store/v3/files/69/6cbfb36a423992bea3fab133ef432cf362148c31f1213fc36d8c4fd93c33c7661efae69c134d3d3f22e0fd7223b4ded3fa42bdff364d75b73ea176db78b722
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

33 lines
2.2 KiB
Plaintext

import { DOMRefValue, FocusableRefValue, FocusableRef } from '@react-types/shared';
import { RefObject, Ref, MutableRefObject } from 'react';
declare function canUseDOM(): boolean;
declare const isBrowser: boolean;
declare function getUserAgentBrowser(navigator: Navigator): "Chrome for iOS" | "Edge" | "Silk" | "Chrome" | "Firefox" | "AOSP" | "IE" | "Safari" | "WebKit" | null;
type UserAgentBrowser = NonNullable<ReturnType<typeof getUserAgentBrowser>>;
declare function getUserAgentOS(navigator: Navigator): "Android" | "iOS" | "Windows" | "Mac" | "Chrome OS" | "Firefox OS" | null;
type UserAgentOS = NonNullable<ReturnType<typeof getUserAgentOS>>;
declare function detectDeviceType(navigator: Navigator): "tablet" | "phone" | "desktop";
type UserAgentDeviceType = NonNullable<ReturnType<typeof detectDeviceType>>;
declare function detectOS(os: UserAgentOS): boolean;
declare function detectBrowser(browser: UserAgentBrowser): boolean;
declare function detectTouch(): boolean;
declare function createDOMRef<T extends HTMLElement = HTMLElement>(ref: RefObject<T>): DOMRefValue<T>;
declare function createFocusableRef<T extends HTMLElement = HTMLElement>(domRef: RefObject<T>, focusableRef?: RefObject<HTMLElement>): FocusableRefValue<T>;
declare function useDOMRef<T extends HTMLElement = HTMLElement>(ref?: RefObject<T | null> | Ref<T | null>): RefObject<T>;
declare function useFocusableRef<T extends HTMLElement = HTMLElement>(ref: FocusableRef<T>, focusableRef?: RefObject<HTMLElement>): RefObject<T>;
interface ContextValue<T> {
ref?: MutableRefObject<T>;
}
declare function useSyncRef<T>(context: ContextValue<T | null>, ref: RefObject<T>): void;
/**
* Checks if two DOMRect objects intersect each other.
*
* @param rect1 - The first DOMRect object.
* @param rect2 - The second DOMRect object.
* @returns A boolean indicating whether the two DOMRect objects intersect.
*/
declare function areRectsIntersecting(rect1: DOMRect, rect2: DOMRect): boolean;
export { type ContextValue, type UserAgentBrowser, type UserAgentDeviceType, type UserAgentOS, areRectsIntersecting, canUseDOM, createDOMRef, createFocusableRef, detectBrowser, detectDeviceType, detectOS, detectTouch, getUserAgentBrowser, getUserAgentOS, isBrowser, useDOMRef, useFocusableRef, useSyncRef };