@siberiacancode/reactuse 0.0.61 → 0.0.63
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/dist/cjs/{_rollupPluginBabelHelpers-COaI5TrH.js → _rollupPluginBabelHelpers-jNdmazlt.js} +2 -2
- package/dist/cjs/_rollupPluginBabelHelpers-jNdmazlt.js.map +1 -0
- package/dist/cjs/hooks/index.js +2 -2
- package/dist/cjs/hooks/useAsync/useAsync.js +2 -2
- package/dist/cjs/hooks/useBattery/useBattery.js +2 -2
- package/dist/cjs/hooks/useBattery/useBattery.js.map +1 -1
- package/dist/cjs/hooks/useBoolean/useBoolean.js +2 -2
- package/dist/cjs/hooks/useBoolean/useBoolean.js.map +1 -1
- package/dist/cjs/hooks/useBreakpoints/constants/breakpoints.js +1 -1
- package/dist/cjs/hooks/useBreakpoints/useBreakpoints.js +2 -2
- package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.js +2 -2
- package/dist/cjs/hooks/useClickOutside/useClickOutside.js.map +1 -1
- package/dist/cjs/hooks/useClipboard/useClipboard.js +2 -2
- package/dist/cjs/hooks/useClipboard/useClipboard.js.map +1 -1
- package/dist/cjs/hooks/useCounter/useCounter.js +2 -2
- package/dist/cjs/hooks/useCssVar/useCssVar.js +2 -2
- package/dist/cjs/hooks/useDebounceCallback/useDebounceCallback.js +1 -1
- package/dist/cjs/hooks/useDebounceValue/useDebounceValue.js +2 -2
- package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
- package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +1 -1
- package/dist/cjs/hooks/useDisclosure/useDisclosure.js +2 -2
- package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js +2 -2
- package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
- package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
- package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
- package/dist/cjs/hooks/useEventListener/useEventListener.js +2 -2
- package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js +2 -2
- package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js.map +1 -1
- package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
- package/dist/cjs/hooks/useField/useField.js +2 -2
- package/dist/cjs/hooks/useFileDialog/useFileDialog.js +2 -2
- package/dist/cjs/hooks/useFps/useFps.js +2 -2
- package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
- package/dist/cjs/hooks/useFullscreen/useFullscreen.js.map +1 -1
- package/dist/cjs/hooks/useGamepad/helpers/mapGamepadToXbox360Controller.js +1 -1
- package/dist/cjs/hooks/useGamepad/useGamepad.js +2 -2
- package/dist/cjs/hooks/useGeolocation/useGeolocation.js +2 -2
- package/dist/cjs/hooks/useHash/useHash.js +2 -2
- package/dist/cjs/hooks/useHotkeys/useHotkeys.js +2 -2
- package/dist/cjs/hooks/useHover/useHover.js +2 -2
- package/dist/cjs/hooks/useIdle/useIdle.js +2 -2
- package/dist/cjs/hooks/useImage/useImage.js +2 -2
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.js +2 -2
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.js.map +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
- package/dist/cjs/hooks/useInterval/useInterval.js +2 -2
- package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
- package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
- package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
- package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
- package/dist/cjs/hooks/useKeyboard/useKeyboard.js +2 -2
- package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
- package/dist/cjs/hooks/useList/useList.js +2 -2
- package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -2
- package/dist/cjs/hooks/useLogger/useLogger.js +2 -2
- package/dist/cjs/hooks/useLongPress/useLongPress.js +2 -2
- package/dist/cjs/hooks/useMap/useMap.js +2 -2
- package/dist/cjs/hooks/useMeasure/useMeasure.js +2 -2
- package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js +1 -1
- package/dist/cjs/hooks/useMemory/useMemory.js +2 -2
- package/dist/cjs/hooks/useMount/useMount.js +1 -1
- package/dist/cjs/hooks/useMouse/useMouse.js +2 -2
- package/dist/cjs/hooks/useMouse/useMouse.js.map +1 -1
- package/dist/cjs/hooks/useMutation/useMutation.js +2 -2
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.js +2 -2
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.js.map +1 -1
- package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
- package/dist/cjs/hooks/useNetwork/useNetwork.js.map +1 -1
- package/dist/cjs/hooks/useOffsetPagination/useOffsetPagination.js +2 -2
- package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
- package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
- package/dist/cjs/hooks/useOrientation/useOrientation.js +2 -2
- package/dist/cjs/hooks/useOtpCredential/useOtpCredential.js +3 -0
- package/dist/cjs/hooks/useOtpCredential/useOtpCredential.js.map +1 -0
- package/dist/cjs/hooks/usePageLeave/usePageLeave.js +2 -2
- package/dist/cjs/hooks/usePaint/helpers/Paint.js +2 -2
- package/dist/cjs/hooks/usePaint/helpers/Pointer.js +2 -2
- package/dist/cjs/hooks/usePaint/usePaint.js +2 -2
- package/dist/cjs/hooks/usePaint/usePaint.js.map +1 -1
- package/dist/cjs/hooks/usePermission/usePermission.js +2 -2
- package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
- package/dist/cjs/hooks/usePreferredContrast/usePreferredContrast.js +1 -1
- package/dist/cjs/hooks/usePreferredDark/usePreferredDark.js +1 -1
- package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
- package/dist/cjs/hooks/usePreferredReducedMotion/usePreferredReducedMotion.js +1 -1
- package/dist/cjs/hooks/usePrevious/usePrevious.js +1 -1
- package/dist/cjs/hooks/useQuery/useQuery.js +2 -2
- package/dist/cjs/hooks/useQuery/useQuery.js.map +1 -1
- package/dist/cjs/hooks/useQueue/useQueue.js +2 -2
- package/dist/cjs/hooks/useRaf/useRaf.js +2 -2
- package/dist/cjs/hooks/useRafValue/useRafValue.js +2 -2
- package/dist/cjs/hooks/useRenderCount/useRenderCount.js +1 -1
- package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js +1 -1
- package/dist/cjs/hooks/useRerender/useRerender.js +2 -2
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.js +2 -2
- package/dist/cjs/hooks/useScript/useScript.js +2 -2
- package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
- package/dist/cjs/hooks/useSet/useSet.js +2 -2
- package/dist/cjs/hooks/useShare/useShare.js +2 -2
- package/dist/cjs/hooks/useStep/useStep.js +2 -2
- package/dist/cjs/hooks/useStopwatch/useStopwatch.js +2 -2
- package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
- package/dist/cjs/hooks/useTextSelection/useTextSelection.js +2 -2
- package/dist/cjs/hooks/useTime/useTime.js +2 -2
- package/dist/cjs/hooks/useTimeout/useTimeout.js +2 -2
- package/dist/cjs/hooks/useToggle/useToggle.js +2 -2
- package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
- package/dist/cjs/hooks/useWebSocket/useWebSocket.js +2 -2
- package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +2 -2
- package/dist/cjs/hooks/useWindowScroll/useWindowScroll.js +2 -2
- package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
- package/dist/cjs/hooks/useWizard/useWizard.js +2 -2
- package/dist/cjs/{index-C9pnl05Z.js → index-fu1v5kX8.js} +2 -2
- package/dist/cjs/{index-C9pnl05Z.js.map → index-fu1v5kX8.js.map} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/utils/helpers/debounce.js +1 -1
- package/dist/cjs/utils/helpers/getElement.js +1 -1
- package/dist/cjs/utils/helpers/getRetry.js +1 -1
- package/dist/cjs/utils/helpers/index.js +2 -2
- package/dist/cjs/utils/helpers/isClient.js +1 -1
- package/dist/cjs/utils/helpers/throttle.js +1 -1
- package/dist/cjs/utils/helpers/time/getDate.js +1 -1
- package/dist/esm/{_rollupPluginBabelHelpers-cL-tjMrq.js → _rollupPluginBabelHelpers-C2ZP0NIT.js} +2 -2
- package/dist/esm/_rollupPluginBabelHelpers-C2ZP0NIT.js.map +1 -0
- package/dist/esm/hooks/index.js +2 -2
- package/dist/esm/hooks/useAsync/useAsync.js +2 -2
- package/dist/esm/hooks/useBattery/useBattery.js +2 -2
- package/dist/esm/hooks/useBattery/useBattery.js.map +1 -1
- package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
- package/dist/esm/hooks/useBoolean/useBoolean.js.map +1 -1
- package/dist/esm/hooks/useBreakpoints/constants/breakpoints.js +1 -1
- package/dist/esm/hooks/useBreakpoints/useBreakpoints.js +2 -2
- package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
- package/dist/esm/hooks/useClickOutside/useClickOutside.js +2 -2
- package/dist/esm/hooks/useClickOutside/useClickOutside.js.map +1 -1
- package/dist/esm/hooks/useClipboard/useClipboard.js +2 -2
- package/dist/esm/hooks/useClipboard/useClipboard.js.map +1 -1
- package/dist/esm/hooks/useCounter/useCounter.js +2 -2
- package/dist/esm/hooks/useCssVar/useCssVar.js +2 -2
- package/dist/esm/hooks/useDebounceCallback/useDebounceCallback.js +1 -1
- package/dist/esm/hooks/useDebounceValue/useDebounceValue.js +2 -2
- package/dist/esm/hooks/useDefault/useDefault.js +2 -2
- package/dist/esm/hooks/useDidUpdate/useDidUpdate.js +1 -1
- package/dist/esm/hooks/useDisclosure/useDisclosure.js +2 -2
- package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js +2 -2
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
- package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
- package/dist/esm/hooks/useEvent/useEvent.js +1 -1
- package/dist/esm/hooks/useEventListener/useEventListener.js +2 -2
- package/dist/esm/hooks/useEyeDropper/useEyeDropper.js +2 -2
- package/dist/esm/hooks/useEyeDropper/useEyeDropper.js.map +1 -1
- package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
- package/dist/esm/hooks/useField/useField.js +2 -2
- package/dist/esm/hooks/useFileDialog/useFileDialog.js +2 -2
- package/dist/esm/hooks/useFps/useFps.js +2 -2
- package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
- package/dist/esm/hooks/useFullscreen/useFullscreen.js.map +1 -1
- package/dist/esm/hooks/useGamepad/helpers/mapGamepadToXbox360Controller.js +1 -1
- package/dist/esm/hooks/useGamepad/useGamepad.js +2 -2
- package/dist/esm/hooks/useGeolocation/useGeolocation.js +2 -2
- package/dist/esm/hooks/useHash/useHash.js +2 -2
- package/dist/esm/hooks/useHotkeys/useHotkeys.js +2 -2
- package/dist/esm/hooks/useHover/useHover.js +2 -2
- package/dist/esm/hooks/useIdle/useIdle.js +2 -2
- package/dist/esm/hooks/useImage/useImage.js +2 -2
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.js +2 -2
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.js.map +1 -1
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
- package/dist/esm/hooks/useInterval/useInterval.js +2 -2
- package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
- package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
- package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
- package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +2 -2
- package/dist/esm/hooks/useKeyboard/useKeyboard.js +2 -2
- package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
- package/dist/esm/hooks/useList/useList.js +2 -2
- package/dist/esm/hooks/useLocalStorage/useLocalStorage.js +2 -2
- package/dist/esm/hooks/useLogger/useLogger.js +2 -2
- package/dist/esm/hooks/useLongPress/useLongPress.js +2 -2
- package/dist/esm/hooks/useMap/useMap.js +2 -2
- package/dist/esm/hooks/useMeasure/useMeasure.js +2 -2
- package/dist/esm/hooks/useMediaQuery/useMediaQuery.js +1 -1
- package/dist/esm/hooks/useMemory/useMemory.js +2 -2
- package/dist/esm/hooks/useMount/useMount.js +1 -1
- package/dist/esm/hooks/useMouse/useMouse.js +2 -2
- package/dist/esm/hooks/useMouse/useMouse.js.map +1 -1
- package/dist/esm/hooks/useMutation/useMutation.js +2 -2
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.js +2 -2
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.js.map +1 -1
- package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
- package/dist/esm/hooks/useNetwork/useNetwork.js.map +1 -1
- package/dist/esm/hooks/useOffsetPagination/useOffsetPagination.js +2 -2
- package/dist/esm/hooks/useOnline/useOnline.js +1 -1
- package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
- package/dist/esm/hooks/useOrientation/useOrientation.js +2 -2
- package/dist/esm/hooks/useOtpCredential/useOtpCredential.js +3 -0
- package/dist/esm/hooks/useOtpCredential/useOtpCredential.js.map +1 -0
- package/dist/esm/hooks/usePageLeave/usePageLeave.js +2 -2
- package/dist/esm/hooks/usePaint/helpers/Paint.js +2 -2
- package/dist/esm/hooks/usePaint/helpers/Pointer.js +2 -2
- package/dist/esm/hooks/usePaint/usePaint.js +2 -2
- package/dist/esm/hooks/usePaint/usePaint.js.map +1 -1
- package/dist/esm/hooks/usePermission/usePermission.js +2 -2
- package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
- package/dist/esm/hooks/usePreferredContrast/usePreferredContrast.js +1 -1
- package/dist/esm/hooks/usePreferredDark/usePreferredDark.js +1 -1
- package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
- package/dist/esm/hooks/usePreferredReducedMotion/usePreferredReducedMotion.js +1 -1
- package/dist/esm/hooks/usePrevious/usePrevious.js +1 -1
- package/dist/esm/hooks/useQuery/useQuery.js +2 -2
- package/dist/esm/hooks/useQuery/useQuery.js.map +1 -1
- package/dist/esm/hooks/useQueue/useQueue.js +2 -2
- package/dist/esm/hooks/useRaf/useRaf.js +2 -2
- package/dist/esm/hooks/useRafValue/useRafValue.js +2 -2
- package/dist/esm/hooks/useRenderCount/useRenderCount.js +1 -1
- package/dist/esm/hooks/useRenderInfo/useRenderInfo.js +1 -1
- package/dist/esm/hooks/useRerender/useRerender.js +2 -2
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.js +2 -2
- package/dist/esm/hooks/useScript/useScript.js +2 -2
- package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
- package/dist/esm/hooks/useSet/useSet.js +2 -2
- package/dist/esm/hooks/useShare/useShare.js +2 -2
- package/dist/esm/hooks/useStep/useStep.js +2 -2
- package/dist/esm/hooks/useStopwatch/useStopwatch.js +2 -2
- package/dist/esm/hooks/useStorage/useStorage.js +2 -2
- package/dist/esm/hooks/useTextSelection/useTextSelection.js +2 -2
- package/dist/esm/hooks/useTime/useTime.js +2 -2
- package/dist/esm/hooks/useTimeout/useTimeout.js +2 -2
- package/dist/esm/hooks/useToggle/useToggle.js +2 -2
- package/dist/esm/hooks/useUnmount/useUnmount.js +1 -1
- package/dist/esm/hooks/useWebSocket/useWebSocket.js +2 -2
- package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +2 -2
- package/dist/esm/hooks/useWindowScroll/useWindowScroll.js +2 -2
- package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
- package/dist/esm/hooks/useWizard/useWizard.js +2 -2
- package/dist/esm/{index-OsnuCk_l.js → index-C-53PAlh.js} +2 -2
- package/dist/esm/{index-OsnuCk_l.js.map → index-C-53PAlh.js.map} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/utils/helpers/debounce.js +1 -1
- package/dist/esm/utils/helpers/getElement.js +1 -1
- package/dist/esm/utils/helpers/getRetry.js +1 -1
- package/dist/esm/utils/helpers/index.js +2 -2
- package/dist/esm/utils/helpers/isClient.js +1 -1
- package/dist/esm/utils/helpers/throttle.js +1 -1
- package/dist/esm/utils/helpers/time/getDate.js +1 -1
- package/dist/index.d.ts +301 -9
- package/package.json +1 -1
- package/dist/cjs/_rollupPluginBabelHelpers-COaI5TrH.js.map +0 -1
- package/dist/cjs/utils/helpers/isPermissionAllowed.js +0 -3
- package/dist/cjs/utils/helpers/isPermissionAllowed.js.map +0 -1
- package/dist/cjs/utils/types/index.js +0 -3
- package/dist/cjs/utils/types/index.js.map +0 -1
- package/dist/esm/_rollupPluginBabelHelpers-cL-tjMrq.js.map +0 -1
- package/dist/esm/utils/helpers/isPermissionAllowed.js +0 -3
- package/dist/esm/utils/helpers/isPermissionAllowed.js.map +0 -1
- package/dist/esm/utils/types/index.js +0 -2
- package/dist/esm/utils/types/index.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.63 */
|
|
2
2
|
var n=function(n){return"function"==typeof n?n():n instanceof Document||n instanceof Window||n instanceof Element?n:n.current};export{n as getElement};
|
|
3
3
|
//# sourceMappingURL=getElement.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
2
|
-
export{debounce}from"./debounce.js";export{getElement}from"./getElement.js";export{getRetry}from"./getRetry.js";export{isClient}from"./isClient.js";export{
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.63 */
|
|
2
|
+
export{debounce}from"./debounce.js";export{getElement}from"./getElement.js";export{getRetry}from"./getRetry.js";export{isClient}from"./isClient.js";export{throttle}from"./throttle.js";export{getDate}from"./time/getDate.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.63 */
|
|
2
2
|
var n,d,e=!("undefined"==typeof window||null===(n=window)||void 0===n||!n.document||null===(d=window)||void 0===d||null===(d=d.document)||void 0===d||!d.createElement);export{e as isClient};
|
|
3
3
|
//# sourceMappingURL=isClient.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.63 */
|
|
2
2
|
var n=function(n,t){var o=!1;return function(){o||(n.apply(void 0,arguments),o=!0,setTimeout((function(){o=!1}),t))}};export{n as throttle};
|
|
3
3
|
//# sourceMappingURL=throttle.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @license @siberiacancode/reactuse v0.0.
|
|
1
|
+
/* @license @siberiacancode/reactuse v0.0.63 */
|
|
2
2
|
var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getSeconds(),n=e.getMinutes(),r=e.getHours();return{seconds:t,minutes:n,hours:r,meridiemHours:{value:r%12==0?12:r%12,type:r>=12?"pm":"am"},day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear(),timestamp:e.getTime()}};export{e as getDate};
|
|
3
3
|
//# sourceMappingURL=getDate.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { DependencyList, RefObject, Dispatch, SetStateAction, EffectCallback, ComponentProps, useEffect, MouseEventHandler, TouchEventHandler } from 'react';
|
|
3
|
-
import { BatteryManager, EyeDropperConstructor, ColorSelectionOptions, ColorSelectionResult, Connection } from '@/utils/types';
|
|
4
3
|
|
|
5
4
|
interface UseAsyncReturn<Data> {
|
|
6
5
|
data?: Data;
|
|
@@ -22,6 +21,12 @@ interface UseAsyncReturn<Data> {
|
|
|
22
21
|
*/
|
|
23
22
|
declare const useAsync: <Data>(callback: () => Promise<Data>, deps?: DependencyList) => UseAsyncReturn<Data>;
|
|
24
23
|
|
|
24
|
+
interface BatteryManager extends EventTarget {
|
|
25
|
+
charging: boolean;
|
|
26
|
+
chargingTime: number;
|
|
27
|
+
dischargingTime: number;
|
|
28
|
+
level: number;
|
|
29
|
+
}
|
|
25
30
|
declare global {
|
|
26
31
|
interface Navigator {
|
|
27
32
|
readonly getBattery: () => Promise<BatteryManager>;
|
|
@@ -74,6 +79,87 @@ type UseBooleanReturn = [
|
|
|
74
79
|
*/
|
|
75
80
|
declare const useBoolean: (initialValue?: boolean) => UseBooleanReturn;
|
|
76
81
|
|
|
82
|
+
/** Breakpoints from Material UI */
|
|
83
|
+
declare const BREAKPOINTS_MATERIAL_UI: {
|
|
84
|
+
xs: number;
|
|
85
|
+
sm: number;
|
|
86
|
+
md: number;
|
|
87
|
+
lg: number;
|
|
88
|
+
xl: number;
|
|
89
|
+
};
|
|
90
|
+
/** Breakpoints from Mantine */
|
|
91
|
+
declare const BREAKPOINTS_MANTINE: {
|
|
92
|
+
xs: number;
|
|
93
|
+
sm: number;
|
|
94
|
+
md: number;
|
|
95
|
+
lg: number;
|
|
96
|
+
xl: number;
|
|
97
|
+
};
|
|
98
|
+
/** Breakpoints from Tailwind */
|
|
99
|
+
declare const BREAKPOINTS_TAILWIND: {
|
|
100
|
+
sm: number;
|
|
101
|
+
md: number;
|
|
102
|
+
lg: number;
|
|
103
|
+
xl: number;
|
|
104
|
+
'2xl': number;
|
|
105
|
+
};
|
|
106
|
+
/** Breakpoints from Bootstrap V5 */
|
|
107
|
+
declare const BREAKPOINTS_BOOTSTRAP_V5: {
|
|
108
|
+
xs: number;
|
|
109
|
+
sm: number;
|
|
110
|
+
md: number;
|
|
111
|
+
lg: number;
|
|
112
|
+
xl: number;
|
|
113
|
+
xxl: number;
|
|
114
|
+
};
|
|
115
|
+
/** Breakpoints from Ant Design */
|
|
116
|
+
declare const BREAKPOINTS_ANT_DESIGN: {
|
|
117
|
+
xs: number;
|
|
118
|
+
sm: number;
|
|
119
|
+
md: number;
|
|
120
|
+
lg: number;
|
|
121
|
+
xl: number;
|
|
122
|
+
xxl: number;
|
|
123
|
+
};
|
|
124
|
+
/** Breakpoints from Quasar V2 */
|
|
125
|
+
declare const BREAKPOINTS_QUASAR_V2: {
|
|
126
|
+
xs: number;
|
|
127
|
+
sm: number;
|
|
128
|
+
md: number;
|
|
129
|
+
lg: number;
|
|
130
|
+
xl: number;
|
|
131
|
+
};
|
|
132
|
+
/** Sematic Breakpoints */
|
|
133
|
+
declare const BREAKPOINTS_SEMANTIC: {
|
|
134
|
+
mobileS: number;
|
|
135
|
+
mobileM: number;
|
|
136
|
+
mobileL: number;
|
|
137
|
+
tablet: number;
|
|
138
|
+
laptop: number;
|
|
139
|
+
laptopL: number;
|
|
140
|
+
desktop4K: number;
|
|
141
|
+
};
|
|
142
|
+
/** Breakpoints from Master CSS */
|
|
143
|
+
declare const BREAKPOINTS_MASTER_CSS: {
|
|
144
|
+
'3xs': number;
|
|
145
|
+
'2xs': number;
|
|
146
|
+
xs: number;
|
|
147
|
+
sm: number;
|
|
148
|
+
md: number;
|
|
149
|
+
lg: number;
|
|
150
|
+
xl: number;
|
|
151
|
+
'2xl': number;
|
|
152
|
+
'3xl': number;
|
|
153
|
+
'4xl': number;
|
|
154
|
+
};
|
|
155
|
+
/** Breakpoints from PrimeFlex */
|
|
156
|
+
declare const BREAKPOINTS_PRIME_FLEX: {
|
|
157
|
+
sm: number;
|
|
158
|
+
md: number;
|
|
159
|
+
lg: number;
|
|
160
|
+
xl: number;
|
|
161
|
+
};
|
|
162
|
+
|
|
77
163
|
/** The breakpoints type */
|
|
78
164
|
type Breakpoints<Breakpoint extends string = string> = Record<Breakpoint, number>;
|
|
79
165
|
/** The use breakpoints strategy */
|
|
@@ -162,6 +248,8 @@ type UseClickOutside = {
|
|
|
162
248
|
*/
|
|
163
249
|
declare const useClickOutside: UseClickOutside;
|
|
164
250
|
|
|
251
|
+
declare const isPermissionAllowed: (status: PermissionState) => boolean;
|
|
252
|
+
declare const legacyCopyToClipboard: (value: string) => void;
|
|
165
253
|
/** The use copy to clipboard return type */
|
|
166
254
|
interface UseCopyToClipboardReturn {
|
|
167
255
|
/** The copied value */
|
|
@@ -451,6 +539,18 @@ declare const useDocumentVisibility: () => DocumentVisibilityState;
|
|
|
451
539
|
*/
|
|
452
540
|
declare const useEvent: <Params extends unknown[], Return>(callback: (...args: Params) => Return) => ((...args: Params) => Return);
|
|
453
541
|
|
|
542
|
+
interface ColorSelectionOptions {
|
|
543
|
+
signal?: AbortSignal;
|
|
544
|
+
}
|
|
545
|
+
interface ColorSelectionResult {
|
|
546
|
+
sRGBHex: string;
|
|
547
|
+
}
|
|
548
|
+
interface EyeDropper {
|
|
549
|
+
open: (options?: ColorSelectionOptions) => Promise<ColorSelectionResult>;
|
|
550
|
+
}
|
|
551
|
+
interface EyeDropperConstructor {
|
|
552
|
+
new (): EyeDropper;
|
|
553
|
+
}
|
|
454
554
|
declare global {
|
|
455
555
|
interface Window {
|
|
456
556
|
readonly EyeDropper?: EyeDropperConstructor | undefined;
|
|
@@ -478,6 +578,8 @@ interface UseEyeDropperReturn {
|
|
|
478
578
|
*/
|
|
479
579
|
declare const useEyeDropper: (initialValue?: string | undefined) => UseEyeDropperReturn;
|
|
480
580
|
|
|
581
|
+
/** The use favicon return type */
|
|
582
|
+
type UseFaviconReturn = [string, Dispatch<SetStateAction<string>>];
|
|
481
583
|
/**
|
|
482
584
|
* @name useFavicon
|
|
483
585
|
* @description - Hook that manages the favicon
|
|
@@ -669,7 +771,7 @@ interface UseFullScreenReturn {
|
|
|
669
771
|
type UseFullScreen = {
|
|
670
772
|
<Target extends UseFullScreenTarget>(target: Target, options?: UseFullScreenOptions): UseFullScreenReturn;
|
|
671
773
|
<Target extends UseFullScreenTarget>(options?: UseFullScreenOptions, target?: never): UseFullScreenReturn & {
|
|
672
|
-
ref:
|
|
774
|
+
ref: (node: Target) => void;
|
|
673
775
|
};
|
|
674
776
|
};
|
|
675
777
|
/**
|
|
@@ -700,11 +802,57 @@ type UseFullScreen = {
|
|
|
700
802
|
*/
|
|
701
803
|
declare const useFullscreen: UseFullScreen;
|
|
702
804
|
|
|
805
|
+
declare const mapGamepadToXbox360Controller: (gamepad: Gamepad) => {
|
|
806
|
+
buttons: {
|
|
807
|
+
a: GamepadButton;
|
|
808
|
+
b: GamepadButton;
|
|
809
|
+
x: GamepadButton;
|
|
810
|
+
y: GamepadButton;
|
|
811
|
+
};
|
|
812
|
+
bumper: {
|
|
813
|
+
left: GamepadButton;
|
|
814
|
+
right: GamepadButton;
|
|
815
|
+
};
|
|
816
|
+
triggers: {
|
|
817
|
+
left: GamepadButton;
|
|
818
|
+
right: GamepadButton;
|
|
819
|
+
};
|
|
820
|
+
stick: {
|
|
821
|
+
left: {
|
|
822
|
+
horizontal: number;
|
|
823
|
+
vertical: number;
|
|
824
|
+
button: GamepadButton;
|
|
825
|
+
};
|
|
826
|
+
right: {
|
|
827
|
+
horizontal: number;
|
|
828
|
+
vertical: number;
|
|
829
|
+
button: GamepadButton;
|
|
830
|
+
};
|
|
831
|
+
};
|
|
832
|
+
dpad: {
|
|
833
|
+
up: GamepadButton;
|
|
834
|
+
down: GamepadButton;
|
|
835
|
+
left: GamepadButton;
|
|
836
|
+
right: GamepadButton;
|
|
837
|
+
};
|
|
838
|
+
back: GamepadButton;
|
|
839
|
+
start: GamepadButton;
|
|
840
|
+
};
|
|
841
|
+
|
|
703
842
|
declare global {
|
|
704
843
|
interface Gamepad {
|
|
705
844
|
hapticActuators?: GamepadHapticActuator[];
|
|
706
845
|
}
|
|
707
846
|
}
|
|
847
|
+
/** The use gamepad return type */
|
|
848
|
+
interface UseGamepadStateReturn {
|
|
849
|
+
/** The gamepad supported status */
|
|
850
|
+
supported: boolean;
|
|
851
|
+
/** The gamepad state */
|
|
852
|
+
gamepads: Gamepad[];
|
|
853
|
+
/** The gamepad active status */
|
|
854
|
+
active: boolean;
|
|
855
|
+
}
|
|
708
856
|
/**
|
|
709
857
|
* @name useGamepad
|
|
710
858
|
* @description - Hook for getting information about gamepad
|
|
@@ -786,7 +934,13 @@ interface UseHotkeysOptions {
|
|
|
786
934
|
/** Alias map for hotkeys */
|
|
787
935
|
aliasMap?: Record<string, string>;
|
|
788
936
|
}
|
|
937
|
+
declare const isHotkeyMatch: (hotkey: string, keys: UseHotkeysKey[]) => boolean;
|
|
789
938
|
type UseHotkeysHotkeys = string[] | string;
|
|
939
|
+
type UseHotkeysKey = {
|
|
940
|
+
key: string;
|
|
941
|
+
code: string;
|
|
942
|
+
alias: string;
|
|
943
|
+
};
|
|
790
944
|
/**
|
|
791
945
|
* @name useHotkeys
|
|
792
946
|
* @description - Hook that listens for hotkeys
|
|
@@ -915,7 +1069,7 @@ interface UseQueryReturn<Data> {
|
|
|
915
1069
|
refetch: () => void;
|
|
916
1070
|
isRefetching: boolean;
|
|
917
1071
|
abort: AbortController['abort'];
|
|
918
|
-
|
|
1072
|
+
aborted: boolean;
|
|
919
1073
|
}
|
|
920
1074
|
/**
|
|
921
1075
|
* @name useQuery
|
|
@@ -935,7 +1089,7 @@ interface UseQueryReturn<Data> {
|
|
|
935
1089
|
* @returns {UseQueryReturn<Data>} An object with the state of the query
|
|
936
1090
|
*
|
|
937
1091
|
* @example
|
|
938
|
-
* const { data, isLoading, isError, isSuccess, error, refetch, isRefetching } = useQuery(() => fetch('url'));
|
|
1092
|
+
* const { data, isLoading, isError, isSuccess, error, refetch, isRefetching, abort, aborted } = useQuery(() => fetch('url'));
|
|
939
1093
|
*/
|
|
940
1094
|
declare const useQuery: <QueryData, Data = QueryData>(callback: (params: UseQueryCallbackParams) => Promise<QueryData>, options?: UseQueryOptions<QueryData, Data>) => UseQueryReturn<Data>;
|
|
941
1095
|
|
|
@@ -956,6 +1110,8 @@ interface UseImageOptions {
|
|
|
956
1110
|
/** The referrer policy of the image */
|
|
957
1111
|
referrerPolicy?: HTMLImageElement['referrerPolicy'];
|
|
958
1112
|
}
|
|
1113
|
+
/** The use image return type */
|
|
1114
|
+
type UseImageReturn = UseQueryReturn<HTMLImageElement>;
|
|
959
1115
|
/**
|
|
960
1116
|
* @name useImage
|
|
961
1117
|
* @description - Hook that load an image in the browser
|
|
@@ -1215,6 +1371,23 @@ declare const useKeysPressed: (params?: UseKeysPressedParams) => {
|
|
|
1215
1371
|
code: string;
|
|
1216
1372
|
}[];
|
|
1217
1373
|
|
|
1374
|
+
/** The use list return type */
|
|
1375
|
+
interface UseListReturn<Item> {
|
|
1376
|
+
/** The current list of items */
|
|
1377
|
+
value: Item[];
|
|
1378
|
+
/** Sets the list of items */
|
|
1379
|
+
set: (list: Item[]) => void;
|
|
1380
|
+
/** Adds an item to the list */
|
|
1381
|
+
push: (item: Item) => void;
|
|
1382
|
+
/** Removes an item from the list */
|
|
1383
|
+
removeAt: (removeAtIndex: number) => void;
|
|
1384
|
+
/** Inserts an item at the specified index */
|
|
1385
|
+
insertAt: (insertAtIndex: number, item: Item) => void;
|
|
1386
|
+
/** Updates an item at the specified index */
|
|
1387
|
+
updateAt: (updateAtIndex: number, item: Item) => void;
|
|
1388
|
+
/** Clears the list */
|
|
1389
|
+
clear: () => void;
|
|
1390
|
+
}
|
|
1218
1391
|
/**
|
|
1219
1392
|
* @name useList
|
|
1220
1393
|
* @description - Hook that defines the logic when unmounting a component
|
|
@@ -1245,6 +1418,12 @@ interface UseStorageOptions<Value> {
|
|
|
1245
1418
|
storage?: Storage;
|
|
1246
1419
|
initialValue?: UseStorageInitialValue<Value>;
|
|
1247
1420
|
}
|
|
1421
|
+
type UseStorageReturn<Value> = {
|
|
1422
|
+
value: Value;
|
|
1423
|
+
set: (value: Value) => void;
|
|
1424
|
+
remove: () => void;
|
|
1425
|
+
};
|
|
1426
|
+
declare const dispatchStorageEvent: (params: Partial<StorageEvent>) => boolean;
|
|
1248
1427
|
/**
|
|
1249
1428
|
* @name useStorage
|
|
1250
1429
|
* @description - Hook that manages storage value
|
|
@@ -1298,6 +1477,7 @@ declare const useLocalStorage: <Value>(key: string, initialValue?: UseStorageIni
|
|
|
1298
1477
|
*/
|
|
1299
1478
|
declare const useLogger: (name: string, params: unknown[]) => void;
|
|
1300
1479
|
|
|
1480
|
+
type UseLongPressTarget = RefObject<Element | null | undefined> | (() => Element) | Element;
|
|
1301
1481
|
type LongPressReactEvents<Target extends Element = Element> = MouseEventHandler<Target> | TouchEventHandler<Target>;
|
|
1302
1482
|
interface UseLongPressOptions {
|
|
1303
1483
|
threshold?: number;
|
|
@@ -1511,6 +1691,9 @@ interface UseMutationReturn<Body, Data> {
|
|
|
1511
1691
|
isError: boolean;
|
|
1512
1692
|
isSuccess: boolean;
|
|
1513
1693
|
}
|
|
1694
|
+
interface RequestOptions<Data> extends UseMutationOptions<Data> {
|
|
1695
|
+
attempt?: number;
|
|
1696
|
+
}
|
|
1514
1697
|
/**
|
|
1515
1698
|
* @name useMutation
|
|
1516
1699
|
* @description - Hook that defines the logic when mutate data
|
|
@@ -1543,7 +1726,7 @@ interface UseMutationObserverOptions extends MutationObserverInit {
|
|
|
1543
1726
|
/** The enabled state of the mutation observer */
|
|
1544
1727
|
enabled?: boolean;
|
|
1545
1728
|
}
|
|
1546
|
-
type
|
|
1729
|
+
type UseMutationObserver = {
|
|
1547
1730
|
<Target extends UseMutationObserverTarget | UseMutationObserverTarget[]>(target: Target, callback: MutationCallback, options?: UseMutationObserverOptions): UseMutationObserverReturn;
|
|
1548
1731
|
<Target extends UseMutationObserverTarget | UseMutationObserverTarget[]>(callback: MutationCallback, options?: UseMutationObserverOptions, target?: never): UseMutationObserverReturn & {
|
|
1549
1732
|
ref: (node: Target) => void;
|
|
@@ -1587,8 +1770,17 @@ type UseResizeObserver$1 = {
|
|
|
1587
1770
|
* @example
|
|
1588
1771
|
* const { observer, stop } = useMutationObserver(ref, () => console.log('callback'))
|
|
1589
1772
|
*/
|
|
1590
|
-
declare const useMutationObserver:
|
|
1773
|
+
declare const useMutationObserver: UseMutationObserver;
|
|
1591
1774
|
|
|
1775
|
+
interface Connection extends EventTarget {
|
|
1776
|
+
readonly downlink: number;
|
|
1777
|
+
readonly downlinkMax: number;
|
|
1778
|
+
readonly effectiveType: 'slow-2g' | '2g' | '3g' | '4g';
|
|
1779
|
+
readonly rtt: number;
|
|
1780
|
+
readonly saveData: boolean;
|
|
1781
|
+
readonly type: 'bluetooth' | 'cellular' | 'ethernet' | 'mixed' | 'none' | 'other' | 'unknown' | 'wifi' | 'wimax';
|
|
1782
|
+
onChange: (event: Event) => void;
|
|
1783
|
+
}
|
|
1592
1784
|
declare global {
|
|
1593
1785
|
interface Navigator {
|
|
1594
1786
|
readonly connection: Connection;
|
|
@@ -1596,6 +1788,10 @@ declare global {
|
|
|
1596
1788
|
readonly webkitConnection: Connection;
|
|
1597
1789
|
}
|
|
1598
1790
|
}
|
|
1791
|
+
/** The type of network connection */
|
|
1792
|
+
type ConnectionType = Connection['type'];
|
|
1793
|
+
/** The effective type of connection */
|
|
1794
|
+
type ConnectionEffectiveType = Connection['effectiveType'];
|
|
1599
1795
|
/** The use network return type */
|
|
1600
1796
|
interface UseNetworkReturn {
|
|
1601
1797
|
/** Indicates if the device is currently online */
|
|
@@ -1613,6 +1809,7 @@ interface UseNetworkReturn {
|
|
|
1613
1809
|
/** The type of network connection (e.g., 'wifi', 'cellular') */
|
|
1614
1810
|
type?: Connection['type'];
|
|
1615
1811
|
}
|
|
1812
|
+
declare const getConnection: () => Connection;
|
|
1616
1813
|
/**
|
|
1617
1814
|
* @name useNetwork
|
|
1618
1815
|
* @description - Hook to track network status
|
|
@@ -1708,6 +1905,7 @@ declare const useOnline: () => boolean;
|
|
|
1708
1905
|
|
|
1709
1906
|
/** The operating system type */
|
|
1710
1907
|
type OperatingSystem = 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux';
|
|
1908
|
+
declare const getOperatingSystem: () => OperatingSystem;
|
|
1711
1909
|
/**
|
|
1712
1910
|
* @name useOperatingSystem
|
|
1713
1911
|
* @description - Hook that returns the operating system of the current browser
|
|
@@ -1739,6 +1937,54 @@ interface UseOrientationReturn {
|
|
|
1739
1937
|
*/
|
|
1740
1938
|
declare const useOrientation: () => UseOrientationReturn;
|
|
1741
1939
|
|
|
1940
|
+
declare global {
|
|
1941
|
+
interface OTPOptions {
|
|
1942
|
+
readonly transport: string[];
|
|
1943
|
+
}
|
|
1944
|
+
interface CredentialRequestOptions {
|
|
1945
|
+
readonly otp: OTPOptions;
|
|
1946
|
+
}
|
|
1947
|
+
interface Credential {
|
|
1948
|
+
readonly code: string;
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
type UseOtpCredentialCallback = (otp: Credential | null) => void;
|
|
1952
|
+
interface UseOtpCredentialParams {
|
|
1953
|
+
onSuccess: (credential: Credential | null) => void;
|
|
1954
|
+
onError: (error: any) => void;
|
|
1955
|
+
}
|
|
1956
|
+
interface UseOtpCredentialReturn {
|
|
1957
|
+
supported: boolean;
|
|
1958
|
+
get: () => Promise<Credential | null>;
|
|
1959
|
+
abort: AbortController['abort'];
|
|
1960
|
+
aborted: boolean;
|
|
1961
|
+
}
|
|
1962
|
+
type UseOtpCredential = {
|
|
1963
|
+
(callback?: UseOtpCredentialCallback): UseOtpCredentialReturn;
|
|
1964
|
+
(params?: UseOtpCredentialParams): UseOtpCredentialReturn;
|
|
1965
|
+
};
|
|
1966
|
+
/**
|
|
1967
|
+
* @name useOtpCredential
|
|
1968
|
+
* @description - Hook that creates an otp credential
|
|
1969
|
+
* @category Browser
|
|
1970
|
+
*
|
|
1971
|
+
* @overload
|
|
1972
|
+
* @param {UseOtpCredentialCallback} callback The callback function to be invoked
|
|
1973
|
+
* @returns {UseOtpCredentialReturn}
|
|
1974
|
+
*
|
|
1975
|
+
* @example
|
|
1976
|
+
* useOtpCredential((credential) => console.log(credential));
|
|
1977
|
+
*
|
|
1978
|
+
* @overload
|
|
1979
|
+
* @param {UseOtpCredentialCallback} params.onSuccess The callback function to be invoked on success
|
|
1980
|
+
* @param {UseOtpCredentialCallback} params.onError The callback function to be invoked on error
|
|
1981
|
+
* @returns {UseOtpCredentialReturn}
|
|
1982
|
+
*
|
|
1983
|
+
* @example
|
|
1984
|
+
* useOtpCredential({ onSuccess: (credential) => console.log(credential), onError: (error) => console.log(error) });
|
|
1985
|
+
*/
|
|
1986
|
+
declare const useOtpCredential: UseOtpCredential;
|
|
1987
|
+
|
|
1742
1988
|
/**
|
|
1743
1989
|
* @name usePageLeave
|
|
1744
1990
|
* @description - Hook what calls given function when mouse leaves the page
|
|
@@ -1855,6 +2101,15 @@ declare const usePaint: UsePaint;
|
|
|
1855
2101
|
|
|
1856
2102
|
/** The permission name */
|
|
1857
2103
|
type UsePermissionName = PermissionName | 'accelerometer' | 'accessibility-events' | 'ambient-light-sensor' | 'background-sync' | 'camera' | 'clipboard-read' | 'clipboard-write' | 'gyroscope' | 'magnetometer' | 'microphone' | 'notifications' | 'payment-handler' | 'persistent-storage' | 'push' | 'speaker';
|
|
2104
|
+
/** The use permission return type */
|
|
2105
|
+
interface UsePermissionReturn {
|
|
2106
|
+
/** The permission state */
|
|
2107
|
+
state: PermissionState;
|
|
2108
|
+
/** The permission supported status */
|
|
2109
|
+
supported: boolean;
|
|
2110
|
+
/** The permission query function */
|
|
2111
|
+
query: () => Promise<PermissionState>;
|
|
2112
|
+
}
|
|
1858
2113
|
/**
|
|
1859
2114
|
* @name usePermission
|
|
1860
2115
|
* @description - Hook that gives you the state of permission
|
|
@@ -2016,6 +2271,7 @@ interface UseRafReturn {
|
|
|
2016
2271
|
*/
|
|
2017
2272
|
declare const useRaf: (callback: UseRafCallback, options?: UseRafOptions) => UseRafReturn;
|
|
2018
2273
|
|
|
2274
|
+
type UseRafValueReturn<Value> = [Value, (value: Value) => void];
|
|
2019
2275
|
/**
|
|
2020
2276
|
* @name useRafValue
|
|
2021
2277
|
* @description - Hook that returns the value and a function to set the value
|
|
@@ -2128,6 +2384,7 @@ declare const useResizeObserver: UseResizeObserver;
|
|
|
2128
2384
|
|
|
2129
2385
|
/** The use script status */
|
|
2130
2386
|
type UseScriptStatus = 'loading' | 'ready' | 'error' | 'unknown';
|
|
2387
|
+
declare const SCRIPT_STATUS_ATTRIBUTE_NAME = "script-status";
|
|
2131
2388
|
/** The use script options extends from attributes script tag */
|
|
2132
2389
|
interface UseScriptOptions extends ComponentProps<'script'> {
|
|
2133
2390
|
/** Whether to remove the script on unmount */
|
|
@@ -2231,6 +2488,13 @@ interface UseShareParams {
|
|
|
2231
2488
|
/** The url of the share */
|
|
2232
2489
|
url?: string;
|
|
2233
2490
|
}
|
|
2491
|
+
/** The use share return type */
|
|
2492
|
+
interface UseShareReturn {
|
|
2493
|
+
/** The share function */
|
|
2494
|
+
share: (shareParams: ShareData) => Promise<void>;
|
|
2495
|
+
/** The share supported status */
|
|
2496
|
+
supported: boolean;
|
|
2497
|
+
}
|
|
2234
2498
|
/**
|
|
2235
2499
|
* @name useShare
|
|
2236
2500
|
* @description - Hook that utilizes the share api
|
|
@@ -2354,6 +2618,7 @@ type UseStopwatch = {
|
|
|
2354
2618
|
*/
|
|
2355
2619
|
declare const useStopwatch: UseStopwatch;
|
|
2356
2620
|
|
|
2621
|
+
declare const getRangesSelection: (selection: Selection) => Range[];
|
|
2357
2622
|
/** The use text selection return type */
|
|
2358
2623
|
interface UseTextSelectionReturn {
|
|
2359
2624
|
/** The current selection text */
|
|
@@ -2423,6 +2688,8 @@ interface UseTimeoutReturn {
|
|
|
2423
2688
|
*/
|
|
2424
2689
|
declare function useTimeout(callback: () => void, delay: number): UseTimeoutReturn;
|
|
2425
2690
|
|
|
2691
|
+
/** The use toggle return type */
|
|
2692
|
+
type UseToggleReturn<Value> = readonly [Value, (value?: Value) => void];
|
|
2426
2693
|
/**
|
|
2427
2694
|
* @name useToggle
|
|
2428
2695
|
* @description - Hook that create toggle
|
|
@@ -2504,11 +2771,38 @@ declare const useWebSocket: (url: UseWebSocketUrl, options?: UseWebSocketOptions
|
|
|
2504
2771
|
*/
|
|
2505
2772
|
declare const useWindowEvent: <Event extends keyof WindowEventMap>(event: Event, listener: (this: Window, event: WindowEventMap[Event]) => any, options?: UseEventListenerOptions) => void;
|
|
2506
2773
|
|
|
2774
|
+
type ScrollPosition = {
|
|
2775
|
+
x: number;
|
|
2776
|
+
y: number;
|
|
2777
|
+
};
|
|
2778
|
+
declare const scrollTo: ({ x, y, behavior }: Partial<ScrollPosition & ScrollOptions>) => void;
|
|
2779
|
+
/**
|
|
2780
|
+
* @name useWindowScroll
|
|
2781
|
+
* @description - Hook that manages the window scroll position
|
|
2782
|
+
* @category Browser
|
|
2783
|
+
*
|
|
2784
|
+
* @returns {UseWindowScrollReturn} An object containing the current window scroll position
|
|
2785
|
+
*
|
|
2786
|
+
* @example
|
|
2787
|
+
* const { value, scrollTo } = useWindowScroll();
|
|
2788
|
+
* */
|
|
2789
|
+
declare const useWindowScroll: () => {
|
|
2790
|
+
value: ScrollPosition;
|
|
2791
|
+
scrollTo: ({ x, y, behavior }: Partial<ScrollPosition & ScrollOptions>) => void;
|
|
2792
|
+
};
|
|
2793
|
+
|
|
2507
2794
|
/** The use window size return type */
|
|
2508
2795
|
interface UseWindowSizeParams {
|
|
2509
2796
|
/** Whether to include the scrollbar in the window size calculation */
|
|
2510
2797
|
includeScrollbar?: boolean;
|
|
2511
2798
|
}
|
|
2799
|
+
/** The use window size return type */
|
|
2800
|
+
interface UseWindowSizeReturn {
|
|
2801
|
+
/** The current window width */
|
|
2802
|
+
width: number;
|
|
2803
|
+
/** The current window height */
|
|
2804
|
+
height: number;
|
|
2805
|
+
}
|
|
2512
2806
|
/**
|
|
2513
2807
|
* @name useWindowSize
|
|
2514
2808
|
* @description - Hook that manages a window size
|
|
@@ -2563,8 +2857,6 @@ declare const getRetry: (retry: number | boolean) => number;
|
|
|
2563
2857
|
|
|
2564
2858
|
declare const isClient: boolean;
|
|
2565
2859
|
|
|
2566
|
-
declare const isPermissionAllowed: (status: PermissionState) => boolean;
|
|
2567
|
-
|
|
2568
2860
|
declare const throttle: <Params extends any[]>(callback: (...args: Params) => void, delay: number) => ((...args: Params) => void);
|
|
2569
2861
|
|
|
2570
2862
|
declare const getDate: (now?: Date) => {
|
|
@@ -2581,4 +2873,4 @@ declare const getDate: (now?: Date) => {
|
|
|
2581
2873
|
timestamp: number;
|
|
2582
2874
|
};
|
|
2583
2875
|
|
|
2584
|
-
export { type GetElementTarget, debounce, getDate, getElement, getRetry, isClient, isPermissionAllowed, throttle, useAsync, useBattery, useBoolean, useBreakpoints, useBrowserLanguage, useClickOutside, useClipboard, useCounter, useCssVar, useDebounceCallback, useDebounceValue, useDefault, useDidUpdate, useDisclosure, useDocumentEvent, useDocumentTitle, useDocumentVisibility, useEvent, useEventListener, useEyeDropper, useFavicon, useField, useFileDialog, useFps, useFullscreen, useGamepad, useGeolocation, useHash, useHotkeys, useHover, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useInterval, useIsFirstRender, useIsomorphicLayoutEffect, useKeyPress, useKeyPressEvent, useKeyboard, useKeysPressed, useList, useLocalStorage, useLogger, useLongPress, useMap, useMeasure, useMediaQuery, useMemory, useMount, useMouse, useMutation, useMutationObserver, useNetwork, useOffsetPagination, useOnline, useOperatingSystem, useOrientation, usePageLeave, usePaint, usePermission, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useQuery, useQueue, useRaf, useRafValue, useRenderCount, useRenderInfo, useRerender, useResizeObserver, useScript, useSessionStorage, useSet, useShare, useStep, useStopwatch, useStorage, useTextSelection, useTime, useTimeout, useToggle, useUnmount, useWebSocket, useWindowEvent, useWindowSize, useWizard };
|
|
2876
|
+
export { BREAKPOINTS_ANT_DESIGN, BREAKPOINTS_BOOTSTRAP_V5, BREAKPOINTS_MANTINE, BREAKPOINTS_MASTER_CSS, BREAKPOINTS_MATERIAL_UI, BREAKPOINTS_PRIME_FLEX, BREAKPOINTS_QUASAR_V2, BREAKPOINTS_SEMANTIC, BREAKPOINTS_TAILWIND, type BatteryManager, type Breakpoints, type ColorSelectionOptions, type ColorSelectionResult, type Connection, type ConnectionEffectiveType, type ConnectionType, type EyeDropper, type EyeDropperConstructor, type GetElementTarget, type LongPressReactEvents, type OperatingSystem, type RequestOptions, SCRIPT_STATUS_ATTRIBUTE_NAME, type ScrollPosition, type UseAsyncReturn, type UseBatteryStateReturn, type UseBooleanReturn, type UseBreakpointsReturn, type UseBreakpointsStrategy, type UseClickOutside, type UseCopyToClipboardParams, type UseCopyToClipboardReturn, type UseCounter, type UseCounterOptions, type UseCounterReturn, type UseCssVar, type UseCssVarReturn, type UseCssVarTarget, type UseDisclosureOptions, type UseDisclosureReturn, type UseDocumentTitleOptions, type UseDocumentTitleReturn, type UseEventListener, type UseEventListenerOptions, type UseEventListenerReturn, type UseEventListenerTarget, type UseEyeDropperReturn, type UseFaviconReturn, type UseFieldParams, type UseFieldRegisterParams, type UseFieldReturn, type UseFileDialog, type UseFileDialogOptions, type UseFileDialogReturn, type UseFullScreen, type UseFullScreenOptions, type UseFullScreenReturn, type UseFullScreenTarget, type UseGamepadStateReturn, type UseGeolocationParams, type UseGeolocationReturn, type UseHotkeysHotkeys, type UseHotkeysKey, type UseHotkeysOptions, type UseHover, type UseHoverOptions, type UseHoverTarget, type UseIdleOptions, type UseIdleReturn, type UseImageOptions, type UseImageReturn, type UseInfiniteScroll, type UseInfiniteScrollOptions, type UseInfiniteScrollTarget, type UseIntersectionObserver, type UseIntersectionObserverOptions, type UseIntersectionObserverReturn, type UseIntersectionObserverTarget, type UseIntervalOptions, type UseIntervalReturn, type UseKeyPressEvent, type UseKeyPressEventKey, type UseKeyPressKey, type UseKeyPressOptions, type UseKeyboardParams, type UseKeysPressedParams, type UseListReturn, type UseLongPressBind, type UseLongPressOptions, type UseLongPressReturn, type UseLongPressTarget, type UseMapReturn, type UseMeasureReturn, type UseMeasureScreen, type UseMeasureTarget, type UseMemoryReturn, type UseMouse, type UseMouseReturn, type UseMutationObserver, type UseMutationObserverOptions, type UseMutationObserverReturn, type UseMutationObserverTarget, type UseNetworkReturn, type UseOffsetPaginationOptions, type UseOffsetPaginationReturn, type UseOrientationReturn, type UseOtpCredential, type UseOtpCredentialCallback, type UseOtpCredentialParams, type UseOtpCredentialReturn, type UsePaint, type UsePaintOptions, type UsePaintReturn, type UsePaintTarget, type UsePermissionName, type UsePermissionReturn, type UsePreferredColorSchemeReturn, type UsePreferredContrastReturn, type UsePreferredReducedMotionReturn, type UseQueryOptions, type UseQueryReturn, type UseQueueReturn, type UseRafCallback, type UseRafOptions, type UseRafParams, type UseRafReturn, type UseRafValueReturn, type UseRenderInfoReturn, type UseResizeObserver, type UseResizeObserverOptions, type UseResizeObserverReturn, type UseResizeObserverTarget, type UseScriptOptions, type UseScriptStatus, type UseShareParams, type UseShareReturn, type UseStopwatchOptions, type UseStopwatchReturn, type UseStorageInitialValue, type UseStorageOptions, type UseStorageReturn, type UseTextSelectionReturn, type UseTimeReturn, type UseToggleReturn, type UseWebSocketOptions, type UseWebSocketReturn, type UseWebSocketStatus, type UseWebSocketUrl, type UseWindowSizeReturn, type WizardItem, debounce, dispatchStorageEvent, getConnection, getDate, getElement, getOperatingSystem, getRangesSelection, getRetry, isClient, isHotkeyMatch, isPermissionAllowed, legacyCopyToClipboard, mapGamepadToXbox360Controller, scrollTo, throttle, useAsync, useBattery, useBoolean, useBreakpoints, useBrowserLanguage, useClickOutside, useClipboard, useCounter, useCssVar, useDebounceCallback, useDebounceValue, useDefault, useDidUpdate, useDisclosure, useDocumentEvent, useDocumentTitle, useDocumentVisibility, useEvent, useEventListener, useEyeDropper, useFavicon, useField, useFileDialog, useFps, useFullscreen, useGamepad, useGeolocation, useHash, useHotkeys, useHover, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useInterval, useIsFirstRender, useIsomorphicLayoutEffect, useKeyPress, useKeyPressEvent, useKeyboard, useKeysPressed, useList, useLocalStorage, useLogger, useLongPress, useMap, useMeasure, useMediaQuery, useMemory, useMount, useMouse, useMutation, useMutationObserver, useNetwork, useOffsetPagination, useOnline, useOperatingSystem, useOrientation, useOtpCredential, usePageLeave, usePaint, usePermission, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useQuery, useQueue, useRaf, useRafValue, useRenderCount, useRenderInfo, useRerender, useResizeObserver, useScript, useSessionStorage, useSet, useShare, useStep, useStopwatch, useStorage, useTextSelection, useTime, useTimeout, useToggle, useUnmount, useWebSocket, useWindowEvent, useWindowScroll, useWindowSize, useWizard };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers-COaI5TrH.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isPermissionAllowed.js","sources":["../../../../src/utils/helpers/isPermissionAllowed.ts"],"sourcesContent":["export const isPermissionAllowed = (status: PermissionState) =>\n status === 'granted' || status === 'prompt';\n"],"names":["status"],"mappings":";yCAAmC,SAACA,GAAuB,MAC9C,YAAXA,GAAmC,WAAXA,CAAmB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers-cL-tjMrq.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isPermissionAllowed.js","sources":["../../../../src/utils/helpers/isPermissionAllowed.ts"],"sourcesContent":["export const isPermissionAllowed = (status: PermissionState) =>\n status === 'granted' || status === 'prompt';\n"],"names":["isPermissionAllowed","status"],"mappings":";IAAaA,EAAsB,SAACC,GAAuB,MAC9C,YAAXA,GAAmC,WAAXA,CAAmB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|