@zayne-labs/toolkit-react 0.12.8 → 0.12.9
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/esm/hooks/index.d.ts +1 -1
- package/dist/esm/{index-BxZryp9p.d.ts → index-BuczfOir.d.ts} +9 -9
- package/dist/esm/{types-CaQ6cPGr.d.ts → types-DHraAX02.d.ts} +2 -2
- package/dist/esm/zustand/compatible/index.d.ts +2 -2
- package/dist/esm/zustand/new-implementation/index.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as useUnmountEffect, B as getErrorMessage, C as useConstant, D as useCallbackRef, E as useClickOutside, F as useAfterMountEffect, I as ContextError, L as CustomContextOptions, M as useLifeCycle, N as useEffectOnce, O as useAnimationInterval, P as useAsyncEffect, R as UseCustomContext, S as useControllableState, T as useComposeRefs, _ as useDisclosure, a as useStore, b as useCopyToClipboard, c as useShallowCompSelector, d as useSearchParamsObject, f as useSearch, g as useIsHydrated, h as useLocationState, i as useThrottleByTimer, j as useMountEffect, k as useAnimateElementRefs, l as useShallowCompValue, m as createUseLocationState, n as useThrottleByFrame, o as createUseStorageState, p as useScrollObserver, r as useThrottleBySetTimeout, s as useStorageState, t as useToggle, u as useSearchParams, v as useDebouncedFn, w as useLazyRef, x as useControllableProp, y as useDebouncedState, z as createCustomContext } from "../index-
|
|
1
|
+
import { A as useUnmountEffect, B as getErrorMessage, C as useConstant, D as useCallbackRef, E as useClickOutside, F as useAfterMountEffect, I as ContextError, L as CustomContextOptions, M as useLifeCycle, N as useEffectOnce, O as useAnimationInterval, P as useAsyncEffect, R as UseCustomContext, S as useControllableState, T as useComposeRefs, _ as useDisclosure, a as useStore, b as useCopyToClipboard, c as useShallowCompSelector, d as useSearchParamsObject, f as useSearch, g as useIsHydrated, h as useLocationState, i as useThrottleByTimer, j as useMountEffect, k as useAnimateElementRefs, l as useShallowCompValue, m as createUseLocationState, n as useThrottleByFrame, o as createUseStorageState, p as useScrollObserver, r as useThrottleBySetTimeout, s as useStorageState, t as useToggle, u as useSearchParams, v as useDebouncedFn, w as useLazyRef, x as useControllableProp, y as useDebouncedState, z as createCustomContext } from "../index-BuczfOir.js";
|
|
2
2
|
import "../index--n6VOfXE.js";
|
|
3
3
|
export { ContextError, CustomContextOptions, UseCustomContext, createCustomContext, createUseLocationState, createUseStorageState, getErrorMessage, useAfterMountEffect, useAnimateElementRefs, useAnimationInterval, useAsyncEffect, useCallbackRef, useClickOutside, useComposeRefs, useConstant, useControllableProp, useControllableState, useCopyToClipboard, useDebouncedFn, useDebouncedState, useDisclosure, useEffectOnce, useIsHydrated, useLazyRef, useLifeCycle, useLocationState, useMountEffect, useScrollObserver, useSearch, useSearchParams, useSearchParamsObject, useShallowCompSelector, useShallowCompValue, useStorageState, useStore, useThrottleByFrame, useThrottleBySetTimeout, useThrottleByTimer, useToggle, useUnmountEffect };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { D as PossibleRef, f as StateSetter } from "./index--n6VOfXE.js";
|
|
2
2
|
import * as react0 from "react";
|
|
3
3
|
import { RefCallback, useEffect } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _zayne_labs_toolkit_core0 from "@zayne-labs/toolkit-core";
|
|
5
5
|
import { AllowedClipboardItems, AnimationIntervalOptions, CopyToClipboardOptions, LocationInfo, LocationStoreApi, LocationStoreOptions, ScrollObserverOptions, StorageOptions, StorageStoreApi, StoreApi, URLSearchParamsInit } from "@zayne-labs/toolkit-core";
|
|
6
6
|
import { AnyFunction, CallbackFn, NonEmptyArray, Prettify, SelectorFn } from "@zayne-labs/toolkit-type-helpers";
|
|
7
7
|
|
|
@@ -217,13 +217,13 @@ declare const useIsHydrated: () => boolean;
|
|
|
217
217
|
//#endregion
|
|
218
218
|
//#region src/hooks/useLocationState.d.ts
|
|
219
219
|
type UseLocationResult<TSlice> = [state: TSlice, actions: LocationStoreApi];
|
|
220
|
-
declare const createUseLocationState: (options?: LocationStoreOptions) => Omit<
|
|
221
|
-
push: (url: string |
|
|
222
|
-
state?:
|
|
220
|
+
declare const createUseLocationState: (options?: LocationStoreOptions) => Omit<_zayne_labs_toolkit_core0.StoreApi<_zayne_labs_toolkit_core0.URLInfoObject>, "resetState" | "setState"> & {
|
|
221
|
+
push: (url: string | _zayne_labs_toolkit_core0.PartialURLInfo, options?: {
|
|
222
|
+
state?: _zayne_labs_toolkit_core0.PartialURLInfo["state"];
|
|
223
223
|
}) => void;
|
|
224
224
|
replace: LocationStoreApi["push"];
|
|
225
225
|
triggerPopstateEvent: (nextLocationState?: LocationInfo["state"]) => void;
|
|
226
|
-
} & (<TSlice =
|
|
226
|
+
} & (<TSlice = _zayne_labs_toolkit_core0.URLInfoObject>(selector?: SelectorFn<LocationInfo, TSlice>) => UseLocationResult<TSlice>);
|
|
227
227
|
declare const useLocationState: <TSlice = LocationInfo>(selector?: SelectorFn<LocationInfo, TSlice>, options?: LocationStoreOptions) => UseLocationResult<TSlice>;
|
|
228
228
|
//#endregion
|
|
229
229
|
//#region src/hooks/useScrollObserver.d.ts
|
|
@@ -244,8 +244,8 @@ declare const useSearch: <TData>(initialData: TData[], delay?: number) => {
|
|
|
244
244
|
type UseSearchParamsOptions = LocationStoreOptions & {
|
|
245
245
|
action?: "push" | "replace";
|
|
246
246
|
};
|
|
247
|
-
declare const useSearchParams: <TSearchParams extends URLSearchParamsInit>(options?: UseSearchParamsOptions) => [searchParams: URLSearchParams, setSearchParams: (newQueryParams: TSearchParams | ((prev: URLSearchParams) => TSearchParams)) => void, triggerPopstateEvent: (nextLocationState?:
|
|
248
|
-
declare const useSearchParamsObject: <TSearchParams extends Record<string, string>>(options?: UseSearchParamsOptions) => [searchParamsObject: TSearchParams, setSearchParamsObject: (newQueryParams: TSearchParams | ((prev: TSearchParams) => TSearchParams)) => void, triggerPopstateEvent: (nextLocationState?:
|
|
247
|
+
declare const useSearchParams: <TSearchParams extends URLSearchParamsInit>(options?: UseSearchParamsOptions) => [searchParams: URLSearchParams, setSearchParams: (newQueryParams: TSearchParams | ((prev: URLSearchParams) => TSearchParams)) => void, triggerPopstateEvent: (nextLocationState?: _zayne_labs_toolkit_core0.LocationInfo["state"]) => void];
|
|
248
|
+
declare const useSearchParamsObject: <TSearchParams extends Record<string, string>>(options?: UseSearchParamsOptions) => [searchParamsObject: TSearchParams, setSearchParamsObject: (newQueryParams: TSearchParams | ((prev: TSearchParams) => TSearchParams)) => void, triggerPopstateEvent: (nextLocationState?: _zayne_labs_toolkit_core0.LocationInfo["state"]) => void];
|
|
249
249
|
//#endregion
|
|
250
250
|
//#region src/hooks/useShallowCompare.d.ts
|
|
251
251
|
declare const useShallowCompSelector: <TState, TResult>(selector: SelectorFn<TState, TResult> | undefined) => (state: TState) => TResult;
|
|
@@ -257,7 +257,7 @@ type UseStorageResult<TState, TSlice = TState> = [state: TSlice, actions: Storag
|
|
|
257
257
|
* @description Creates a custom hook that returns a storage state and actions to modify it. You can use this if you need shared options.
|
|
258
258
|
* @note You must use this if you want to be able to prevent syncing state across tabs.
|
|
259
259
|
*/
|
|
260
|
-
declare const createUseStorageState: <TState>(baseOptions: StorageOptions<TState>) =>
|
|
260
|
+
declare const createUseStorageState: <TState>(baseOptions: StorageOptions<TState>) => _zayne_labs_toolkit_core0.StoreApi<TState> & {
|
|
261
261
|
removeState: () => void;
|
|
262
262
|
} & (<TSlice = TState>(selector?: SelectorFn<TState, TSlice>) => UseStorageResult<TState, TSlice>);
|
|
263
263
|
type UseStorageStateOptions<TValue> = Omit<StorageOptions<TValue>, "initialValue" | "key">;
|
|
@@ -284,4 +284,4 @@ type InitialState = boolean | (() => boolean);
|
|
|
284
284
|
declare const useToggle: (initialValue?: InitialState) => [value: boolean, toggleValue: <TValue>(newValue?: TValue) => void];
|
|
285
285
|
//#endregion
|
|
286
286
|
export { useUnmountEffect as A, getErrorMessage as B, useConstant as C, useCallbackRef as D, useClickOutside as E, useAfterMountEffect as F, ContextError as I, CustomContextOptions as L, useLifeCycle as M, useEffectOnce as N, useAnimationInterval as O, useAsyncEffect as P, UseCustomContext as R, useControllableState as S, useComposeRefs as T, useDisclosure as _, useStore as a, useCopyToClipboard as b, useShallowCompSelector as c, useSearchParamsObject as d, useSearch as f, useIsHydrated as g, useLocationState as h, useThrottleByTimer as i, useMountEffect as j, useAnimateElementRefs as k, useShallowCompValue as l, createUseLocationState as m, useThrottleByFrame as n, createUseStorageState as o, useScrollObserver as p, useThrottleBySetTimeout as r, useStorageState as s, useToggle as t, useSearchParams as u, useDebouncedFn as v, useLazyRef as w, useControllableProp as x, useDebouncedState as y, createCustomContext as z };
|
|
287
|
-
//# sourceMappingURL=index-
|
|
287
|
+
//# sourceMappingURL=index-BuczfOir.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as CustomContextOptions } from "./index-
|
|
1
|
+
import { L as CustomContextOptions } from "./index-BuczfOir.js";
|
|
2
2
|
import * as react11 from "react";
|
|
3
3
|
import { StoreApi } from "@zayne-labs/toolkit-core";
|
|
4
4
|
import { SelectorFn } from "@zayne-labs/toolkit-type-helpers";
|
|
@@ -24,4 +24,4 @@ interface StoreMutators<S, A> {}
|
|
|
24
24
|
type StoreMutatorIdentifier = keyof StoreMutators<unknown, unknown>;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { createZustandContext as a, UseBoundStore as i, Mutate as n, StoreMutatorIdentifier as r, Get as t };
|
|
27
|
-
//# sourceMappingURL=types-
|
|
27
|
+
//# sourceMappingURL=types-DHraAX02.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../index-
|
|
1
|
+
import "../../index-BuczfOir.js";
|
|
2
2
|
import "../../index--n6VOfXE.js";
|
|
3
|
-
import { a as createZustandContext, i as UseBoundStore, t as Get } from "../../types-
|
|
3
|
+
import { a as createZustandContext, i as UseBoundStore, t as Get } from "../../types-DHraAX02.js";
|
|
4
4
|
import { StoreApi } from "@zayne-labs/toolkit-core";
|
|
5
5
|
import { Mutate, StoreMutatorIdentifier } from "zustand";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../index-
|
|
1
|
+
import "../../index-BuczfOir.js";
|
|
2
2
|
import "../../index--n6VOfXE.js";
|
|
3
|
-
import { a as createZustandContext, i as UseBoundStore, n as Mutate, r as StoreMutatorIdentifier, t as Get } from "../../types-
|
|
3
|
+
import { a as createZustandContext, i as UseBoundStore, n as Mutate, r as StoreMutatorIdentifier, t as Get } from "../../types-DHraAX02.js";
|
|
4
4
|
import { StoreApi } from "@zayne-labs/toolkit-core";
|
|
5
5
|
|
|
6
6
|
//#region src/zustand/new-implementation/createReactStore.d.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zayne-labs/toolkit-react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.9",
|
|
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",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@zayne-labs/toolkit-core": "0.12.
|
|
53
|
-
"@zayne-labs/toolkit-type-helpers": "0.12.
|
|
52
|
+
"@zayne-labs/toolkit-core": "0.12.9",
|
|
53
|
+
"@zayne-labs/toolkit-type-helpers": "0.12.9"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@arethetypeswrong/cli": "^0.18.2",
|