@trackunit/react-components 0.1.215 → 0.1.216
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LocalStorageCallbacks, LocalStorageParams } from "./types";
|
|
2
|
-
type ValidateStateOptions<
|
|
3
|
-
state:
|
|
4
|
-
defaultState:
|
|
2
|
+
type ValidateStateOptions<TState> = Required<Pick<LocalStorageParams<TState>, "schema">> & {
|
|
3
|
+
state: TState;
|
|
4
|
+
defaultState: TState;
|
|
5
5
|
} & LocalStorageCallbacks;
|
|
6
6
|
/**
|
|
7
7
|
* Validates the state object using a Zod schema.
|
|
@@ -10,4 +10,4 @@ export type DebounceDirection = "in" | "out" | "both";
|
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
export declare const useDebounce: <
|
|
13
|
+
export declare const useDebounce: <TValue>(value: TValue, delay?: number, direction?: DebounceDirection) => TValue;
|
|
@@ -6,4 +6,4 @@ import { Dispatch, SetStateAction } from "react";
|
|
|
6
6
|
*
|
|
7
7
|
* If no custom state is provided, the fallback state will be used and it works like a normal useState hook.
|
|
8
8
|
*/
|
|
9
|
-
export declare const useOptionallyElevatedState: <
|
|
9
|
+
export declare const useOptionallyElevatedState: <TState>(initialState: TState, customState?: [TState, Dispatch<SetStateAction<TState>>] | undefined) => [TState, Dispatch<SetStateAction<TState>>];
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @returns {boolean} Returns true if it is the first render, false otherwise.
|
|
6
6
|
*/
|
|
7
|
-
export declare const useSelfUpdatingRef: <
|
|
7
|
+
export declare const useSelfUpdatingRef: <TState>(initialState: TState) => import("react").MutableRefObject<TState>;
|