react-hook-toolkit 1.0.23 → 1.1.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/LICENSE +35 -0
- package/README.md +131 -6
- package/dist/chunk1213/chunk158261.d.ts +2 -13
- package/dist/chunk1213/chunk158261.js +3 -3
- package/dist/chunk1516/chunk0021.d.ts +109 -0
- package/dist/chunk1516/chunk0021.js +700 -0
- package/dist/chunk1516/chunk0022.d.ts +2 -0
- package/dist/chunk1516/chunk0022.js +381 -0
- package/dist/chunk1516/chunk613852.d.ts +2 -62
- package/dist/chunk1516/chunk726433.d.ts +12 -6
- package/dist/chunk1516/chunk726433.js +313 -1
- package/dist/chunk1516/chunk940514.d.ts +6 -191
- package/dist/chunk1516/chunk940514.js +5 -647
- package/dist/chunk1617/chunk613556.d.ts +4 -0
- package/dist/chunk1617/chunk613556.js +145 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +6 -3
- package/dist/type.d.ts +296 -0
- package/dist/type.js +7 -0
- package/dist/utils.d.ts +18 -0
- package/dist/utils.js +68 -0
- package/package.json +25 -4
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
38
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39
|
+
if (ar || !(i in from)) {
|
|
40
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
41
|
+
ar[i] = from[i];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
|
+
};
|
|
46
|
+
import { useCallback, useEffect, useState } from "react";
|
|
47
|
+
export var useBrowser = function () {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
var _c = useState(new URL(window.location.href)), currentUrl = _c[0], setCurrentUrl = _c[1];
|
|
50
|
+
var _d = useState({
|
|
51
|
+
canGoBack: ((_a = window.history.state) === null || _a === void 0 ? void 0 : _a.idx) > 0,
|
|
52
|
+
canGoForward: ((_b = window.history.state) === null || _b === void 0 ? void 0 : _b.idx) < window.history.length - 1,
|
|
53
|
+
historyLength: window.history.length,
|
|
54
|
+
}), historyState = _d[0], setHistoryState = _d[1];
|
|
55
|
+
var _e = useState(navigator.onLine), isOnline = _e[0], setIsOnline = _e[1];
|
|
56
|
+
var _f = useState(false), isFullscreen = _f[0], setIsFullscreen = _f[1];
|
|
57
|
+
var _g = useState({
|
|
58
|
+
width: window.innerWidth,
|
|
59
|
+
height: window.innerHeight,
|
|
60
|
+
}), viewportSize = _g[0], setViewportSize = _g[1];
|
|
61
|
+
var _h = useState({
|
|
62
|
+
width: window.screen.width,
|
|
63
|
+
height: window.screen.height,
|
|
64
|
+
}), screenSize = _h[0], setScreenSize = _h[1];
|
|
65
|
+
// Update URL and history state when changes occur
|
|
66
|
+
var updateState = useCallback(function () {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
setCurrentUrl(new URL(window.location.href));
|
|
69
|
+
setHistoryState({
|
|
70
|
+
canGoBack: ((_a = window.history.state) === null || _a === void 0 ? void 0 : _a.idx) > 0,
|
|
71
|
+
canGoForward: ((_b = window.history.state) === null || _b === void 0 ? void 0 : _b.idx) < window.history.length - 1,
|
|
72
|
+
historyLength: window.history.length,
|
|
73
|
+
});
|
|
74
|
+
}, []);
|
|
75
|
+
// Event listeners setup
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
var handlePopState = function () { return updateState(); };
|
|
78
|
+
var handleOnline = function () { return setIsOnline(true); };
|
|
79
|
+
var handleOffline = function () { return setIsOnline(false); };
|
|
80
|
+
var handleResize = function () {
|
|
81
|
+
setViewportSize({
|
|
82
|
+
width: window.innerWidth,
|
|
83
|
+
height: window.innerHeight,
|
|
84
|
+
});
|
|
85
|
+
setScreenSize({
|
|
86
|
+
width: window.screen.width,
|
|
87
|
+
height: window.screen.height,
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
var handleFullscreenChange = function () {
|
|
91
|
+
setIsFullscreen(!!document.fullscreenElement);
|
|
92
|
+
};
|
|
93
|
+
window.addEventListener('popstate', handlePopState);
|
|
94
|
+
window.addEventListener('online', handleOnline);
|
|
95
|
+
window.addEventListener('offline', handleOffline);
|
|
96
|
+
window.addEventListener('resize', handleResize);
|
|
97
|
+
document.addEventListener('fullscreenchange', handleFullscreenChange);
|
|
98
|
+
return function () {
|
|
99
|
+
window.removeEventListener('popstate', handlePopState);
|
|
100
|
+
window.removeEventListener('online', handleOnline);
|
|
101
|
+
window.removeEventListener('offline', handleOffline);
|
|
102
|
+
window.removeEventListener('resize', handleResize);
|
|
103
|
+
document.removeEventListener('fullscreenchange', handleFullscreenChange);
|
|
104
|
+
};
|
|
105
|
+
}, [updateState]);
|
|
106
|
+
var goBack = useCallback(function () {
|
|
107
|
+
try {
|
|
108
|
+
if (historyState.canGoBack) {
|
|
109
|
+
window.history.back();
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
console.warn('Cannot go back - no history available');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
console.error('Error going back:', error);
|
|
117
|
+
window.location.href = '/';
|
|
118
|
+
}
|
|
119
|
+
}, [historyState.canGoBack]);
|
|
120
|
+
var goForward = useCallback(function () {
|
|
121
|
+
try {
|
|
122
|
+
if (historyState.canGoForward) {
|
|
123
|
+
window.history.forward();
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
console.warn('Cannot go forward - no history available');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
console.error('Error going forward:', error);
|
|
131
|
+
}
|
|
132
|
+
}, [historyState.canGoForward]);
|
|
133
|
+
var reload = useCallback(function (hardReload, scrollToTop) {
|
|
134
|
+
if (hardReload === void 0) { hardReload = false; }
|
|
135
|
+
if (scrollToTop === void 0) { scrollToTop = false; }
|
|
136
|
+
try {
|
|
137
|
+
if (scrollToTop) {
|
|
138
|
+
window.scrollTo(0, 0);
|
|
139
|
+
}
|
|
140
|
+
if (hardReload) {
|
|
141
|
+
window.location.href = window.location.href;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
window.location.reload();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
console.error('Error reloading page:', error);
|
|
149
|
+
}
|
|
150
|
+
}, []);
|
|
151
|
+
var navigateTo = useCallback(function (url, replace) {
|
|
152
|
+
if (replace === void 0) { replace = false; }
|
|
153
|
+
try {
|
|
154
|
+
var urlObj = typeof url === 'string' ? new URL(url, window.location.origin) : url;
|
|
155
|
+
if (replace) {
|
|
156
|
+
window.location.replace(urlObj.href);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
window.location.href = urlObj.href;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
console.error("Error navigating to ".concat(url, ":"), error);
|
|
164
|
+
}
|
|
165
|
+
}, []);
|
|
166
|
+
var clearBrowserData = useCallback(function () {
|
|
167
|
+
var args_1 = [];
|
|
168
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
169
|
+
args_1[_i] = arguments[_i];
|
|
170
|
+
}
|
|
171
|
+
return __awaiter(void 0, __spreadArray([], args_1, true), void 0, function (settings) {
|
|
172
|
+
var _a, clearCache, _b, clearCookies, _c, clearLocalStorage, _d, clearSessionStorage, cacheKeys, error_1;
|
|
173
|
+
if (settings === void 0) { settings = {}; }
|
|
174
|
+
return __generator(this, function (_e) {
|
|
175
|
+
switch (_e.label) {
|
|
176
|
+
case 0:
|
|
177
|
+
_a = settings.clearCache, clearCache = _a === void 0 ? false : _a, _b = settings.clearCookies, clearCookies = _b === void 0 ? false : _b, _c = settings.clearLocalStorage, clearLocalStorage = _c === void 0 ? false : _c, _d = settings.clearSessionStorage, clearSessionStorage = _d === void 0 ? false : _d;
|
|
178
|
+
_e.label = 1;
|
|
179
|
+
case 1:
|
|
180
|
+
_e.trys.push([1, 5, , 6]);
|
|
181
|
+
if (clearLocalStorage) {
|
|
182
|
+
localStorage.clear();
|
|
183
|
+
}
|
|
184
|
+
if (clearSessionStorage) {
|
|
185
|
+
sessionStorage.clear();
|
|
186
|
+
}
|
|
187
|
+
if (clearCookies) {
|
|
188
|
+
document.cookie.split(';').forEach(function (cookie) {
|
|
189
|
+
var name = cookie.split('=')[0];
|
|
190
|
+
document.cookie = "".concat(name, "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/");
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (!(clearCache && 'caches' in window)) return [3 /*break*/, 4];
|
|
194
|
+
return [4 /*yield*/, caches.keys()];
|
|
195
|
+
case 2:
|
|
196
|
+
cacheKeys = _e.sent();
|
|
197
|
+
return [4 /*yield*/, Promise.all(cacheKeys.map(function (key) { return caches.delete(key); }))];
|
|
198
|
+
case 3:
|
|
199
|
+
_e.sent();
|
|
200
|
+
_e.label = 4;
|
|
201
|
+
case 4: return [3 /*break*/, 6];
|
|
202
|
+
case 5:
|
|
203
|
+
error_1 = _e.sent();
|
|
204
|
+
console.error('Error clearing browser data:', error_1);
|
|
205
|
+
throw error_1;
|
|
206
|
+
case 6: return [2 /*return*/];
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
}, []);
|
|
211
|
+
var copyCurrentUrl = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
212
|
+
var error_2, textArea;
|
|
213
|
+
return __generator(this, function (_a) {
|
|
214
|
+
switch (_a.label) {
|
|
215
|
+
case 0:
|
|
216
|
+
_a.trys.push([0, 2, , 3]);
|
|
217
|
+
return [4 /*yield*/, navigator.clipboard.writeText(window.location.href)];
|
|
218
|
+
case 1:
|
|
219
|
+
_a.sent();
|
|
220
|
+
return [3 /*break*/, 3];
|
|
221
|
+
case 2:
|
|
222
|
+
error_2 = _a.sent();
|
|
223
|
+
console.error('Error copying URL to clipboard:', error_2);
|
|
224
|
+
textArea = document.createElement('textarea');
|
|
225
|
+
textArea.value = window.location.href;
|
|
226
|
+
document.body.appendChild(textArea);
|
|
227
|
+
textArea.select();
|
|
228
|
+
document.execCommand('copy');
|
|
229
|
+
document.body.removeChild(textArea);
|
|
230
|
+
return [3 /*break*/, 3];
|
|
231
|
+
case 3: return [2 /*return*/];
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}); }, []);
|
|
235
|
+
var openNewTab = useCallback(function (url) {
|
|
236
|
+
try {
|
|
237
|
+
window.open(url || window.location.href, '_blank', 'noopener,noreferrer');
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
console.error('Error opening new tab:', error);
|
|
241
|
+
}
|
|
242
|
+
}, []);
|
|
243
|
+
var getFaviconUrl = useCallback(function (size) {
|
|
244
|
+
if (size === void 0) { size = 32; }
|
|
245
|
+
var url = new URL(window.location.origin);
|
|
246
|
+
url.pathname = '/favicon.ico';
|
|
247
|
+
url.searchParams.set('size', size.toString());
|
|
248
|
+
return url.href;
|
|
249
|
+
}, []);
|
|
250
|
+
var getPageTitle = useCallback(function () {
|
|
251
|
+
return document.title;
|
|
252
|
+
}, []);
|
|
253
|
+
var setPageTitle = useCallback(function (title) {
|
|
254
|
+
document.title = title;
|
|
255
|
+
}, []);
|
|
256
|
+
var enableFullscreen = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
257
|
+
var error_3;
|
|
258
|
+
return __generator(this, function (_a) {
|
|
259
|
+
switch (_a.label) {
|
|
260
|
+
case 0:
|
|
261
|
+
_a.trys.push([0, 7, , 8]);
|
|
262
|
+
if (!document.documentElement.requestFullscreen) return [3 /*break*/, 2];
|
|
263
|
+
return [4 /*yield*/, document.documentElement.requestFullscreen()];
|
|
264
|
+
case 1:
|
|
265
|
+
_a.sent();
|
|
266
|
+
return [3 /*break*/, 6];
|
|
267
|
+
case 2:
|
|
268
|
+
if (!document.documentElement.webkitRequestFullscreen) return [3 /*break*/, 4];
|
|
269
|
+
return [4 /*yield*/, document.documentElement.webkitRequestFullscreen()];
|
|
270
|
+
case 3:
|
|
271
|
+
_a.sent();
|
|
272
|
+
return [3 /*break*/, 6];
|
|
273
|
+
case 4:
|
|
274
|
+
if (!document.documentElement.msRequestFullscreen) return [3 /*break*/, 6];
|
|
275
|
+
return [4 /*yield*/, document.documentElement.msRequestFullscreen()];
|
|
276
|
+
case 5:
|
|
277
|
+
_a.sent();
|
|
278
|
+
_a.label = 6;
|
|
279
|
+
case 6: return [3 /*break*/, 8];
|
|
280
|
+
case 7:
|
|
281
|
+
error_3 = _a.sent();
|
|
282
|
+
console.error('Error enabling fullscreen:', error_3);
|
|
283
|
+
throw error_3;
|
|
284
|
+
case 8: return [2 /*return*/];
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}); }, []);
|
|
288
|
+
var disableFullscreen = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
289
|
+
var error_4;
|
|
290
|
+
return __generator(this, function (_a) {
|
|
291
|
+
switch (_a.label) {
|
|
292
|
+
case 0:
|
|
293
|
+
_a.trys.push([0, 7, , 8]);
|
|
294
|
+
if (!document.exitFullscreen) return [3 /*break*/, 2];
|
|
295
|
+
return [4 /*yield*/, document.exitFullscreen()];
|
|
296
|
+
case 1:
|
|
297
|
+
_a.sent();
|
|
298
|
+
return [3 /*break*/, 6];
|
|
299
|
+
case 2:
|
|
300
|
+
if (!document.webkitExitFullscreen) return [3 /*break*/, 4];
|
|
301
|
+
return [4 /*yield*/, document.webkitExitFullscreen()];
|
|
302
|
+
case 3:
|
|
303
|
+
_a.sent();
|
|
304
|
+
return [3 /*break*/, 6];
|
|
305
|
+
case 4:
|
|
306
|
+
if (!document.msExitFullscreen) return [3 /*break*/, 6];
|
|
307
|
+
return [4 /*yield*/, document.msExitFullscreen()];
|
|
308
|
+
case 5:
|
|
309
|
+
_a.sent();
|
|
310
|
+
_a.label = 6;
|
|
311
|
+
case 6: return [3 /*break*/, 8];
|
|
312
|
+
case 7:
|
|
313
|
+
error_4 = _a.sent();
|
|
314
|
+
console.error('Error disabling fullscreen:', error_4);
|
|
315
|
+
throw error_4;
|
|
316
|
+
case 8: return [2 /*return*/];
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
}); }, []);
|
|
320
|
+
var printPage = useCallback(function () {
|
|
321
|
+
window.print();
|
|
322
|
+
}, []);
|
|
323
|
+
var getUserAgent = useCallback(function () {
|
|
324
|
+
return navigator.userAgent;
|
|
325
|
+
}, []);
|
|
326
|
+
var shareContent = useCallback(function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
327
|
+
return __generator(this, function (_a) {
|
|
328
|
+
switch (_a.label) {
|
|
329
|
+
case 0:
|
|
330
|
+
if (!navigator.share) {
|
|
331
|
+
throw new Error('Web Share API not supported');
|
|
332
|
+
}
|
|
333
|
+
return [4 /*yield*/, navigator.share(data)];
|
|
334
|
+
case 1:
|
|
335
|
+
_a.sent();
|
|
336
|
+
return [2 /*return*/];
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}); }, []);
|
|
340
|
+
var closeCurrentTab = useCallback(function () {
|
|
341
|
+
try {
|
|
342
|
+
// Note: This will only work if the tab was opened by JavaScript
|
|
343
|
+
// Browsers typically prevent closing windows/tabs not opened by script
|
|
344
|
+
window.close();
|
|
345
|
+
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
console.error('Error closing tab:', error);
|
|
348
|
+
// Fallback: Redirect to about:blank
|
|
349
|
+
window.location.href = 'about:blank';
|
|
350
|
+
}
|
|
351
|
+
}, []);
|
|
352
|
+
return {
|
|
353
|
+
currentUrl: currentUrl,
|
|
354
|
+
currentPath: currentUrl.pathname,
|
|
355
|
+
currentHash: currentUrl.hash,
|
|
356
|
+
currentSearchParams: currentUrl.searchParams,
|
|
357
|
+
goBack: goBack,
|
|
358
|
+
goForward: goForward,
|
|
359
|
+
reload: reload,
|
|
360
|
+
navigateTo: navigateTo,
|
|
361
|
+
clearBrowserData: clearBrowserData,
|
|
362
|
+
historyState: historyState,
|
|
363
|
+
isOnline: isOnline,
|
|
364
|
+
copyCurrentUrl: copyCurrentUrl,
|
|
365
|
+
openNewTab: openNewTab,
|
|
366
|
+
getFaviconUrl: getFaviconUrl,
|
|
367
|
+
getPageTitle: getPageTitle,
|
|
368
|
+
setPageTitle: setPageTitle,
|
|
369
|
+
isSecureContext: window.isSecureContext,
|
|
370
|
+
viewportSize: viewportSize,
|
|
371
|
+
screenSize: screenSize,
|
|
372
|
+
enableFullscreen: enableFullscreen,
|
|
373
|
+
disableFullscreen: disableFullscreen,
|
|
374
|
+
isFullscreen: isFullscreen,
|
|
375
|
+
printPage: printPage,
|
|
376
|
+
getUserAgent: getUserAgent,
|
|
377
|
+
shareContent: shareContent,
|
|
378
|
+
isShareSupported: 'share' in navigator,
|
|
379
|
+
closeCurrentTab: closeCurrentTab,
|
|
380
|
+
};
|
|
381
|
+
};
|
|
@@ -1,70 +1,10 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
+
import { FileComponentProps, AlertPropsType, DetailsCardProps, UploadButtonProps, DownloadFileProps, ContextMenuProps } from '../type';
|
|
2
3
|
export declare const DynamicLoader: (Component: any) => (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
|
|
4
|
-
type: string;
|
|
5
|
-
msg: string;
|
|
6
|
-
duration?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const AlertMessage: FC<PropsType>;
|
|
9
|
-
interface DetailsCardProps {
|
|
10
|
-
isLoading?: boolean;
|
|
11
|
-
title: string;
|
|
12
|
-
details: any[];
|
|
13
|
-
spacing?: number;
|
|
14
|
-
boxShadow?: string;
|
|
15
|
-
background?: string;
|
|
16
|
-
loaderType?: 'skeleton' | 'circular';
|
|
17
|
-
displayType?: 'flex' | 'block';
|
|
18
|
-
}
|
|
4
|
+
export declare const AlertMessage: FC<AlertPropsType>;
|
|
19
5
|
export declare const DetailsCard: ({ isLoading, title, details, spacing, boxShadow, background, loaderType, displayType, }: DetailsCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
6
|
export declare const LabeledValue: ({ label, value, style }: any) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
interface FileComponentProps {
|
|
22
|
-
primaryKey: string | number;
|
|
23
|
-
filename: string;
|
|
24
|
-
size: string | number;
|
|
25
|
-
onDownload?: any;
|
|
26
|
-
width?: number;
|
|
27
|
-
borderColor?: string;
|
|
28
|
-
fileColor?: 'inherit' | 'primary' | 'secondary' | 'error' | 'disabled' | 'action';
|
|
29
|
-
isDownloading: boolean;
|
|
30
|
-
}
|
|
31
7
|
export declare const FilePreview: ({ primaryKey, filename, size, onDownload, width, borderColor, fileColor, isDownloading, }: FileComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
interface UploadButtonProps {
|
|
33
|
-
isUpload?: boolean;
|
|
34
|
-
color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
35
|
-
state?: {
|
|
36
|
-
isUploaded?: boolean;
|
|
37
|
-
isUploadError?: boolean;
|
|
38
|
-
isLoadingUpload?: boolean;
|
|
39
|
-
};
|
|
40
|
-
onFileSelect: (file: File) => void;
|
|
41
|
-
}
|
|
42
8
|
export declare const UploadFile: React.FC<UploadButtonProps>;
|
|
43
|
-
interface DownloadButtonState {
|
|
44
|
-
isDownloaded?: boolean;
|
|
45
|
-
isDownloadError?: boolean;
|
|
46
|
-
isLoadingDownload?: boolean;
|
|
47
|
-
}
|
|
48
|
-
interface DownloadFileProps {
|
|
49
|
-
isDownload?: boolean;
|
|
50
|
-
color?: 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
|
|
51
|
-
state?: DownloadButtonState;
|
|
52
|
-
onDownload: () => void;
|
|
53
|
-
}
|
|
54
9
|
export declare const DownloadFile: React.FC<DownloadFileProps>;
|
|
55
|
-
type MenuPosition = 'auto' | 'fixed';
|
|
56
|
-
type ThemeMode = 'light' | 'dark';
|
|
57
|
-
interface ContextMenuProps {
|
|
58
|
-
options: any;
|
|
59
|
-
children: React.ReactNode;
|
|
60
|
-
disabled?: boolean;
|
|
61
|
-
className?: string;
|
|
62
|
-
menuClassName?: string;
|
|
63
|
-
position?: MenuPosition;
|
|
64
|
-
onShow?: () => void;
|
|
65
|
-
onHide?: () => void;
|
|
66
|
-
currentInstance?: any;
|
|
67
|
-
theme?: ThemeMode;
|
|
68
|
-
}
|
|
69
10
|
export declare const ContextMenuWrapper: React.FC<ContextMenuProps>;
|
|
70
|
-
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
import { UseRecentSearchOptions, ISpeechOptions, ISpeechState, MotionSensorState, IPermissionDescriptor, IState } from "../type";
|
|
1
3
|
export declare function useHistoryState<T>(initialPresent: T): {
|
|
2
4
|
state: T;
|
|
3
5
|
set: (newPresent: T) => void;
|
|
@@ -37,16 +39,20 @@ export declare function useLongPress(callback: (event: Event) => void, options?:
|
|
|
37
39
|
onTouchStart: any;
|
|
38
40
|
onTouchEnd: any;
|
|
39
41
|
};
|
|
40
|
-
type UseRecentSearchOptions = {
|
|
41
|
-
key?: string;
|
|
42
|
-
limit?: number;
|
|
43
|
-
uniqueKey?: string;
|
|
44
|
-
excludeEmpty?: boolean;
|
|
45
|
-
};
|
|
46
42
|
export declare const useRecentSearch: (options?: UseRecentSearchOptions) => {
|
|
47
43
|
recentSearches: any;
|
|
48
44
|
addSearch: (item: any) => void;
|
|
49
45
|
clearSearch: () => void;
|
|
50
46
|
hasSearch: (value: string) => any;
|
|
51
47
|
};
|
|
48
|
+
export declare const useUnmountedRef: () => import("react").MutableRefObject<boolean>;
|
|
49
|
+
export declare function configResponsive(config: any): void;
|
|
50
|
+
export declare const useResponsive: () => any;
|
|
51
|
+
export declare const useClickAway: <E extends Event = Event>(ref: RefObject<HTMLElement | null>, onClickAway: (event: E) => void, events?: string[]) => void;
|
|
52
|
+
export declare const useBeforeUnload: (enabled?: boolean | (() => boolean), message?: string) => void;
|
|
53
|
+
export declare const useHoverDirty: (ref: RefObject<Element>, enabled?: boolean) => boolean;
|
|
54
|
+
export declare const useMotion: (initialState?: MotionSensorState) => MotionSensorState;
|
|
55
|
+
export declare const usePageLeave: (onPageLeave: any, args?: never[]) => void;
|
|
56
|
+
export declare const usePermission: (permissionDesc: IPermissionDescriptor) => IState;
|
|
57
|
+
export declare const useSpeech: (text: string, options: ISpeechOptions) => ISpeechState;
|
|
52
58
|
export {};
|