@zayne-labs/toolkit-react 0.9.54 → 0.9.55
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, useLifeCycle, useLocationState, useMountEffect, usePresence, useScrollObserver, useSearch, useSearchParams, useSearchParamsObject, 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, useLifeCycle, useLocationState, useMountEffect, usePresence, useScrollObserver, useSearch, useSearchParams, useSearchParamsObject, useStorageState, useStore, useThrottleByFrame, useThrottleBySetTimeout, useThrottleByTimer, useToggle, useUnmountEffect } from "../index-44MAU7Zb.js";
|
2
2
|
export { ContextError, CustomContextOptions, createCustomContext, createUseLocationState, createUseStorageState, getErrorMessage, useAfterMountEffect, useAnimateElementRefs, useAnimationInterval, useAsyncEffect, useCallbackRef, useClickOutside, useConstant, useCopyToClipboard, useDebouncedFn, useDebouncedState, useDisclosure, useEffectOnce, useIsServer, useLifeCycle, useLocationState, useMountEffect, usePresence, useScrollObserver, useSearch, useSearchParams, useSearchParamsObject, 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_core7 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
|
@@ -138,13 +138,13 @@ declare const useIsServer: () => boolean;
|
|
138
138
|
//#endregion
|
139
139
|
//#region src/hooks/useLocationState.d.ts
|
140
140
|
type UseLocationResult<TSlice> = [state: TSlice, actions: LocationStoreApi];
|
141
|
-
declare const createUseLocationState: (options?: LocationStoreOptions) => Omit<
|
142
|
-
push: (url: string |
|
143
|
-
state?:
|
141
|
+
declare const createUseLocationState: (options?: LocationStoreOptions) => Omit<_zayne_labs_toolkit_core7.StoreApi<_zayne_labs_toolkit_core7.URLInfoObject>, "setState" | "resetState"> & {
|
142
|
+
push: (url: string | _zayne_labs_toolkit_core7.PartialURLInfo, options?: {
|
143
|
+
state?: _zayne_labs_toolkit_core7.PartialURLInfo["state"];
|
144
144
|
}) => void;
|
145
145
|
replace: LocationStoreApi["push"];
|
146
146
|
triggerPopstateEvent: (nextLocationState?: LocationInfo["state"]) => void;
|
147
|
-
} & (<TSlice =
|
147
|
+
} & (<TSlice = _zayne_labs_toolkit_core7.URLInfoObject>(selector?: SelectorFn<LocationInfo, TSlice>) => UseLocationResult<TSlice>);
|
148
148
|
declare const useLocationState: <TSlice = LocationInfo>(selector?: SelectorFn<LocationInfo, TSlice>, options?: LocationStoreOptions) => UseLocationResult<TSlice>;
|
149
149
|
//#endregion
|
150
150
|
//#region src/hooks/useToggle.d.ts
|
@@ -208,11 +208,11 @@ type UseSearchParamsOptions = LocationStoreOptions & {
|
|
208
208
|
};
|
209
209
|
declare const useSearchParams: <TSearchParams extends URLSearchParamsInit>(options?: UseSearchParamsOptions) => readonly [URLSearchParams, {
|
210
210
|
(newQueryParams: TSearchParams | ((prev: URLSearchParams) => TSearchParams)): void;
|
211
|
-
triggerPopstateEvent: (nextLocationState?:
|
211
|
+
triggerPopstateEvent: (nextLocationState?: _zayne_labs_toolkit_core7.LocationInfo["state"]) => void;
|
212
212
|
}];
|
213
213
|
declare const useSearchParamsObject: <TSearchParams extends Record<string, string>>(options?: UseSearchParamsOptions) => readonly [TSearchParams, {
|
214
214
|
(newQueryParams: TSearchParams | ((prev: TSearchParams) => TSearchParams)): void;
|
215
|
-
triggerPopstateEvent: (nextLocationState?:
|
215
|
+
triggerPopstateEvent: (nextLocationState?: _zayne_labs_toolkit_core7.LocationInfo["state"]) => void;
|
216
216
|
}];
|
217
217
|
//#endregion
|
218
218
|
//#region src/hooks/useStorageState.d.ts
|
@@ -221,7 +221,7 @@ type UseStorageResult<TState, TSlice = TState> = [state: TSlice, actions: Storag
|
|
221
221
|
* @description Creates a custom hook that returns a storage state and actions to modify it. You can use this if you need shared options.
|
222
222
|
* @note You must use this if you want to be able to prevent syncing state across tabs.
|
223
223
|
*/
|
224
|
-
declare const createUseStorageState: <TState>(baseOptions: StorageOptions<TState>) =>
|
224
|
+
declare const createUseStorageState: <TState>(baseOptions: StorageOptions<TState>) => _zayne_labs_toolkit_core7.StoreApi<TState> & {
|
225
225
|
removeState: () => void;
|
226
226
|
} & (<TSlice = TState>(selector?: SelectorFn<TState, TSlice>) => UseStorageResult<TState, TSlice>);
|
227
227
|
type UseStorageStateOptions<TValue> = Omit<StorageOptions<TValue>, "initialValue" | "key">;
|
@@ -244,4 +244,4 @@ declare const useThrottleByFrame: <TParams>(callbackFn: CallbackFn<TParams>) =>
|
|
244
244
|
};
|
245
245
|
//#endregion
|
246
246
|
export { ContextError, CustomContextOptions, createCustomContext, createUseLocationState, createUseStorageState, getErrorMessage, useAfterMountEffect, useAnimateElementRefs, useAnimationInterval, useAsyncEffect, useCallbackRef, useClickOutside, useConstant, useCopyToClipboard, useDebouncedFn, useDebouncedState, useDisclosure, useEffectOnce, useIsServer, useLifeCycle, useLocationState, useMountEffect, usePresence, useScrollObserver, useSearch, useSearchParams, useSearchParamsObject, useStorageState, useStore, useThrottleByFrame, useThrottleBySetTimeout, useThrottleByTimer, useToggle, useUnmountEffect };
|
247
|
-
//# sourceMappingURL=index-
|
247
|
+
//# sourceMappingURL=index-44MAU7Zb.d.ts.map
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { CustomContextOptions } from "../index-
|
1
|
+
import { CustomContextOptions } from "../index-44MAU7Zb.js";
|
2
2
|
import { AnyObject, Prettify, SelectorFn } from "@zayne-labs/toolkit-type-helpers";
|
3
|
-
import * as
|
3
|
+
import * as react0 from "react";
|
4
4
|
import { StoreApi } from "@zayne-labs/toolkit-core";
|
5
|
-
import * as
|
5
|
+
import * as zustand2 from "zustand";
|
6
6
|
import { Mutate, StateCreator as StateCreator$1, StoreApi as StoreApi$1, StoreMutatorIdentifier, UseBoundStore } from "zustand";
|
7
7
|
|
8
8
|
//#region src/zustand/createZustandContext.d.ts
|
@@ -14,13 +14,13 @@ declare const createZustandContext: <TState extends Record<string, unknown>, TSt
|
|
14
14
|
store?: undefined;
|
15
15
|
}) & {
|
16
16
|
children: React.ReactNode;
|
17
|
-
}) =>
|
17
|
+
}) => react0.DetailedReactHTMLElement<react0.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, useZustandStoreContext: <TResult = TState>(selector?: SelectorFn<TState, TResult>) => TResult];
|
18
18
|
//#endregion
|
19
19
|
//#region src/zustand/createZustandStoreWithCombine.d.ts
|
20
20
|
type Write<TInitialState, TExtraState> = Prettify<Omit<TInitialState, keyof TExtraState> & TExtraState>;
|
21
21
|
declare const combine: <TInitialState extends AnyObject, TExtraState extends AnyObject, Mps extends Array<[StoreMutatorIdentifier, unknown]> = [], Mcs extends Array<[StoreMutatorIdentifier, unknown]> = []>(initialState: TInitialState, storeCreator: StateCreator$1<TInitialState, Mps, Mcs, TExtraState>) => StateCreator$1<Write<TInitialState, TExtraState>, Mps, Mcs>;
|
22
|
-
declare const createStoreWithCombine: <TInitialState extends AnyObject, TExtraState extends AnyObject>(...params: Parameters<typeof combine<TInitialState, TExtraState>>) =>
|
23
|
-
declare const createWithCombine: <TInitialState extends AnyObject, TExtraState extends AnyObject>(...params: Parameters<typeof combine<TInitialState, TExtraState>>) =>
|
22
|
+
declare const createStoreWithCombine: <TInitialState extends AnyObject, TExtraState extends AnyObject>(...params: Parameters<typeof combine<TInitialState, TExtraState>>) => zustand2.StoreApi<Omit<TInitialState, keyof TExtraState> & TExtraState extends infer T ? { [Key in keyof T]: (Omit<TInitialState, keyof TExtraState> & TExtraState)[Key] } : never>;
|
23
|
+
declare const createWithCombine: <TInitialState extends AnyObject, TExtraState extends AnyObject>(...params: Parameters<typeof combine<TInitialState, TExtraState>>) => zustand2.UseBoundStore<zustand2.StoreApi<Omit<TInitialState, keyof TExtraState> & TExtraState extends infer T ? { [Key in keyof T]: (Omit<TInitialState, keyof TExtraState> & TExtraState)[Key] } : never>>;
|
24
24
|
//#endregion
|
25
25
|
//#region src/zustand/createZustandStoreWithSubscribe.d.ts
|
26
26
|
type Get<T, K, F> = K extends keyof T ? T[K] : F;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zayne-labs/toolkit-react",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.9.
|
4
|
+
"version": "0.9.55",
|
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.9.
|
51
|
-
"@zayne-labs/toolkit-type-helpers": "0.9.
|
50
|
+
"@zayne-labs/toolkit-core": "0.9.55",
|
51
|
+
"@zayne-labs/toolkit-type-helpers": "0.9.55"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
54
|
"@arethetypeswrong/cli": "^0.18.2",
|