@pdg/react-hook 1.0.26 → 1.0.27
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/clearIntervalRef.d.ts +1 -1
- package/dist/clearTimeoutRef.d.ts +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/dist/useAutoUpdateLayoutRefState.d.ts +4 -4
- package/dist/useAutoUpdateRef.d.ts +2 -2
- package/dist/useAutoUpdateRefState.d.ts +4 -4
- package/dist/useIntervalRef.d.ts +2 -2
- package/dist/useTimeoutRef.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -181,7 +181,7 @@ function useAutoUpdateLayoutRefState(state, callback) {
|
|
|
181
181
|
ref.current = undefined;
|
|
182
182
|
}
|
|
183
183
|
}function useTimeoutRef() {
|
|
184
|
-
var ref = useRef();
|
|
184
|
+
var ref = useRef(undefined);
|
|
185
185
|
useEffect(function () {
|
|
186
186
|
return function () {
|
|
187
187
|
clearTimeoutRef(ref);
|
|
@@ -216,7 +216,7 @@ function useAutoUpdateLayoutRefState(state, callback) {
|
|
|
216
216
|
ref.current = undefined;
|
|
217
217
|
}
|
|
218
218
|
}function useIntervalRef() {
|
|
219
|
-
var ref = useRef();
|
|
219
|
+
var ref = useRef(undefined);
|
|
220
220
|
useEffect(function () {
|
|
221
221
|
return function () {
|
|
222
222
|
clearIntervalRef(ref);
|
package/dist/index.js
CHANGED
|
@@ -181,7 +181,7 @@ function useAutoUpdateLayoutRefState(state, callback) {
|
|
|
181
181
|
ref.current = undefined;
|
|
182
182
|
}
|
|
183
183
|
}function useTimeoutRef() {
|
|
184
|
-
var ref = react.useRef();
|
|
184
|
+
var ref = react.useRef(undefined);
|
|
185
185
|
react.useEffect(function () {
|
|
186
186
|
return function () {
|
|
187
187
|
clearTimeoutRef(ref);
|
|
@@ -216,7 +216,7 @@ function useAutoUpdateLayoutRefState(state, callback) {
|
|
|
216
216
|
ref.current = undefined;
|
|
217
217
|
}
|
|
218
218
|
}function useIntervalRef() {
|
|
219
|
-
var ref = react.useRef();
|
|
219
|
+
var ref = react.useRef(undefined);
|
|
220
220
|
react.useEffect(function () {
|
|
221
221
|
return function () {
|
|
222
222
|
clearIntervalRef(ref);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function useAutoUpdateLayoutRefState<T>(state: Exclude<T, (...args: any[]) => any>): [
|
|
3
|
-
export declare function useAutoUpdateLayoutRefState<T>(state: Exclude<T, (...args: any[]) => any>, callback: (state: T) => T): [
|
|
1
|
+
import { RefObject, SetStateAction } from 'react';
|
|
2
|
+
export declare function useAutoUpdateLayoutRefState<T>(state: Exclude<T, (...args: any[]) => any>): [RefObject<T>, T, (value: SetStateAction<T>) => T];
|
|
3
|
+
export declare function useAutoUpdateLayoutRefState<T>(state: Exclude<T, (...args: any[]) => any>, callback: (state: T) => T): [RefObject<T>, T, (value: SetStateAction<T>, skipCallback?: boolean) => T];
|
|
4
4
|
export declare function useAutoUpdateLayoutRefState<T = never, StateT = never>(state: Exclude<StateT, (...args: any[]) => any>, callback: (state: T | StateT) => T extends never ? StateT : T): [
|
|
5
|
-
|
|
5
|
+
RefObject<T extends never ? StateT : T>,
|
|
6
6
|
T extends never ? StateT : T,
|
|
7
7
|
(value: SetStateAction<T | StateT>, skipCallback?: boolean) => T extends never ? StateT : T
|
|
8
8
|
];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function useAutoUpdateRef<T>(value: T):
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export declare function useAutoUpdateRef<T>(value: T): RefObject<T>;
|
|
3
3
|
export default useAutoUpdateRef;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function useAutoUpdateRefState<T>(state: Exclude<T, (...args: any[]) => any>): [
|
|
3
|
-
export declare function useAutoUpdateRefState<T>(state: Exclude<T, (...args: any[]) => any>, callback: (state: T) => T): [
|
|
1
|
+
import { RefObject, SetStateAction } from 'react';
|
|
2
|
+
export declare function useAutoUpdateRefState<T>(state: Exclude<T, (...args: any[]) => any>): [RefObject<T>, T, (value: SetStateAction<T>) => T];
|
|
3
|
+
export declare function useAutoUpdateRefState<T>(state: Exclude<T, (...args: any[]) => any>, callback: (state: T) => T): [RefObject<T>, T, (value: SetStateAction<T>, skipCallback?: boolean) => T];
|
|
4
4
|
export declare function useAutoUpdateRefState<T = never, StateT = never>(state: Exclude<StateT, (...args: any[]) => any>, callback: (state: T | StateT) => T extends never ? StateT : T): [
|
|
5
|
-
|
|
5
|
+
RefObject<T extends never ? StateT : T>,
|
|
6
6
|
T extends never ? StateT : T,
|
|
7
7
|
(value: SetStateAction<T | StateT>, skipCallback?: boolean) => T extends never ? StateT : T
|
|
8
8
|
];
|
package/dist/useIntervalRef.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type UseIntervalReturnValue = [
|
|
3
|
-
React.
|
|
4
|
-
(callback: (ref: React.
|
|
3
|
+
React.RefObject<NodeJS.Timeout | undefined>,
|
|
4
|
+
(callback: (ref: React.RefObject<NodeJS.Timeout | undefined>) => void, ms?: number) => void
|
|
5
5
|
];
|
|
6
6
|
export declare function useIntervalRef(): UseIntervalReturnValue;
|
|
7
7
|
export default useIntervalRef;
|
package/dist/useTimeoutRef.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type UseTimeoutReturnValue = [
|
|
3
|
-
React.
|
|
3
|
+
React.RefObject<NodeJS.Timeout | undefined>,
|
|
4
4
|
(callback: (args: void) => void, ms?: number) => void
|
|
5
5
|
];
|
|
6
6
|
export declare function useTimeoutRef(): UseTimeoutReturnValue;
|
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.27",
|
|
5
5
|
"description": "React Hook",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"rollup": "^4.39.0",
|
|
60
60
|
"rollup-plugin-delete": "^2.2.0",
|
|
61
61
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
62
|
-
"rollup-plugin-
|
|
62
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
63
63
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
64
64
|
"sass": "^1.86.3",
|
|
65
65
|
"typescript": "^5.8.3"
|