@oneplatformdev/hooks 0.1.0-13 → 0.1.0-15
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/package.json +6 -4
- package/dist/CHANGELOG.md +0 -35
- package/dist/LICENSE +0 -21
- package/dist/README.md +0 -7
- package/dist/index.d.ts +0 -37
- package/dist/index.d.ts.map +0 -1
- package/dist/package.json +0 -67
- package/dist/useBoolean/index.d.ts +0 -2
- package/dist/useBoolean/index.d.ts.map +0 -1
- package/dist/useBoolean/index.js +0 -4
- package/dist/useBoolean/useBoolean.d.ts +0 -29
- package/dist/useBoolean/useBoolean.d.ts.map +0 -1
- package/dist/useBoolean/useBoolean.js +0 -16
- package/dist/useClickAnyWhere/index.d.ts +0 -2
- package/dist/useClickAnyWhere/index.d.ts.map +0 -1
- package/dist/useClickAnyWhere/index.js +0 -4
- package/dist/useClickAnyWhere/useClickAnyWhere.d.ts +0 -17
- package/dist/useClickAnyWhere/useClickAnyWhere.d.ts.map +0 -1
- package/dist/useClickAnyWhere/useClickAnyWhere.js +0 -9
- package/dist/useCopyToClipboard/index.d.ts +0 -2
- package/dist/useCopyToClipboard/index.d.ts.map +0 -1
- package/dist/useCopyToClipboard/index.js +0 -4
- package/dist/useCopyToClipboard/useCopyToClipboard.d.ts +0 -34
- package/dist/useCopyToClipboard/useCopyToClipboard.d.ts.map +0 -1
- package/dist/useCopyToClipboard/useCopyToClipboard.js +0 -16
- package/dist/useCountdown/index.d.ts +0 -2
- package/dist/useCountdown/index.d.ts.map +0 -1
- package/dist/useCountdown/index.js +0 -4
- package/dist/useCountdown/useCountdown.d.ts +0 -47
- package/dist/useCountdown/useCountdown.d.ts.map +0 -1
- package/dist/useCountdown/useCountdown.js +0 -33
- package/dist/useCounter/index.d.ts +0 -2
- package/dist/useCounter/index.d.ts.map +0 -1
- package/dist/useCounter/index.js +0 -4
- package/dist/useCounter/useCounter.d.ts +0 -28
- package/dist/useCounter/useCounter.d.ts.map +0 -1
- package/dist/useCounter/useCounter.js +0 -20
- package/dist/useDarkMode/index.d.ts +0 -2
- package/dist/useDarkMode/index.d.ts.map +0 -1
- package/dist/useDarkMode/index.js +0 -4
- package/dist/useDarkMode/useDarkMode.d.ts +0 -46
- package/dist/useDarkMode/useDarkMode.d.ts.map +0 -1
- package/dist/useDarkMode/useDarkMode.js +0 -38
- package/dist/useDebounceCallback/index.d.ts +0 -3
- package/dist/useDebounceCallback/index.d.ts.map +0 -1
- package/dist/useDebounceCallback/index.js +0 -5
- package/dist/useDebounceCallback/useDebounceCallback.d.ts +0 -62
- package/dist/useDebounceCallback/useDebounceCallback.d.ts.map +0 -1
- package/dist/useDebounceCallback/useDebounceCallback.js +0 -21
- package/dist/useDebounceValue/index.d.ts +0 -2
- package/dist/useDebounceValue/index.d.ts.map +0 -1
- package/dist/useDebounceValue/index.js +0 -4
- package/dist/useDebounceValue/useDebounceValue.d.ts +0 -40
- package/dist/useDebounceValue/useDebounceValue.d.ts.map +0 -1
- package/dist/useDebounceValue/useDebounceValue.js +0 -13
- package/dist/useDocumentTitle/index.d.ts +0 -2
- package/dist/useDocumentTitle/index.d.ts.map +0 -1
- package/dist/useDocumentTitle/index.js +0 -4
- package/dist/useDocumentTitle/useDocumentTitle.d.ts +0 -19
- package/dist/useDocumentTitle/useDocumentTitle.d.ts.map +0 -1
- package/dist/useDocumentTitle/useDocumentTitle.js +0 -16
- package/dist/useEventCallback/index.d.ts +0 -2
- package/dist/useEventCallback/index.d.ts.map +0 -1
- package/dist/useEventCallback/index.js +0 -4
- package/dist/useEventCallback/useEventCallback.d.ts +0 -18
- package/dist/useEventCallback/useEventCallback.d.ts.map +0 -1
- package/dist/useEventCallback/useEventCallback.js +0 -13
- package/dist/useEventListener/index.d.ts +0 -2
- package/dist/useEventListener/index.d.ts.map +0 -1
- package/dist/useEventListener/index.js +0 -4
- package/dist/useEventListener/useEventListener.d.ts +0 -7
- package/dist/useEventListener/useEventListener.d.ts.map +0 -1
- package/dist/useEventListener/useEventListener.js +0 -20
- package/dist/useHover/index.d.ts +0 -2
- package/dist/useHover/index.d.ts.map +0 -1
- package/dist/useHover/index.js +0 -4
- package/dist/useHover/useHover.d.ts +0 -17
- package/dist/useHover/useHover.d.ts.map +0 -1
- package/dist/useHover/useHover.js +0 -13
- package/dist/useIntersectionObserver/index.d.ts +0 -2
- package/dist/useIntersectionObserver/index.d.ts.map +0 -1
- package/dist/useIntersectionObserver/index.js +0 -4
- package/dist/useIntersectionObserver/useIntersectionObserver.d.ts +0 -72
- package/dist/useIntersectionObserver/useIntersectionObserver.d.ts.map +0 -1
- package/dist/useIntersectionObserver/useIntersectionObserver.js +0 -53
- package/dist/useInterval/index.d.ts +0 -2
- package/dist/useInterval/index.d.ts.map +0 -1
- package/dist/useInterval/index.js +0 -4
- package/dist/useInterval/useInterval.d.ts +0 -16
- package/dist/useInterval/useInterval.d.ts.map +0 -1
- package/dist/useInterval/useInterval.js +0 -20
- package/dist/useIsClient/index.d.ts +0 -2
- package/dist/useIsClient/index.d.ts.map +0 -1
- package/dist/useIsClient/index.js +0 -4
- package/dist/useIsClient/useIsClient.d.ts +0 -13
- package/dist/useIsClient/useIsClient.d.ts.map +0 -1
- package/dist/useIsClient/useIsClient.js +0 -10
- package/dist/useIsMobile/index.d.ts +0 -3
- package/dist/useIsMobile/index.d.ts.map +0 -1
- package/dist/useIsMobile/index.js +0 -4
- package/dist/useIsMobile/types.d.ts +0 -4
- package/dist/useIsMobile/types.d.ts.map +0 -1
- package/dist/useIsMobile/types.js +0 -1
- package/dist/useIsMobile/useIsMobile.d.ts +0 -3
- package/dist/useIsMobile/useIsMobile.d.ts.map +0 -1
- package/dist/useIsMobile/useIsMobile.js +0 -16
- package/dist/useIsMounted/index.d.ts +0 -2
- package/dist/useIsMounted/index.d.ts.map +0 -1
- package/dist/useIsMounted/index.js +0 -4
- package/dist/useIsMounted/useIsMounted.d.ts +0 -2
- package/dist/useIsMounted/useIsMounted.d.ts.map +0 -1
- package/dist/useIsMounted/useIsMounted.js +0 -10
- package/dist/useIsomorphicLayoutEffect/index.d.ts +0 -2
- package/dist/useIsomorphicLayoutEffect/index.d.ts.map +0 -1
- package/dist/useIsomorphicLayoutEffect/index.js +0 -4
- package/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +0 -16
- package/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts.map +0 -1
- package/dist/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +0 -5
- package/dist/useLocalStorage/index.d.ts +0 -2
- package/dist/useLocalStorage/index.d.ts.map +0 -1
- package/dist/useLocalStorage/index.js +0 -4
- package/dist/useLocalStorage/useLocalStorage.d.ts +0 -39
- package/dist/useLocalStorage/useLocalStorage.d.ts.map +0 -1
- package/dist/useLocalStorage/useLocalStorage.js +0 -65
- package/dist/useLockBody/index.d.ts +0 -2
- package/dist/useLockBody/index.d.ts.map +0 -1
- package/dist/useLockBody/index.js +0 -4
- package/dist/useLockBody/useLockBody.d.ts +0 -2
- package/dist/useLockBody/useLockBody.d.ts.map +0 -1
- package/dist/useLockBody/useLockBody.js +0 -12
- package/dist/useMap/index.d.ts +0 -2
- package/dist/useMap/index.d.ts.map +0 -1
- package/dist/useMap/index.js +0 -4
- package/dist/useMap/useMap.d.ts +0 -48
- package/dist/useMap/useMap.d.ts.map +0 -1
- package/dist/useMap/useMap.js +0 -27
- package/dist/useMediaQuery/index.d.ts +0 -2
- package/dist/useMediaQuery/index.d.ts.map +0 -1
- package/dist/useMediaQuery/index.js +0 -4
- package/dist/useMediaQuery/useMediaQuery.d.ts +0 -29
- package/dist/useMediaQuery/useMediaQuery.d.ts.map +0 -1
- package/dist/useMediaQuery/useMediaQuery.js +0 -21
- package/dist/useOnClickOutside/index.d.ts +0 -2
- package/dist/useOnClickOutside/index.d.ts.map +0 -1
- package/dist/useOnClickOutside/index.js +0 -4
- package/dist/useOnClickOutside/useOnClickOutside.d.ts +0 -24
- package/dist/useOnClickOutside/useOnClickOutside.d.ts.map +0 -1
- package/dist/useOnClickOutside/useOnClickOutside.js +0 -17
- package/dist/useQueryString/index.d.ts +0 -2
- package/dist/useQueryString/index.d.ts.map +0 -1
- package/dist/useQueryString/index.js +0 -4
- package/dist/useQueryString/useQueryString.d.ts +0 -10
- package/dist/useQueryString/useQueryString.d.ts.map +0 -1
- package/dist/useQueryString/useQueryString.js +0 -10
- package/dist/useReadLocalStorage/index.d.ts +0 -2
- package/dist/useReadLocalStorage/index.d.ts.map +0 -1
- package/dist/useReadLocalStorage/index.js +0 -4
- package/dist/useReadLocalStorage/useReadLocalStorage.d.ts +0 -14
- package/dist/useReadLocalStorage/useReadLocalStorage.d.ts.map +0 -1
- package/dist/useReadLocalStorage/useReadLocalStorage.js +0 -48
- package/dist/useResizeObserver/index.d.ts +0 -2
- package/dist/useResizeObserver/index.d.ts.map +0 -1
- package/dist/useResizeObserver/index.js +0 -4
- package/dist/useResizeObserver/useResizeObserver.d.ts +0 -44
- package/dist/useResizeObserver/useResizeObserver.d.ts.map +0 -1
- package/dist/useResizeObserver/useResizeObserver.js +0 -31
- package/dist/useScreen/index.d.ts +0 -2
- package/dist/useScreen/index.d.ts.map +0 -1
- package/dist/useScreen/index.js +0 -4
- package/dist/useScreen/useScreen.d.ts +0 -20
- package/dist/useScreen/useScreen.d.ts.map +0 -1
- package/dist/useScreen/useScreen.js +0 -48
- package/dist/useScript/index.d.ts +0 -2
- package/dist/useScript/index.d.ts.map +0 -1
- package/dist/useScript/index.js +0 -4
- package/dist/useScript/useScript.d.ts +0 -24
- package/dist/useScript/useScript.d.ts.map +0 -1
- package/dist/useScript/useScript.js +0 -45
- package/dist/useScrollLock/index.d.ts +0 -2
- package/dist/useScrollLock/index.d.ts.map +0 -1
- package/dist/useScrollLock/index.js +0 -4
- package/dist/useScrollLock/useScrollLock.d.ts +0 -54
- package/dist/useScrollLock/useScrollLock.d.ts.map +0 -1
- package/dist/useScrollLock/useScrollLock.js +0 -26
- package/dist/useSessionStorage/index.d.ts +0 -2
- package/dist/useSessionStorage/index.d.ts.map +0 -1
- package/dist/useSessionStorage/index.js +0 -4
- package/dist/useSessionStorage/useSessionStorage.d.ts +0 -39
- package/dist/useSessionStorage/useSessionStorage.d.ts.map +0 -1
- package/dist/useSessionStorage/useSessionStorage.js +0 -65
- package/dist/useStep/index.d.ts +0 -2
- package/dist/useStep/index.d.ts.map +0 -1
- package/dist/useStep/index.js +0 -4
- package/dist/useStep/useStep.d.ts +0 -31
- package/dist/useStep/useStep.d.ts.map +0 -1
- package/dist/useStep/useStep.js +0 -34
- package/dist/useTernaryDarkMode/index.d.ts +0 -2
- package/dist/useTernaryDarkMode/index.d.ts.map +0 -1
- package/dist/useTernaryDarkMode/index.js +0 -4
- package/dist/useTernaryDarkMode/useTernaryDarkMode.d.ts +0 -46
- package/dist/useTernaryDarkMode/useTernaryDarkMode.d.ts.map +0 -1
- package/dist/useTernaryDarkMode/useTernaryDarkMode.js +0 -27
- package/dist/useTimeout/index.d.ts +0 -2
- package/dist/useTimeout/index.d.ts.map +0 -1
- package/dist/useTimeout/index.js +0 -4
- package/dist/useTimeout/useTimeout.d.ts +0 -17
- package/dist/useTimeout/useTimeout.d.ts.map +0 -1
- package/dist/useTimeout/useTimeout.js +0 -20
- package/dist/useToggle/index.d.ts +0 -2
- package/dist/useToggle/index.d.ts.map +0 -1
- package/dist/useToggle/index.js +0 -4
- package/dist/useToggle/useToggle.d.ts +0 -18
- package/dist/useToggle/useToggle.d.ts.map +0 -1
- package/dist/useToggle/useToggle.js +0 -10
- package/dist/useUnmount/index.d.ts +0 -2
- package/dist/useUnmount/index.d.ts.map +0 -1
- package/dist/useUnmount/index.js +0 -4
- package/dist/useUnmount/useUnmount.d.ts +0 -14
- package/dist/useUnmount/useUnmount.d.ts.map +0 -1
- package/dist/useUnmount/useUnmount.js +0 -13
- package/dist/useWindowSize/index.d.ts +0 -2
- package/dist/useWindowSize/index.d.ts.map +0 -1
- package/dist/useWindowSize/index.js +0 -4
- package/dist/useWindowSize/useWindowSize.d.ts +0 -30
- package/dist/useWindowSize/useWindowSize.d.ts.map +0 -1
- package/dist/useWindowSize/useWindowSize.js +0 -31
- /package/{dist/index.js → index.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneplatformdev/hooks",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-15",
|
|
4
4
|
"description": "React hook library",
|
|
5
5
|
"author": "One Platform Development Team",
|
|
6
6
|
"keywords": [
|
|
@@ -38,10 +38,12 @@
|
|
|
38
38
|
"default": "./*.js"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public",
|
|
43
|
+
"directory": "dist"
|
|
44
|
+
},
|
|
41
45
|
"files": [
|
|
42
|
-
"dist",
|
|
43
|
-
"README.md",
|
|
44
|
-
"LICENSE",
|
|
46
|
+
"dist/**",
|
|
45
47
|
"!**/*.tsbuildinfo"
|
|
46
48
|
],
|
|
47
49
|
"dependencies": {
|
package/dist/CHANGELOG.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
## 0.1.0-12 (2025-09-15)
|
|
2
|
-
|
|
3
|
-
This was a version bump only for @oneplatformdev/hooks to align it with other projects, there were no code changes.
|
|
4
|
-
|
|
5
|
-
## 0.1.0-11 (2025-09-15)
|
|
6
|
-
|
|
7
|
-
This was a version bump only for @oneplatformdev/hooks to align it with other projects, there were no code changes.
|
|
8
|
-
|
|
9
|
-
## 0.1.0-10 (2025-09-11)
|
|
10
|
-
|
|
11
|
-
This was a version bump only for @oneplatformdev/hooks to align it with other projects, there were no code changes.
|
|
12
|
-
|
|
13
|
-
## 0.1.0-9 (2025-09-11)
|
|
14
|
-
|
|
15
|
-
This was a version bump only for @oneplatformdev/hooks to align it with other projects, there were no code changes.
|
|
16
|
-
|
|
17
|
-
## 0.1.0-8 (2025-09-11)
|
|
18
|
-
|
|
19
|
-
This was a version bump only for @oneplatformdev/hooks to align it with other projects, there were no code changes.
|
|
20
|
-
|
|
21
|
-
## 0.1.0-7 (2025-09-11)
|
|
22
|
-
|
|
23
|
-
This was a version bump only for @oneplatformdev/hooks to align it with other projects, there were no code changes.
|
|
24
|
-
|
|
25
|
-
## 0.1.0-6 (2025-09-11)
|
|
26
|
-
|
|
27
|
-
This was a version bump only for @oneplatformdev/hooks to align it with other projects, there were no code changes.
|
|
28
|
-
|
|
29
|
-
## 0.1.0-5 (2025-09-11)
|
|
30
|
-
|
|
31
|
-
This was a version bump only for @oneplatformdev/hooks to align it with other projects, there were no code changes.
|
|
32
|
-
|
|
33
|
-
## 0.1.0-4 (2025-09-11)
|
|
34
|
-
|
|
35
|
-
This was a version bump only for @oneplatformdev/hooks to align it with other projects, there were no code changes.
|
package/dist/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Oleh Maksimenko
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/README.md
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export * from './useBoolean';
|
|
2
|
-
export * from './useClickAnyWhere';
|
|
3
|
-
export * from './useCopyToClipboard';
|
|
4
|
-
export * from './useCountdown';
|
|
5
|
-
export * from './useCounter';
|
|
6
|
-
export * from './useDarkMode';
|
|
7
|
-
export * from './useDebounceCallback';
|
|
8
|
-
export * from './useDebounceValue';
|
|
9
|
-
export * from './useDocumentTitle';
|
|
10
|
-
export * from './useEventCallback';
|
|
11
|
-
export * from './useEventListener';
|
|
12
|
-
export * from './useHover';
|
|
13
|
-
export * from './useIntersectionObserver';
|
|
14
|
-
export * from './useInterval';
|
|
15
|
-
export * from './useIsClient';
|
|
16
|
-
export * from './useIsMobile';
|
|
17
|
-
export * from './useIsMounted';
|
|
18
|
-
export * from './useIsomorphicLayoutEffect';
|
|
19
|
-
export * from './useLocalStorage';
|
|
20
|
-
export * from './useLockBody';
|
|
21
|
-
export * from './useMap';
|
|
22
|
-
export * from './useMediaQuery';
|
|
23
|
-
export * from './useOnClickOutside';
|
|
24
|
-
export * from './useReadLocalStorage';
|
|
25
|
-
export * from './useResizeObserver';
|
|
26
|
-
export * from './useScreen';
|
|
27
|
-
export * from './useScript';
|
|
28
|
-
export * from './useScrollLock';
|
|
29
|
-
export * from './useSessionStorage';
|
|
30
|
-
export * from './useStep';
|
|
31
|
-
export * from './useTernaryDarkMode';
|
|
32
|
-
export * from './useTimeout';
|
|
33
|
-
export * from './useToggle';
|
|
34
|
-
export * from './useUnmount';
|
|
35
|
-
export * from './useWindowSize';
|
|
36
|
-
export * from './useQueryString';
|
|
37
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
package/dist/package.json
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@oneplatformdev/hooks",
|
|
3
|
-
"version": "0.1.0-12",
|
|
4
|
-
"description": "React hook library",
|
|
5
|
-
"author": "One Platform Development Team",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"react",
|
|
8
|
-
"oneplatform",
|
|
9
|
-
"hooks",
|
|
10
|
-
"typescript"
|
|
11
|
-
],
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "git+https://github.com/oneplatformdev/core.git",
|
|
15
|
-
"directory": "packages/hooks"
|
|
16
|
-
},
|
|
17
|
-
"bugs": {
|
|
18
|
-
"url": "https://github.com/oneplatformdev/core/issues"
|
|
19
|
-
},
|
|
20
|
-
"homepage": "private package",
|
|
21
|
-
"private": false,
|
|
22
|
-
"license": "MIT",
|
|
23
|
-
"type": "module",
|
|
24
|
-
"main": "./index.js",
|
|
25
|
-
"module": "./index.js",
|
|
26
|
-
"types": "./index.d.ts",
|
|
27
|
-
"exports": {
|
|
28
|
-
"./package.json": "./package.json",
|
|
29
|
-
".": {
|
|
30
|
-
"@oneplatformdev/source": "./src/index.ts",
|
|
31
|
-
"types": "./index.d.ts",
|
|
32
|
-
"import": "./index.js",
|
|
33
|
-
"default": "./index.js"
|
|
34
|
-
},
|
|
35
|
-
"./*": {
|
|
36
|
-
"types": "./*.d.ts",
|
|
37
|
-
"import": "./*.js",
|
|
38
|
-
"default": "./*.js"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"files": [
|
|
42
|
-
"dist",
|
|
43
|
-
"README.md",
|
|
44
|
-
"LICENSE",
|
|
45
|
-
"!**/*.tsbuildinfo"
|
|
46
|
-
],
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"lodash.debounce": "^4.0.8"
|
|
49
|
-
},
|
|
50
|
-
"peerDependencies": {
|
|
51
|
-
"react": ">=18",
|
|
52
|
-
"react-dom": ">=18",
|
|
53
|
-
"@types/react": ">=18",
|
|
54
|
-
"@types/lodash.debounce": "^4.0.9"
|
|
55
|
-
},
|
|
56
|
-
"peerDependenciesMeta": {
|
|
57
|
-
"@types/react": {
|
|
58
|
-
"optional": true
|
|
59
|
-
},
|
|
60
|
-
"@types/react-dom": {
|
|
61
|
-
"optional": true
|
|
62
|
-
},
|
|
63
|
-
"@types/lodash.debounce": {
|
|
64
|
-
"optional": true
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/useBoolean/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
package/dist/useBoolean/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
/** The useBoolean return type. */
|
|
3
|
-
type UseBooleanReturn = {
|
|
4
|
-
/** The current boolean state value. */
|
|
5
|
-
value: boolean;
|
|
6
|
-
/** Function to set the boolean state directly. */
|
|
7
|
-
setValue: Dispatch<SetStateAction<boolean>>;
|
|
8
|
-
/** Function to set the boolean state to `true`. */
|
|
9
|
-
setTrue: () => void;
|
|
10
|
-
/** Function to set the boolean state to `false`. */
|
|
11
|
-
setFalse: () => void;
|
|
12
|
-
/** Function to toggle the boolean state. */
|
|
13
|
-
toggle: () => void;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Custom hook that handles boolean state with useful utility functions.
|
|
17
|
-
* @param {boolean} [defaultValue] - The initial value for the boolean state (default is `false`).
|
|
18
|
-
* @returns {UseBooleanReturn} An object containing the boolean state value and utility functions to manipulate the state.
|
|
19
|
-
* @throws Will throw an error if `defaultValue` is an invalid boolean value.
|
|
20
|
-
* @public
|
|
21
|
-
* @see [Documentation](https://usehooks-ts.com/react-hook/use-boolean)
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* const { value, setTrue, setFalse, toggle } = useBoolean(true);
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare function useBoolean(defaultValue?: boolean): UseBooleanReturn;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=useBoolean.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBoolean.d.ts","sourceRoot":"","sources":["../../src/useBoolean/useBoolean.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAErD,kCAAkC;AAClC,KAAK,gBAAgB,GAAG;IACtB,uCAAuC;IACvC,KAAK,EAAE,OAAO,CAAA;IACd,kDAAkD;IAClD,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3C,mDAAmD;IACnD,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,4CAA4C;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,YAAY,UAAQ,GAAG,gBAAgB,CAmBjE"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useState as n, useCallback as t } from "react";
|
|
2
|
-
function c(o = !1) {
|
|
3
|
-
if (typeof o != "boolean")
|
|
4
|
-
throw new Error("defaultValue must be `true` or `false`");
|
|
5
|
-
const [s, e] = n(o), r = t(() => {
|
|
6
|
-
e(!0);
|
|
7
|
-
}, []), a = t(() => {
|
|
8
|
-
e(!1);
|
|
9
|
-
}, []), l = t(() => {
|
|
10
|
-
e((u) => !u);
|
|
11
|
-
}, []);
|
|
12
|
-
return { value: s, setValue: e, setTrue: r, setFalse: a, toggle: l };
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
c as useBoolean
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/useClickAnyWhere/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom hook that handles click events anywhere on the document.
|
|
3
|
-
* @param {Function} handler - The function to be called when a click event is detected anywhere on the document.
|
|
4
|
-
* @public
|
|
5
|
-
* @see [Documentation](https://usehooks-ts.com/react-hook/use-click-any-where)
|
|
6
|
-
* @example
|
|
7
|
-
* ```tsx
|
|
8
|
-
* const handleClick = (event) => {
|
|
9
|
-
* console.log('Document clicked!', event);
|
|
10
|
-
* };
|
|
11
|
-
*
|
|
12
|
-
* // Attach click event handler to document
|
|
13
|
-
* useClickAnywhere(handleClick);
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare function useClickAnyWhere(handler: (event: MouseEvent) => void): void;
|
|
17
|
-
//# sourceMappingURL=useClickAnyWhere.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useClickAnyWhere.d.ts","sourceRoot":"","sources":["../../src/useClickAnyWhere/useClickAnyWhere.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,QAIpE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/useCopyToClipboard/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The copied text as `string` or `null` if nothing has been copied yet.
|
|
3
|
-
*/
|
|
4
|
-
type CopiedValue = string | null;
|
|
5
|
-
/**
|
|
6
|
-
* Function to copy text to the clipboard.
|
|
7
|
-
* @param text - The text to copy to the clipboard.
|
|
8
|
-
* @returns {Promise<boolean>} A promise that resolves to `true` if the text was copied successfully, or `false` otherwise.
|
|
9
|
-
*/
|
|
10
|
-
type CopyFn = (text: string) => Promise<boolean>;
|
|
11
|
-
/**
|
|
12
|
-
* Custom hook that copies text to the clipboard using the [`Clipboard API`](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API).
|
|
13
|
-
* @returns {[CopiedValue, CopyFn]} An tuple containing the copied text and a function to copy text to the clipboard.
|
|
14
|
-
* @public
|
|
15
|
-
* @see [Documentation](https://usehooks-ts.com/react-hook/use-copy-to-clipboard)
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* const [copiedText, copyToClipboard] = useCopyToClipboard();
|
|
19
|
-
* const textToCopy = 'Hello, world!';
|
|
20
|
-
*
|
|
21
|
-
* // Attempt to copy text to the clipboard
|
|
22
|
-
* copyToClipboard(textToCopy)
|
|
23
|
-
* .then(success => {
|
|
24
|
-
* if (success) {
|
|
25
|
-
* console.log(`Text "${textToCopy}" copied to clipboard successfully.`);
|
|
26
|
-
* } else {
|
|
27
|
-
* console.error('Failed to copy text to clipboard.');
|
|
28
|
-
* }
|
|
29
|
-
* });
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export declare function useCopyToClipboard(): [CopiedValue, CopyFn];
|
|
33
|
-
export {};
|
|
34
|
-
//# sourceMappingURL=useCopyToClipboard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCopyToClipboard.d.ts","sourceRoot":"","sources":["../../src/useCopyToClipboard/useCopyToClipboard.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,WAAW,GAAG,MAAM,GAAG,IAAI,CAAA;AAEhC;;;;GAIG;AACH,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAEhD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAsB1D"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useState as n, useCallback as l } from "react";
|
|
2
|
-
function c() {
|
|
3
|
-
const [e, r] = n(null), t = l(async (o) => {
|
|
4
|
-
if (!navigator?.clipboard)
|
|
5
|
-
return console.warn("Clipboard not supported"), !1;
|
|
6
|
-
try {
|
|
7
|
-
return await navigator.clipboard.writeText(o), r(o), !0;
|
|
8
|
-
} catch (a) {
|
|
9
|
-
return console.warn("Copy failed", a), r(null), !1;
|
|
10
|
-
}
|
|
11
|
-
}, []);
|
|
12
|
-
return [e, t];
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
c as useCopyToClipboard
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/useCountdown/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/** The countdown's options. */
|
|
2
|
-
type CountdownOptions = {
|
|
3
|
-
/** The countdown's starting number, initial value of the returned number. */
|
|
4
|
-
countStart: number;
|
|
5
|
-
/**
|
|
6
|
-
* The countdown's interval, in milliseconds.
|
|
7
|
-
* @default 1000
|
|
8
|
-
*/
|
|
9
|
-
intervalMs?: number;
|
|
10
|
-
/**
|
|
11
|
-
* True if the countdown is increment.
|
|
12
|
-
* @default false
|
|
13
|
-
*/
|
|
14
|
-
isIncrement?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* The countdown's stopping number. Pass `-Infinity` to decrease forever.
|
|
17
|
-
* @default 0
|
|
18
|
-
*/
|
|
19
|
-
countStop?: number;
|
|
20
|
-
};
|
|
21
|
-
/** The countdown's controllers. */
|
|
22
|
-
type CountdownControllers = {
|
|
23
|
-
/** Start the countdown. */
|
|
24
|
-
startCountdown: () => void;
|
|
25
|
-
/** Stop the countdown. */
|
|
26
|
-
stopCountdown: () => void;
|
|
27
|
-
/** Reset the countdown. */
|
|
28
|
-
resetCountdown: () => void;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Custom hook that manages countdown.
|
|
32
|
-
* @param {CountdownOptions} countdownOptions - The countdown's options.
|
|
33
|
-
* @returns {[number, CountdownControllers]} An array containing the countdown's count and its controllers.
|
|
34
|
-
* @public
|
|
35
|
-
* @see [Documentation](https://usehooks-ts.com/react-hook/use-countdown)
|
|
36
|
-
* @example
|
|
37
|
-
* ```tsx
|
|
38
|
-
* const [counter, { start, stop, reset }] = useCountdown({
|
|
39
|
-
* countStart: 10,
|
|
40
|
-
* intervalMs: 1000,
|
|
41
|
-
* isIncrement: false,
|
|
42
|
-
* });
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare function useCountdown({ countStart, countStop, intervalMs, isIncrement, }: CountdownOptions): [number, CountdownControllers];
|
|
46
|
-
export {};
|
|
47
|
-
//# sourceMappingURL=useCountdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCountdown.d.ts","sourceRoot":"","sources":["../../src/useCountdown/useCountdown.ts"],"names":[],"mappings":"AAMA,+BAA+B;AAC/B,KAAK,gBAAgB,GAAG;IACtB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,mCAAmC;AACnC,KAAK,oBAAoB,GAAG;IAC1B,2BAA2B;IAC3B,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,0BAA0B;IAC1B,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,2BAA2B;IAC3B,cAAc,EAAE,MAAM,IAAI,CAAA;CAC3B,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,SAAa,EACb,UAAiB,EACjB,WAAmB,GACpB,EAAE,gBAAgB,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CA0CnD"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useCallback as l } from "react";
|
|
2
|
-
import { useBoolean as d } from "../useBoolean/useBoolean.js";
|
|
3
|
-
import { useCounter as w } from "../useCounter/useCounter.js";
|
|
4
|
-
import { useInterval as p } from "../useInterval/useInterval.js";
|
|
5
|
-
function x({
|
|
6
|
-
countStart: a,
|
|
7
|
-
countStop: n = 0,
|
|
8
|
-
intervalMs: c = 1e3,
|
|
9
|
-
isIncrement: t = !1
|
|
10
|
-
}) {
|
|
11
|
-
const {
|
|
12
|
-
count: o,
|
|
13
|
-
increment: r,
|
|
14
|
-
decrement: s,
|
|
15
|
-
reset: u
|
|
16
|
-
} = w(a), {
|
|
17
|
-
value: f,
|
|
18
|
-
setTrue: i,
|
|
19
|
-
setFalse: e
|
|
20
|
-
} = d(!1), m = l(() => {
|
|
21
|
-
e(), u();
|
|
22
|
-
}, [e, u]), C = l(() => {
|
|
23
|
-
if (o === n) {
|
|
24
|
-
e();
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
t ? r() : s();
|
|
28
|
-
}, [o, n, s, r, t, e]);
|
|
29
|
-
return p(C, f ? c : null), [o, { startCountdown: i, stopCountdown: e, resetCountdown: m }];
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
x as useCountdown
|
|
33
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/useCounter/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
package/dist/useCounter/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
/** The hook return type. */
|
|
3
|
-
type UseCounterReturn = {
|
|
4
|
-
/** The current count value. */
|
|
5
|
-
count: number;
|
|
6
|
-
/** Function to increment the counter by 1. */
|
|
7
|
-
increment: () => void;
|
|
8
|
-
/** Function to decrement the counter by 1. */
|
|
9
|
-
decrement: () => void;
|
|
10
|
-
/** Function to reset the counter to its initial value. */
|
|
11
|
-
reset: () => void;
|
|
12
|
-
/** Function to set a specific value to the counter. */
|
|
13
|
-
setCount: Dispatch<SetStateAction<number>>;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Custom hook that manages a counter with increment, decrement, reset, and setCount functionalities.
|
|
17
|
-
* @param {number} [initialValue] - The initial value for the counter.
|
|
18
|
-
* @returns {UseCounterReturn} An object containing the current count and functions to interact with the counter.
|
|
19
|
-
* @public
|
|
20
|
-
* @see [Documentation](https://usehooks-ts.com/react-hook/use-counter)
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* const { count, increment, decrement, reset, setCount } = useCounter(5);
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare function useCounter(initialValue?: number): UseCounterReturn;
|
|
27
|
-
export {};
|
|
28
|
-
//# sourceMappingURL=useCounter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCounter.d.ts","sourceRoot":"","sources":["../../src/useCounter/useCounter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAErD,4BAA4B;AAC5B,KAAK,gBAAgB,GAAG;IACtB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,uDAAuD;IACvD,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;CAC3C,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAsBlE"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useState as m, useCallback as o } from "react";
|
|
2
|
-
function f(e) {
|
|
3
|
-
const [c, t] = m(e ?? 0), r = o(() => {
|
|
4
|
-
t((n) => n + 1);
|
|
5
|
-
}, []), s = o(() => {
|
|
6
|
-
t((n) => n - 1);
|
|
7
|
-
}, []), u = o(() => {
|
|
8
|
-
t(e ?? 0);
|
|
9
|
-
}, [e]);
|
|
10
|
-
return {
|
|
11
|
-
count: c,
|
|
12
|
-
increment: r,
|
|
13
|
-
decrement: s,
|
|
14
|
-
reset: u,
|
|
15
|
-
setCount: t
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
f as useCounter
|
|
20
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/useDarkMode/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/** The hook options. */
|
|
2
|
-
type DarkModeOptions = {
|
|
3
|
-
/**
|
|
4
|
-
* The initial value of the dark mode.
|
|
5
|
-
* @default false
|
|
6
|
-
*/
|
|
7
|
-
defaultValue?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* The key to use in the local storage.
|
|
10
|
-
* @default 'usehooks-ts-dark-mode'
|
|
11
|
-
*/
|
|
12
|
-
localStorageKey?: string;
|
|
13
|
-
/**
|
|
14
|
-
* If `true` (default), the hook will initialize reading `localStorage`.
|
|
15
|
-
* In SSR, you should set it to `false`, returning the `defaultValue` or `false` initially.
|
|
16
|
-
* @default true
|
|
17
|
-
*/
|
|
18
|
-
initializeWithValue?: boolean;
|
|
19
|
-
};
|
|
20
|
-
/** The hook return type. */
|
|
21
|
-
type DarkModeReturn = {
|
|
22
|
-
/** The current state of the dark mode. */
|
|
23
|
-
isDarkMode: boolean;
|
|
24
|
-
/** Function to toggle the dark mode. */
|
|
25
|
-
toggle: () => void;
|
|
26
|
-
/** Function to enable the dark mode. */
|
|
27
|
-
enable: () => void;
|
|
28
|
-
/** Function to disable the dark mode. */
|
|
29
|
-
disable: () => void;
|
|
30
|
-
/** Function to set a specific value to the dark mode. */
|
|
31
|
-
set: (value: boolean) => void;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Custom hook that returns the current state of the dark mode.
|
|
35
|
-
* @param {?DarkModeOptions} [options] - The initial value of the dark mode, default `false`.
|
|
36
|
-
* @returns {DarkModeReturn} An object containing the dark mode's state and its controllers.
|
|
37
|
-
* @public
|
|
38
|
-
* @see [Documentation](https://usehooks-ts.com/react-hook/use-dark-mode)
|
|
39
|
-
* @example
|
|
40
|
-
* ```tsx
|
|
41
|
-
* const { isDarkMode, toggle, enable, disable, set } = useDarkMode({ defaultValue: true });
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function useDarkMode(options?: DarkModeOptions): DarkModeReturn;
|
|
45
|
-
export {};
|
|
46
|
-
//# sourceMappingURL=useDarkMode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDarkMode.d.ts","sourceRoot":"","sources":["../../src/useDarkMode/useDarkMode.ts"],"names":[],"mappings":"AAOA,wBAAwB;AACxB,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,CAAA;AAED,4BAA4B;AAC5B,KAAK,cAAc,GAAG;IACpB,0CAA0C;IAC1C,UAAU,EAAE,OAAO,CAAA;IACnB,wCAAwC;IACxC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,wCAAwC;IACxC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,yCAAyC;IACzC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,yDAAyD;IACzD,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CAC9B,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,eAAoB,GAAG,cAAc,CAuCzE"}
|