@websolutespa/bom-mixer-hooks 0.0.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @websolutespa/bom-mixer-hooks
2
+
3
+ ## 0.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Added: first release.
@@ -0,0 +1,551 @@
1
+ import * as React$1 from 'react';
2
+ import React__default, { RefObject, Dispatch, SetStateAction, MutableRefObject, ComponentProps, useEffect } from 'react';
3
+ import { FetchRequestOptions, ISchema, IEquatable } from '@websolutespa/bom-mixer-core';
4
+ import * as zustand_middleware from 'zustand/middleware';
5
+ import { StateStorage } from 'zustand/middleware';
6
+ import * as zustand from 'zustand';
7
+ import { ICartItem, ICartAddItem, IAddressOptions, ICheckoutPartial, IFeatureType, ILayout, IPage, IUser } from '@websolutespa/bom-mixer-models';
8
+ import { NextRouter } from 'next/router';
9
+
10
+ declare function useApiFetch<T = any>(pathname: string, options?: FetchRequestOptions): [T | undefined, boolean, any, React$1.Dispatch<any>];
11
+ declare function useApiGet<T = any>(pathname: string, options?: FetchRequestOptions): [T | undefined, boolean, any, React$1.Dispatch<any>];
12
+ declare function useApiPost<T = any>(pathname: string, payload: unknown, options?: FetchRequestOptions): [T | undefined, boolean, any, React$1.Dispatch<any>];
13
+ declare function useApiPut<T = any>(pathname: string, payload: unknown, options?: FetchRequestOptions): [T | undefined, boolean, any, React$1.Dispatch<any>];
14
+ declare function useApiPatch<T = any>(pathname: string, payload: unknown, options?: FetchRequestOptions): [T | undefined, boolean, any, React$1.Dispatch<any>];
15
+ declare function useApiDelete<T = any>(pathname: string, options?: FetchRequestOptions): [T | undefined, boolean, any, React$1.Dispatch<any>];
16
+ type Api = {
17
+ get: <T = any>(pathname: string, options?: FetchRequestOptions) => Promise<T>;
18
+ post: <T = any>(pathname: string, payload?: unknown, options?: FetchRequestOptions) => Promise<T>;
19
+ put: <T = any>(pathname: string, payload?: unknown, options?: FetchRequestOptions) => Promise<T>;
20
+ patch: <T = any>(pathname: string, payload?: unknown, options?: FetchRequestOptions) => Promise<T>;
21
+ delete: <T = any>(pathname: string, options?: FetchRequestOptions) => Promise<T>;
22
+ };
23
+ declare function useApi(): Api;
24
+
25
+ declare function useBodyScroll(elementRef?: RefObject<HTMLElement> | null, options?: BodyScrollOptions): [boolean, Dispatch<SetStateAction<boolean>>];
26
+ declare function getOwnerPaddingRight(element: Element): number;
27
+ declare function getOwnerScrollbarWidth(element: Element): number;
28
+ type ElementStackItem = {
29
+ overflow: string;
30
+ paddingRight: string;
31
+ };
32
+ type BodyScrollOptions = {
33
+ scrollLayer?: boolean;
34
+ delayReset?: number;
35
+ };
36
+
37
+ type BreakpointType = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
38
+ type Breakpoint = {
39
+ key: BreakpointType;
40
+ min: number;
41
+ max: number;
42
+ };
43
+ declare function useBreakpoint(): Breakpoint;
44
+
45
+ type CartProps = {
46
+ hydrated: boolean;
47
+ items: ICartItem[];
48
+ };
49
+ type CartActions = {
50
+ count(): number;
51
+ has(item: ISchema): boolean;
52
+ find(item: ISchema): ICartItem | undefined;
53
+ add(item: ICartAddItem, qty?: number): void;
54
+ remove(item: ISchema): number;
55
+ update(item: ICartItem): void;
56
+ clear(): void;
57
+ };
58
+ type CartState = CartProps & {
59
+ actions: CartActions;
60
+ };
61
+ declare const CartContext: React$1.Context<(Omit<zustand.StoreApi<CartState>, "persist"> & {
62
+ persist: {
63
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<CartState, unknown>>) => void;
64
+ clearStorage: () => void;
65
+ rehydrate: () => void | Promise<void>;
66
+ hasHydrated: () => boolean;
67
+ onHydrate: (fn: (state: CartState) => void) => () => void;
68
+ onFinishHydration: (fn: (state: CartState) => void) => () => void;
69
+ getOptions: () => Partial<zustand_middleware.PersistOptions<CartState, unknown>>;
70
+ };
71
+ }) | null>;
72
+ type CartProviderProps = React.PropsWithChildren<{
73
+ items?: ICartItem[];
74
+ storage?: StateStorage;
75
+ }>;
76
+ declare function CartProvider({ children, ...props }: CartProviderProps): JSX.Element;
77
+ declare function useCart<T>(selector: (state: CartState) => T, equalityFn?: (left: T, right: T) => boolean): T;
78
+
79
+ type CheckoutProps = {
80
+ hydrated: boolean;
81
+ data: IAddressOptions;
82
+ checkout: ICheckoutPartial;
83
+ };
84
+ type CheckoutActions = {
85
+ setCheckout(checkout: ICheckoutPartial): void;
86
+ };
87
+ type CheckoutState = CheckoutProps & {
88
+ actions: CheckoutActions;
89
+ };
90
+ declare const CheckoutContext: React$1.Context<(Omit<zustand.StoreApi<CheckoutState>, "persist"> & {
91
+ persist: {
92
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<CheckoutState, unknown>>) => void;
93
+ clearStorage: () => void;
94
+ rehydrate: () => void | Promise<void>;
95
+ hasHydrated: () => boolean;
96
+ onHydrate: (fn: (state: CheckoutState) => void) => () => void;
97
+ onFinishHydration: (fn: (state: CheckoutState) => void) => () => void;
98
+ getOptions: () => Partial<zustand_middleware.PersistOptions<CheckoutState, unknown>>;
99
+ };
100
+ }) | null>;
101
+ type CheckoutProviderProps = React.PropsWithChildren<{
102
+ data: IAddressOptions;
103
+ checkout?: ICheckoutPartial;
104
+ storage?: StateStorage;
105
+ }>;
106
+ declare function CheckoutProvider({ children, ...props }: CheckoutProviderProps): JSX.Element;
107
+ declare function useCheckout<T>(selector: (state: CheckoutState) => T, equalityFn?: (left: T, right: T) => boolean): T;
108
+
109
+ declare function useClickAnyWhere(handler: (event: MouseEvent) => void): void;
110
+
111
+ type ClickOutGetContainer = () => HTMLElement | null;
112
+ declare function useClickOut(ref: MutableRefObject<HTMLElement | null>, handler: (event: MouseEvent) => void): void;
113
+
114
+ declare function useCurrency(currency?: string, locale?: string): (value: number) => string;
115
+
116
+ declare function useCurrentState<S>(initialState: S | (() => S)): CurrentStateType<S>;
117
+ type CurrentStateType<S> = [S, Dispatch<SetStateAction<S>>, MutableRefObject<S>];
118
+
119
+ declare function useDateTimeFormat(options?: Intl.DateTimeFormatOptions, locale?: string): (value: Date | string) => string;
120
+
121
+ declare function useDebounce<T>(value: T, msec?: number): T;
122
+
123
+ /**
124
+ * Returns a memoized function that will only call the passed function when it hasn't been called for the msec period
125
+ * @param func The function to be called
126
+ * @param msec Wait period after function hasn't been called for
127
+ * @returns A memoized function that is debounced
128
+ */
129
+ declare function useDebounceCallback<T extends (...args: any[]) => any>(callback: T, msec?: number): (...args: unknown[]) => void;
130
+
131
+ declare function useDebugChangedProps(props: ComponentProps<any>): void;
132
+
133
+ declare function useDomObserver(ref: MutableRefObject<HTMLElement | null> | undefined, callback?: MutationCallback): void;
134
+
135
+ type UIValue = string | number | boolean | undefined;
136
+ type UIViews = {
137
+ [key: string]: UIValue;
138
+ };
139
+ type UIReducer = (state: UIViews) => UIValue;
140
+ type UIActions = {
141
+ reduce(key: string, reducer: UIReducer): void;
142
+ };
143
+ type UIStore = {
144
+ views: UIViews;
145
+ actions: UIActions;
146
+ };
147
+ declare const useUI: zustand.UseBoundStore<zustand.StoreApi<UIStore>>;
148
+
149
+ declare function useDrawer(): [drawer: UIValue, open: (value?: string) => void, close: () => void];
150
+
151
+ type Size = {
152
+ width: number;
153
+ height: number;
154
+ };
155
+ declare function useElementSize<T extends HTMLElement = HTMLDivElement>(): [(node: T | null) => void, Size];
156
+
157
+ declare function useEventListener_<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: undefined, options?: boolean | AddEventListenerOptions): void;
158
+ declare function useEventListener_<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLDivElement>(eventName: K, handler: (event: HTMLElementEventMap[K]) => void, element: RefObject<T>, options?: boolean | AddEventListenerOptions): void;
159
+ declare function useEventListener_<K extends keyof DocumentEventMap>(eventName: K, handler: (event: DocumentEventMap[K]) => void, element: RefObject<Document>, options?: boolean | AddEventListenerOptions): void;
160
+ declare const useEventListener: typeof useEventListener_;
161
+
162
+ type FilterParams = {
163
+ [key: string]: IEquatable[] | null;
164
+ };
165
+ type FilterValues = IEquatable[][];
166
+ declare enum FilterMode {
167
+ SELECT = "select",
168
+ AND = "and",
169
+ OR = "or",
170
+ QUERY = "query"
171
+ }
172
+ type IFilterOption = {
173
+ id: IEquatable;
174
+ title: string;
175
+ count?: number;
176
+ disabled?: boolean;
177
+ };
178
+ type IFilter = {
179
+ id?: string;
180
+ title?: string;
181
+ mode?: FilterMode;
182
+ options?: IFilterOption[];
183
+ values?: IEquatable[];
184
+ };
185
+ declare class Filter<T> implements IFilter {
186
+ id: string;
187
+ title: string;
188
+ mode: FilterMode;
189
+ options: IFilterOption[];
190
+ values: IEquatable[];
191
+ constructor(options?: IFilter);
192
+ static fromFeatureType<T>(featureType: IFeatureType, mode?: FilterMode): Filter<T>;
193
+ filter(item: T, value: IEquatable): boolean;
194
+ match(item: T): boolean;
195
+ removeInvalidOptions(items: T[]): void;
196
+ getLabel(): string | null;
197
+ hasAny(): boolean;
198
+ getCount(): number;
199
+ hasResults(): boolean;
200
+ has(option: IFilterOption): boolean;
201
+ set(option: IFilterOption): void;
202
+ remove(option: IFilterOption): void;
203
+ toggle(option: IFilterOption): void;
204
+ clear(): void;
205
+ }
206
+
207
+ declare function getFilters<T>(items: T[], featureTypes: IFeatureType[], filterMap: (key: string, item: T, value: IEquatable) => boolean, params?: FilterParams | null): Filter<T>[];
208
+ declare function getFilteredItems<T>(items: T[], selectedFilters: Filter<T>[]): T[];
209
+ declare function setFilters<T>(items: T[], filters: Filter<T>[], filter?: Filter<T>, values?: IEquatable[]): T[];
210
+ declare function filtersToParams<T>(filters: Filter<T>[]): FilterParams | null;
211
+
212
+ declare function useFilters<T>(items: T[], featureTypes: IFeatureType[], filterItem: (key: string, item: T, value: IEquatable) => boolean, initialValues?: FilterParams | null): UseFiltersResultType<T>;
213
+ type UseFiltersResultType<T> = {
214
+ filteredItems: T[];
215
+ filters: Filter<T>[];
216
+ setFilter: (filter?: Filter<T>, values?: IEquatable[]) => void;
217
+ itemsWithOmittedKeys: (...keys: string[]) => T[];
218
+ };
219
+
220
+ declare const createGenericContext: <T>() => readonly [() => NonNullable<T>, React$1.Provider<T | undefined>];
221
+
222
+ /**
223
+ * @desc Made compatible with {GeolocationPositionError} and {PositionError} cause
224
+ * PositionError been renamed to GeolocationPositionError in typescript 4.1.x and making
225
+ * own compatible interface is most easiest way to avoid errors.
226
+ */
227
+ type IGeolocationPositionError = {
228
+ readonly code: number;
229
+ readonly message: string;
230
+ readonly PERMISSION_DENIED: number;
231
+ readonly POSITION_UNAVAILABLE: number;
232
+ readonly TIMEOUT: number;
233
+ };
234
+ type GeoLocationSensorState = {
235
+ loading: boolean;
236
+ accuracy: number | null;
237
+ altitude: number | null;
238
+ altitudeAccuracy: number | null;
239
+ heading: number | null;
240
+ latitude: number | null;
241
+ longitude: number | null;
242
+ speed: number | null;
243
+ timestamp: number | null;
244
+ error?: Error | IGeolocationPositionError;
245
+ };
246
+ declare function getCurrentPosition(options?: PositionOptions): Promise<GeoLocationSensorState>;
247
+ declare function hasGeolocation(): boolean;
248
+
249
+ declare function useGeolocation(options?: PositionOptions): GeoLocationSensorState;
250
+
251
+ declare function useIdle(delay?: number, immediate?: boolean): boolean;
252
+
253
+ declare function useInfiniteLoader(items: any[], perPage?: number, delayInMs?: number): [any[], () => void, boolean];
254
+
255
+ declare const useIsomorphicLayoutEffect: typeof useEffect;
256
+
257
+ /**
258
+ * KeyBinding Codes
259
+ * The content of this file is based on the design of the open source project "microsoft/vscode",
260
+ * Copyright (c) Microsoft Corporation. All rights reserved.
261
+ *
262
+ * We inherit the KeyMod values from "microsoft/vscode",
263
+ * but use the Browser's KeyboardEvent event implementation, and all values are used only as identification.
264
+ */
265
+ declare enum KeyCode {
266
+ Unknown = 0,
267
+ Backspace = 8,
268
+ Tab = 9,
269
+ Enter = 13,
270
+ Shift = 16,
271
+ Ctrl = 17,
272
+ Alt = 18,
273
+ PauseBreak = 19,
274
+ CapsLock = 20,
275
+ Escape = 27,
276
+ Space = 32,
277
+ PageUp = 33,
278
+ PageDown = 34,
279
+ End = 35,
280
+ Home = 36,
281
+ LeftArrow = 37,
282
+ UpArrow = 38,
283
+ RightArrow = 39,
284
+ DownArrow = 40,
285
+ Insert = 45,
286
+ Delete = 46,
287
+ KEY_0 = 48,
288
+ KEY_1 = 49,
289
+ KEY_2 = 50,
290
+ KEY_3 = 51,
291
+ KEY_4 = 52,
292
+ KEY_5 = 53,
293
+ KEY_6 = 54,
294
+ KEY_7 = 55,
295
+ KEY_8 = 56,
296
+ KEY_9 = 57,
297
+ KEY_A = 65,
298
+ KEY_B = 66,
299
+ KEY_C = 67,
300
+ KEY_D = 68,
301
+ KEY_E = 69,
302
+ KEY_F = 70,
303
+ KEY_G = 71,
304
+ KEY_H = 72,
305
+ KEY_I = 73,
306
+ KEY_J = 74,
307
+ KEY_K = 75,
308
+ KEY_L = 76,
309
+ KEY_M = 77,
310
+ KEY_N = 78,
311
+ KEY_O = 79,
312
+ KEY_P = 80,
313
+ KEY_Q = 81,
314
+ KEY_R = 82,
315
+ KEY_S = 83,
316
+ KEY_T = 84,
317
+ KEY_U = 85,
318
+ KEY_V = 86,
319
+ KEY_W = 87,
320
+ KEY_X = 88,
321
+ KEY_Y = 89,
322
+ KEY_Z = 90,
323
+ Meta = 91,
324
+ F1 = 112,
325
+ F2 = 113,
326
+ F3 = 114,
327
+ F4 = 115,
328
+ F5 = 116,
329
+ F6 = 117,
330
+ F7 = 118,
331
+ F8 = 119,
332
+ F9 = 120,
333
+ F10 = 121,
334
+ F11 = 122,
335
+ F12 = 123,
336
+ NumLock = 144,
337
+ ScrollLock = 145,
338
+ Equal = 187,
339
+ Minus = 189,
340
+ Backquote = 192,
341
+ Backslash = 220
342
+ }
343
+ declare enum KeyMod {
344
+ CtrlCmd = 2048,
345
+ Shift = 1024,
346
+ Alt = 512,
347
+ WinCtrl = 256
348
+ }
349
+
350
+ declare const useKeyboard: UseKeyboard;
351
+
352
+ type KeyboardOptions = {
353
+ disableGlobalEvent?: boolean;
354
+ stopPropagation?: boolean;
355
+ preventDefault?: boolean;
356
+ capture?: boolean;
357
+ event?: 'keydown' | 'keypress' | 'keyup';
358
+ };
359
+ type KeyboardResult = {
360
+ bindings: {
361
+ onKeyDown: React__default.KeyboardEventHandler;
362
+ onKeyDownCapture: React__default.KeyboardEventHandler;
363
+ onKeyPress: React__default.KeyboardEventHandler;
364
+ onKeyPressCapture: React__default.KeyboardEventHandler;
365
+ onKeyUp: React__default.KeyboardEventHandler;
366
+ onKeyUpCapture: React__default.KeyboardEventHandler;
367
+ };
368
+ };
369
+ type UseKeyboardHandler = (event: React__default.KeyboardEvent | KeyboardEvent) => void;
370
+ type UseKeyboard = (handler: UseKeyboardHandler, keyBindings: Array<number> | number, options?: KeyboardOptions) => KeyboardResult;
371
+
372
+ type ILabelContext = (key: string, params?: {
373
+ [key: string]: any;
374
+ }) => string;
375
+ declare const useLabel: () => ILabelContext;
376
+ declare function LabelProvider({ children }: {
377
+ children?: React__default.ReactNode;
378
+ }): JSX.Element;
379
+ declare function parseParams(label: string, params: {
380
+ [key: string]: any;
381
+ }): string;
382
+
383
+ type ILayoutContext = ILayout;
384
+ declare const useLayout: () => ILayout;
385
+ declare function LayoutProvider({ children, layout }: {
386
+ children?: React__default.ReactNode;
387
+ layout: ILayout;
388
+ }): JSX.Element;
389
+
390
+ declare function useModal(): [modal: UIValue, open: (value?: string) => void, close: () => void];
391
+
392
+ declare function useMounted(): boolean;
393
+
394
+ declare function useNumber(options?: Intl.NumberFormatOptions, locale?: string): (value: number) => string;
395
+
396
+ type IPageContext = IPage;
397
+ declare const usePage: () => NonNullable<IPage>;
398
+ declare function PageProvider({ children, page }: {
399
+ children?: React__default.ReactNode;
400
+ page: IPage;
401
+ }): JSX.Element;
402
+
403
+ type IPaginationInfo<T> = {
404
+ items: T[];
405
+ total: number;
406
+ pages: number;
407
+ page: number;
408
+ perPage: number;
409
+ };
410
+ declare function getPagedItems<T>(items: T[], page: number, perPage: number): T[];
411
+
412
+ declare function usePagination<T>($items: T[], $page?: number, $perPage?: number): {
413
+ items: T[];
414
+ page: number;
415
+ pages: number;
416
+ total: number;
417
+ nextPage: () => void;
418
+ previousPage: () => void;
419
+ goToPage: (page: number) => void;
420
+ setPerPage: (perPage: number) => void;
421
+ };
422
+
423
+ declare function usePortal(name?: string, getContainer?: () => HTMLElement | null): HTMLElement | null;
424
+ declare function createElementWithId(id: string): HTMLElement;
425
+ declare function getUID(): string;
426
+
427
+ declare function usePrevious<T>(state: T): T | undefined | null;
428
+
429
+ type SizeType = {
430
+ width: number;
431
+ height: number;
432
+ };
433
+ type SizeResult = [SizeType, () => void];
434
+ declare function useRealSize<T extends HTMLElement>(ref: MutableRefObject<T | null>): SizeResult;
435
+ declare function getRealSize(element: HTMLElement | null): SizeType;
436
+
437
+ declare function useResize(callback: () => unknown, immediate?: boolean): void;
438
+
439
+ type Scroll = {
440
+ left: number;
441
+ top: number;
442
+ };
443
+ declare function useScroll(): Scroll;
444
+
445
+ declare function useScrollTo(): (event: React.MouseEvent<HTMLElement>) => void;
446
+ declare function scrollToSelector(selector?: string, offset?: number): void;
447
+ declare function scrollToRelativeY(y?: number, offset?: number): void;
448
+ declare function scrollToY(y?: number): void;
449
+
450
+ declare const isBrowser: boolean;
451
+ declare function getSearchParams(url: string, key?: string): IParams | string | null;
452
+ declare function updateSearchParams(currentPath: string, params: IParams): {
453
+ pathname: string;
454
+ query: {
455
+ [key: string]: string;
456
+ };
457
+ };
458
+ declare function replaceSearchParams(router: NextRouter, params: IParams): void;
459
+ declare function pushSearchParams(router: NextRouter, params: IParams): void;
460
+ declare function replaceSearchParamsSilently(params: IParams): void;
461
+ declare function useSearchParams(): IUseSearchParamsResult;
462
+ declare function useSearchParamsValue(key: string): IUseSearchParamsValueResult;
463
+ type IUseSearchParamsResult = {
464
+ params: IParams;
465
+ replaceParamsSilently: (params: IParams) => void;
466
+ replaceParams: (params: IParams) => void;
467
+ };
468
+ type IUseSearchParamsValueResult = {
469
+ params: string | null;
470
+ replaceParamsSilently: (params: IParams) => void;
471
+ };
472
+ type IParams = {
473
+ [key: string]: string;
474
+ };
475
+
476
+ declare function decode(encoded: string | null | undefined, key?: string): IParamsEncoded;
477
+ declare function getSearchParamsEncoded(url: string, key?: string): {} | null;
478
+ declare function updateSearchParamsEncoded(currentPath: string, value: IParamsEncoded, key?: string): {
479
+ pathname: string;
480
+ query: {
481
+ [key: string]: string;
482
+ };
483
+ };
484
+ declare function replaceSearchParamsEncoded(router: NextRouter, value: IParamsEncoded, key?: string): void;
485
+ declare function pushSearchParamsEncoded(router: NextRouter, value: IParamsEncoded, key?: string): void;
486
+ declare function replaceSearchParamsEncodedSilently(value: IParamsEncoded, key?: string): void;
487
+ declare function useSearchParamsEncoded(key?: string): IUseSearchParamsEncodedResult;
488
+ type IUseSearchParamsEncodedResult = {
489
+ params: IParamsEncoded;
490
+ replaceParamsSilently: (params: IParamsEncoded) => void;
491
+ replaceParams: (params: IParamsEncoded) => void;
492
+ };
493
+ type IParamsEncoded = {
494
+ [key: string]: any;
495
+ } | null;
496
+
497
+ type Sorting<T> = {
498
+ items: T[];
499
+ sort?: IEquatable;
500
+ };
501
+ declare function useSorting<T>(items_: T[], callback_: (items: T[], sort?: IEquatable) => T[], sort_?: IEquatable): {
502
+ items: T[];
503
+ sort: string | number | undefined;
504
+ setSort: (sort?: IEquatable) => void;
505
+ };
506
+
507
+ type SSRState = {
508
+ isBrowser: boolean;
509
+ isServer: boolean;
510
+ };
511
+ declare function useSSR(): SSRState;
512
+ declare const detectIsBrowser: () => boolean;
513
+
514
+ declare function useSwiperIndex(): [number, (index: number) => void];
515
+
516
+ /**
517
+ * Like `useRef`, but it returns immutable ref that contains actual value.
518
+ *
519
+ * @param value
520
+ */
521
+ declare function useSyncedRef<T>(value: T): {
522
+ readonly current: T;
523
+ };
524
+
525
+ declare function useUnit(unit?: string, locale?: string): (value: number) => string;
526
+
527
+ /**
528
+ * Run effect only when component is unmounted.
529
+ *
530
+ * @param effect Effector to run on unmount
531
+ */
532
+ declare function useUnmountEffect(effect: CallableFunction): void;
533
+
534
+ type UserState = {
535
+ user?: IUser;
536
+ };
537
+ type UserActions = {
538
+ setUser: (user?: IUser) => void;
539
+ };
540
+ type UserStore = UserState & {
541
+ actions: UserActions;
542
+ };
543
+ declare const useUser: zustand.UseBoundStore<zustand.StoreApi<UserStore>>;
544
+
545
+ type WindowSize = {
546
+ width: number;
547
+ height: number;
548
+ };
549
+ declare function useWindowSize(): WindowSize;
550
+
551
+ export { BodyScrollOptions, CartContext, CartProvider, CheckoutContext, CheckoutProvider, ClickOutGetContainer, CurrentStateType, ElementStackItem, Filter, FilterMode, FilterParams, FilterValues, GeoLocationSensorState, IFilter, IFilterOption, IGeolocationPositionError, ILabelContext, ILayoutContext, IPageContext, IPaginationInfo, IParams, IParamsEncoded, IUseSearchParamsEncodedResult, IUseSearchParamsResult, IUseSearchParamsValueResult, KeyCode, KeyMod, KeyboardOptions, KeyboardResult, LabelProvider, LayoutProvider, PageProvider, SSRState, SizeResult, SizeType, Sorting, UIReducer, UIValue, UseFiltersResultType, UseKeyboard, UseKeyboardHandler, createElementWithId, createGenericContext, decode, detectIsBrowser, filtersToParams, getCurrentPosition, getFilteredItems, getFilters, getOwnerPaddingRight, getOwnerScrollbarWidth, getPagedItems, getRealSize, getSearchParams, getSearchParamsEncoded, getUID, hasGeolocation, isBrowser, parseParams, pushSearchParams, pushSearchParamsEncoded, replaceSearchParams, replaceSearchParamsEncoded, replaceSearchParamsEncodedSilently, replaceSearchParamsSilently, scrollToRelativeY, scrollToSelector, scrollToY, setFilters, updateSearchParams, updateSearchParamsEncoded, useApi, useApiDelete, useApiFetch, useApiGet, useApiPatch, useApiPost, useApiPut, useBodyScroll, useBreakpoint, useCart, useCheckout, useClickAnyWhere, useClickOut, useCurrency, useCurrentState, useDateTimeFormat, useDebounce, useDebounceCallback, useDebugChangedProps, useDomObserver, useDrawer, useElementSize, useEventListener, useFilters, useGeolocation, useIdle, useInfiniteLoader, useIsomorphicLayoutEffect, useKeyboard, useLabel, useLayout, useModal, useMounted, useNumber, usePage, usePagination, usePortal, usePrevious, useRealSize, useResize, useSSR, useScroll, useScrollTo, useSearchParams, useSearchParamsEncoded, useSearchParamsValue, useSorting, useSwiperIndex, useSyncedRef, useUI, useUnit, useUnmountEffect, useUser, useWindowSize };