@vitus-labs/hooks 1.2.1 → 1.2.3-alpha.56
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/LICENSE +1 -1
- package/README.md +83 -0
- package/lib/analysis/index.js.html +1 -1
- package/lib/index.d.ts +31 -21
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +49 -32
- package/lib/index.js.map +1 -1
- package/package.json +19 -20
- package/lib/types/index.d.ts +0 -7
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/useHover.d.ts +0 -8
- package/lib/types/useHover.d.ts.map +0 -1
- package/lib/types/useWindowResize.d.ts +0 -11
- package/lib/types/useWindowResize.d.ts.map +0 -1
package/LICENSE
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# @vitus-labs/hooks
|
|
2
|
+
|
|
3
|
+
Lightweight React hooks for common UI interactions.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@vitus-labs/hooks)
|
|
6
|
+
[](https://github.com/vitus-labs/ui-system/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @vitus-labs/hooks
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Hooks
|
|
15
|
+
|
|
16
|
+
### useHover
|
|
17
|
+
|
|
18
|
+
Tracks hover state with stable callback references.
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { useHover } from '@vitus-labs/hooks'
|
|
22
|
+
|
|
23
|
+
const MyComponent = () => {
|
|
24
|
+
const { hover, onMouseEnter, onMouseLeave } = useHover()
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
onMouseEnter={onMouseEnter}
|
|
29
|
+
onMouseLeave={onMouseLeave}
|
|
30
|
+
style={{ background: hover ? '#f0f0f0' : '#fff' }}
|
|
31
|
+
>
|
|
32
|
+
{hover ? 'Hovered' : 'Hover me'}
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Parameters:**
|
|
39
|
+
|
|
40
|
+
| Param | Type | Default | Description |
|
|
41
|
+
| ----- | ---- | ------- | ----------- |
|
|
42
|
+
| initialValue | `boolean` | `false` | Initial hover state |
|
|
43
|
+
|
|
44
|
+
**Returns:** `{ hover: boolean, onMouseEnter: () => void, onMouseLeave: () => void }`
|
|
45
|
+
|
|
46
|
+
### useWindowResize
|
|
47
|
+
|
|
48
|
+
Tracks viewport dimensions with throttled updates.
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import { useWindowResize } from '@vitus-labs/hooks'
|
|
52
|
+
|
|
53
|
+
const Layout = () => {
|
|
54
|
+
const { width, height } = useWindowResize({
|
|
55
|
+
throttleDelay: 300,
|
|
56
|
+
onChange: ({ width }) => console.log('Width:', width),
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
return <div>Viewport: {width} x {height}</div>
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Parameters:**
|
|
64
|
+
|
|
65
|
+
| Param | Type | Default | Description |
|
|
66
|
+
| ----- | ---- | ------- | ----------- |
|
|
67
|
+
| params.throttleDelay | `number` | `200` | Milliseconds between resize handler calls |
|
|
68
|
+
| params.onChange | `(sizes) => void` | — | Callback fired on each resize |
|
|
69
|
+
| initialValues.width | `number` | `0` | Initial width (useful for SSR) |
|
|
70
|
+
| initialValues.height | `number` | `0` | Initial height (useful for SSR) |
|
|
71
|
+
|
|
72
|
+
**Returns:** `{ width: number, height: number }`
|
|
73
|
+
|
|
74
|
+
## Peer Dependencies
|
|
75
|
+
|
|
76
|
+
| Package | Version |
|
|
77
|
+
| ------- | ------- |
|
|
78
|
+
| react | >= 19 |
|
|
79
|
+
| @vitus-labs/core | * |
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
MIT
|
|
@@ -5386,7 +5386,7 @@ var drawChart = (function (exports) {
|
|
|
5386
5386
|
</script>
|
|
5387
5387
|
<script>
|
|
5388
5388
|
/*<!--*/
|
|
5389
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"
|
|
5389
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"1a8c7527-1","name":"useHover.ts"},{"uid":"1a8c7527-3","name":"useWindowResize.ts"},{"uid":"1a8c7527-5","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"1a8c7527-1":{"renderedLength":412,"gzipLength":260,"brotliLength":0,"metaUid":"1a8c7527-0"},"1a8c7527-3":{"renderedLength":1158,"gzipLength":543,"brotliLength":0,"metaUid":"1a8c7527-2"},"1a8c7527-5":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"1a8c7527-4"}},"nodeMetas":{"1a8c7527-0":{"id":"/src/useHover.ts","moduleParts":{"index.js":"1a8c7527-1"},"imported":[{"uid":"1a8c7527-6"}],"importedBy":[{"uid":"1a8c7527-4"}]},"1a8c7527-2":{"id":"/src/useWindowResize.ts","moduleParts":{"index.js":"1a8c7527-3"},"imported":[{"uid":"1a8c7527-7"},{"uid":"1a8c7527-6"}],"importedBy":[{"uid":"1a8c7527-4"}]},"1a8c7527-4":{"id":"/src/index.ts","moduleParts":{"index.js":"1a8c7527-5"},"imported":[{"uid":"1a8c7527-0"},{"uid":"1a8c7527-2"}],"importedBy":[],"isEntry":true},"1a8c7527-6":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a8c7527-0"},{"uid":"1a8c7527-2"}]},"1a8c7527-7":{"id":"@vitus-labs/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a8c7527-2"}]}},"env":{"rollup":"4.23.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
5390
5390
|
|
|
5391
5391
|
const run = () => {
|
|
5392
5392
|
const width = window.innerWidth;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
//#region src/useHover.d.ts
|
|
2
|
+
type UseHover = (initialValue?: boolean) => {
|
|
3
|
+
hover: boolean;
|
|
4
|
+
onMouseEnter: () => void;
|
|
5
|
+
onMouseLeave: () => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Simple hover-state hook that returns a boolean plus stable
|
|
9
|
+
* `onMouseEnter`/`onMouseLeave` handlers ready to spread onto an element.
|
|
10
|
+
*/
|
|
11
|
+
declare const useHover: UseHover;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/useWindowResize.d.ts
|
|
14
|
+
type Sizes = {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
type UseWindowResize = (params?: Partial<{
|
|
19
|
+
throttleDelay: number;
|
|
20
|
+
onChange: (params: Sizes) => void;
|
|
21
|
+
}>, initialValues?: Partial<Sizes>) => Sizes;
|
|
22
|
+
/**
|
|
23
|
+
* Tracks the browser viewport size, throttled to avoid excessive re-renders.
|
|
24
|
+
* Reads `window.innerWidth`/`innerHeight` on mount and on every resize event.
|
|
25
|
+
* An optional `onChange` callback fires alongside state updates.
|
|
26
|
+
* Cleans up both the event listener and any pending throttled call on unmount.
|
|
27
|
+
*/
|
|
28
|
+
declare const useWindowResize: UseWindowResize;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { type UseHover, type UseWindowResize, useHover, useWindowResize };
|
|
31
|
+
//# sourceMappingURL=index.d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.d.ts","names":[],"sources":["../src/useHover.ts","../src/useWindowResize.ts"],"sourcesContent":[],"mappings":";KAEY,QAAA;EAAA,KAAA,EAAA,OAAQ;EAUd,YAWL,EAAA,GAAA,GAAA,IAXe;;;;;ACJhB;;cDIM,QCDiB,EDCP,QCDO;;;KARlB,KAAA;EDDO,KAAA,EAAA,MAAQ;EAUd,MAAA,EAAA,MAWL;;KCfW,eAAA,UAAZ,GACW;;EANN,QAAK,EAAA,CAAA,MAAA,EAQa,KARb,EAAA,GAAA,IAAA;AAKV,CAAA,CAAA,EAAY,aAAe,CAAf,EAKM,OALS,CAKD,KALC,CAAA,EAAA,GAMtB,KANsB;;;;;;;cAcrB,eARI,EAQa,eARb"}
|
package/lib/index.js
CHANGED
|
@@ -1,40 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { throttle } from
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { throttle } from "@vitus-labs/core";
|
|
3
3
|
|
|
4
|
+
//#region src/useHover.ts
|
|
5
|
+
/**
|
|
6
|
+
* Simple hover-state hook that returns a boolean plus stable
|
|
7
|
+
* `onMouseEnter`/`onMouseLeave` handlers ready to spread onto an element.
|
|
8
|
+
*/
|
|
4
9
|
const useHover = (initial = false) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onMouseLeave: unsetHover,
|
|
12
|
-
};
|
|
10
|
+
const [hover, handleHover] = useState(initial);
|
|
11
|
+
return {
|
|
12
|
+
hover,
|
|
13
|
+
onMouseEnter: useCallback(() => handleHover(true), []),
|
|
14
|
+
onMouseLeave: useCallback(() => handleHover(false), [])
|
|
15
|
+
};
|
|
13
16
|
};
|
|
14
17
|
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/useWindowResize.ts
|
|
20
|
+
/**
|
|
21
|
+
* Tracks the browser viewport size, throttled to avoid excessive re-renders.
|
|
22
|
+
* Reads `window.innerWidth`/`innerHeight` on mount and on every resize event.
|
|
23
|
+
* An optional `onChange` callback fires alongside state updates.
|
|
24
|
+
* Cleans up both the event listener and any pending throttled call on unmount.
|
|
25
|
+
*/
|
|
15
26
|
const useWindowResize = ({ throttleDelay = 200, onChange } = {}, { width = 0, height = 0 } = {}) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
const [windowSize, setWindowSize] = useState({
|
|
28
|
+
width,
|
|
29
|
+
height
|
|
30
|
+
});
|
|
31
|
+
const onChangeRef = useRef(onChange);
|
|
32
|
+
onChangeRef.current = onChange;
|
|
33
|
+
const updateSizes = useCallback(() => {
|
|
34
|
+
const sizes = {
|
|
35
|
+
width: window.innerWidth,
|
|
36
|
+
height: window.innerHeight
|
|
37
|
+
};
|
|
38
|
+
setWindowSize(sizes);
|
|
39
|
+
if (onChangeRef.current) onChangeRef.current(sizes);
|
|
40
|
+
}, []);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
updateSizes();
|
|
43
|
+
}, [updateSizes]);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const throttled = throttle(updateSizes, throttleDelay);
|
|
46
|
+
window.addEventListener("resize", throttled, false);
|
|
47
|
+
return () => {
|
|
48
|
+
window.removeEventListener("resize", throttled, false);
|
|
49
|
+
throttled.cancel();
|
|
50
|
+
};
|
|
51
|
+
}, [updateSizes, throttleDelay]);
|
|
52
|
+
return windowSize;
|
|
37
53
|
};
|
|
38
54
|
|
|
55
|
+
//#endregion
|
|
39
56
|
export { useHover, useWindowResize };
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/useHover.ts","../src/useWindowResize.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/useHover.ts","../src/useWindowResize.ts"],"sourcesContent":["import { useCallback, useState } from 'react'\n\nexport type UseHover = (initialValue?: boolean) => {\n hover: boolean\n onMouseEnter: () => void\n onMouseLeave: () => void\n}\n\n/**\n * Simple hover-state hook that returns a boolean plus stable\n * `onMouseEnter`/`onMouseLeave` handlers ready to spread onto an element.\n */\nconst useHover: UseHover = (initial = false) => {\n const [hover, handleHover] = useState(initial)\n\n const setHover = useCallback(() => handleHover(true), [])\n const unsetHover = useCallback(() => handleHover(false), [])\n\n return {\n hover,\n onMouseEnter: setHover,\n onMouseLeave: unsetHover,\n }\n}\n\nexport default useHover\n","import { throttle } from '@vitus-labs/core'\nimport { useCallback, useEffect, useRef, useState } from 'react'\n\ntype Sizes = {\n width: number\n height: number\n}\n\nexport type UseWindowResize = (\n params?: Partial<{\n throttleDelay: number\n onChange: (params: Sizes) => void\n }>,\n initialValues?: Partial<Sizes>,\n) => Sizes\n\n/**\n * Tracks the browser viewport size, throttled to avoid excessive re-renders.\n * Reads `window.innerWidth`/`innerHeight` on mount and on every resize event.\n * An optional `onChange` callback fires alongside state updates.\n * Cleans up both the event listener and any pending throttled call on unmount.\n */\nconst useWindowResize: UseWindowResize = (\n { throttleDelay = 200, onChange } = {},\n { width = 0, height = 0 } = {},\n) => {\n const [windowSize, setWindowSize] = useState({ width, height })\n const onChangeRef = useRef(onChange)\n onChangeRef.current = onChange\n\n const updateSizes = useCallback(() => {\n const sizes = {\n width: window.innerWidth,\n height: window.innerHeight,\n }\n\n setWindowSize(sizes)\n if (onChangeRef.current) onChangeRef.current(sizes)\n }, [])\n\n useEffect(() => {\n updateSizes()\n }, [updateSizes])\n\n useEffect(() => {\n const throttled = throttle(updateSizes, throttleDelay)\n window.addEventListener('resize', throttled, false)\n\n return () => {\n window.removeEventListener('resize', throttled, false)\n throttled.cancel()\n }\n }, [updateSizes, throttleDelay])\n\n return windowSize\n}\n\nexport default useWindowResize\n"],"mappings":";;;;;;;;AAYA,MAAM,YAAsB,UAAU,UAAU;CAC9C,MAAM,CAAC,OAAO,eAAe,SAAS,QAAQ;AAK9C,QAAO;EACL;EACA,cALe,kBAAkB,YAAY,KAAK,EAAE,EAAE,CAAC;EAMvD,cALiB,kBAAkB,YAAY,MAAM,EAAE,EAAE,CAAC;EAM3D;;;;;;;;;;;ACAH,MAAM,mBACJ,EAAE,gBAAgB,KAAK,aAAa,EAAE,EACtC,EAAE,QAAQ,GAAG,SAAS,MAAM,EAAE,KAC3B;CACH,MAAM,CAAC,YAAY,iBAAiB,SAAS;EAAE;EAAO;EAAQ,CAAC;CAC/D,MAAM,cAAc,OAAO,SAAS;AACpC,aAAY,UAAU;CAEtB,MAAM,cAAc,kBAAkB;EACpC,MAAM,QAAQ;GACZ,OAAO,OAAO;GACd,QAAQ,OAAO;GAChB;AAED,gBAAc,MAAM;AACpB,MAAI,YAAY,QAAS,aAAY,QAAQ,MAAM;IAClD,EAAE,CAAC;AAEN,iBAAgB;AACd,eAAa;IACZ,CAAC,YAAY,CAAC;AAEjB,iBAAgB;EACd,MAAM,YAAY,SAAS,aAAa,cAAc;AACtD,SAAO,iBAAiB,UAAU,WAAW,MAAM;AAEnD,eAAa;AACX,UAAO,oBAAoB,UAAU,WAAW,MAAM;AACtD,aAAU,QAAQ;;IAEnB,CAAC,aAAa,cAAc,CAAC;AAEhC,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitus-labs/hooks",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3-alpha.56+ebabe78",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Vit Bokisch <vit@bokisch.cz>",
|
|
6
6
|
"maintainers": [
|
|
@@ -18,38 +18,37 @@
|
|
|
18
18
|
"homepage": "https://github.com/vitus-labs/ui-system/tree/master/packages/hooks",
|
|
19
19
|
"description": "Universal styles",
|
|
20
20
|
"scripts": {
|
|
21
|
-
"dev": "
|
|
22
|
-
"prepublish": "
|
|
23
|
-
"build": "
|
|
24
|
-
"build:watch": "
|
|
25
|
-
"lint
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"test": "
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"cover": "coveralls < .coverage/lcov.info"
|
|
21
|
+
"dev": "bun run vl_stories",
|
|
22
|
+
"prepublish": "bun run build",
|
|
23
|
+
"build": "bun run vl_rolldown_build",
|
|
24
|
+
"build:watch": "bun run vl_rolldown_build-watch",
|
|
25
|
+
"lint": "biome check src/",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:coverage": "vitest run --coverage",
|
|
28
|
+
"test:watch": "vitest",
|
|
29
|
+
"cover": "coveralls < .coverage/lcov.info",
|
|
30
|
+
"typecheck": "tsc --noEmit"
|
|
32
31
|
},
|
|
33
32
|
"publishConfig": {
|
|
34
33
|
"access": "public"
|
|
35
34
|
},
|
|
36
35
|
"repository": {
|
|
37
36
|
"type": "git",
|
|
38
|
-
"url": "
|
|
37
|
+
"url": "https://github.com/vitus-labs/ui-system",
|
|
38
|
+
"directory": "packages/hooks"
|
|
39
39
|
},
|
|
40
40
|
"bugs": {
|
|
41
41
|
"url": "https://github.com/vitus-labs/ui-system/issues"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@vitus-labs/core": "*",
|
|
45
|
-
"react": ">=
|
|
45
|
+
"react": ">= 19"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@vitus-labs/core": "1.2.
|
|
49
|
-
"@vitus-labs/tools-
|
|
50
|
-
"@vitus-labs/tools-
|
|
51
|
-
"@vitus-labs/tools-
|
|
52
|
-
"@vitus-labs/tools-typescript": "^1.5.0-alpha.0"
|
|
48
|
+
"@vitus-labs/core": "1.2.3-alpha.56+ebabe78",
|
|
49
|
+
"@vitus-labs/tools-rolldown": "^1.5.2-alpha.1",
|
|
50
|
+
"@vitus-labs/tools-storybook": "^1.5.2-alpha.1",
|
|
51
|
+
"@vitus-labs/tools-typescript": "^1.5.2-alpha.1"
|
|
53
52
|
},
|
|
54
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "ebabe785e9e7b488bbe13d0772b1a3c74a886e2d"
|
|
55
54
|
}
|
package/lib/types/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import useHover from './useHover';
|
|
2
|
-
import useWindowResize from './useWindowResize';
|
|
3
|
-
import type { UseHover } from './useHover';
|
|
4
|
-
import type { UseWindowResize } from './useWindowResize';
|
|
5
|
-
export type { UseHover, UseWindowResize };
|
|
6
|
-
export { useHover, useWindowResize };
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;AAEzC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAA"}
|
package/lib/types/useHover.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHover.d.ts","sourceRoot":"","sources":["../../src/useHover.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,CAAC,YAAY,CAAC,EAAE,OAAO,KAAK;IACjD,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB,CAAA;AAED,QAAA,MAAM,QAAQ,EAAE,QAWf,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type Sizes = {
|
|
2
|
-
width: number;
|
|
3
|
-
height: number;
|
|
4
|
-
};
|
|
5
|
-
export type UseWindowResize = (params?: Partial<{
|
|
6
|
-
throttleDelay: number;
|
|
7
|
-
onChange: (params: Sizes) => void;
|
|
8
|
-
}>, initialValues?: Partial<Sizes>) => Sizes;
|
|
9
|
-
declare const useWindowResize: UseWindowResize;
|
|
10
|
-
export default useWindowResize;
|
|
11
|
-
//# sourceMappingURL=useWindowResize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowResize.d.ts","sourceRoot":"","sources":["../../src/useWindowResize.ts"],"names":[],"mappings":"AAGA,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,CAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,KAAK,IAAI,CAAA;CAClC,CAAC,EACF,aAAa,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,KAC3B,KAAK,CAAA;AAEV,QAAA,MAAM,eAAe,EAAE,eA+BtB,CAAA;AAED,eAAe,eAAe,CAAA"}
|