@siberiacancode/reactuse 0.2.28 → 0.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -71
- package/dist/cjs/helpers/createContext/createContext.cjs.map +1 -1
- package/dist/cjs/helpers/createEventEmitter/createEventEmitter.cjs.map +1 -1
- package/dist/cjs/helpers/createReactiveContext/createReactiveContext.cjs.map +1 -1
- package/dist/cjs/helpers/createStore/createStore.cjs.map +1 -1
- package/dist/cjs/hooks/useActiveElement/useActiveElement.cjs.map +1 -1
- package/dist/cjs/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/cjs/hooks/useAudio/useAudio.cjs.map +1 -1
- package/dist/cjs/hooks/useAutoScroll/useAutoScroll.cjs +1 -1
- package/dist/cjs/hooks/useAutoScroll/useAutoScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useBattery/useBattery.cjs +1 -1
- package/dist/cjs/hooks/useBattery/useBattery.cjs.map +1 -1
- package/dist/cjs/hooks/useBluetooth/useBluetooth.cjs +1 -1
- package/dist/cjs/hooks/useBluetooth/useBluetooth.cjs.map +1 -1
- package/dist/cjs/hooks/useBoolean/useBoolean.cjs.map +1 -1
- package/dist/cjs/hooks/useBreakpoints/useBreakpoints.cjs.map +1 -1
- package/dist/cjs/hooks/useBroadcastChannel/useBroadcastChannel.cjs +1 -1
- package/dist/cjs/hooks/useBroadcastChannel/useBroadcastChannel.cjs.map +1 -1
- package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.cjs.map +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.cjs.map +1 -1
- package/dist/cjs/hooks/useClipboard/useClipboard.cjs.map +1 -1
- package/dist/cjs/hooks/useConst/useConst.cjs.map +1 -1
- package/dist/cjs/hooks/useCookie/useCookie.cjs.map +1 -1
- package/dist/cjs/hooks/useCookies/useCookies.cjs.map +1 -1
- package/dist/cjs/hooks/useCopy/useCopy.cjs.map +1 -1
- package/dist/cjs/hooks/useCounter/useCounter.cjs.map +1 -1
- package/dist/cjs/hooks/useCssVar/useCssVar.cjs.map +1 -1
- package/dist/cjs/hooks/useDebounceCallback/useDebounceCallback.cjs.map +1 -1
- package/dist/cjs/hooks/useDebounceState/useDebounceState.cjs +2 -0
- package/dist/cjs/hooks/useDebounceState/useDebounceState.cjs.map +1 -0
- package/dist/cjs/hooks/useDebounceValue/useDebounceValue.cjs.map +1 -1
- package/dist/cjs/hooks/useDefault/useDefault.cjs.map +1 -1
- package/dist/cjs/hooks/useDeviceMotion/useDeviceMotion.cjs.map +1 -1
- package/dist/cjs/hooks/useDeviceOrientation/useDeviceOrientation.cjs +1 -1
- package/dist/cjs/hooks/useDeviceOrientation/useDeviceOrientation.cjs.map +1 -1
- package/dist/cjs/hooks/useDevicePixelRatio/useDevicePixelRatio.cjs +1 -1
- package/dist/cjs/hooks/useDevicePixelRatio/useDevicePixelRatio.cjs.map +1 -1
- package/dist/cjs/hooks/useDidUpdate/useDidUpdate.cjs.map +1 -1
- package/dist/cjs/hooks/useDisclosure/useDisclosure.cjs.map +1 -1
- package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.cjs.map +1 -1
- package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.cjs.map +1 -1
- package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.cjs.map +1 -1
- package/dist/cjs/hooks/useDoubleClick/useDoubleClick.cjs.map +1 -1
- package/dist/cjs/hooks/useDropZone/useDropZone.cjs +1 -1
- package/dist/cjs/hooks/useDropZone/useDropZone.cjs.map +1 -1
- package/dist/cjs/hooks/useElementSize/useElementSize.cjs.map +1 -1
- package/dist/cjs/hooks/useEvent/useEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.cjs +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.cjs.map +1 -1
- package/dist/cjs/hooks/useEventSource/useEventSource.cjs.map +1 -1
- package/dist/cjs/hooks/useEyeDropper/useEyeDropper.cjs +1 -1
- package/dist/cjs/hooks/useEyeDropper/useEyeDropper.cjs.map +1 -1
- package/dist/cjs/hooks/useFavicon/useFavicon.cjs +1 -1
- package/dist/cjs/hooks/useFavicon/useFavicon.cjs.map +1 -1
- package/dist/cjs/hooks/useField/useField.cjs.map +1 -1
- package/dist/cjs/hooks/useFileDialog/useFileDialog.cjs.map +1 -1
- package/dist/cjs/hooks/useFocus/useFocus.cjs +1 -1
- package/dist/cjs/hooks/useFocus/useFocus.cjs.map +1 -1
- package/dist/cjs/hooks/useFps/useFps.cjs.map +1 -1
- package/dist/cjs/hooks/useFul/useFul.cjs.map +1 -1
- package/dist/cjs/hooks/useFullscreen/useFullscreen.cjs.map +1 -1
- package/dist/cjs/hooks/useGamepad/useGamepad.cjs +1 -1
- package/dist/cjs/hooks/useGamepad/useGamepad.cjs.map +1 -1
- package/dist/cjs/hooks/useGeolocation/useGeolocation.cjs.map +1 -1
- package/dist/cjs/hooks/useHash/useHash.cjs.map +1 -1
- package/dist/cjs/hooks/useHotkeys/useHotkeys.cjs.map +1 -1
- package/dist/cjs/hooks/useHover/useHover.cjs +1 -1
- package/dist/cjs/hooks/useHover/useHover.cjs.map +1 -1
- package/dist/cjs/hooks/useIdle/useIdle.cjs.map +1 -1
- package/dist/cjs/hooks/useImage/useImage.cjs.map +1 -1
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useInterval/useInterval.cjs.map +1 -1
- package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.cjs.map +1 -1
- package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs.map +1 -1
- package/dist/cjs/hooks/useKeyPress/useKeyPress.cjs.map +1 -1
- package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useKeyboard/useKeyboard.cjs.map +1 -1
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.cjs.map +1 -1
- package/dist/cjs/hooks/useLastChanged/useLastChanged.cjs.map +1 -1
- package/dist/cjs/hooks/useLatest/useLatest.cjs.map +1 -1
- package/dist/cjs/hooks/useLess/useLess.cjs.map +1 -1
- package/dist/cjs/hooks/useList/useList.cjs.map +1 -1
- package/dist/cjs/hooks/useLocalStorage/useLocalStorage.cjs.map +1 -1
- package/dist/cjs/hooks/useLockCallback/useLockCallback.cjs.map +1 -1
- package/dist/cjs/hooks/useLockScroll/useLockScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useLogger/useLogger.cjs.map +1 -1
- package/dist/cjs/hooks/useLongPress/useLongPress.cjs.map +1 -1
- package/dist/cjs/hooks/useMap/useMap.cjs.map +1 -1
- package/dist/cjs/hooks/useMeasure/useMeasure.cjs.map +1 -1
- package/dist/cjs/hooks/useMediaControls/useMediaControls.cjs.map +1 -1
- package/dist/cjs/hooks/useMediaQuery/useMediaQuery.cjs.map +1 -1
- package/dist/cjs/hooks/useMemory/useMemory.cjs +1 -1
- package/dist/cjs/hooks/useMemory/useMemory.cjs.map +1 -1
- package/dist/cjs/hooks/useMergedRef/useMergedRef.cjs +2 -0
- package/dist/cjs/hooks/useMergedRef/useMergedRef.cjs.map +1 -0
- package/dist/cjs/hooks/useMount/useMount.cjs.map +1 -1
- package/dist/cjs/hooks/useMouse/useMouse.cjs.map +1 -1
- package/dist/cjs/hooks/useMutation/useMutation.cjs +1 -1
- package/dist/cjs/hooks/useMutation/useMutation.cjs.map +1 -1
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.cjs +1 -1
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useNetwork/useNetwork.cjs.map +1 -1
- package/dist/cjs/hooks/useOffsetPagination/useOffsetPagination.cjs +1 -1
- package/dist/cjs/hooks/useOffsetPagination/useOffsetPagination.cjs.map +1 -1
- package/dist/cjs/hooks/useOnce/useOnce.cjs.map +1 -1
- package/dist/cjs/hooks/useOnline/useOnline.cjs.map +1 -1
- package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.cjs.map +1 -1
- package/dist/cjs/hooks/useOptimistic/useOptimistic.cjs.map +1 -1
- package/dist/cjs/hooks/useOrientation/useOrientation.cjs +1 -1
- package/dist/cjs/hooks/useOrientation/useOrientation.cjs.map +1 -1
- package/dist/cjs/hooks/useOtpCredential/useOtpCredential.cjs +1 -1
- package/dist/cjs/hooks/useOtpCredential/useOtpCredential.cjs.map +1 -1
- package/dist/cjs/hooks/usePageLeave/usePageLeave.cjs.map +1 -1
- package/dist/cjs/hooks/usePaint/usePaint.cjs.map +1 -1
- package/dist/cjs/hooks/useParallax/useParallax.cjs.map +1 -1
- package/dist/cjs/hooks/usePerformanceObserver/usePerformanceObserver.cjs +1 -1
- package/dist/cjs/hooks/usePerformanceObserver/usePerformanceObserver.cjs.map +1 -1
- package/dist/cjs/hooks/usePermission/usePermission.cjs +1 -1
- package/dist/cjs/hooks/usePermission/usePermission.cjs.map +1 -1
- package/dist/cjs/hooks/usePictureInPicture/usePictureInPicture.cjs +1 -1
- package/dist/cjs/hooks/usePictureInPicture/usePictureInPicture.cjs.map +1 -1
- package/dist/cjs/hooks/usePointerLock/usePointerLock.cjs +1 -1
- package/dist/cjs/hooks/usePointerLock/usePointerLock.cjs.map +1 -1
- package/dist/cjs/hooks/usePostMessage/usePostMessage.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredContrast/usePreferredContrast.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredDark/usePreferredDark.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredReducedMotion/usePreferredReducedMotion.cjs.map +1 -1
- package/dist/cjs/hooks/usePrevious/usePrevious.cjs.map +1 -1
- package/dist/cjs/hooks/useQuery/useQuery.cjs.map +1 -1
- package/dist/cjs/hooks/useQueue/useQueue.cjs.map +1 -1
- package/dist/cjs/hooks/useRaf/useRaf.cjs.map +1 -1
- package/dist/cjs/hooks/useRafState/useRafState.cjs.map +1 -1
- package/dist/cjs/hooks/useRefState/useRefState.cjs.map +1 -1
- package/dist/cjs/hooks/useRenderCount/useRenderCount.cjs.map +1 -1
- package/dist/cjs/hooks/useRenderInfo/useRenderInfo.cjs.map +1 -1
- package/dist/cjs/hooks/useRerender/useRerender.cjs.map +1 -1
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.cjs +1 -1
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useRightClick/useRightClick.cjs.map +1 -1
- package/dist/cjs/hooks/useScript/useScript.cjs.map +1 -1
- package/dist/cjs/hooks/useScroll/useScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useScrollIntoView/useScrollIntoView.cjs.map +1 -1
- package/dist/cjs/hooks/useScrollTo/useScrollTo.cjs.map +1 -1
- package/dist/cjs/hooks/useSessionStorage/useSessionStorage.cjs.map +1 -1
- package/dist/cjs/hooks/useSet/useSet.cjs.map +1 -1
- package/dist/cjs/hooks/useShallowEffect/useShallowEffect.cjs.map +1 -1
- package/dist/cjs/hooks/useShare/useShare.cjs +1 -1
- package/dist/cjs/hooks/useShare/useShare.cjs.map +1 -1
- package/dist/cjs/hooks/useSpeechRecognition/useSpeechRecognition.cjs.map +1 -1
- package/dist/cjs/hooks/useSpeechSynthesis/useSpeechSynthesis.cjs +1 -1
- package/dist/cjs/hooks/useSpeechSynthesis/useSpeechSynthesis.cjs.map +1 -1
- package/dist/cjs/hooks/useStateHistory/useStateHistory.cjs.map +1 -1
- package/dist/cjs/hooks/useStep/useStep.cjs.map +1 -1
- package/dist/cjs/hooks/useSticky/useSticky.cjs.map +1 -1
- package/dist/cjs/hooks/useStopwatch/useStopwatch.cjs.map +1 -1
- package/dist/cjs/hooks/useStorage/useStorage.cjs.map +1 -1
- package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs +1 -1
- package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs.map +1 -1
- package/dist/cjs/hooks/useTextSelection/useTextSelection.cjs.map +1 -1
- package/dist/cjs/hooks/useThrottleCallback/useThrottleCallback.cjs.map +1 -1
- package/dist/cjs/hooks/useThrottleState/useThrottleState.cjs +2 -0
- package/dist/cjs/hooks/useThrottleState/useThrottleState.cjs.map +1 -0
- package/dist/cjs/hooks/useThrottleValue/useThrottleValue.cjs.map +1 -1
- package/dist/cjs/hooks/useTime/useTime.cjs.map +1 -1
- package/dist/cjs/hooks/useTimeout/useTimeout.cjs.map +1 -1
- package/dist/cjs/hooks/useTimer/useTimer.cjs.map +1 -1
- package/dist/cjs/hooks/useToggle/useToggle.cjs.map +1 -1
- package/dist/cjs/hooks/useUnmount/useUnmount.cjs.map +1 -1
- package/dist/cjs/hooks/useUrlSearchParam/useUrlSearchParam.cjs.map +1 -1
- package/dist/cjs/hooks/useUrlSearchParams/useUrlSearchParams.cjs.map +1 -1
- package/dist/cjs/hooks/useVibrate/useVibrate.cjs +1 -1
- package/dist/cjs/hooks/useVibrate/useVibrate.cjs.map +1 -1
- package/dist/cjs/hooks/useVirtualKeyboard/useVirtualKeyboard.cjs +1 -1
- package/dist/cjs/hooks/useVirtualKeyboard/useVirtualKeyboard.cjs.map +1 -1
- package/dist/cjs/hooks/useWakeLock/useWakeLock.cjs +1 -1
- package/dist/cjs/hooks/useWakeLock/useWakeLock.cjs.map +1 -1
- package/dist/cjs/hooks/useWebSocket/useWebSocket.cjs.map +1 -1
- package/dist/cjs/hooks/useWindowEvent/useWindowEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useWindowFocus/useWindowFocus.cjs.map +1 -1
- package/dist/cjs/hooks/useWindowScroll/useWindowScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useWindowSize/useWindowSize.cjs.map +1 -1
- package/dist/cjs/hooks/useWizard/useWizard.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/helpers/createContext/createContext.mjs.map +1 -1
- package/dist/esm/helpers/createEventEmitter/createEventEmitter.mjs.map +1 -1
- package/dist/esm/helpers/createReactiveContext/createReactiveContext.mjs.map +1 -1
- package/dist/esm/helpers/createStore/createStore.mjs.map +1 -1
- package/dist/esm/hooks/useActiveElement/useActiveElement.mjs.map +1 -1
- package/dist/esm/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/esm/hooks/useAudio/useAudio.mjs.map +1 -1
- package/dist/esm/hooks/useAutoScroll/useAutoScroll.mjs +25 -31
- package/dist/esm/hooks/useAutoScroll/useAutoScroll.mjs.map +1 -1
- package/dist/esm/hooks/useBattery/useBattery.mjs +1 -1
- package/dist/esm/hooks/useBattery/useBattery.mjs.map +1 -1
- package/dist/esm/hooks/useBluetooth/useBluetooth.mjs +16 -18
- package/dist/esm/hooks/useBluetooth/useBluetooth.mjs.map +1 -1
- package/dist/esm/hooks/useBoolean/useBoolean.mjs.map +1 -1
- package/dist/esm/hooks/useBreakpoints/useBreakpoints.mjs.map +1 -1
- package/dist/esm/hooks/useBroadcastChannel/useBroadcastChannel.mjs +8 -8
- package/dist/esm/hooks/useBroadcastChannel/useBroadcastChannel.mjs.map +1 -1
- package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.mjs.map +1 -1
- package/dist/esm/hooks/useClickOutside/useClickOutside.mjs.map +1 -1
- package/dist/esm/hooks/useClipboard/useClipboard.mjs.map +1 -1
- package/dist/esm/hooks/useConst/useConst.mjs.map +1 -1
- package/dist/esm/hooks/useCookie/useCookie.mjs.map +1 -1
- package/dist/esm/hooks/useCookies/useCookies.mjs.map +1 -1
- package/dist/esm/hooks/useCopy/useCopy.mjs.map +1 -1
- package/dist/esm/hooks/useCounter/useCounter.mjs.map +1 -1
- package/dist/esm/hooks/useCssVar/useCssVar.mjs.map +1 -1
- package/dist/esm/hooks/useDebounceCallback/useDebounceCallback.mjs.map +1 -1
- package/dist/esm/hooks/useDebounceState/useDebounceState.mjs +10 -0
- package/dist/esm/hooks/useDebounceState/useDebounceState.mjs.map +1 -0
- package/dist/esm/hooks/useDebounceValue/useDebounceValue.mjs.map +1 -1
- package/dist/esm/hooks/useDefault/useDefault.mjs.map +1 -1
- package/dist/esm/hooks/useDeviceMotion/useDeviceMotion.mjs.map +1 -1
- package/dist/esm/hooks/useDeviceOrientation/useDeviceOrientation.mjs +1 -1
- package/dist/esm/hooks/useDeviceOrientation/useDeviceOrientation.mjs.map +1 -1
- package/dist/esm/hooks/useDevicePixelRatio/useDevicePixelRatio.mjs +1 -1
- package/dist/esm/hooks/useDevicePixelRatio/useDevicePixelRatio.mjs.map +1 -1
- package/dist/esm/hooks/useDidUpdate/useDidUpdate.mjs.map +1 -1
- package/dist/esm/hooks/useDisclosure/useDisclosure.mjs.map +1 -1
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.mjs.map +1 -1
- package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.mjs.map +1 -1
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.mjs.map +1 -1
- package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.mjs.map +1 -1
- package/dist/esm/hooks/useDoubleClick/useDoubleClick.mjs.map +1 -1
- package/dist/esm/hooks/useDropZone/useDropZone.mjs +12 -12
- package/dist/esm/hooks/useDropZone/useDropZone.mjs.map +1 -1
- package/dist/esm/hooks/useElementSize/useElementSize.mjs.map +1 -1
- package/dist/esm/hooks/useEvent/useEvent.mjs.map +1 -1
- package/dist/esm/hooks/useEventListener/useEventListener.mjs +15 -15
- package/dist/esm/hooks/useEventListener/useEventListener.mjs.map +1 -1
- package/dist/esm/hooks/useEventSource/useEventSource.mjs.map +1 -1
- package/dist/esm/hooks/useEyeDropper/useEyeDropper.mjs +3 -3
- package/dist/esm/hooks/useEyeDropper/useEyeDropper.mjs.map +1 -1
- package/dist/esm/hooks/useFavicon/useFavicon.mjs +12 -15
- package/dist/esm/hooks/useFavicon/useFavicon.mjs.map +1 -1
- package/dist/esm/hooks/useField/useField.mjs.map +1 -1
- package/dist/esm/hooks/useFileDialog/useFileDialog.mjs.map +1 -1
- package/dist/esm/hooks/useFocus/useFocus.mjs +26 -22
- package/dist/esm/hooks/useFocus/useFocus.mjs.map +1 -1
- package/dist/esm/hooks/useFps/useFps.mjs.map +1 -1
- package/dist/esm/hooks/useFul/useFul.mjs.map +1 -1
- package/dist/esm/hooks/useFullscreen/useFullscreen.mjs.map +1 -1
- package/dist/esm/hooks/useGamepad/useGamepad.mjs +13 -13
- package/dist/esm/hooks/useGamepad/useGamepad.mjs.map +1 -1
- package/dist/esm/hooks/useGeolocation/useGeolocation.mjs.map +1 -1
- package/dist/esm/hooks/useHash/useHash.mjs.map +1 -1
- package/dist/esm/hooks/useHotkeys/useHotkeys.mjs.map +1 -1
- package/dist/esm/hooks/useHover/useHover.mjs +15 -15
- package/dist/esm/hooks/useHover/useHover.mjs.map +1 -1
- package/dist/esm/hooks/useIdle/useIdle.mjs.map +1 -1
- package/dist/esm/hooks/useImage/useImage.mjs.map +1 -1
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs.map +1 -1
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs +19 -18
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs.map +1 -1
- package/dist/esm/hooks/useInterval/useInterval.mjs.map +1 -1
- package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.mjs.map +1 -1
- package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs.map +1 -1
- package/dist/esm/hooks/useKeyPress/useKeyPress.mjs.map +1 -1
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.mjs.map +1 -1
- package/dist/esm/hooks/useKeyboard/useKeyboard.mjs.map +1 -1
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.mjs.map +1 -1
- package/dist/esm/hooks/useLastChanged/useLastChanged.mjs.map +1 -1
- package/dist/esm/hooks/useLatest/useLatest.mjs.map +1 -1
- package/dist/esm/hooks/useLess/useLess.mjs.map +1 -1
- package/dist/esm/hooks/useList/useList.mjs.map +1 -1
- package/dist/esm/hooks/useLocalStorage/useLocalStorage.mjs.map +1 -1
- package/dist/esm/hooks/useLockCallback/useLockCallback.mjs.map +1 -1
- package/dist/esm/hooks/useLockScroll/useLockScroll.mjs.map +1 -1
- package/dist/esm/hooks/useLogger/useLogger.mjs.map +1 -1
- package/dist/esm/hooks/useLongPress/useLongPress.mjs.map +1 -1
- package/dist/esm/hooks/useMap/useMap.mjs.map +1 -1
- package/dist/esm/hooks/useMeasure/useMeasure.mjs.map +1 -1
- package/dist/esm/hooks/useMediaControls/useMediaControls.mjs.map +1 -1
- package/dist/esm/hooks/useMediaQuery/useMediaQuery.mjs.map +1 -1
- package/dist/esm/hooks/useMemory/useMemory.mjs +4 -4
- package/dist/esm/hooks/useMemory/useMemory.mjs.map +1 -1
- package/dist/esm/hooks/useMergedRef/useMergedRef.mjs +25 -0
- package/dist/esm/hooks/useMergedRef/useMergedRef.mjs.map +1 -0
- package/dist/esm/hooks/useMount/useMount.mjs.map +1 -1
- package/dist/esm/hooks/useMouse/useMouse.mjs.map +1 -1
- package/dist/esm/hooks/useMutation/useMutation.mjs +18 -18
- package/dist/esm/hooks/useMutation/useMutation.mjs.map +1 -1
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs +28 -20
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs.map +1 -1
- package/dist/esm/hooks/useNetwork/useNetwork.mjs.map +1 -1
- package/dist/esm/hooks/useOffsetPagination/useOffsetPagination.mjs +34 -41
- package/dist/esm/hooks/useOffsetPagination/useOffsetPagination.mjs.map +1 -1
- package/dist/esm/hooks/useOnce/useOnce.mjs.map +1 -1
- package/dist/esm/hooks/useOnline/useOnline.mjs.map +1 -1
- package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.mjs.map +1 -1
- package/dist/esm/hooks/useOptimistic/useOptimistic.mjs.map +1 -1
- package/dist/esm/hooks/useOrientation/useOrientation.mjs +9 -9
- package/dist/esm/hooks/useOrientation/useOrientation.mjs.map +1 -1
- package/dist/esm/hooks/useOtpCredential/useOtpCredential.mjs +3 -3
- package/dist/esm/hooks/useOtpCredential/useOtpCredential.mjs.map +1 -1
- package/dist/esm/hooks/usePageLeave/usePageLeave.mjs.map +1 -1
- package/dist/esm/hooks/usePaint/usePaint.mjs.map +1 -1
- package/dist/esm/hooks/useParallax/useParallax.mjs.map +1 -1
- package/dist/esm/hooks/usePerformanceObserver/usePerformanceObserver.mjs +11 -11
- package/dist/esm/hooks/usePerformanceObserver/usePerformanceObserver.mjs.map +1 -1
- package/dist/esm/hooks/usePermission/usePermission.mjs +4 -4
- package/dist/esm/hooks/usePermission/usePermission.mjs.map +1 -1
- package/dist/esm/hooks/usePictureInPicture/usePictureInPicture.mjs +17 -17
- package/dist/esm/hooks/usePictureInPicture/usePictureInPicture.mjs.map +1 -1
- package/dist/esm/hooks/usePointerLock/usePointerLock.mjs +3 -3
- package/dist/esm/hooks/usePointerLock/usePointerLock.mjs.map +1 -1
- package/dist/esm/hooks/usePostMessage/usePostMessage.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredContrast/usePreferredContrast.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredDark/usePreferredDark.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredReducedMotion/usePreferredReducedMotion.mjs.map +1 -1
- package/dist/esm/hooks/usePrevious/usePrevious.mjs.map +1 -1
- package/dist/esm/hooks/useQuery/useQuery.mjs.map +1 -1
- package/dist/esm/hooks/useQueue/useQueue.mjs.map +1 -1
- package/dist/esm/hooks/useRaf/useRaf.mjs.map +1 -1
- package/dist/esm/hooks/useRafState/useRafState.mjs.map +1 -1
- package/dist/esm/hooks/useRefState/useRefState.mjs.map +1 -1
- package/dist/esm/hooks/useRenderCount/useRenderCount.mjs.map +1 -1
- package/dist/esm/hooks/useRenderInfo/useRenderInfo.mjs.map +1 -1
- package/dist/esm/hooks/useRerender/useRerender.mjs.map +1 -1
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs +17 -16
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs.map +1 -1
- package/dist/esm/hooks/useRightClick/useRightClick.mjs.map +1 -1
- package/dist/esm/hooks/useScript/useScript.mjs.map +1 -1
- package/dist/esm/hooks/useScroll/useScroll.mjs.map +1 -1
- package/dist/esm/hooks/useScrollIntoView/useScrollIntoView.mjs.map +1 -1
- package/dist/esm/hooks/useScrollTo/useScrollTo.mjs.map +1 -1
- package/dist/esm/hooks/useSessionStorage/useSessionStorage.mjs.map +1 -1
- package/dist/esm/hooks/useSet/useSet.mjs.map +1 -1
- package/dist/esm/hooks/useShallowEffect/useShallowEffect.mjs.map +1 -1
- package/dist/esm/hooks/useShare/useShare.mjs +1 -1
- package/dist/esm/hooks/useShare/useShare.mjs.map +1 -1
- package/dist/esm/hooks/useSpeechRecognition/useSpeechRecognition.mjs.map +1 -1
- package/dist/esm/hooks/useSpeechSynthesis/useSpeechSynthesis.mjs +11 -11
- package/dist/esm/hooks/useSpeechSynthesis/useSpeechSynthesis.mjs.map +1 -1
- package/dist/esm/hooks/useStateHistory/useStateHistory.mjs.map +1 -1
- package/dist/esm/hooks/useStep/useStep.mjs.map +1 -1
- package/dist/esm/hooks/useSticky/useSticky.mjs.map +1 -1
- package/dist/esm/hooks/useStopwatch/useStopwatch.mjs.map +1 -1
- package/dist/esm/hooks/useStorage/useStorage.mjs.map +1 -1
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs +14 -14
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs.map +1 -1
- package/dist/esm/hooks/useTextSelection/useTextSelection.mjs.map +1 -1
- package/dist/esm/hooks/useThrottleCallback/useThrottleCallback.mjs.map +1 -1
- package/dist/esm/hooks/useThrottleState/useThrottleState.mjs +10 -0
- package/dist/esm/hooks/useThrottleState/useThrottleState.mjs.map +1 -0
- package/dist/esm/hooks/useThrottleValue/useThrottleValue.mjs.map +1 -1
- package/dist/esm/hooks/useTime/useTime.mjs.map +1 -1
- package/dist/esm/hooks/useTimeout/useTimeout.mjs.map +1 -1
- package/dist/esm/hooks/useTimer/useTimer.mjs.map +1 -1
- package/dist/esm/hooks/useToggle/useToggle.mjs.map +1 -1
- package/dist/esm/hooks/useUnmount/useUnmount.mjs.map +1 -1
- package/dist/esm/hooks/useUrlSearchParam/useUrlSearchParam.mjs.map +1 -1
- package/dist/esm/hooks/useUrlSearchParams/useUrlSearchParams.mjs.map +1 -1
- package/dist/esm/hooks/useVibrate/useVibrate.mjs +12 -12
- package/dist/esm/hooks/useVibrate/useVibrate.mjs.map +1 -1
- package/dist/esm/hooks/useVirtualKeyboard/useVirtualKeyboard.mjs +7 -7
- package/dist/esm/hooks/useVirtualKeyboard/useVirtualKeyboard.mjs.map +1 -1
- package/dist/esm/hooks/useWakeLock/useWakeLock.mjs +1 -1
- package/dist/esm/hooks/useWakeLock/useWakeLock.mjs.map +1 -1
- package/dist/esm/hooks/useWebSocket/useWebSocket.mjs.map +1 -1
- package/dist/esm/hooks/useWindowEvent/useWindowEvent.mjs.map +1 -1
- package/dist/esm/hooks/useWindowFocus/useWindowFocus.mjs.map +1 -1
- package/dist/esm/hooks/useWindowScroll/useWindowScroll.mjs.map +1 -1
- package/dist/esm/hooks/useWindowSize/useWindowSize.mjs.map +1 -1
- package/dist/esm/hooks/useWizard/useWizard.mjs.map +1 -1
- package/dist/esm/index.mjs +147 -139
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/helpers/createContext/createContext.d.ts +1 -0
- package/dist/types/helpers/createEventEmitter/createEventEmitter.d.ts +1 -0
- package/dist/types/helpers/createReactiveContext/createReactiveContext.d.ts +1 -0
- package/dist/types/helpers/createStore/createStore.d.ts +1 -0
- package/dist/types/hooks/state.d.ts +1 -0
- package/dist/types/hooks/useActiveElement/useActiveElement.d.ts +1 -0
- package/dist/types/hooks/useAsync/useAsync.d.ts +1 -0
- package/dist/types/hooks/useAudio/useAudio.d.ts +2 -1
- package/dist/types/hooks/useAutoScroll/useAutoScroll.d.ts +1 -0
- package/dist/types/hooks/useBattery/useBattery.d.ts +1 -0
- package/dist/types/hooks/useBluetooth/useBluetooth.d.ts +1 -0
- package/dist/types/hooks/useBoolean/useBoolean.d.ts +2 -1
- package/dist/types/hooks/useBreakpoints/useBreakpoints.d.ts +1 -0
- package/dist/types/hooks/useBroadcastChannel/useBroadcastChannel.d.ts +1 -0
- package/dist/types/hooks/useBrowserLanguage/useBrowserLanguage.d.ts +2 -1
- package/dist/types/hooks/useClickOutside/useClickOutside.d.ts +2 -1
- package/dist/types/hooks/useClipboard/useClipboard.d.ts +2 -1
- package/dist/types/hooks/useConst/useConst.d.ts +2 -1
- package/dist/types/hooks/useCookie/useCookie.d.ts +2 -1
- package/dist/types/hooks/useCookies/useCookies.d.ts +2 -1
- package/dist/types/hooks/useCopy/useCopy.d.ts +2 -1
- package/dist/types/hooks/useCounter/useCounter.d.ts +2 -1
- package/dist/types/hooks/useCssVar/useCssVar.d.ts +2 -1
- package/dist/types/hooks/useDebounceCallback/useDebounceCallback.d.ts +1 -0
- package/dist/types/hooks/useDebounceState/useDebounceState.d.ts +15 -0
- package/dist/types/hooks/useDebounceValue/useDebounceValue.d.ts +2 -1
- package/dist/types/hooks/useDefault/useDefault.d.ts +2 -1
- package/dist/types/hooks/useDeviceMotion/useDeviceMotion.d.ts +2 -1
- package/dist/types/hooks/useDeviceOrientation/useDeviceOrientation.d.ts +1 -0
- package/dist/types/hooks/useDevicePixelRatio/useDevicePixelRatio.d.ts +1 -0
- package/dist/types/hooks/useDidUpdate/useDidUpdate.d.ts +2 -1
- package/dist/types/hooks/useDisclosure/useDisclosure.d.ts +2 -1
- package/dist/types/hooks/useDisplayMedia/useDisplayMedia.d.ts +1 -0
- package/dist/types/hooks/useDocumentEvent/useDocumentEvent.d.ts +2 -1
- package/dist/types/hooks/useDocumentTitle/useDocumentTitle.d.ts +2 -1
- package/dist/types/hooks/useDocumentVisibility/useDocumentVisibility.d.ts +2 -1
- package/dist/types/hooks/useDoubleClick/useDoubleClick.d.ts +2 -1
- package/dist/types/hooks/useDropZone/useDropZone.d.ts +2 -1
- package/dist/types/hooks/useElementSize/useElementSize.d.ts +2 -1
- package/dist/types/hooks/useEvent/useEvent.d.ts +2 -1
- package/dist/types/hooks/useEventListener/useEventListener.d.ts +5 -2
- package/dist/types/hooks/useEventSource/useEventSource.d.ts +1 -0
- package/dist/types/hooks/useEyeDropper/useEyeDropper.d.ts +1 -0
- package/dist/types/hooks/useFavicon/useFavicon.d.ts +2 -1
- package/dist/types/hooks/useField/useField.d.ts +1 -0
- package/dist/types/hooks/useFileDialog/useFileDialog.d.ts +1 -0
- package/dist/types/hooks/useFocus/useFocus.d.ts +25 -0
- package/dist/types/hooks/useFps/useFps.d.ts +1 -0
- package/dist/types/hooks/useFul/useFul.d.ts +1 -0
- package/dist/types/hooks/useFullscreen/useFullscreen.d.ts +1 -0
- package/dist/types/hooks/useGamepad/useGamepad.d.ts +1 -0
- package/dist/types/hooks/useGeolocation/useGeolocation.d.ts +1 -0
- package/dist/types/hooks/useHash/useHash.d.ts +1 -0
- package/dist/types/hooks/useHotkeys/useHotkeys.d.ts +1 -0
- package/dist/types/hooks/useHover/useHover.d.ts +3 -0
- package/dist/types/hooks/useIdle/useIdle.d.ts +1 -0
- package/dist/types/hooks/useImage/useImage.d.ts +1 -0
- package/dist/types/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +1 -0
- package/dist/types/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +15 -6
- package/dist/types/hooks/useInterval/useInterval.d.ts +1 -0
- package/dist/types/hooks/useIsFirstRender/useIsFirstRender.d.ts +1 -0
- package/dist/types/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +1 -0
- package/dist/types/hooks/useKeyPress/useKeyPress.d.ts +1 -0
- package/dist/types/hooks/useKeyPressEvent/useKeyPressEvent.d.ts +1 -0
- package/dist/types/hooks/useKeyboard/useKeyboard.d.ts +1 -0
- package/dist/types/hooks/useKeysPressed/useKeysPressed.d.ts +1 -2
- package/dist/types/hooks/useLastChanged/useLastChanged.d.ts +1 -0
- package/dist/types/hooks/useLatest/useLatest.d.ts +1 -0
- package/dist/types/hooks/useLess/useLess.d.ts +1 -0
- package/dist/types/hooks/useList/useList.d.ts +1 -0
- package/dist/types/hooks/useLocalStorage/useLocalStorage.d.ts +1 -0
- package/dist/types/hooks/useLockCallback/useLockCallback.d.ts +1 -0
- package/dist/types/hooks/useLockScroll/useLockScroll.d.ts +1 -1
- package/dist/types/hooks/useLogger/useLogger.d.ts +1 -0
- package/dist/types/hooks/useLongPress/useLongPress.d.ts +1 -0
- package/dist/types/hooks/useMap/useMap.d.ts +1 -0
- package/dist/types/hooks/useMeasure/useMeasure.d.ts +1 -0
- package/dist/types/hooks/useMediaControls/useMediaControls.d.ts +1 -0
- package/dist/types/hooks/useMediaQuery/useMediaQuery.d.ts +1 -0
- package/dist/types/hooks/useMemory/useMemory.d.ts +1 -0
- package/dist/types/hooks/useMergedRef/useMergedRef.d.ts +17 -0
- package/dist/types/hooks/useMount/useMount.d.ts +1 -0
- package/dist/types/hooks/useMouse/useMouse.d.ts +1 -0
- package/dist/types/hooks/useMutation/useMutation.d.ts +1 -0
- package/dist/types/hooks/useMutationObserver/useMutationObserver.d.ts +43 -26
- package/dist/types/hooks/useNetwork/useNetwork.d.ts +1 -0
- package/dist/types/hooks/useObject/useObject.d.ts +35 -0
- package/dist/types/hooks/useOffsetPagination/useOffsetPagination.d.ts +12 -24
- package/dist/types/hooks/useOnce/useOnce.d.ts +1 -0
- package/dist/types/hooks/useOnline/useOnline.d.ts +1 -0
- package/dist/types/hooks/useOperatingSystem/useOperatingSystem.d.ts +1 -0
- package/dist/types/hooks/useOptimistic/useOptimistic.d.ts +1 -0
- package/dist/types/hooks/useOrientation/useOrientation.d.ts +2 -1
- package/dist/types/hooks/useOtpCredential/useOtpCredential.d.ts +1 -0
- package/dist/types/hooks/usePageLeave/usePageLeave.d.ts +1 -0
- package/dist/types/hooks/usePaint/usePaint.d.ts +1 -0
- package/dist/types/hooks/useParallax/useParallax.d.ts +1 -0
- package/dist/types/hooks/usePerformanceObserver/usePerformanceObserver.d.ts +1 -0
- package/dist/types/hooks/usePermission/usePermission.d.ts +1 -0
- package/dist/types/hooks/usePictureInPicture/usePictureInPicture.d.ts +1 -0
- package/dist/types/hooks/usePointerLock/usePointerLock.d.ts +1 -0
- package/dist/types/hooks/usePostMessage/usePostMessage.d.ts +1 -0
- package/dist/types/hooks/usePreferredColorScheme/usePreferredColorScheme.d.ts +1 -0
- package/dist/types/hooks/usePreferredContrast/usePreferredContrast.d.ts +1 -0
- package/dist/types/hooks/usePreferredDark/usePreferredDark.d.ts +1 -0
- package/dist/types/hooks/usePreferredLanguages/usePreferredLanguages.d.ts +1 -0
- package/dist/types/hooks/usePreferredReducedMotion/usePreferredReducedMotion.d.ts +1 -0
- package/dist/types/hooks/usePrevious/usePrevious.d.ts +1 -0
- package/dist/types/hooks/useQuery/useQuery.d.ts +1 -0
- package/dist/types/hooks/useQueue/useQueue.d.ts +1 -0
- package/dist/types/hooks/useRaf/useRaf.d.ts +1 -0
- package/dist/types/hooks/useRafState/useRafState.d.ts +3 -0
- package/dist/types/hooks/useRefState/useRefState.d.ts +1 -0
- package/dist/types/hooks/useRenderCount/useRenderCount.d.ts +1 -0
- package/dist/types/hooks/useRenderInfo/useRenderInfo.d.ts +1 -0
- package/dist/types/hooks/useRerender/useRerender.d.ts +1 -0
- package/dist/types/hooks/useResizeObserver/useResizeObserver.d.ts +55 -31
- package/dist/types/hooks/useRightClick/useRightClick.d.ts +1 -0
- package/dist/types/hooks/useScript/useScript.d.ts +1 -0
- package/dist/types/hooks/useScroll/useScroll.d.ts +1 -0
- package/dist/types/hooks/useScrollIntoView/useScrollIntoView.d.ts +1 -0
- package/dist/types/hooks/useScrollTo/useScrollTo.d.ts +1 -0
- package/dist/types/hooks/useSessionStorage/useSessionStorage.d.ts +1 -0
- package/dist/types/hooks/useSet/useSet.d.ts +1 -0
- package/dist/types/hooks/useShallowEffect/useShallowEffect.d.ts +1 -0
- package/dist/types/hooks/useShare/useShare.d.ts +1 -0
- package/dist/types/hooks/useSpeechRecognition/useSpeechRecognition.d.ts +1 -0
- package/dist/types/hooks/useSpeechSynthesis/useSpeechSynthesis.d.ts +1 -0
- package/dist/types/hooks/useStateHistory/useStateHistory.d.ts +1 -0
- package/dist/types/hooks/useStep/useStep.d.ts +1 -0
- package/dist/types/hooks/useSticky/useSticky.d.ts +1 -0
- package/dist/types/hooks/useStopwatch/useStopwatch.d.ts +1 -0
- package/dist/types/hooks/useStorage/useStorage.d.ts +1 -0
- package/dist/types/hooks/useTextDirection/useTextDirection.d.ts +1 -0
- package/dist/types/hooks/useTextSelection/useTextSelection.d.ts +1 -0
- package/dist/types/hooks/useThrottleCallback/useThrottleCallback.d.ts +1 -0
- package/dist/types/hooks/useThrottleState/useThrottleState.d.ts +15 -0
- package/dist/types/hooks/useThrottleValue/useThrottleValue.d.ts +1 -0
- package/dist/types/hooks/useTime/useTime.d.ts +1 -0
- package/dist/types/hooks/useTimeout/useTimeout.d.ts +1 -0
- package/dist/types/hooks/useTimer/useTimer.d.ts +1 -0
- package/dist/types/hooks/useToggle/useToggle.d.ts +1 -0
- package/dist/types/hooks/useUnmount/useUnmount.d.ts +1 -0
- package/dist/types/hooks/useUrlSearchParam/useUrlSearchParam.d.ts +1 -0
- package/dist/types/hooks/useUrlSearchParams/useUrlSearchParams.d.ts +1 -0
- package/dist/types/hooks/useVibrate/useVibrate.d.ts +1 -0
- package/dist/types/hooks/useVirtualKeyboard/useVirtualKeyboard.d.ts +1 -0
- package/dist/types/hooks/useWakeLock/useWakeLock.d.ts +1 -0
- package/dist/types/hooks/useWebSocket/useWebSocket.d.ts +17 -0
- package/dist/types/hooks/useWindowEvent/useWindowEvent.d.ts +1 -0
- package/dist/types/hooks/useWindowFocus/useWindowFocus.d.ts +1 -0
- package/dist/types/hooks/useWindowScroll/useWindowScroll.d.ts +1 -0
- package/dist/types/hooks/useWindowSize/useWindowSize.d.ts +1 -0
- package/dist/types/hooks/useWizard/useWizard.d.ts +1 -0
- package/dist/types/hooks/utilities.d.ts +2 -0
- package/package.json +89 -89
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { HookTarget } from '../../utils/helpers';
|
|
2
2
|
import { StateRef } from '../useRefState/useRefState';
|
|
3
|
-
|
|
3
|
+
/** The intersection observer callback type */
|
|
4
|
+
export type UseIntersectionObserverCallback = (entry: IntersectionObserverEntry, observer: IntersectionObserver) => void;
|
|
4
5
|
/** The intersection observer options type */
|
|
5
6
|
export interface UseIntersectionObserverOptions extends Omit<IntersectionObserverInit, 'root'> {
|
|
7
|
+
/** The enabled state of the intersection observer */
|
|
6
8
|
enabled?: boolean;
|
|
9
|
+
/** The callback to execute when intersection is detected */
|
|
7
10
|
onChange?: UseIntersectionObserverCallback;
|
|
11
|
+
/** The root element to observe */
|
|
8
12
|
root?: HookTarget;
|
|
9
13
|
}
|
|
10
14
|
/** The intersection observer return type */
|
|
11
15
|
export interface UseIntersectionObserverReturn {
|
|
16
|
+
/** The intersection observer entry */
|
|
12
17
|
entry?: IntersectionObserverEntry;
|
|
18
|
+
/** The in view state of the intersection observer */
|
|
13
19
|
inView: boolean;
|
|
20
|
+
/** The intersection observer instance */
|
|
21
|
+
observer?: IntersectionObserver;
|
|
14
22
|
}
|
|
15
23
|
export interface UseIntersectionObserver {
|
|
16
24
|
<Target extends Element>(options?: UseIntersectionObserverOptions, target?: never): UseIntersectionObserverReturn & {
|
|
@@ -20,12 +28,13 @@ export interface UseIntersectionObserver {
|
|
|
20
28
|
<Target extends Element>(callback: UseIntersectionObserverCallback, target?: never): UseIntersectionObserverReturn & {
|
|
21
29
|
ref: StateRef<Target>;
|
|
22
30
|
};
|
|
23
|
-
(
|
|
31
|
+
(target: HookTarget, callback: UseIntersectionObserverCallback): UseIntersectionObserverReturn;
|
|
24
32
|
}
|
|
25
33
|
/**
|
|
26
34
|
* @name useIntersectionObserver
|
|
27
35
|
* @description - Hook that gives you intersection observer state
|
|
28
36
|
* @category Sensors
|
|
37
|
+
* @usage medium
|
|
29
38
|
*
|
|
30
39
|
* @browserapi IntersectionObserver https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver
|
|
31
40
|
*
|
|
@@ -37,7 +46,7 @@ export interface UseIntersectionObserver {
|
|
|
37
46
|
* @returns {UseIntersectionObserverReturn} An object containing the state
|
|
38
47
|
*
|
|
39
48
|
* @example
|
|
40
|
-
* const { ref, entry, inView } = useIntersectionObserver();
|
|
49
|
+
* const { ref, entry, inView, observer } = useIntersectionObserver();
|
|
41
50
|
*
|
|
42
51
|
* @overload
|
|
43
52
|
* @template Target The target element
|
|
@@ -47,7 +56,7 @@ export interface UseIntersectionObserver {
|
|
|
47
56
|
* @returns {UseIntersectionObserverReturn & { ref: StateRef<Target> }} A React ref to attach to the target element
|
|
48
57
|
*
|
|
49
58
|
* @example
|
|
50
|
-
* const { entry, inView } = useIntersectionObserver(ref);
|
|
59
|
+
* const { entry, inView, observer } = useIntersectionObserver(ref);
|
|
51
60
|
*
|
|
52
61
|
* @overload
|
|
53
62
|
* @template Target The target element
|
|
@@ -55,7 +64,7 @@ export interface UseIntersectionObserver {
|
|
|
55
64
|
* @returns {UseIntersectionObserverReturn & { ref: StateRef<Target> }} A React ref to attach to the target element
|
|
56
65
|
*
|
|
57
66
|
* @example
|
|
58
|
-
* const { ref, entry, inView } = useIntersectionObserver(() => console.log('callback'));
|
|
67
|
+
* const { ref, entry, inView, observer } = useIntersectionObserver(() => console.log('callback'));
|
|
59
68
|
*
|
|
60
69
|
* @overload
|
|
61
70
|
* @param {UseIntersectionObserverCallback} callback The callback to execute when intersection is detected
|
|
@@ -63,6 +72,6 @@ export interface UseIntersectionObserver {
|
|
|
63
72
|
* @returns {UseIntersectionObserverReturn} An object containing the state
|
|
64
73
|
*
|
|
65
74
|
* @example
|
|
66
|
-
* const { entry, inView } = useIntersectionObserver(() => console.log('callback'), ref);
|
|
75
|
+
* const { entry, inView, observer } = useIntersectionObserver(() => console.log('callback'), ref);
|
|
67
76
|
*/
|
|
68
77
|
export declare const useIntersectionObserver: UseIntersectionObserver;
|
|
@@ -3,6 +3,7 @@ import { useEffect } from 'react';
|
|
|
3
3
|
* @name useIsomorphicLayoutEffect
|
|
4
4
|
* @description - Hook conditionally selects either `useLayoutEffect` or `useEffect` based on the environment
|
|
5
5
|
* @category Lifecycle
|
|
6
|
+
* @usage high
|
|
6
7
|
*
|
|
7
8
|
* @example
|
|
8
9
|
* useIsomorphicLayoutEffect(() => console.log('effect'), [])
|
|
@@ -21,6 +21,7 @@ export interface UseKeyPressEvent {
|
|
|
21
21
|
* @name useKeyPressEvent
|
|
22
22
|
* @description - Hook that listens for key press events on specified targets
|
|
23
23
|
* @category Sensors
|
|
24
|
+
* @usage low
|
|
24
25
|
*
|
|
25
26
|
* @overload
|
|
26
27
|
* @param {UseKeyPressEventKey} key The key or array of keys to listen for.
|
|
@@ -19,11 +19,10 @@ export interface UseKeysPressed {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Hook that tracks which keyboard keys are currently pressed
|
|
23
|
-
*
|
|
24
22
|
* @name useKeysPressed
|
|
25
23
|
* @description Tracks all currently pressed keyboard keys and their codes
|
|
26
24
|
* @category Sensors
|
|
25
|
+
* @usage low
|
|
27
26
|
*
|
|
28
27
|
* @overload
|
|
29
28
|
* @param {HookTarget | Window} target DOM element or ref to attach keyboard listeners to
|
|
@@ -6,6 +6,7 @@ export interface UseLastChangedOptions {
|
|
|
6
6
|
* @name useLastChanged
|
|
7
7
|
* @description - Hook for records the timestamp of the last change
|
|
8
8
|
* @category Utilities
|
|
9
|
+
* @usage low
|
|
9
10
|
*
|
|
10
11
|
* @param {any} source The source of the last change
|
|
11
12
|
* @param {number | null} [options.initialValue=null] The initial value
|
|
@@ -7,6 +7,7 @@ export interface UseLatestReturn<Value> {
|
|
|
7
7
|
* @name useLatest
|
|
8
8
|
* @description - Hook that returns the stable reference of the value
|
|
9
9
|
* @category Utilities
|
|
10
|
+
* @usage medium
|
|
10
11
|
*
|
|
11
12
|
* @template Value The type of the value
|
|
12
13
|
* @param {Value} value The value to get the previous value
|
|
@@ -19,6 +19,7 @@ export interface UseListReturn<Item> {
|
|
|
19
19
|
* @name useList
|
|
20
20
|
* @description - Hook that provides state and helper methods to manage a list of items
|
|
21
21
|
* @category State
|
|
22
|
+
* @usage medium
|
|
22
23
|
*
|
|
23
24
|
* @template Item The type of the item
|
|
24
25
|
* @param {Item[] | (() => Item[])} initialList The initial list of items
|
|
@@ -3,6 +3,7 @@ import { UseStorageInitialValue, UseStorageOptions } from '../useStorage/useStor
|
|
|
3
3
|
* @name useLocalStorage
|
|
4
4
|
* @description - Hook that manages local storage value
|
|
5
5
|
* @category State
|
|
6
|
+
* @usage high
|
|
6
7
|
*
|
|
7
8
|
* @browserapi localStorage https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
|
|
8
9
|
*
|
|
@@ -28,7 +28,7 @@ export interface UseLockScroll {
|
|
|
28
28
|
* @name useLockScroll
|
|
29
29
|
* @description - Hook that locks scroll on an element or document body
|
|
30
30
|
* @category Elements
|
|
31
|
-
*
|
|
31
|
+
* @usage medium
|
|
32
32
|
*
|
|
33
33
|
* @overload
|
|
34
34
|
* @param {HookTarget} [target=document.body] The target element to lock scroll on
|
|
@@ -18,6 +18,7 @@ export interface UseLongPress {
|
|
|
18
18
|
* @name useLongPress
|
|
19
19
|
* @description - Hook that defines the logic when long pressing an element
|
|
20
20
|
* @category Elements
|
|
21
|
+
* @usage medium
|
|
21
22
|
*
|
|
22
23
|
* @overload
|
|
23
24
|
* @param {HookTarget} target The target element to be long pressed
|
|
@@ -65,6 +65,7 @@ export interface UseMediaControls {
|
|
|
65
65
|
* @name useMediaControls
|
|
66
66
|
* @description Hook that provides controls for HTML media elements (audio/video)
|
|
67
67
|
* @category Browser
|
|
68
|
+
* @usage low
|
|
68
69
|
*
|
|
69
70
|
* @overload
|
|
70
71
|
* @param {HookTarget} target The target media element
|
|
@@ -18,6 +18,7 @@ export interface UseMemoryReturn {
|
|
|
18
18
|
* @name useMemory
|
|
19
19
|
* @description - Hook that gives you current memory usage
|
|
20
20
|
* @category Browser
|
|
21
|
+
* @usage low
|
|
21
22
|
*
|
|
22
23
|
* @browserapi performance.memory https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
|
|
23
24
|
*
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Ref, RefCallback } from 'react';
|
|
2
|
+
export declare const assignRef: <Element>(ref: Ref<Element>, value: Element) => ReturnType<RefCallback<Element>>;
|
|
3
|
+
export declare const mergeRefs: <Element>(...refs: Ref<Element>[]) => RefCallback<Element>;
|
|
4
|
+
/**
|
|
5
|
+
* @name useMergedRef
|
|
6
|
+
* @description - Hook that merges multiple refs into a single ref
|
|
7
|
+
* @category State
|
|
8
|
+
* @usage medium
|
|
9
|
+
*
|
|
10
|
+
* @template Element The element type
|
|
11
|
+
* @param {...Ref<Element>[]} refs The refs to merge
|
|
12
|
+
* @returns {RefCallback<Element>} A memoized ref callback that assigns to all provided refs
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const mergedRef = useMergedRef(firstRef, secondRef);
|
|
16
|
+
*/
|
|
17
|
+
export declare const useMergedRef: <Element>(...refs: Ref<Element>[]) => RefCallback<Element>;
|
|
@@ -20,6 +20,7 @@ export interface RequestOptions<Data> extends UseMutationOptions<Data> {
|
|
|
20
20
|
* @name useMutation
|
|
21
21
|
* @description - Hook that defines the logic when mutate data
|
|
22
22
|
* @category Async
|
|
23
|
+
* @usage high
|
|
23
24
|
*
|
|
24
25
|
* @template Body The type of the body
|
|
25
26
|
* @template Data The type of the data
|
|
@@ -1,60 +1,77 @@
|
|
|
1
1
|
import { HookTarget } from '../../utils/helpers';
|
|
2
2
|
import { StateRef } from '../useRefState/useRefState';
|
|
3
|
-
/** The mutation observer
|
|
4
|
-
export type
|
|
5
|
-
/** The mutation observer return type */
|
|
6
|
-
export interface UseMutationObserverReturn {
|
|
7
|
-
/** The mutation observer instance */
|
|
8
|
-
observer: MutationObserver;
|
|
9
|
-
/** The mutation observer entries */
|
|
10
|
-
stop: () => void;
|
|
11
|
-
}
|
|
3
|
+
/** The mutation observer callback type */
|
|
4
|
+
export type UseMutationObserverCallback = (mutations: MutationRecord[], observer: MutationObserver) => void;
|
|
12
5
|
/** The mutation observer options type */
|
|
13
6
|
export interface UseMutationObserverOptions extends MutationObserverInit {
|
|
14
7
|
/** The enabled state of the mutation observer */
|
|
15
8
|
enabled?: boolean;
|
|
9
|
+
/** The callback to execute when mutation is detected */
|
|
10
|
+
onChange?: UseMutationObserverCallback;
|
|
11
|
+
}
|
|
12
|
+
/** The mutation observer return type */
|
|
13
|
+
export interface UseMutationObserverReturn {
|
|
14
|
+
/** The mutation observer instance */
|
|
15
|
+
observer?: MutationObserver;
|
|
16
16
|
}
|
|
17
17
|
export interface UseMutationObserver {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
<Target extends Element>(options?: UseMutationObserverOptions, target?: never): UseMutationObserverReturn & {
|
|
19
|
+
ref: StateRef<Target>;
|
|
20
|
+
};
|
|
21
|
+
(target: HookTarget, options?: UseMutationObserverOptions): UseMutationObserverReturn;
|
|
22
|
+
<Target extends Element>(callback: UseMutationObserverCallback, target?: never): UseMutationObserverReturn & {
|
|
20
23
|
ref: StateRef<Target>;
|
|
21
24
|
};
|
|
25
|
+
(target: HookTarget, callback: UseMutationObserverCallback): UseMutationObserverReturn;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* @name useMutationObserver
|
|
25
29
|
* @description - Hook that gives you mutation observer state
|
|
26
30
|
* @category Sensors
|
|
31
|
+
* @usage low
|
|
32
|
+
*
|
|
33
|
+
* @browserapi MutationObserver https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
|
|
27
34
|
*
|
|
28
35
|
* @overload
|
|
29
|
-
* @
|
|
30
|
-
* @param {MutationCallback} callback The callback to execute when mutation is detected
|
|
36
|
+
* @param {HookTarget} target The target element to observe
|
|
31
37
|
* @param {boolean} [options.enabled=true] The enabled state of the mutation observer
|
|
38
|
+
* @param {UseMutationObserverCallback} [options.onChange] The callback to execute when mutation is detected
|
|
32
39
|
* @param {boolean} [options.attributes] Set to true if mutations to target's attributes are to be observed
|
|
33
40
|
* @param {boolean} [options.characterData] Set to true if mutations to target's data are to be observed
|
|
34
41
|
* @param {boolean} [options.childList] Set to true if mutations to target's children are to be observed
|
|
35
|
-
* @param {boolean} [options.subtree]
|
|
36
|
-
* @
|
|
37
|
-
* @param {boolean} [options.attributeOldValue] Set to a list of attribute local names (without namespace) if not all attribute mutations need to be observed and attributes is true or omitted
|
|
38
|
-
* @param {string[]} [options.attributeFilter] Set to a list of attribute local names (without namespace) if not all attribute mutations need to be observed and attributes is true or omitted
|
|
39
|
-
* @returns {UseMutationObserverReturn & { ref: StateRef<Target> }} An object containing the mutation observer state
|
|
42
|
+
* @param {boolean} [options.subtree] Set to true if mutations to not just target, but also target's descendants are to be observed
|
|
43
|
+
* @returns {UseMutationObserverReturn} An object containing the mutation observer state
|
|
40
44
|
*
|
|
41
45
|
* @example
|
|
42
|
-
* const {
|
|
46
|
+
* const { observer, stop } = useMutationObserver(ref, { childList: true });
|
|
43
47
|
*
|
|
44
48
|
* @overload
|
|
45
|
-
* @
|
|
46
|
-
* @param {MutationCallback} callback The callback to execute when mutation is detected
|
|
49
|
+
* @template Target The target element
|
|
47
50
|
* @param {boolean} [options.enabled=true] The enabled state of the mutation observer
|
|
51
|
+
* @param {UseMutationObserverCallback} [options.onChange] The callback to execute when mutation is detected
|
|
48
52
|
* @param {boolean} [options.attributes] Set to true if mutations to target's attributes are to be observed
|
|
49
53
|
* @param {boolean} [options.characterData] Set to true if mutations to target's data are to be observed
|
|
50
54
|
* @param {boolean} [options.childList] Set to true if mutations to target's children are to be observed
|
|
51
|
-
* @param {boolean} [options.subtree]
|
|
52
|
-
* @
|
|
53
|
-
*
|
|
54
|
-
* @
|
|
55
|
+
* @param {boolean} [options.subtree] Set to true if mutations to not just target, but also target's descendants are to be observed
|
|
56
|
+
* @returns {UseMutationObserverReturn & { ref: StateRef<Target> }} A React ref to attach to the target element
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* const { ref, observer, stop } = useMutationObserver({ childList: true });
|
|
60
|
+
*
|
|
61
|
+
* @overload
|
|
62
|
+
* @template Target The target element
|
|
63
|
+
* @param {UseMutationObserverCallback} callback The callback to execute when mutation is detected
|
|
64
|
+
* @returns {UseMutationObserverReturn & { ref: StateRef<Target> }} A React ref to attach to the target element
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* const { ref, observer, stop } = useMutationObserver((mutations) => console.log(mutations));
|
|
68
|
+
*
|
|
69
|
+
* @overload
|
|
70
|
+
* @param {UseMutationObserverCallback} callback The callback to execute when mutation is detected
|
|
71
|
+
* @param {HookTarget} target The target element to observe
|
|
55
72
|
* @returns {UseMutationObserverReturn} An object containing the mutation observer state
|
|
56
73
|
*
|
|
57
74
|
* @example
|
|
58
|
-
* const { observer, stop } = useMutationObserver(
|
|
75
|
+
* const { observer, stop } = useMutationObserver((mutations) => console.log(mutations), ref);
|
|
59
76
|
*/
|
|
60
77
|
export declare const useMutationObserver: UseMutationObserver;
|
|
@@ -40,6 +40,7 @@ export declare const getConnection: () => Connection;
|
|
|
40
40
|
* @name useNetwork
|
|
41
41
|
* @description - Hook to track network status
|
|
42
42
|
* @category Browser
|
|
43
|
+
* @usage low
|
|
43
44
|
*
|
|
44
45
|
* @browserapi navigator.connection https://developer.mozilla.org/en-US/docs/Web/API/Navigator/connection
|
|
45
46
|
*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** The use object return type */
|
|
2
|
+
export interface UseObjectReturn<Value extends object> {
|
|
3
|
+
/** Checks if the object is empty */
|
|
4
|
+
empty: boolean;
|
|
5
|
+
/** Gets the keys of the object */
|
|
6
|
+
keys: Array<keyof Value>;
|
|
7
|
+
/** Gets the number of properties */
|
|
8
|
+
size: number;
|
|
9
|
+
/** The current object state */
|
|
10
|
+
value: Value;
|
|
11
|
+
/** Clears all properties from the object */
|
|
12
|
+
clear: () => void;
|
|
13
|
+
/** Checks if a property exists */
|
|
14
|
+
has: (key: keyof Value) => boolean;
|
|
15
|
+
/** Removes a property from the object */
|
|
16
|
+
remove: (key: keyof Value) => void;
|
|
17
|
+
/** Resets the object to its initial value */
|
|
18
|
+
reset: () => void;
|
|
19
|
+
/** Sets a property on the object */
|
|
20
|
+
set: (value: Partial<Value>) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @name useObject
|
|
24
|
+
* @description - Hook that provides state and helper methods to manage an object
|
|
25
|
+
* @category State
|
|
26
|
+
* @usage medium
|
|
27
|
+
*
|
|
28
|
+
* @template Value The type of the object
|
|
29
|
+
* @param {Value} initialValue The initial object value
|
|
30
|
+
* @returns {UseObjectReturn<Value>} An object containing the current state and functions to interact with the object
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const { value, set, reset, remove, update, merge, clear, toggle, has, keys, isEmpty, size } = useObject({ name: 'John', age: 30, isActive: true });
|
|
34
|
+
*/
|
|
35
|
+
export declare function useObject<Value extends object>(initialValue: Value): UseObjectReturn<Value>;
|
|
@@ -3,29 +3,17 @@ export interface UseOffsetPaginationOptions {
|
|
|
3
3
|
/** The initial page number */
|
|
4
4
|
initialPage?: number;
|
|
5
5
|
/** The number of items per page */
|
|
6
|
-
|
|
6
|
+
initialPageSize?: number;
|
|
7
7
|
/** The total number of items */
|
|
8
8
|
total?: number;
|
|
9
9
|
/** The callback function to be invoked when page changes */
|
|
10
|
-
|
|
11
|
-
page: number;
|
|
12
|
-
pageSize: number;
|
|
13
|
-
}) => void;
|
|
14
|
-
/** The callback function to be invoked when page count changes */
|
|
15
|
-
onPageCountChange?: ({ page, pageSize }: {
|
|
16
|
-
page: number;
|
|
17
|
-
pageSize: number;
|
|
18
|
-
}) => void;
|
|
19
|
-
/** The callback function to be invoked when page size changes */
|
|
20
|
-
onPageSizeChange?: ({ page, pageSize }: {
|
|
10
|
+
onChange?: ({ page, pageSize }: {
|
|
21
11
|
page: number;
|
|
22
12
|
pageSize: number;
|
|
23
13
|
}) => void;
|
|
24
14
|
}
|
|
25
15
|
/** The use offset pagination return type */
|
|
26
16
|
export interface UseOffsetPaginationReturn {
|
|
27
|
-
/** The number of items per page */
|
|
28
|
-
currentPageSize: number;
|
|
29
17
|
/** Whether the current page is the first page */
|
|
30
18
|
isFirstPage: boolean;
|
|
31
19
|
/** Whether the current page is the last page */
|
|
@@ -34,35 +22,35 @@ export interface UseOffsetPaginationReturn {
|
|
|
34
22
|
page: number;
|
|
35
23
|
/** The total number of pages */
|
|
36
24
|
pageCount: number;
|
|
25
|
+
/** The number of items per page */
|
|
26
|
+
pageSize: number;
|
|
37
27
|
/** The callback function to go to the next page */
|
|
38
28
|
next: () => void;
|
|
39
29
|
/** The callback function to go to the previous page */
|
|
40
30
|
prev: () => void;
|
|
41
31
|
/** The callback function to set the current page */
|
|
42
|
-
|
|
32
|
+
setPage: (page: number) => void;
|
|
33
|
+
/** The callback function to set the page size */
|
|
34
|
+
setPageSize: (pageSize: number) => void;
|
|
43
35
|
}
|
|
44
36
|
/**
|
|
45
37
|
* @name useOffsetPagination
|
|
46
38
|
* @description - Hook that defines the logic when pagination
|
|
47
39
|
* @category State
|
|
40
|
+
* @usage medium
|
|
48
41
|
*
|
|
49
42
|
* @param {UseOffsetPaginationOptions} options - The options for the hook
|
|
50
43
|
* @param {number} [options.total] - The total number of items
|
|
51
44
|
* @param {number} [options.pageSize] - The number of items per page
|
|
52
45
|
* @param {number} [options.initialPage] - The current page
|
|
53
|
-
* @param {({ page, pageSize }: { page: number; pageSize: number }) => void} [options.
|
|
54
|
-
* @param {({ page, pageSize }: { page: number; pageSize: number }) => void} [options.onPageCountChange] - The callback function to be invoked when page count changes
|
|
55
|
-
* @param {({ page, pageSize }: { page: number; pageSize: number }) => void} [options.onPageSizeChange] - The callback function to be invoked when page size changes
|
|
46
|
+
* @param {({ page, pageSize }: { page: number; pageSize: number }) => void} [options.onChange] - The callback function to be invoked when page changes
|
|
56
47
|
* @returns {UseOffsetPaginationReturn} - The state of the hook
|
|
57
48
|
*
|
|
58
49
|
* @example
|
|
59
50
|
* const { currentPage, currentPageSize, pageCount, isFirstPage, isLastPage, prev, next } = useOffsetPagination({
|
|
60
51
|
* total: 100,
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* onPageChange: (page) => {},
|
|
64
|
-
* onPageCountChange: (pageCount) => {},
|
|
65
|
-
* onPageSizeChange: (pageSize) => {}
|
|
52
|
+
* initialPageSize: 10,
|
|
53
|
+
* initialPage: 1
|
|
66
54
|
* });
|
|
67
55
|
*/
|
|
68
|
-
export declare const useOffsetPagination: ({ total,
|
|
56
|
+
export declare const useOffsetPagination: ({ total, initialPage, initialPageSize, onChange }?: UseOffsetPaginationOptions) => UseOffsetPaginationReturn;
|
|
@@ -3,6 +3,7 @@ import { EffectCallback } from 'react';
|
|
|
3
3
|
* @name useEffectOnce
|
|
4
4
|
* @description - Hook that runs an effect only once. Please do not use it in production code!
|
|
5
5
|
* @category Humor
|
|
6
|
+
* @usage low
|
|
6
7
|
*
|
|
7
8
|
* @warning - This hook will run effect only once even in strict mode. Please do not use it in production code!
|
|
8
9
|
*
|
|
@@ -5,6 +5,7 @@ export declare const getOperatingSystem: () => OperatingSystem;
|
|
|
5
5
|
* @name useOperatingSystem
|
|
6
6
|
* @description - Hook that returns the operating system of the current browser
|
|
7
7
|
* @category User
|
|
8
|
+
* @usage low
|
|
8
9
|
*
|
|
9
10
|
* @returns {OperatingSystem} The operating system
|
|
10
11
|
*
|
|
@@ -6,6 +6,7 @@ export type UseOptimisticReturn<State> = [
|
|
|
6
6
|
* @name useOptimistic
|
|
7
7
|
* @description - Hook that allows get optimistic value before its update
|
|
8
8
|
* @category Async
|
|
9
|
+
* @usage medium
|
|
9
10
|
*
|
|
10
11
|
* @template State The type of the state
|
|
11
12
|
* @param {State} state The value to be returned initially and whenever no action is pending
|
|
@@ -7,7 +7,7 @@ export interface UseOrientationValue {
|
|
|
7
7
|
/** The current angle */
|
|
8
8
|
angle: number;
|
|
9
9
|
/** The current orientation type */
|
|
10
|
-
orientationType
|
|
10
|
+
orientationType?: OrientationType;
|
|
11
11
|
}
|
|
12
12
|
export type OrientationLockType = 'any' | 'landscape-primary' | 'landscape-secondary' | 'landscape' | 'natural' | 'portrait-primary' | 'portrait-secondary' | 'portrait';
|
|
13
13
|
export interface useOrientationReturn {
|
|
@@ -24,6 +24,7 @@ export interface useOrientationReturn {
|
|
|
24
24
|
* @name useOrientation
|
|
25
25
|
* @description - Hook that provides the current screen orientation
|
|
26
26
|
* @category Sensors
|
|
27
|
+
* @usage low
|
|
27
28
|
*
|
|
28
29
|
* @browserapi screen.orientation https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation
|
|
29
30
|
*
|
|
@@ -28,6 +28,7 @@ export interface UseOtpCredential {
|
|
|
28
28
|
* @name useOtpCredential
|
|
29
29
|
* @description - Hook that creates an otp credential
|
|
30
30
|
* @category Browser
|
|
31
|
+
* @usage low
|
|
31
32
|
*
|
|
32
33
|
* @browserapi navigator.credentials https://developer.mozilla.org/en-US/docs/Web/API/Navigator/credentials
|
|
33
34
|
*
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @name usePageLeave
|
|
3
3
|
* @description - Hook what calls given function when mouse leaves the page
|
|
4
4
|
* @category Sensors
|
|
5
|
+
* @usage low
|
|
5
6
|
*
|
|
6
7
|
* @param {() => void} [callback] The callback function what calls then mouse leaves the page
|
|
7
8
|
* @returns {boolean} A boolean which determines if the mouse left the page
|