@zayne-labs/toolkit-react 0.10.3 → 0.10.5
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,2 +1,2 @@
|
|
|
1
|
-
import { ContextError, CustomContextOptions, createCustomContext, createUseLocationState, createUseStorageState, getErrorMessage, useAfterMountEffect, useAnimateElementRefs, useAnimationInterval, useAsyncEffect, useCallbackRef, useClickOutside, useConstant, useCopyToClipboard, useDebouncedFn, useDebouncedState, useDisclosure, useEffectOnce, useIsServer, useLazyRef, useLifeCycle, useLocationState, useMountEffect, usePresence, useScrollObserver, useSearch, useSearchParams, useSearchParamsObject, useShallowComparedSelector, useShallowComparedValue, useStorageState, useStore, useThrottleByFrame, useThrottleBySetTimeout, useThrottleByTimer, useToggle, useUnmountEffect } from "../index-
|
|
1
|
+
import { ContextError, CustomContextOptions, createCustomContext, createUseLocationState, createUseStorageState, getErrorMessage, useAfterMountEffect, useAnimateElementRefs, useAnimationInterval, useAsyncEffect, useCallbackRef, useClickOutside, useConstant, useCopyToClipboard, useDebouncedFn, useDebouncedState, useDisclosure, useEffectOnce, useIsServer, useLazyRef, useLifeCycle, useLocationState, useMountEffect, usePresence, useScrollObserver, useSearch, useSearchParams, useSearchParamsObject, useShallowComparedSelector, useShallowComparedValue, useStorageState, useStore, useThrottleByFrame, useThrottleBySetTimeout, useThrottleByTimer, useToggle, useUnmountEffect } from "../index-BIGErP1D.js";
|
|
2
2
|
export { ContextError, CustomContextOptions, createCustomContext, createUseLocationState, createUseStorageState, getErrorMessage, useAfterMountEffect, useAnimateElementRefs, useAnimationInterval, useAsyncEffect, useCallbackRef, useClickOutside, useConstant, useCopyToClipboard, useDebouncedFn, useDebouncedState, useDisclosure, useEffectOnce, useIsServer, useLazyRef, useLifeCycle, useLocationState, useMountEffect, usePresence, useScrollObserver, useSearch, useSearchParams, useSearchParamsObject, useShallowComparedSelector, useShallowComparedValue, useStorageState, useStore, useThrottleByFrame, useThrottleBySetTimeout, useThrottleByTimer, useToggle, useUnmountEffect };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyFunction, CallbackFn, NonEmptyArray, Prettify, SelectorFn } from "@zayne-labs/toolkit-type-helpers";
|
|
2
2
|
import * as react5 from "react";
|
|
3
3
|
import { RefCallback, useEffect } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _zayne_labs_toolkit_core12 from "@zayne-labs/toolkit-core";
|
|
5
5
|
import { AnimationIntervalOptions, LocationInfo, LocationStoreApi, LocationStoreOptions, ScrollObserverOptions, StorageOptions, StorageStoreApi, StoreApi, URLSearchParamsInit } from "@zayne-labs/toolkit-core";
|
|
6
6
|
|
|
7
7
|
//#region src/hooks/createCustomContext.d.ts
|
|
@@ -139,13 +139,13 @@ declare const useIsServer: () => boolean;
|
|
|
139
139
|
//#endregion
|
|
140
140
|
//#region src/hooks/useLocationState.d.ts
|
|
141
141
|
type UseLocationResult<TSlice> = [state: TSlice, actions: LocationStoreApi];
|
|
142
|
-
declare const createUseLocationState: (options?: LocationStoreOptions) => Omit<
|
|
143
|
-
push: (url: string |
|
|
144
|
-
state?:
|
|
142
|
+
declare const createUseLocationState: (options?: LocationStoreOptions) => Omit<_zayne_labs_toolkit_core12.StoreApi<_zayne_labs_toolkit_core12.URLInfoObject>, "setState" | "resetState"> & {
|
|
143
|
+
push: (url: string | _zayne_labs_toolkit_core12.PartialURLInfo, options?: {
|
|
144
|
+
state?: _zayne_labs_toolkit_core12.PartialURLInfo["state"];
|
|
145
145
|
}) => void;
|
|
146
146
|
replace: LocationStoreApi["push"];
|
|
147
147
|
triggerPopstateEvent: (nextLocationState?: LocationInfo["state"]) => void;
|
|
148
|
-
} & (<TSlice =
|
|
148
|
+
} & (<TSlice = _zayne_labs_toolkit_core12.URLInfoObject>(selector?: SelectorFn<LocationInfo, TSlice>) => UseLocationResult<TSlice>);
|
|
149
149
|
declare const useLocationState: <TSlice = LocationInfo>(selector?: SelectorFn<LocationInfo, TSlice>, options?: LocationStoreOptions) => UseLocationResult<TSlice>;
|
|
150
150
|
//#endregion
|
|
151
151
|
//#region src/hooks/useToggle.d.ts
|
|
@@ -209,11 +209,11 @@ type UseSearchParamsOptions = LocationStoreOptions & {
|
|
|
209
209
|
};
|
|
210
210
|
declare const useSearchParams: <TSearchParams extends URLSearchParamsInit>(options?: UseSearchParamsOptions) => readonly [URLSearchParams, {
|
|
211
211
|
(newQueryParams: TSearchParams | ((prev: URLSearchParams) => TSearchParams)): void;
|
|
212
|
-
triggerPopstateEvent: (nextLocationState?:
|
|
212
|
+
triggerPopstateEvent: (nextLocationState?: _zayne_labs_toolkit_core12.LocationInfo["state"]) => void;
|
|
213
213
|
}];
|
|
214
214
|
declare const useSearchParamsObject: <TSearchParams extends Record<string, string>>(options?: UseSearchParamsOptions) => readonly [TSearchParams, {
|
|
215
215
|
(newQueryParams: TSearchParams | ((prev: TSearchParams) => TSearchParams)): void;
|
|
216
|
-
triggerPopstateEvent: (nextLocationState?:
|
|
216
|
+
triggerPopstateEvent: (nextLocationState?: _zayne_labs_toolkit_core12.LocationInfo["state"]) => void;
|
|
217
217
|
}];
|
|
218
218
|
//#endregion
|
|
219
219
|
//#region src/hooks/useShallowCompare.d.ts
|
|
@@ -226,7 +226,7 @@ type UseStorageResult<TState, TSlice = TState> = [state: TSlice, actions: Storag
|
|
|
226
226
|
* @description Creates a custom hook that returns a storage state and actions to modify it. You can use this if you need shared options.
|
|
227
227
|
* @note You must use this if you want to be able to prevent syncing state across tabs.
|
|
228
228
|
*/
|
|
229
|
-
declare const createUseStorageState: <TState>(baseOptions: StorageOptions<TState>) =>
|
|
229
|
+
declare const createUseStorageState: <TState>(baseOptions: StorageOptions<TState>) => _zayne_labs_toolkit_core12.StoreApi<TState> & {
|
|
230
230
|
removeState: () => void;
|
|
231
231
|
} & (<TSlice = TState>(selector?: SelectorFn<TState, TSlice>) => UseStorageResult<TState, TSlice>);
|
|
232
232
|
type UseStorageStateOptions<TValue> = Omit<StorageOptions<TValue>, "initialValue" | "key">;
|
|
@@ -249,4 +249,4 @@ declare const useThrottleByFrame: <TParams>(callbackFn: CallbackFn<TParams>) =>
|
|
|
249
249
|
};
|
|
250
250
|
//#endregion
|
|
251
251
|
export { ContextError, CustomContextOptions, createCustomContext, createUseLocationState, createUseStorageState, getErrorMessage, useAfterMountEffect, useAnimateElementRefs, useAnimationInterval, useAsyncEffect, useCallbackRef, useClickOutside, useConstant, useCopyToClipboard, useDebouncedFn, useDebouncedState, useDisclosure, useEffectOnce, useIsServer, useLazyRef, useLifeCycle, useLocationState, useMountEffect, usePresence, useScrollObserver, useSearch, useSearchParams, useSearchParamsObject, useShallowComparedSelector, useShallowComparedValue, useStorageState, useStore, useThrottleByFrame, useThrottleBySetTimeout, useThrottleByTimer, useToggle, useUnmountEffect };
|
|
252
|
-
//# sourceMappingURL=index-
|
|
252
|
+
//# sourceMappingURL=index-BIGErP1D.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomContextOptions } from "../index-
|
|
1
|
+
import { CustomContextOptions } from "../index-BIGErP1D.js";
|
|
2
2
|
import { AnyObject, Prettify, SelectorFn } from "@zayne-labs/toolkit-type-helpers";
|
|
3
3
|
import * as react0 from "react";
|
|
4
4
|
import { StoreApi } from "@zayne-labs/toolkit-core";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zayne-labs/toolkit-react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.5",
|
|
5
5
|
"description": "A collection of utility functions, types and composables used by my other projects. Nothing too fancy but can be useful.",
|
|
6
6
|
"author": "Ryan Zayne",
|
|
7
7
|
"license": "MIT",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@zayne-labs/toolkit-core": "0.10.
|
|
51
|
-
"@zayne-labs/toolkit-type-helpers": "0.10.
|
|
50
|
+
"@zayne-labs/toolkit-core": "0.10.5",
|
|
51
|
+
"@zayne-labs/toolkit-type-helpers": "0.10.5"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@arethetypeswrong/cli": "^0.18.2",
|