react-hook-toolkit 1.2.1 → 1.2.3
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/chunk1213/chunk158261.js +41 -0
- package/dist/chunk1213/chunk158862.js +121 -0
- package/dist/chunk1415/chunk143.js +58 -0
- package/dist/chunk1516/chunk0021.js +700 -0
- package/dist/chunk1516/chunk0022.js +381 -0
- package/dist/chunk1516/chunk613852.js +299 -0
- package/dist/chunk1516/chunk726433.js +621 -0
- package/dist/chunk1516/chunk940514.js +817 -0
- package/dist/chunk1617/chunk613555.js +115 -0
- package/dist/chunk1617/chunk613557.js +7 -0
- package/dist/index.d.ts +15 -565
- package/dist/index.js +17 -204
- package/dist/type.js +7 -0
- package/dist/utils.js +104 -0
- package/package.json +52 -60
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -204
- package/dist/index.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,565 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children?: ReactNode;
|
|
17
|
-
}
|
|
18
|
-
declare const DrawerProvider: FC<DrawerProviderProps>;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @license HEXE
|
|
22
|
-
* Copyright (c) 2020-2024 Shivaji & Collaborators
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
type HookFunction = () => any;
|
|
28
|
-
declare class HEXE {
|
|
29
|
-
private hs;
|
|
30
|
-
private ss;
|
|
31
|
-
constructor();
|
|
32
|
-
setHook(name: string, hookFunction: HookFunction): this;
|
|
33
|
-
private putHooks;
|
|
34
|
-
component(): react__default.FC;
|
|
35
|
-
getHook(name: string): any;
|
|
36
|
-
}
|
|
37
|
-
declare const ReactHooksWrapper: react__default.FC<{}>;
|
|
38
|
-
declare const getHook: (name: string) => any;
|
|
39
|
-
declare const setHook: (name: string, hookFunction: HookFunction) => HEXE;
|
|
40
|
-
|
|
41
|
-
interface FileComponentProps {
|
|
42
|
-
primaryKey: string | number;
|
|
43
|
-
filename: string;
|
|
44
|
-
size: string | number;
|
|
45
|
-
onDownload?: any;
|
|
46
|
-
width?: number;
|
|
47
|
-
borderColor?: string;
|
|
48
|
-
fileColor?: 'inherit' | 'primary' | 'secondary' | 'error' | 'disabled' | 'action';
|
|
49
|
-
isDownloading: boolean;
|
|
50
|
-
}
|
|
51
|
-
interface AlertPropsType {
|
|
52
|
-
type: string;
|
|
53
|
-
msg: string;
|
|
54
|
-
duration?: number;
|
|
55
|
-
}
|
|
56
|
-
interface DetailsCardProps {
|
|
57
|
-
isLoading?: boolean;
|
|
58
|
-
title: string;
|
|
59
|
-
details: any[];
|
|
60
|
-
spacing?: number;
|
|
61
|
-
boxShadow?: string;
|
|
62
|
-
background?: string;
|
|
63
|
-
loaderType?: 'skeleton' | 'circular';
|
|
64
|
-
displayType?: 'flex' | 'block';
|
|
65
|
-
}
|
|
66
|
-
interface UploadButtonProps {
|
|
67
|
-
isUpload?: boolean;
|
|
68
|
-
color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
69
|
-
state?: {
|
|
70
|
-
isUploaded?: boolean;
|
|
71
|
-
isUploadError?: boolean;
|
|
72
|
-
isLoadingUpload?: boolean;
|
|
73
|
-
};
|
|
74
|
-
onFileSelect: (file: File) => void;
|
|
75
|
-
}
|
|
76
|
-
interface DownloadButtonState {
|
|
77
|
-
isDownloaded?: boolean;
|
|
78
|
-
isDownloadError?: boolean;
|
|
79
|
-
isLoadingDownload?: boolean;
|
|
80
|
-
}
|
|
81
|
-
interface DownloadFileProps {
|
|
82
|
-
isDownload?: boolean;
|
|
83
|
-
color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
84
|
-
state?: DownloadButtonState;
|
|
85
|
-
onDownload: () => void;
|
|
86
|
-
}
|
|
87
|
-
type MenuPosition = 'auto' | 'fixed';
|
|
88
|
-
type ThemeMode = 'light' | 'dark';
|
|
89
|
-
interface ContextMenuProps {
|
|
90
|
-
options: any;
|
|
91
|
-
children: React.ReactNode;
|
|
92
|
-
disabled?: boolean;
|
|
93
|
-
className?: string;
|
|
94
|
-
menuClassName?: string;
|
|
95
|
-
position?: MenuPosition;
|
|
96
|
-
onShow?: () => void;
|
|
97
|
-
onHide?: () => void;
|
|
98
|
-
currentInstance?: any;
|
|
99
|
-
theme?: ThemeMode;
|
|
100
|
-
}
|
|
101
|
-
type UseRecentSearchOptions = {
|
|
102
|
-
key?: string;
|
|
103
|
-
limit?: number;
|
|
104
|
-
uniqueKey?: string;
|
|
105
|
-
excludeEmpty?: boolean;
|
|
106
|
-
};
|
|
107
|
-
interface UseAxiosResponse<T> {
|
|
108
|
-
data: T | null;
|
|
109
|
-
loading: boolean;
|
|
110
|
-
error: string | null;
|
|
111
|
-
makeRequest: (url: string, method?: string, requestData?: any) => void;
|
|
112
|
-
cancelRequest: () => void;
|
|
113
|
-
}
|
|
114
|
-
interface UseAxiosConfig extends AxiosRequestConfig {
|
|
115
|
-
baseURL?: string;
|
|
116
|
-
headers?: {
|
|
117
|
-
[key: string]: string;
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
interface FetchState<T> {
|
|
121
|
-
data: T | null;
|
|
122
|
-
loading: boolean;
|
|
123
|
-
error: string | null;
|
|
124
|
-
}
|
|
125
|
-
interface WindowSize {
|
|
126
|
-
width: number;
|
|
127
|
-
height: number;
|
|
128
|
-
}
|
|
129
|
-
interface ScrollPosition {
|
|
130
|
-
x: number;
|
|
131
|
-
y: number;
|
|
132
|
-
}
|
|
133
|
-
interface MousePosition {
|
|
134
|
-
x: number;
|
|
135
|
-
y: number;
|
|
136
|
-
}
|
|
137
|
-
type IdleStatus = 'idle' | 'pending' | 'success' | 'error';
|
|
138
|
-
type AsyncFunction<T> = () => Promise<T>;
|
|
139
|
-
interface UseAsyncReturn<T> {
|
|
140
|
-
execute: () => void;
|
|
141
|
-
status: IdleStatus;
|
|
142
|
-
value: T | null;
|
|
143
|
-
error: Error | null;
|
|
144
|
-
}
|
|
145
|
-
interface BatteryState {
|
|
146
|
-
supported: boolean;
|
|
147
|
-
loading: boolean;
|
|
148
|
-
level: number | null;
|
|
149
|
-
charging: boolean | null;
|
|
150
|
-
chargingTime: number | null;
|
|
151
|
-
dischargingTime: number | null;
|
|
152
|
-
}
|
|
153
|
-
interface HistoryState {
|
|
154
|
-
[key: string]: any;
|
|
155
|
-
}
|
|
156
|
-
interface UseHistory {
|
|
157
|
-
history: History;
|
|
158
|
-
state: HistoryState | null;
|
|
159
|
-
push: (path: string, state?: HistoryState) => void;
|
|
160
|
-
replace: (path: string, state?: HistoryState) => void;
|
|
161
|
-
goBack: () => void;
|
|
162
|
-
goForward: () => void;
|
|
163
|
-
}
|
|
164
|
-
interface UseSessionStorage<T> {
|
|
165
|
-
(key: string, initialValue: T): [T, (value: T) => void];
|
|
166
|
-
}
|
|
167
|
-
interface UseSound {
|
|
168
|
-
play: () => void;
|
|
169
|
-
pause: () => void;
|
|
170
|
-
stop: () => void;
|
|
171
|
-
setVolume: (volume: number) => void;
|
|
172
|
-
isPlaying: boolean;
|
|
173
|
-
error: Error | null;
|
|
174
|
-
}
|
|
175
|
-
interface TouchPosition {
|
|
176
|
-
x: number | null;
|
|
177
|
-
y: number | null;
|
|
178
|
-
}
|
|
179
|
-
interface UseTouch {
|
|
180
|
-
(elementRef: React.RefObject<HTMLElement>): {
|
|
181
|
-
touchStart: TouchPosition;
|
|
182
|
-
touchMove: TouchPosition;
|
|
183
|
-
touchEnd: TouchPosition;
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
interface MotionSensorState {
|
|
187
|
-
acceleration: {
|
|
188
|
-
x: number | null;
|
|
189
|
-
y: number | null;
|
|
190
|
-
z: number | null;
|
|
191
|
-
};
|
|
192
|
-
accelerationIncludingGravity: {
|
|
193
|
-
x: number | null;
|
|
194
|
-
y: number | null;
|
|
195
|
-
z: number | null;
|
|
196
|
-
};
|
|
197
|
-
rotationRate: {
|
|
198
|
-
alpha: number | null;
|
|
199
|
-
beta: number | null;
|
|
200
|
-
gamma: number | null;
|
|
201
|
-
};
|
|
202
|
-
interval: number | null;
|
|
203
|
-
}
|
|
204
|
-
type SpeechOptions = {
|
|
205
|
-
lang: string;
|
|
206
|
-
voice?: SpeechSynthesisVoice;
|
|
207
|
-
rate: number;
|
|
208
|
-
pitch: number;
|
|
209
|
-
volume: number;
|
|
210
|
-
};
|
|
211
|
-
type IState = PermissionState | '';
|
|
212
|
-
type IPermissionDescriptor = PermissionDescriptor | (PermissionDescriptor & {
|
|
213
|
-
deviceId?: string;
|
|
214
|
-
}) | (PermissionDescriptor & {
|
|
215
|
-
sysex?: boolean;
|
|
216
|
-
}) | (PermissionDescriptor & {
|
|
217
|
-
userVisibleOnly?: boolean;
|
|
218
|
-
});
|
|
219
|
-
type ISpeechOptions = Partial<SpeechOptions>;
|
|
220
|
-
type VoiceInfo = Pick<SpeechSynthesisVoice, 'lang' | 'name'>;
|
|
221
|
-
type ISpeechState = SpeechOptions & {
|
|
222
|
-
isPlaying: boolean;
|
|
223
|
-
status: string;
|
|
224
|
-
voiceInfo: VoiceInfo;
|
|
225
|
-
};
|
|
226
|
-
interface BrowserHistoryState {
|
|
227
|
-
canGoBack: boolean;
|
|
228
|
-
canGoForward: boolean;
|
|
229
|
-
historyLength: number;
|
|
230
|
-
}
|
|
231
|
-
interface BrowserSettings {
|
|
232
|
-
clearCache: boolean;
|
|
233
|
-
clearCookies: boolean;
|
|
234
|
-
clearLocalStorage: boolean;
|
|
235
|
-
clearSessionStorage: boolean;
|
|
236
|
-
}
|
|
237
|
-
interface UseBrowserControlsReturn {
|
|
238
|
-
currentUrl: URL;
|
|
239
|
-
currentPath: string;
|
|
240
|
-
currentHash: string;
|
|
241
|
-
currentSearchParams: URLSearchParams;
|
|
242
|
-
goBack: () => void;
|
|
243
|
-
goForward: () => void;
|
|
244
|
-
reload: (hardReload?: boolean, scrollToTop?: boolean) => void;
|
|
245
|
-
navigateTo: (url: string | URL, replace?: boolean) => void;
|
|
246
|
-
clearBrowserData: (settings: Partial<BrowserSettings>) => Promise<void>;
|
|
247
|
-
historyState: BrowserHistoryState;
|
|
248
|
-
isOnline: boolean;
|
|
249
|
-
copyCurrentUrl: () => Promise<void>;
|
|
250
|
-
openNewTab: (url?: string) => void;
|
|
251
|
-
getFaviconUrl: (size?: number) => string;
|
|
252
|
-
getPageTitle: () => string;
|
|
253
|
-
setPageTitle: (title: string) => void;
|
|
254
|
-
isSecureContext: boolean;
|
|
255
|
-
viewportSize: {
|
|
256
|
-
width: number;
|
|
257
|
-
height: number;
|
|
258
|
-
};
|
|
259
|
-
screenSize: {
|
|
260
|
-
width: number;
|
|
261
|
-
height: number;
|
|
262
|
-
};
|
|
263
|
-
enableFullscreen: () => Promise<void>;
|
|
264
|
-
disableFullscreen: () => Promise<void>;
|
|
265
|
-
isFullscreen: boolean;
|
|
266
|
-
printPage: () => void;
|
|
267
|
-
getUserAgent: () => string;
|
|
268
|
-
shareContent: (data: ShareData) => Promise<void>;
|
|
269
|
-
isShareSupported: boolean;
|
|
270
|
-
closeCurrentTab: () => void;
|
|
271
|
-
}
|
|
272
|
-
interface AnimatedWrapperProps {
|
|
273
|
-
animationClass?: string;
|
|
274
|
-
delay?: any;
|
|
275
|
-
children: React.ReactNode;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
declare const DynamicLoader: (Component: any) => (props: any) => react_jsx_runtime.JSX.Element;
|
|
279
|
-
declare const AlertMessage: FC<AlertPropsType>;
|
|
280
|
-
declare const DetailsCard: ({ isLoading, title, details, spacing, boxShadow, background, loaderType, displayType, }: DetailsCardProps) => react_jsx_runtime.JSX.Element;
|
|
281
|
-
declare const LabeledValue: ({ label, value, style }: any) => react_jsx_runtime.JSX.Element;
|
|
282
|
-
declare const FilePreview: ({ primaryKey, filename, size, onDownload, width, borderColor, fileColor, isDownloading, }: FileComponentProps) => react_jsx_runtime.JSX.Element;
|
|
283
|
-
declare const UploadFile: react__default.FC<UploadButtonProps>;
|
|
284
|
-
declare const DownloadFile: react__default.FC<DownloadFileProps>;
|
|
285
|
-
declare const ContextMenuWrapper: react__default.FC<ContextMenuProps>;
|
|
286
|
-
|
|
287
|
-
declare const FileSkeleton: ({ length, width, borderColor }: {
|
|
288
|
-
length?: number | undefined;
|
|
289
|
-
width?: number | undefined;
|
|
290
|
-
borderColor?: string | undefined;
|
|
291
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
292
|
-
declare const TableSkeleton: ({ rows, columns }: {
|
|
293
|
-
rows?: number | undefined;
|
|
294
|
-
columns?: number | undefined;
|
|
295
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
296
|
-
declare const LineChartSkeleton: () => react_jsx_runtime.JSX.Element;
|
|
297
|
-
declare const CardSkeleton: () => react_jsx_runtime.JSX.Element;
|
|
298
|
-
declare const PieChartSkeleton: React.FC;
|
|
299
|
-
declare const FieldSkeleton: ({ length, width, spacing, isLabel, responsive, }: {
|
|
300
|
-
length?: number | undefined;
|
|
301
|
-
width?: string | undefined;
|
|
302
|
-
spacing?: number | undefined;
|
|
303
|
-
isLabel?: boolean | undefined;
|
|
304
|
-
responsive?: {
|
|
305
|
-
xs: number;
|
|
306
|
-
sm: number;
|
|
307
|
-
md: number;
|
|
308
|
-
} | undefined;
|
|
309
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
310
|
-
|
|
311
|
-
declare function useHistoryState<T>(initialPresent: T): {
|
|
312
|
-
state: T;
|
|
313
|
-
set: (newPresent: T) => void;
|
|
314
|
-
undo: () => void;
|
|
315
|
-
redo: () => void;
|
|
316
|
-
reset: (newPresent: T) => void;
|
|
317
|
-
clear: () => void;
|
|
318
|
-
canUndo: boolean;
|
|
319
|
-
canRedo: boolean;
|
|
320
|
-
past: T[];
|
|
321
|
-
future: T[];
|
|
322
|
-
};
|
|
323
|
-
declare function useIdle(ms?: number): boolean;
|
|
324
|
-
declare function useIsFirstRender(): boolean;
|
|
325
|
-
declare function useList<T>(initialList?: T[]): {
|
|
326
|
-
list: T[];
|
|
327
|
-
actions: {
|
|
328
|
-
set: (newList: T[]) => void;
|
|
329
|
-
push: (element: T) => void;
|
|
330
|
-
removeAt: (index: number) => void;
|
|
331
|
-
insertAt: (index: number, element: T) => void;
|
|
332
|
-
updateAt: (index: number, element: T) => void;
|
|
333
|
-
clear: () => void;
|
|
334
|
-
};
|
|
335
|
-
};
|
|
336
|
-
declare function useLockBodyScroll(lock?: boolean): void;
|
|
337
|
-
type LongPressOptions = {
|
|
338
|
-
threshold?: number;
|
|
339
|
-
onStart?: (event: Event) => void;
|
|
340
|
-
onFinish?: (event: Event) => void;
|
|
341
|
-
onCancel?: (event: Event) => void;
|
|
342
|
-
};
|
|
343
|
-
declare function useLongPress(callback: (event: Event) => void, options?: LongPressOptions): {
|
|
344
|
-
onMouseDown: any;
|
|
345
|
-
onMouseUp: any;
|
|
346
|
-
onMouseLeave: any;
|
|
347
|
-
onTouchStart: any;
|
|
348
|
-
onTouchEnd: any;
|
|
349
|
-
};
|
|
350
|
-
declare const useRecentSearch: (options?: UseRecentSearchOptions) => {
|
|
351
|
-
recentSearches: any;
|
|
352
|
-
addSearch: (item: any) => void;
|
|
353
|
-
clearSearch: () => void;
|
|
354
|
-
hasSearch: (value: string) => any;
|
|
355
|
-
};
|
|
356
|
-
declare const useUnmountedRef: () => react.MutableRefObject<boolean>;
|
|
357
|
-
declare const useResponsive: () => any;
|
|
358
|
-
declare const useClickAway: <E extends Event = Event>(ref: RefObject<HTMLElement | null>, onClickAway: (event: E) => void, events?: string[]) => void;
|
|
359
|
-
declare const useBeforeUnload: (enabled?: boolean | (() => boolean), message?: string) => void;
|
|
360
|
-
declare const useHoverDirty: (ref: RefObject<Element>, enabled?: boolean) => boolean;
|
|
361
|
-
declare const useMotion: (initialState?: MotionSensorState) => MotionSensorState;
|
|
362
|
-
declare const usePageLeave: (onPageLeave: any, args?: never[]) => void;
|
|
363
|
-
declare const usePermission: (permissionDesc: IPermissionDescriptor) => IState;
|
|
364
|
-
declare const useSpeech: (text: string, options: ISpeechOptions) => ISpeechState;
|
|
365
|
-
|
|
366
|
-
declare const useBrowser: () => UseBrowserControlsReturn;
|
|
367
|
-
|
|
368
|
-
interface AxiosConfigProps {
|
|
369
|
-
baseURL: string;
|
|
370
|
-
handleAuthError?: (axiosInstance: AxiosInstance, originalRequest: AxiosRequestConfig, err: AxiosError) => Promise<AxiosResponse>;
|
|
371
|
-
timeout: number;
|
|
372
|
-
}
|
|
373
|
-
declare const privateAxios: ({ baseURL, handleAuthError, timeout }: AxiosConfigProps) => AxiosInstance;
|
|
374
|
-
interface AxiosNoAuthConfigProps {
|
|
375
|
-
baseURL: string;
|
|
376
|
-
timeout: number;
|
|
377
|
-
}
|
|
378
|
-
declare const publicAxios: ({ baseURL, timeout }: AxiosNoAuthConfigProps) => AxiosInstance;
|
|
379
|
-
|
|
380
|
-
declare const useAxios: <T>(config?: UseAxiosConfig) => UseAxiosResponse<T>;
|
|
381
|
-
declare const useGenericReducer: <State, Action extends {
|
|
382
|
-
type: string;
|
|
383
|
-
}>(initialState: State, actions: Record<string, (state: State, action: Action) => State>) => (state: State | undefined, action: Action) => State;
|
|
384
|
-
declare function useRequest<T>(url: string): FetchState<T>;
|
|
385
|
-
declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T) => void];
|
|
386
|
-
declare function useToggle(initialValue?: boolean): [boolean, () => void];
|
|
387
|
-
declare function useDebounce<T>(value: T, delay: number): T;
|
|
388
|
-
declare function useThrottle<T>(value: T, limit: number): T;
|
|
389
|
-
declare function usePrevious<T>(value: T): T | undefined;
|
|
390
|
-
declare function useMediaQuery(query: string): boolean;
|
|
391
|
-
declare function useClipboard(): [boolean, (text: string) => Promise<void>];
|
|
392
|
-
declare function useInterval(callback: () => void, delay: number | null): void;
|
|
393
|
-
declare function useWindowSize(): WindowSize;
|
|
394
|
-
declare function useKeyPress(targetKey: string): boolean;
|
|
395
|
-
declare function useOnlineStatus(): boolean;
|
|
396
|
-
declare function useScrollPosition(): ScrollPosition;
|
|
397
|
-
declare function useTimeout(callback: () => void, delay: number | null): void;
|
|
398
|
-
declare function useDarkMode(): [boolean, () => void];
|
|
399
|
-
declare function useForm<T extends Record<string, any>>(initialValues: T): {
|
|
400
|
-
values: T;
|
|
401
|
-
errors: Partial<Record<keyof T, string>>;
|
|
402
|
-
handleChange: (name: keyof T, value: any) => void;
|
|
403
|
-
validate: (validators: Partial<Record<keyof T, (value: any) => string | null>>) => boolean;
|
|
404
|
-
};
|
|
405
|
-
declare function useArray<T>(initialArray: T[]): {
|
|
406
|
-
array: T[];
|
|
407
|
-
set: react.Dispatch<react.SetStateAction<T[]>>;
|
|
408
|
-
push: (item: T) => void;
|
|
409
|
-
removeByIndex: (index: number) => void;
|
|
410
|
-
clear: () => void;
|
|
411
|
-
};
|
|
412
|
-
declare const useStepper: (totalSteps: number) => {
|
|
413
|
-
activeStep: number;
|
|
414
|
-
handleNext: () => void;
|
|
415
|
-
handleBack: () => void;
|
|
416
|
-
handleReset: () => void;
|
|
417
|
-
totalSteps: number;
|
|
418
|
-
isFirstStep: boolean;
|
|
419
|
-
isLastStep: boolean;
|
|
420
|
-
isProccesing: boolean;
|
|
421
|
-
setIsProccesing: react.Dispatch<react.SetStateAction<boolean>>;
|
|
422
|
-
goto: (step: number) => void;
|
|
423
|
-
};
|
|
424
|
-
declare function useDebouncedCallback(callback: () => void, delay: number): () => void;
|
|
425
|
-
declare function useScrollLock(lock: boolean): void;
|
|
426
|
-
declare function useResizeObserver<T extends HTMLElement>(ref: RefObject<T>): WindowSize | null;
|
|
427
|
-
declare function useMousePosition(): MousePosition;
|
|
428
|
-
type ScrollDirection = 'up' | 'down';
|
|
429
|
-
declare function useScrollDirection(): ScrollDirection;
|
|
430
|
-
declare function useImageLoader(src: string): {
|
|
431
|
-
loaded: boolean;
|
|
432
|
-
error: boolean;
|
|
433
|
-
};
|
|
434
|
-
declare function usePersistedState<T>(key: string, initialValue: T): [T, React.Dispatch<React.SetStateAction<T>>];
|
|
435
|
-
declare function useReducedMotion(): boolean;
|
|
436
|
-
declare function useCookie(key: string): [string | null, (value: string, options?: any) => void, () => void];
|
|
437
|
-
declare function useRequestRetry<T>(url: string, options: RequestInit, retries?: number): {
|
|
438
|
-
data: T | null;
|
|
439
|
-
error: string | null;
|
|
440
|
-
loading: boolean;
|
|
441
|
-
};
|
|
442
|
-
declare function useDelay<T>(value: T, delay: number): T;
|
|
443
|
-
declare function useVisibilityChange(): boolean;
|
|
444
|
-
declare function useDebouncedValue<T>(value: T, delay: number): T;
|
|
445
|
-
declare function useAsync<T>(asyncFunction: AsyncFunction<T>, immediate?: boolean): UseAsyncReturn<T>;
|
|
446
|
-
type ScriptStatus = 'loading' | 'ready' | 'error' | 'unknown';
|
|
447
|
-
declare function useScript(src: string, removeOnUnmount?: boolean): ScriptStatus;
|
|
448
|
-
declare function useIndexedDB<T>(dbName: string, storeName: string): {
|
|
449
|
-
data: T | null;
|
|
450
|
-
error: Error | null;
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
declare function useGeoLocation(): {
|
|
454
|
-
position: GeolocationPosition | null;
|
|
455
|
-
error: Error | null;
|
|
456
|
-
};
|
|
457
|
-
declare function useTimer(initialTime: number): {
|
|
458
|
-
time: number;
|
|
459
|
-
error: Error | null;
|
|
460
|
-
};
|
|
461
|
-
declare function useIsMounted(): boolean;
|
|
462
|
-
declare function useCss(css: string): {
|
|
463
|
-
error: Error | null;
|
|
464
|
-
};
|
|
465
|
-
declare function useSpeak(text: string): {
|
|
466
|
-
speak: () => void;
|
|
467
|
-
error: Error | null;
|
|
468
|
-
};
|
|
469
|
-
declare function useCountUp(target: number, duration: number): {
|
|
470
|
-
count: number;
|
|
471
|
-
error: Error | null;
|
|
472
|
-
};
|
|
473
|
-
declare function useCountDown(start: number): {
|
|
474
|
-
count: number;
|
|
475
|
-
error: Error | null;
|
|
476
|
-
};
|
|
477
|
-
declare const useBattery: () => BatteryState;
|
|
478
|
-
declare const useEventListener: (eventName: string, handler: (event: Event) => void, elementRef?: React.RefObject<HTMLElement>, options?: boolean | AddEventListenerOptions) => void;
|
|
479
|
-
declare const useHistory: () => UseHistory;
|
|
480
|
-
interface UsePreferredLanguage {
|
|
481
|
-
language: string;
|
|
482
|
-
languages: Array<string>;
|
|
483
|
-
isSupported: boolean;
|
|
484
|
-
}
|
|
485
|
-
declare const usePreferredLanguage: () => UsePreferredLanguage;
|
|
486
|
-
declare const useSessionStorage: UseSessionStorage<any>;
|
|
487
|
-
declare const useSound: (url: string) => UseSound;
|
|
488
|
-
declare const useTouch: UseTouch;
|
|
489
|
-
declare const useUpdateEffect: (effect: React.EffectCallback, deps: React.DependencyList) => void;
|
|
490
|
-
declare const usePersistedForm: <T>(key: string, initialValue: T) => [T, (value: T) => void];
|
|
491
|
-
declare const useCrossFieldValidation: <T extends Record<string, any>>(validate: (values: T) => Record<keyof T, string | null>) => {
|
|
492
|
-
errors: Record<keyof T, string | null>;
|
|
493
|
-
validateFields: (values: T) => boolean;
|
|
494
|
-
};
|
|
495
|
-
declare const useFieldArray: <T>(initialValue: T[]) => {
|
|
496
|
-
fields: T[];
|
|
497
|
-
append: (item: T) => void;
|
|
498
|
-
remove: (index: number) => void;
|
|
499
|
-
update: (index: number, item: T) => void;
|
|
500
|
-
};
|
|
501
|
-
type SubmitHandler<T> = (data: T) => Promise<void>;
|
|
502
|
-
declare const useFormSubmit: <T>(handler: SubmitHandler<T>) => {
|
|
503
|
-
handleSubmit: (data: T) => Promise<void>;
|
|
504
|
-
isSubmitting: boolean;
|
|
505
|
-
submitError: string | null;
|
|
506
|
-
};
|
|
507
|
-
declare const useSmartForm: <T extends Record<string, any>>(initialValues: T, storageKey?: string) => {
|
|
508
|
-
values: T;
|
|
509
|
-
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
510
|
-
setValues: react.Dispatch<react.SetStateAction<T>>;
|
|
511
|
-
dirty: boolean;
|
|
512
|
-
};
|
|
513
|
-
declare const useUndo: <T>(initialState: T) => {
|
|
514
|
-
state: T;
|
|
515
|
-
setState: (newState: T) => void;
|
|
516
|
-
undo: () => false | void;
|
|
517
|
-
redo: () => false | void;
|
|
518
|
-
canUndo: boolean;
|
|
519
|
-
canRedo: boolean;
|
|
520
|
-
};
|
|
521
|
-
declare const useFormWizard: <T extends Record<string, any>>(steps: {
|
|
522
|
-
validate?: (values: T) => Record<string, string>;
|
|
523
|
-
component: React.FC<{
|
|
524
|
-
values: T;
|
|
525
|
-
setValues: (v: T) => void;
|
|
526
|
-
}>;
|
|
527
|
-
}[], initialValues: T) => {
|
|
528
|
-
currentStep: number;
|
|
529
|
-
CurrentStep: react.FC<{
|
|
530
|
-
values: T;
|
|
531
|
-
setValues: (v: T) => void;
|
|
532
|
-
}>;
|
|
533
|
-
values: T;
|
|
534
|
-
setValues: react.Dispatch<react.SetStateAction<T>>;
|
|
535
|
-
next: () => void;
|
|
536
|
-
prev: () => void;
|
|
537
|
-
errors: Record<string, string>;
|
|
538
|
-
isFirstStep: boolean;
|
|
539
|
-
isLastStep: boolean;
|
|
540
|
-
};
|
|
541
|
-
declare const createOptimizedContext: <T>() => readonly [react.Provider<T | undefined>, <U>(selector: (value: T) => U) => U];
|
|
542
|
-
declare const useWebSocket: <T>(url: string, onMessage?: (data: T) => void) => {
|
|
543
|
-
data: T | null;
|
|
544
|
-
send: (message: any) => void;
|
|
545
|
-
isConnected: boolean;
|
|
546
|
-
};
|
|
547
|
-
declare const useDragReorder: <T>(initialItems: T[]) => {
|
|
548
|
-
items: T[];
|
|
549
|
-
handleDragStart: (index: number) => void;
|
|
550
|
-
handleDragEnter: (index: number) => void;
|
|
551
|
-
handleDrop: () => void;
|
|
552
|
-
};
|
|
553
|
-
declare const useInfiniteScroll: <T>(fetchData: (page: number) => Promise<T[]>, initialData?: T[]) => {
|
|
554
|
-
data: T[];
|
|
555
|
-
loading: boolean;
|
|
556
|
-
hasMore: boolean;
|
|
557
|
-
lastElementRef: (node: HTMLElement | null) => void;
|
|
558
|
-
};
|
|
559
|
-
declare const useEventListeners: (eventType: string, handler: (event: Event) => void, element?: HTMLElement | Window, options?: AddEventListenerOptions) => void;
|
|
560
|
-
|
|
561
|
-
declare const AnimatedWrapper: react__default.FC<AnimatedWrapperProps>;
|
|
562
|
-
|
|
563
|
-
declare const useDrawer: () => DrawerContextValue;
|
|
564
|
-
|
|
565
|
-
export { AlertMessage, AnimatedWrapper, CardSkeleton, ContextMenuWrapper, DetailsCard, DownloadFile, DrawerProvider, DynamicLoader, FieldSkeleton, FilePreview, FileSkeleton, LabeledValue, LineChartSkeleton, PieChartSkeleton, TableSkeleton, UploadFile, createOptimizedContext, ReactHooksWrapper as default, getHook, privateAxios, publicAxios, setHook, useArray, useAsync, useAxios, useBattery, useBeforeUnload, useBrowser, useClickAway, useClipboard, useCookie, useCountDown, useCountUp, useCrossFieldValidation, useCss, useDarkMode, useDebounce, useDebouncedCallback, useDebouncedValue, useDelay, useDragReorder, useDrawer, useEventListener, useEventListeners, useFieldArray, useForm, useFormSubmit, useFormWizard, useGenericReducer, useGeoLocation, useHistory, useHistoryState, useHoverDirty, useIdle, useImageLoader, useIndexedDB, useInfiniteScroll, useInterval, useIsFirstRender, useIsMounted, useKeyPress, useList, useLocalStorage, useLockBodyScroll, useLongPress, useMediaQuery, useMotion, useMousePosition, useOnlineStatus, usePageLeave, usePermission, usePersistedForm, usePersistedState, usePreferredLanguage, usePrevious, useRecentSearch, useReducedMotion, useRequest, useRequestRetry, useResizeObserver, useResponsive, useScript, useScrollDirection, useScrollLock, useScrollPosition, useSessionStorage, useSmartForm, useSound, useSpeak, useSpeech, useStepper, useThrottle, useTimeout, useTimer, useToggle, useTouch, useUndo, useUnmountedRef, useUpdateEffect, useVisibilityChange, useWebSocket, useWindowSize };
|
|
1
|
+
import 'nprogress/nprogress.css';
|
|
2
|
+
import 'animate.css';
|
|
3
|
+
import { DynamicLoader, AlertMessage, FilePreview, LabeledValue, DetailsCard, UploadFile, DownloadFile, ContextMenuWrapper } from './chunk1516/chunk613852';
|
|
4
|
+
import { ReactHooksWrapper, getHook, setHook } from './chunk1415/chunk143';
|
|
5
|
+
import { FileSkeleton, TableSkeleton, PieChartSkeleton, CardSkeleton, LineChartSkeleton, FieldSkeleton } from './chunk1617/chunk613555';
|
|
6
|
+
import { useHistoryState, useIdle, useIsFirstRender, useList, useLockBodyScroll, useLongPress, useRecentSearch, useSpeech, usePermission, usePageLeave, useMotion, useHoverDirty, useBeforeUnload, useClickAway, useResponsive, useUnmountedRef } from './chunk1516/chunk726433';
|
|
7
|
+
import { useBrowser } from './chunk1516/chunk0022';
|
|
8
|
+
import { privateAxios, publicAxios } from './chunk1213/chunk158862';
|
|
9
|
+
declare const useDrawer: () => import("./chunk1213/chunk158261").DrawerContextValue;
|
|
10
|
+
import { useGenericReducer, useArray, useAsync, useAxios, useClipboard, useCookie, useDarkMode, useDebounce, useDebouncedCallback, useDebouncedValue, useDelay, useRequest, useRequestRetry, useForm, useImageLoader, useIndexedDB, useInterval, useKeyPress, useLocalStorage, useMediaQuery, useMousePosition, useOnlineStatus, usePersistedState, usePrevious, useReducedMotion, useResizeObserver, useScrollDirection, useScrollLock, useScrollPosition, useScript, useStepper, useThrottle, useTimeout, useToggle, useVisibilityChange, useWindowSize } from './chunk1516/chunk940514';
|
|
11
|
+
import { createOptimizedContext, useBattery, useCountDown, useCountUp, useCrossFieldValidation, useCss, useDragReorder, useEventListener, useEventListeners, useFieldArray, useFormSubmit, useFormWizard, useGeoLocation, useHistory, useInfiniteScroll, useIsMounted, usePersistedForm, usePreferredLanguage, useSessionStorage, useSmartForm, useSound, useSpeak, useTimer, useTouch, useUndo, useUpdateEffect, useWebSocket } from './chunk1516/chunk0021';
|
|
12
|
+
import { DrawerProvider } from './chunk1213/chunk158261';
|
|
13
|
+
import { AnimatedWrapper } from './chunk1617/chunk613557';
|
|
14
|
+
export default ReactHooksWrapper;
|
|
15
|
+
export { getHook, setHook, privateAxios, publicAxios, useGenericReducer, useArray, useAsync, useAxios, useBrowser, useBattery, useBeforeUnload, useClipboard, useCookie, useClickAway, useCountDown, useCountUp, useCrossFieldValidation, useCss, useDrawer, useDarkMode, useDebounce, useDebouncedCallback, useDebouncedValue, useDelay, useDragReorder, useEventListener, useEventListeners, useRequest, useRequestRetry, useFieldArray, useForm, useFormSubmit, useFormWizard, useGeoLocation, useHoverDirty, useHistory, useHistoryState, useIdle, useImageLoader, useIndexedDB, useInfiniteScroll, useInterval, useIsFirstRender, useIsMounted, useKeyPress, useList, useLocalStorage, useLockBodyScroll, useLongPress, useMotion, useMediaQuery, useMousePosition, useOnlineStatus, usePersistedForm, usePersistedState, usePreferredLanguage, usePrevious, usePermission, usePageLeave, useReducedMotion, useRecentSearch, useResponsive, useResizeObserver, useScript, useScrollDirection, useScrollLock, useScrollPosition, useSessionStorage, useSmartForm, useSound, useSpeech, useSpeak, useStepper, useThrottle, useTimeout, useTimer, useToggle, useTouch, useUnmountedRef, useUndo, useUpdateEffect, useVisibilityChange, useWebSocket, useWindowSize, AlertMessage, CardSkeleton, AnimatedWrapper, ContextMenuWrapper, DrawerProvider, DetailsCard, DownloadFile, DynamicLoader, FieldSkeleton, FilePreview, FileSkeleton, LineChartSkeleton, LabeledValue, PieChartSkeleton, TableSkeleton, UploadFile, createOptimizedContext, };
|