@pdg/react-hook 1.0.33 → 1.0.35
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.
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { RefObject, SetStateAction } from 'react';
|
|
2
|
-
|
|
3
|
-
export declare function useAutoUpdateRefState<T
|
|
4
|
-
export declare function useAutoUpdateRefState<T
|
|
5
|
-
RefObject<T extends never ? StateT : T>,
|
|
6
|
-
T extends never ? StateT : T,
|
|
7
|
-
(value: SetStateAction<T | StateT>, skipCallback?: boolean) => T extends never ? StateT : T
|
|
8
|
-
];
|
|
2
|
+
import { Func } from '@pdg/types';
|
|
3
|
+
export declare function useAutoUpdateRefState<T, V extends T extends Func ? never : T, Result = T extends Func ? never : [RefObject<V>, V, (value: SetStateAction<V>) => V]>(state: T): Result;
|
|
4
|
+
export declare function useAutoUpdateRefState<T, V extends T extends Func ? never : T, Callback extends (state: V) => V, Result = T extends Func ? never : [RefObject<V>, V, (value: SetStateAction<V>, skipCallback?: boolean) => V]>(state: T, callback: Callback): Result;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { SetStateAction } from 'react';
|
|
2
|
-
|
|
3
|
-
export declare function useAutoUpdateState<T
|
|
4
|
-
export declare function useAutoUpdateState<T
|
|
5
|
-
T extends never ? StateT : T,
|
|
6
|
-
(value: SetStateAction<T | StateT>, skipCallback?: boolean) => T extends never ? StateT : T
|
|
7
|
-
];
|
|
2
|
+
import { Func } from '@pdg/types';
|
|
3
|
+
export declare function useAutoUpdateState<T, V extends T extends Func ? never : T, Result = T extends Func ? never : [V, (value: SetStateAction<V>) => V]>(state: T): Result;
|
|
4
|
+
export declare function useAutoUpdateState<T, V extends T extends Func ? never : T, Callback extends (state: V) => V, Result = T extends Func ? never : [V, (value: SetStateAction<V>, skipCallback?: boolean) => V]>(state: T, callback: Callback): Result;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdg/react-hook",
|
|
3
3
|
"title": "React Hook",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.35",
|
|
5
5
|
"description": "React Hook",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@eslint/js": "^9.28.0",
|
|
50
|
+
"@pdg/types": "^1.0.6",
|
|
50
51
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
51
52
|
"@rollup/plugin-eslint": "^9.0.5",
|
|
52
53
|
"@rollup/plugin-node-resolve": "^16.0.1",
|