@reactuses/core 6.1.1 → 6.1.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/index.d.mts CHANGED
@@ -10,6 +10,7 @@ import { FetchEventSourceInit } from '@microsoft/fetch-event-source';
10
10
  * @title useActiveElement
11
11
  * @returns_en Returns an instance of the type parameter `T` or `null`.
12
12
  * @returns 返回类型参数 `T` 或 `null` 的实例
13
+ * @returns_zh-Hant 返回類型參數 `T` 或 `null` 的實例
13
14
  */
14
15
  type UseActiveElement = <T extends Element>() => T | null;
15
16
 
@@ -22,17 +23,20 @@ declare const useActiveElement: UseActiveElement;
22
23
  type UseAsyncEffect = <T>(
23
24
  /**
24
25
  * @zh 支持promise的副作用函数
26
+ * @zh-Hant 支援promise的副作用函數
25
27
  * @en effect that support promise
26
28
  */
27
29
  effect: () => Promise<T> | T,
28
30
  /**
29
31
  * @zh 清理函数
32
+ * @zh-Hant 清理函數
30
33
  * @en cleanup function
31
34
  * @defaultValue () => {}
32
35
  */
33
36
  cleanup?: typeof effect,
34
37
  /**
35
38
  * @zh 依赖列表
39
+ * @zh-Hant 依賴列表
36
40
  * @en dependency list
37
41
  */
38
42
  deps?: DependencyList) => void;
@@ -49,16 +53,19 @@ type BasicTarget<T extends TargetType = Element> = (() => TargetValue<T>) | Targ
49
53
  type UseClickOutside = (
50
54
  /**
51
55
  * @zh dom对象
56
+ * @zh-Hant dom對象
52
57
  * @en dom element
53
58
  */
54
59
  target: BasicTarget<Element>,
55
60
  /**
56
61
  * @zh 监听函数
62
+ * @zh-Hant 監聽函數
57
63
  * @en listener fucntion
58
64
  */
59
65
  handler: (evt: EventType) => void,
60
66
  /**
61
67
  * @zh 监听函数是否生效
68
+ * @zh-Hant 監聽函數是否生效
62
69
  * @en whether the listener fucntion is enabled
63
70
  */
64
71
  enabled?: boolean) => void;
@@ -76,20 +83,27 @@ declare const useClickOutside: UseClickOutside;
76
83
  * - The current value of the cookie.
77
84
  * - A function to update the value of the cookie.
78
85
  * - A function to refresh the value of the cookie, incase other events change it.
86
+ * @returns_zh-Hant 包含以下元素的元組:
87
+ * - cookie 的當前值。
88
+ * - 更新 cookie 值的函數。
89
+ * - 刷新 cookie 值的函數,以防其他事件更改它。
79
90
  */
80
91
  type UseCookie = (
81
92
  /**
82
93
  * @zh 键值
94
+ * @zh-Hant 鍵值
83
95
  * @en key
84
96
  */
85
97
  key: string,
86
98
  /**
87
99
  * @zh 透传给 `js-cookie` 的参数
100
+ * @zh-Hant 透傳給 `js-cookie` 的參數
88
101
  * @en option pass to `js-cookie`
89
102
  */
90
103
  options?: Cookies.CookieAttributes,
91
104
  /**
92
105
  * @zh 默认值,ssr必须传递
106
+ * @zh-Hant 預設值,ssr必須傳遞
93
107
  * @en defaultValue, must be required in ssr
94
108
  */
95
109
  defaultValue?: string) => readonly [
@@ -114,21 +128,28 @@ declare const useCookie: UseCookie;
114
128
  * - 小时。
115
129
  * - 分钟。
116
130
  * - 秒数。
131
+ * @returns_zh-Hant 包含以下元素的元組:
132
+ * - 小時。
133
+ * - 分鐘。
134
+ * - 秒數。
117
135
  */
118
136
  type UseCountDown = (
119
137
  /**
120
138
  * @zh 时间差
139
+ * @zh-Hant 時間差
121
140
  * @en time differ
122
141
  */
123
142
  time: number,
124
143
  /**
125
144
  * @zh 时间格式化函数
145
+ * @zh-Hant 時間格式化函數
126
146
  * @en time format function
127
147
  * @defaultValue HH MM SS
128
148
  */
129
149
  format?: (num: number) => [string, string, string],
130
150
  /**
131
151
  * @zh 倒计时结束的回调函数
152
+ * @zh-Hant 倒計時結束的回調函數
132
153
  * @en callback function for end of countdown
133
154
  */
134
155
  callback?: () => void) => readonly [string, string, string];
@@ -143,27 +164,36 @@ declare const useCountDown: UseCountDown;
143
164
  * - A function to increment the counter. It optionally accepts a number to increment the counter by, defaulting to 1.
144
165
  * - A function to decrement the counter. It optionally accepts a number to decrement the counter by, defaulting to 1.
145
166
  * - A function to reset the counter to its initial value.
146
- * @returns 包含以下元素的元组:
167
+ * @returns 包含以下元素的元组:
147
168
  * - 计数器的当前值。
148
169
  * - 设置计数器状态的函数。 它可以接受数字或返回数字的函数。
149
170
  * - 递增计数器的函数。 它可以选择接受一个数字来增加计数器,默认为 1。
150
171
  * - 递减计数器的函数。 它可以选择接受一个数字来减少计数器,默认为 1。
151
172
  * - 将计数器重置为其初始值的函数。
173
+ * @returns_zh-Hant 包含以下元素的元組:
174
+ * - 計數器的當前值。
175
+ * - 設定計數器狀態的函數。它可以接受數字或返回數字的函數。
176
+ * - 遞增計數器的函數。它可以選擇接受一個數字來增加計數器,預設為 1。
177
+ * - 遞減計數器的函數。它可以選擇接受一個數字來減少計數器,預設為 1。
178
+ * - 將計數器重設為其初始值的函數。
152
179
  */
153
180
  type UseCounter = (
154
181
  /**
155
182
  * @zh 初始值,可以为数字或者一个初始化的函数
183
+ * @zh-Hant 初始值,可以為數字或者一個初始化的函數
156
184
  * @en The initial value of the counter. It can be a number or a function that returns a number. If not provided, the counter will start from 0.
157
185
  * @defaultValue 0
158
186
  */
159
187
  initialValue?: number | (() => number),
160
188
  /**
161
189
  * @zh 最大值。不提供则无上限
190
+ * @zh-Hant 最大值。不提供則無上限
162
191
  * @en The maximum value that the counter can reach. If not provided or null, there is no upper limit.
163
192
  */
164
193
  max?: number | null,
165
194
  /**
166
195
  * @zh 最小值。不提供则无下限
196
+ * @zh-Hant 最小值。不提供則無下限
167
197
  * @en The minimum value that the counter can reach. If not provided or null, there is no lower limit.
168
198
  */
169
199
  min?: number | null) => readonly [
@@ -185,25 +215,32 @@ declare const defaultOptions: UseCssVarOptions;
185
215
  * @returns 包含以下元素的元组:
186
216
  * - css 变量值
187
217
  * - 更新 css 变量值的函数
218
+ * @returns_zh-Hant 包含以下元素的元組:
219
+ * - css 變數值
220
+ * - 更新 css 變數值的函數
188
221
  */
189
222
  type UseCssVar = <T extends HTMLElement = HTMLElement>(
190
223
  /**
191
224
  * @zh 属性值,比如 --color
225
+ * @zh-Hant 屬性值,比如 --color
192
226
  * @en prop, eg: --color
193
227
  */
194
228
  prop: string,
195
229
  /**
196
230
  * @zh dom元素
231
+ * @zh-Hant dom元素
197
232
  * @en dom element
198
233
  */
199
234
  target: BasicTarget<T>,
200
235
  /**
201
236
  * @zh 默认值
237
+ * @zh-Hant 預設值
202
238
  * @en default value
203
239
  */
204
240
  defaultValue?: string,
205
241
  /**
206
242
  * @zh 可选项
243
+ * @zh-Hant 可選項
207
244
  * @en options
208
245
  */
209
246
  options?: UseCssVarOptions) => readonly [string, (v: string) => void];
@@ -214,6 +251,7 @@ interface UseCssVarOptions {
214
251
  /**
215
252
  * @en Use MutationObserver to monitor variable changes
216
253
  * @zh 使用 MutationObserver 来监听变量变更
254
+ * @zh-Hant 使用 MutationObserver 來監聽變數變更
217
255
  * @defaultValue false
218
256
  */
219
257
  observe?: boolean;
@@ -228,16 +266,19 @@ type DepsEqualFnType<TDeps extends DependencyList> = (prevDeps: TDeps, nextDeps:
228
266
  type UseCustomCompareEffect = <TDeps extends DependencyList>(
229
267
  /**
230
268
  * @zh 副作用函数
269
+ * @zh-Hant 副作用函數
231
270
  * @en effect callback
232
271
  */
233
272
  effect: EffectCallback,
234
273
  /**
235
274
  * @zh 依赖列表
275
+ * @zh-Hant 依賴列表
236
276
  * @en deps
237
277
  */
238
278
  deps: TDeps,
239
279
  /**
240
280
  * @zh 依赖比较函数
281
+ * @zh-Hant 依賴比較函數
241
282
  * @en deps compare function
242
283
  */
243
284
  depsEqual: DepsEqualFnType<TDeps>) => void;
@@ -254,15 +295,21 @@ declare const useCustomCompareEffect: UseCustomCompareEffect;
254
295
  * - 数组中当前的索引对象值
255
296
  * - 设置索引为前一个的函数
256
297
  * - 设置索引为后一个的函数
298
+ * @returns_zh-Hant 包含以下元素的元組:
299
+ * - 陣列中當前的索引對象值
300
+ * - 設定索引為前一個的函數
301
+ * - 設定索引為後一個的函數
257
302
  */
258
303
  type UseCycleList = <T>(
259
304
  /**
260
305
  * @zh 循环数组
306
+ * @zh-Hant 循環陣列
261
307
  * @en cycle array
262
308
  */
263
309
  list: T[],
264
310
  /**
265
311
  * @zh 数组索引
312
+ * @zh-Hant 陣列索引
266
313
  * @en array index
267
314
  */
268
315
  i?: number) => readonly [T, (i?: number) => void, (i?: number) => void];
@@ -276,41 +323,48 @@ interface UseDarkOptions {
276
323
  /**
277
324
  * @en CSS Selector for the target element applying to
278
325
  * @zh 适用于目标元素的 CSS 选择器
326
+ * @zh-Hant 適用於目標元素的 CSS 選擇器
279
327
  * @defaultValue 'html'
280
328
  */
281
329
  selector?: string;
282
330
  /**
283
331
  * @en HTML attribute applying the target element
284
332
  * @zh 应用到目标元素的 html 属性
333
+ * @zh-Hant 應用到目標元素的 html 屬性
285
334
  * @defaultValue 'class'
286
335
  */
287
336
  attribute?: string;
288
337
  /**
289
338
  * @en default value
290
339
  * @zh 默认值
340
+ * @zh-Hant 預設值
291
341
  * @defaultValue false
292
342
  */
293
343
  defaultValue?: boolean;
294
344
  /**
295
345
  * @en Key to persist the data into localStorage/sessionStorage.
296
346
  * @zh 将数据持久保存到 localStorage/sessionStorage 的键值
347
+ * @zh-Hant 將資料持久保存到 localStorage/sessionStorage 的鍵值
297
348
  * @defaultValue 'reactuses-color-scheme'
298
349
  */
299
350
  storageKey?: string;
300
351
  /**
301
352
  * @en Storage object, can be localStorage or sessionStorage
302
353
  * @zh 存储对象,可以是localStorage或sessionStorage
354
+ * @zh-Hant 儲存對象,可以是localStorage或sessionStorage
303
355
  * @defaultValue `localStorage`
304
356
  */
305
357
  storage?: () => Storage;
306
358
  /**
307
359
  * @en name dark apply to element
308
360
  * @zh 应用到目标元素上黑色类名称
361
+ * @zh-Hant 應用到目標元素上黑色類名稱
309
362
  */
310
363
  classNameDark: string;
311
364
  /**
312
365
  * @en name light apply to element
313
366
  * @zh 应用到目标元素上的亮色类名称
367
+ * @zh-Hant 應用到目標元素上的亮色類名稱
314
368
  */
315
369
  classNameLight: string;
316
370
  }
@@ -324,6 +378,10 @@ interface UseDarkOptions {
324
378
  * - 黑暗状态的当前值。
325
379
  * - 切换黑暗状态的功能。
326
380
  * - 更新黑暗状态的功能。
381
+ * @returns_zh-Hant 包含以下元素的元組:
382
+ * - 黑暗狀態的當前值。
383
+ * - 切換黑暗狀態的功能。
384
+ * - 更新黑暗狀態的功能。
327
385
  */
328
386
  type UseDarkMode = (options: UseDarkOptions) => readonly [
329
387
  boolean | null,
@@ -339,16 +397,19 @@ declare const useDarkMode: UseDarkMode;
339
397
  type UseDebounce = <T>(
340
398
  /**
341
399
  * @zh 要防抖的值
400
+ * @zh-Hant 要防抖的值
342
401
  * @en the value need to debounce
343
402
  */
344
403
  value: T,
345
404
  /**
346
405
  * @zh 间隔时间
406
+ * @zh-Hant 間隔時間
347
407
  * @en wait time
348
408
  */
349
409
  wait?: number,
350
410
  /**
351
411
  * @zh 传递给 `lodash.debounce` 的选项
412
+ * @zh-Hant 傳遞給 `lodash.debounce` 的選項
352
413
  * @en options passed to `lodash.debounce`
353
414
  */
354
415
  options?: DebounceSettings) => T;
@@ -365,20 +426,27 @@ declare const useDebounce: UseDebounce;
365
426
  * - run:执行函数。
366
427
  * - cancel:取消执行函数。
367
428
  * - flush: 立即执行函数
429
+ * @returns_zh-Hant 具有以下元素的對象:
430
+ * - run:執行函數。
431
+ * - cancel:取消執行函數。
432
+ * - flush: 立即執行函數
368
433
  */
369
434
  type UseDebounceFn = <T extends (...args: any) => any>(
370
435
  /**
371
436
  * @zh 要防抖的函数
437
+ * @zh-Hant 要防抖的函數
372
438
  * @en debounce function
373
439
  */
374
440
  fn: T,
375
441
  /**
376
442
  * @zh 间隔时间
443
+ * @zh-Hant 間隔時間
377
444
  * @en wait time
378
445
  */
379
446
  wait?: number,
380
447
  /**
381
448
  * @zh 传递给 `lodash.debounce` 的属性
449
+ * @zh-Hant 傳遞給 `lodash.debounce` 的屬性
382
450
  * @en options passed to `lodash.debounce`
383
451
  */
384
452
  options?: DebounceSettings$1) => {
@@ -395,11 +463,13 @@ declare const useDebounceFn: UseDebounceFn;
395
463
  type UseDeepCompareEffect = (
396
464
  /**
397
465
  * @zh 副作用函数
466
+ * @zh-Hant 副作用函數
398
467
  * @en effect function
399
468
  */
400
469
  effect: EffectCallback,
401
470
  /**
402
471
  * @zh 依赖列表
472
+ * @zh-Hant 依賴列表
403
473
  * @en dep list
404
474
  */
405
475
  deps: DependencyList) => void;
@@ -418,21 +488,25 @@ type UseDoubleClick = (props: UseDoubleClickProps) => void;
418
488
  interface UseDoubleClickProps {
419
489
  /**
420
490
  * @zh dom对象
491
+ * @zh-Hant dom對象
421
492
  * @en dom element
422
493
  */
423
494
  target: BasicTarget<Element>;
424
495
  /**
425
496
  * @zh 延迟时间(毫秒)
497
+ * @zh-Hant 延遲時間(毫秒)
426
498
  * @en latency time (milliseconds)
427
499
  */
428
500
  latency?: number | undefined;
429
501
  /**
430
502
  * @zh 单击事件处理函数
503
+ * @zh-Hant 單擊事件處理函數
431
504
  * @en single click event handler
432
505
  */
433
506
  onSingleClick?: ((e?: MouseEvent | TouchEvent) => void) | undefined;
434
507
  /**
435
508
  * @zh 双击事件处理函数
509
+ * @zh-Hant 雙擊事件處理函數
436
510
  * @en double click event handler
437
511
  */
438
512
  onDoubleClick?: ((e?: MouseEvent | TouchEvent) => void) | undefined;
@@ -480,15 +554,22 @@ interface Pausable$1 {
480
554
  * - y
481
555
  * - Whether the element is being dragged
482
556
  * set the element position
557
+ * @returns_zh-Hant 包含以下元素的元組:
558
+ * - x
559
+ * - y
560
+ * - 元素是否在拖動中
561
+ * - 設定元素的位置
483
562
  */
484
563
  type UseDraggable = (
485
564
  /**
486
565
  * @zh dom对象
566
+ * @zh-Hant dom對象
487
567
  * @en dom element
488
568
  */
489
569
  target: BasicTarget<HTMLElement | SVGElement>,
490
570
  /**
491
571
  * @zh 可选参数
572
+ * @zh-Hant 可選參數
492
573
  * @en optional params
493
574
  */
494
575
  options?: UseDraggableOptions) => readonly [number, number, boolean, Dispatch<SetStateAction<Position>>];
@@ -567,15 +648,18 @@ declare const useDraggable: UseDraggable;
567
648
  * @title useDropZone
568
649
  * @returns 文件是否在区域上
569
650
  * @returns_en Whether the file is on the zone
651
+ * @returns_zh-Hant 檔案是否在區域上
570
652
  */
571
653
  type UseDropZone = (
572
654
  /**
573
655
  * @zh 目标元素
656
+ * @zh-Hant 目標元素
574
657
  * @en target element
575
658
  */
576
659
  target: BasicTarget<EventTarget>,
577
660
  /**
578
661
  * @zh 拖拽释放时候的回调
662
+ * @zh-Hant 拖拽釋放時候的回調
579
663
  * @en drop callback
580
664
  */
581
665
  onDrop?: ((files: File[] | null) => void) | undefined) => boolean;
@@ -588,11 +672,13 @@ declare const useDropZone: UseDropZone;
588
672
  type UseElementBounding = (
589
673
  /**
590
674
  * @zh 目标元素
675
+ * @zh-Hant 目標元素
591
676
  * @en target element
592
677
  */
593
678
  target: BasicTarget<Element>,
594
679
  /**
595
680
  * @zh 可选参数
681
+ * @zh-Hant 可選參數
596
682
  * @en optional params
597
683
  */
598
684
  options?: UseElementBoundingOptions) => UseElementBoundingReturn;
@@ -686,10 +772,14 @@ declare const useElementBounding: UseElementBounding;
686
772
  * @returns 包含以下元素的元组:
687
773
  * - 元素宽度。
688
774
  * - 元素高度。
775
+ * @returns_zh-Hant 包含以下元素的元組:
776
+ * - 元素寬度。
777
+ * - 元素高度。
689
778
  */
690
779
  type UseElementSize = (
691
780
  /**
692
781
  * @zh dom对象
782
+ * @zh-Hant dom對象
693
783
  * @en dom element
694
784
  */
695
785
  target: BasicTarget<Element>,
@@ -709,15 +799,20 @@ declare const useElementSize: UseElementSize;
709
799
  * @returns_en A tuple with the following elements:
710
800
  * - is the current element visible.
711
801
  * - stop observer listening function.
802
+ * @returns_zh-Hant 包含以下元素的元組:
803
+ * - 當前元素是否可見。
804
+ * - 停止監聽函數。
712
805
  */
713
806
  type UseElementVisibility = (
714
807
  /**
715
808
  * @zh dom对象
809
+ * @zh-Hant dom對象
716
810
  * @en dom element
717
811
  */
718
812
  target: BasicTarget<HTMLElement | SVGElement>,
719
813
  /**
720
814
  * @zh 传递给 `intersectionObserver` 的选项
815
+ * @zh-Hant 傳遞給 `intersectionObserver` 的選項
721
816
  * @en options passed to `intersectionObserver`
722
817
  */
723
818
  options?: IntersectionObserverInit) => readonly [boolean, () => void];
@@ -730,6 +825,7 @@ declare const useElementVisibility: UseElementVisibility;
730
825
  type UseEvent = <T extends Fn>(
731
826
  /**
732
827
  * @zh 函数
828
+ * @zh-Hant 函數
733
829
  * @en function
734
830
  */
735
831
  fn: T) => T;
@@ -749,6 +845,10 @@ declare const useEvent: UseEvent;
749
845
  * - a function to add lisenter.
750
846
  * - fire functiion.
751
847
  * stop functiion
848
+ * @returns_zh-Hant 包含以下元素的元組:
849
+ * - 添加監聽器的函數。
850
+ * - 觸發函數。
851
+ * - 停止函數。
752
852
  */
753
853
  type UseEventEmitter = <T, U = void>() => readonly [
754
854
  UseEventEmitterEvent<T, U>,
@@ -803,6 +903,9 @@ declare function useEventListener(eventName: string, handler: (...p: any) => voi
803
903
  * @returns_en A tuple with the following elements:
804
904
  * - Whether the browser supports this feature.
805
905
  * - A function to open eye dropper.
906
+ * @returns_zh-Hant 包含以下元素的元組:
907
+ * - 瀏覽器是否支援該特性。
908
+ * - 打開顏色選擇器的函數。
806
909
  */
807
910
  type UseEyeDropper = () => readonly [
808
911
  boolean,
@@ -814,6 +917,7 @@ type UseEyeDropper = () => readonly [
814
917
  interface UseEyeDropperOpenOptions {
815
918
  /**
816
919
  * @zh 终止信号
920
+ * @zh-Hant 終止信號
817
921
  * @en abort signal
818
922
  */
819
923
  signal?: AbortSignal;
@@ -843,6 +947,10 @@ declare function useFavicon(href: string, baseUrl?: string, rel?: string): void;
843
947
  * - file array.
844
948
  * - A function to open file dialog.
845
949
  * - A function to reset files
950
+ * @returns_zh-Hant 包含以下元素的元組:
951
+ * - 檔案陣列。
952
+ * - 打開檔案選擇器函數。
953
+ * - 重設函數。
846
954
  */
847
955
  type UseFileDialog = (options?: UseFileDialogOptions) => readonly [
848
956
  FileList | null,
@@ -855,6 +963,7 @@ type UseFileDialog = (options?: UseFileDialogOptions) => readonly [
855
963
  interface UseFileDialogOptions {
856
964
  /**
857
965
  * @zh 选择多个文件
966
+ * @zh-Hant 選擇多個檔案
858
967
  * @en choose multiple file
859
968
  * @defaultValue true
860
969
  */
@@ -877,6 +986,9 @@ declare const useFileDialog: UseFileDialog;
877
986
 
878
987
  /**
879
988
  * @title useFirstMountState
989
+ * @returns 组件是否刚刚挂载的布尔值
990
+ * @returns_en A boolean value indicating whether the component is just mounted
991
+ * @returns_zh-Hant 組件是否剛剛掛載的布爾值
880
992
  */
881
993
  type UseFirstMountState = () => boolean;
882
994
 
@@ -890,15 +1002,20 @@ declare const useFirstMountState: UseFirstMountState;
890
1002
  * @returns_en A tuple with the following elements:
891
1003
  * - whether the element focus.
892
1004
  * - A function to update focus state.
1005
+ * @returns_zh-Hant 包含以下元素的元組:
1006
+ * - 元素是否聚焦。
1007
+ * - 更新聚焦狀態。
893
1008
  */
894
1009
  type UseFocus = (
895
1010
  /**
896
1011
  * @zh dom对象
1012
+ * @zh-Hant dom對象
897
1013
  * @en dom element
898
1014
  */
899
1015
  target: BasicTarget<HTMLElement | SVGElement>,
900
1016
  /**
901
1017
  * @zh 默认值
1018
+ * @zh-Hant 預設值
902
1019
  * @en defaultValue
903
1020
  * @defaultValue false
904
1021
  */
@@ -910,6 +1027,7 @@ declare const useFocus: UseFocus;
910
1027
  * @title useFps
911
1028
  * @returns 每秒帧数
912
1029
  * @returns_en frames per second
1030
+ * @returns_zh-Hant 每秒幀數
913
1031
  */
914
1032
  type UseFps = (options?: UseFpsOptions) => number;
915
1033
  /**
@@ -919,6 +1037,7 @@ interface UseFpsOptions {
919
1037
  /**
920
1038
  * @en Calculate the FPS on every x frames.
921
1039
  * @zh 每过 x 帧计算一次
1040
+ * @zh-Hant 每過 x 幀計算一次
922
1041
  * @defaultValue 10
923
1042
  */
924
1043
  every?: number;
@@ -942,10 +1061,18 @@ declare function useFps(options?: UseFpsOptions): number;
942
1061
  * - exitFullscreen
943
1062
  * - toggleFullscreen
944
1063
  * - isEnabled: whether the browser support fullscreen
1064
+ * @returns_zh-Hant 包含以下元素的元組:
1065
+ * - 當前是否處於全螢幕。
1066
+ * - 一個操作對象:
1067
+ * - enterFullscreen: 進入全螢幕。
1068
+ * - exitFullscreen: 退出全螢幕。
1069
+ * - toggleFullscreen: 切換全螢幕。
1070
+ * - isEnabled: 當前瀏覽器是否支援全螢幕。
945
1071
  */
946
1072
  type UseFullscreen = (
947
1073
  /**
948
1074
  * @zh dom元素
1075
+ * @zh-Hant dom元素
949
1076
  * @en dom element
950
1077
  */
951
1078
  target: BasicTarget<Element>,
@@ -1012,10 +1139,16 @@ declare const useFullscreen: UseFullscreen;
1012
1139
  * - timestamp when get coordinates.
1013
1140
  * - errors.
1014
1141
  * - Whether the browser supports `geolocation`.
1142
+ * @returns_zh-Hant 包含以下元素的對象:
1143
+ * - 坐標。
1144
+ * - 獲取坐標的時間戳。
1145
+ * - 錯誤。
1146
+ * - 瀏覽器是否支援 `geolocation`。
1015
1147
  */
1016
1148
  type UseGeolocation = (
1017
1149
  /**
1018
1150
  * @zh 可选 `PositionOptions` 参数
1151
+ * @zh-Hant 可選 `PositionOptions` 參數
1019
1152
  * @en optional `PositionOptions` params
1020
1153
  */
1021
1154
  options?: Partial<PositionOptions>) => {
@@ -1037,6 +1170,7 @@ declare const useGeolocation: UseGeolocation;
1037
1170
  type UseHover = <T extends Element = HTMLDivElement>(
1038
1171
  /**
1039
1172
  * @zh dom对象
1173
+ * @zh-Hant dom對象
1040
1174
  * @en dom element
1041
1175
  */
1042
1176
  target: BasicTarget<T>) => boolean;
@@ -1047,16 +1181,19 @@ declare const useHover: UseHover;
1047
1181
  * @title UseIdle
1048
1182
  * @returns 是否处于空闲
1049
1183
  * @returns_en whether user is idle
1184
+ * @returns_zh-Hant 是否處於空閒
1050
1185
  */
1051
1186
  type UseIdle = (
1052
1187
  /**
1053
1188
  * @zh 检测时间
1189
+ * @zh-Hant 檢測時間
1054
1190
  * @en detection time
1055
1191
  * @defaultValue 60e3
1056
1192
  */
1057
1193
  ms?: number,
1058
1194
  /**
1059
1195
  * @zh 初始值
1196
+ * @zh-Hant 初始值
1060
1197
  * @en initial value
1061
1198
  * @defaultValue false
1062
1199
  */
@@ -1084,15 +1221,23 @@ declare const useIdle: UseIdle;
1084
1221
  * - Whether it is scrolling.
1085
1222
  * - Boundary arrival status.
1086
1223
  * - Scroll direction.
1224
+ * @returns_zh-Hant 包含以下元素的元組:
1225
+ * - x 值。
1226
+ * - y 值。
1227
+ * - 是否在滚動。
1228
+ * - 到達邊界狀態。
1229
+ * - 滚動方向
1087
1230
  */
1088
1231
  type UseScroll = (
1089
1232
  /**
1090
1233
  * @zh dom元素
1234
+ * @zh-Hant dom元素
1091
1235
  * @en dom elment
1092
1236
  */
1093
1237
  target: BasicTarget<Element> | Window | Document,
1094
1238
  /**
1095
1239
  * @zh 可选参数
1240
+ * @zh-Hant 可選參數
1096
1241
  * @en optional params
1097
1242
  */
1098
1243
  options?: UseScrollOptions) => readonly [
@@ -1107,8 +1252,9 @@ options?: UseScrollOptions) => readonly [
1107
1252
  */
1108
1253
  interface UseScrollOptions {
1109
1254
  /**
1110
- * @en Throttle time for scroll event, its disabled by default.
1255
+ * @en Throttle time for scroll event, it's disabled by default.
1111
1256
  * @zh 滚动事件的节流时间,默认关闭。
1257
+ * @zh-Hant 滚動事件的節流時間,預設關閉。
1112
1258
  * @defaultValue 0
1113
1259
  */
1114
1260
  throttle?: number;
@@ -1117,27 +1263,33 @@ interface UseScrollOptions {
1117
1263
  * This configuration will be setting to (throttle + idle) when the `throttle` is configured.
1118
1264
  * @zh 滚动结束时的检查时间。
1119
1265
  * 当配置 `throttle` 时,此配置将设置为 (throttle +idle)。
1266
+ * @zh-Hant 滚動結束時的檢查時間。
1267
+ * 當配置 `throttle` 時,此配置將設置為 (throttle +idle)。
1120
1268
  * @default 200
1121
1269
  */
1122
1270
  idle?: number;
1123
1271
  /**
1124
1272
  * @en Offset arrived states by x pixels
1125
1273
  * @zh 将到达状态偏移 x 像素
1274
+ * @zh-Hant 將到達狀態偏移 x 像素
1126
1275
  */
1127
1276
  offset?: UseScrollOffset;
1128
1277
  /**
1129
1278
  * @en Trigger it when scrolling.
1130
1279
  * @zh 滚动的回调
1280
+ * @zh-Hant 滚動的回調
1131
1281
  */
1132
1282
  onScroll?: (e: Event) => void;
1133
1283
  /**
1134
1284
  * @en Trigger it when scrolling ends.
1135
1285
  * @zh 滚动结束的回调
1286
+ * @zh-Hant 滚動結束的回調
1136
1287
  */
1137
1288
  onStop?: (e: Event) => void;
1138
1289
  /**
1139
1290
  * @en Listener options for scroll event.
1140
1291
  * @zh 滚动事件参数
1292
+ * @zh-Hant 滚動事件參數
1141
1293
  * @defaultValue {capture: false, passive: true}
1142
1294
  */
1143
1295
  eventListenerOptions?: boolean | AddEventListenerOptions;
@@ -1155,21 +1307,25 @@ interface UseScrollArrivedState {
1155
1307
  /**
1156
1308
  * @en arrived left
1157
1309
  * @zh 到达左边
1310
+ * @zh-Hant 到達左邊
1158
1311
  */
1159
1312
  left: boolean;
1160
1313
  /**
1161
1314
  * @en arrived right
1162
1315
  * @zh 到达右边
1316
+ * @zh-Hant 到達右邊
1163
1317
  */
1164
1318
  right: boolean;
1165
1319
  /**
1166
1320
  * @en arrived top
1167
1321
  * @zh 到达顶部
1322
+ * @zh-Hant 到達頂部
1168
1323
  */
1169
1324
  top: boolean;
1170
1325
  /**
1171
1326
  * @en arrived bottom
1172
1327
  * @zh 到达底部
1328
+ * @zh-Hant 到達底部
1173
1329
  */
1174
1330
  bottom: boolean;
1175
1331
  }
@@ -1180,21 +1336,25 @@ interface UseScrollDirection {
1180
1336
  /**
1181
1337
  * @en scroll left
1182
1338
  * @zh 向左滚动
1339
+ * @zh-Hant 向左滚動
1183
1340
  */
1184
1341
  left: boolean;
1185
1342
  /**
1186
1343
  * @en scroll right
1187
1344
  * @zh 向右滚动
1345
+ * @zh-Hant 向右滚動
1188
1346
  */
1189
1347
  right: boolean;
1190
1348
  /**
1191
1349
  * @en scroll top
1192
1350
  * @zh 向上滚动
1351
+ * @zh-Hant 向上滚動
1193
1352
  */
1194
1353
  top: boolean;
1195
1354
  /**
1196
1355
  * @en scroll bottom
1197
1356
  * @zh 向下滚动
1357
+ * @zh-Hant 向下滚動
1198
1358
  */
1199
1359
  bottom: boolean;
1200
1360
  }
@@ -1205,11 +1365,13 @@ interface UseScrollDirection {
1205
1365
  type UseInfiniteScroll = (
1206
1366
  /**
1207
1367
  * @zh dom元素
1368
+ * @zh-Hant dom元素
1208
1369
  * @en dom element
1209
1370
  */
1210
1371
  target: BasicTarget<Element>,
1211
1372
  /**
1212
1373
  * @zh 加载更多函数
1374
+ * @zh-Hant 加載更多函數
1213
1375
  * @en load more function
1214
1376
  */
1215
1377
  onLoadMore: UseInfiniteScrollLoadMore,
@@ -1313,15 +1475,18 @@ declare const useInfiniteScroll: UseInfiniteScroll;
1313
1475
  * @title useIntersectionObserver
1314
1476
  * @returns 停止监听函数
1315
1477
  * @returns_en stop listening function
1478
+ * @returns_zh-Hant 停止監聽函數
1316
1479
  */
1317
1480
  type UseIntersectionObserver = (
1318
1481
  /**
1319
1482
  * @zh dom元素
1483
+ * @zh-Hant dom元素
1320
1484
  * @en dom element
1321
1485
  */
1322
1486
  target: BasicTarget<Element>,
1323
1487
  /**
1324
1488
  * @zh 回调
1489
+ * @zh-Hant 回調
1325
1490
  * @en callback
1326
1491
  */
1327
1492
  callback: IntersectionObserverCallback,
@@ -1339,11 +1504,13 @@ declare const useIntersectionObserver: UseIntersectionObserver;
1339
1504
  type UseInterval = (
1340
1505
  /**
1341
1506
  * @zh 回调
1507
+ * @zh-Hant 回調
1342
1508
  * @en callback
1343
1509
  */
1344
1510
  callback: () => void,
1345
1511
  /**
1346
1512
  * @zh 时间,如果为 `null` 的话则停止计时器
1513
+ * @zh-Hant 時間,如果為 `null` 的話則停止計時器
1347
1514
  * @en Time, if `null` then stop the timer
1348
1515
  */
1349
1516
  delay?: number | null,
@@ -1396,15 +1563,18 @@ declare const useIsomorphicLayoutEffect: typeof useEffect;
1396
1563
  * @title useKeyModifier
1397
1564
  * @returns 按键是否被按下
1398
1565
  * @returns_en Whether the key is pressed
1566
+ * @returns_zh-Hant 按鍵是否被按下
1399
1567
  */
1400
1568
  type UseKeyModifier = (
1401
1569
  /**
1402
1570
  * @zh 键位
1571
+ * @zh-Hant 鍵位
1403
1572
  * @en key modifier
1404
1573
  */
1405
1574
  modifier: KeyModifier,
1406
1575
  /**
1407
1576
  * @zh 可选参数
1577
+ * @zh-Hant 可選參數
1408
1578
  * @en optional params
1409
1579
  */
1410
1580
  options?: UseModifierOptions) => boolean;
@@ -1433,10 +1603,12 @@ declare const useKeyModifier: UseKeyModifier;
1433
1603
  * @title useLatest
1434
1604
  * @returns ref 对象
1435
1605
  * @returns_en ref object
1606
+ * @returns_zh-Hant ref 對象
1436
1607
  */
1437
1608
  type UseLatest = <T>(
1438
1609
  /**
1439
1610
  * @zh 追踪值
1611
+ * @zh-Hant 追蹤值
1440
1612
  * @en tracked value
1441
1613
  */
1442
1614
  value: T) => MutableRefObject<T>;
@@ -1490,11 +1662,13 @@ declare function useLocalStorage<T = unknown>(key: string, defaults: null, optio
1490
1662
  type UseLocationSelector = <R>(
1491
1663
  /**
1492
1664
  * @zh 选择器
1665
+ * @zh-Hant 選擇器
1493
1666
  * @en selector function
1494
1667
  */
1495
1668
  selector: (location: Location) => R,
1496
1669
  /**
1497
1670
  * @zh 默认值
1671
+ * @zh-Hant 預設值
1498
1672
  * @en default value
1499
1673
  */
1500
1674
  fallback?: R | undefined) => R | undefined;
@@ -1515,15 +1689,23 @@ declare const useLocationSelector: UseLocationSelector;
1515
1689
  * - onMouseUp: Mouse up event.
1516
1690
  * - onMouseLeave: Mouse leave event.
1517
1691
  * - onTouchEnd: Finger touch end event.
1692
+ * @returns_zh-Hant 包含以下元素的對象:
1693
+ * - onMouseDown 滑鼠按下事件。
1694
+ * - onTouchStart 手指按下事件。
1695
+ * - onMouseUp 滑鼠放開事件。
1696
+ * - onMouseLeave 滑鼠離開事件
1697
+ * - onTouchEnd 手指放開事件
1518
1698
  */
1519
1699
  type UseLongPress = (
1520
1700
  /**
1521
1701
  * @zh 回调
1702
+ * @zh-Hant 回調
1522
1703
  * @en callback
1523
1704
  */
1524
1705
  callback: (e: TouchEvent | MouseEvent) => void,
1525
1706
  /**
1526
1707
  * @zh 可选参数
1708
+ * @zh-Hant 可選參數
1527
1709
  * @en optional params
1528
1710
  */
1529
1711
  options?: UseLongPressOptions) => {
@@ -1539,12 +1721,14 @@ options?: UseLongPressOptions) => {
1539
1721
  interface UseLongPressOptions {
1540
1722
  /**
1541
1723
  * @zh 阻止默认事件
1724
+ * @zh-Hant 阻止預設事件
1542
1725
  * @en whether prevent default event
1543
1726
  * @defaultValue true
1544
1727
  */
1545
1728
  isPreventDefault?: boolean;
1546
1729
  /**
1547
1730
  * @zh 延迟
1731
+ * @zh-Hant 延遲
1548
1732
  * @en delay time
1549
1733
  * @defaultValue 300
1550
1734
  */
@@ -1557,15 +1741,18 @@ declare const useLongPress: UseLongPress;
1557
1741
  * @title useMeasure
1558
1742
  * @returns [DOMRect值,停止监听函数]
1559
1743
  * @returns_en [DOMRect, stop listening function]
1744
+ * @returns_zh-Hant [DOMRect值,停止監聽函數]
1560
1745
  */
1561
1746
  type UseMeasure = (
1562
1747
  /**
1563
1748
  * @zh dom对象
1749
+ * @zh-Hant dom對象
1564
1750
  * @en dom element
1565
1751
  */
1566
1752
  target: BasicTarget<Element>,
1567
1753
  /**
1568
1754
  * @zh 可选参数
1755
+ * @zh-Hant 可選參數
1569
1756
  * @en optional params
1570
1757
  */
1571
1758
  options?: ResizeObserverOptions) => readonly [UseMeasureRect, () => void];
@@ -1584,10 +1771,14 @@ declare const useMeasure: UseMeasure;
1584
1771
  * @returns_en A tuple with the following elements:
1585
1772
  * - The media devices info.
1586
1773
  * - A function to request media devices permission.
1774
+ * @returns_zh-Hant 包含以下元素的元組:
1775
+ * - 媒體設備信息。
1776
+ * - 請求媒體設備權限。
1587
1777
  */
1588
1778
  type UseMediaDevices = (
1589
1779
  /**
1590
1780
  * @zh 可选参数
1781
+ * @zh-Hant 可選參數
1591
1782
  * @en optional params
1592
1783
  */
1593
1784
  options?: UseMediaDeviceOptions) => readonly [
@@ -1609,12 +1800,14 @@ interface UseMediaDeviceOptions {
1609
1800
  * @en Request for permissions immediately if it's not granted,
1610
1801
  * otherwise label and deviceIds could be empty
1611
1802
  * @zh 自动请求权限
1803
+ * @zh-Hant 自動請求權限
1612
1804
  * @defaultValue false
1613
1805
  */
1614
1806
  requestPermissions?: boolean;
1615
1807
  /**
1616
1808
  * @en Request for types of media permissions
1617
1809
  * @zh 请求媒体权限类型
1810
+ * @zh-Hant 請求媒體權限類型
1618
1811
  * @defaultValue { audio: true, video: true }
1619
1812
  */
1620
1813
  constraints?: MediaStreamConstraints;
@@ -1626,15 +1819,18 @@ declare const useMediaDevices: UseMediaDevices;
1626
1819
  * @title useMediaQuery
1627
1820
  * @returns 是否符合媒体查询
1628
1821
  * @returns_en whether comply with media inquiries
1822
+ * @returns_zh-Hant 是否符合媒體查詢
1629
1823
  */
1630
1824
  type UseMediaQuery = (
1631
1825
  /**
1632
1826
  * @zh 媒体查询字符串
1827
+ * @zh-Hant 媒體查詢字符串
1633
1828
  * @en media query string
1634
1829
  */
1635
1830
  query: string,
1636
1831
  /**
1637
1832
  * @zh 默认值
1833
+ * @zh-Hant 預設值
1638
1834
  * @en default value
1639
1835
  */
1640
1836
  defaultState?: boolean) => boolean;
@@ -1647,6 +1843,7 @@ declare const useMediaQuery: UseMediaQuery;
1647
1843
  type UseMount = (
1648
1844
  /**
1649
1845
  * @zh 副作用函数
1846
+ * @zh-Hant 副作用函數
1650
1847
  * @en effect function
1651
1848
  */
1652
1849
  effect: () => void) => void;
@@ -1659,10 +1856,12 @@ declare function useMountedState(): () => boolean;
1659
1856
  * @title useMouse
1660
1857
  * @returns 鼠标位置
1661
1858
  * @returns_en Mouse Position
1859
+ * @returns_zh-Hant 滑鼠位置
1662
1860
  */
1663
1861
  type UseMouse = (
1664
1862
  /**
1665
1863
  * @zh dom元素
1864
+ * @zh-Hant dom元素
1666
1865
  * @en dom element
1667
1866
  */
1668
1867
  target?: BasicTarget) => UseMouseCursorState;
@@ -1694,10 +1893,14 @@ declare const useMouse: UseMouse;
1694
1893
  * @returns_en A tuple with the following elements:
1695
1894
  * - whether the mouse is pressed.
1696
1895
  * - the pressed source type
1896
+ * @returns_zh-Hant 包含以下元素的元組:
1897
+ * - 滑鼠是否按下。
1898
+ * - 按下的事件來源。
1697
1899
  */
1698
1900
  type UseMousePressed = (
1699
1901
  /**
1700
1902
  * @zh dom对象
1903
+ * @zh-Hant dom對象
1701
1904
  * @en dom element
1702
1905
  */
1703
1906
  target?: BasicTarget<Element>,
@@ -1740,15 +1943,18 @@ declare const useMousePressed: UseMousePressed;
1740
1943
  * @title UseMutationObserver
1741
1944
  * @returns 停止函数
1742
1945
  * @returns_en stop listenering function
1946
+ * @returns_zh-Hant 停止函數
1743
1947
  */
1744
1948
  type UseMutationObserver = (
1745
1949
  /**
1746
1950
  * @zh 回调
1951
+ * @zh-Hant 回調
1747
1952
  * @en callback
1748
1953
  */
1749
1954
  callback: MutationCallback,
1750
1955
  /**
1751
1956
  * @zh dom元素
1957
+ * @zh-Hant dom元素
1752
1958
  * @en dom对象
1753
1959
  */
1754
1960
  target: BasicTarget,
@@ -1771,6 +1977,7 @@ interface IUseNetworkState {
1771
1977
  /**
1772
1978
  * @en Whether browser connected to the network or not.
1773
1979
  * @zh 浏览器是否连接网络
1980
+ * @zh-Hant 瀏覽器是否連接網路
1774
1981
  */
1775
1982
  online: boolean | undefined;
1776
1983
  /**
@@ -1778,6 +1985,8 @@ interface IUseNetworkState {
1778
1985
  * just connected or lost connection.
1779
1986
  * @zh `online` 属性的先前值。 帮助识别浏览器是否
1780
1987
  * 刚刚连接或失去连接。
1988
+ * @zh-Hant `online` 屬性的先前值。 幫助識別瀏覽器是否
1989
+ * 剛剛連接或失去連接。
1781
1990
  */
1782
1991
  previous: boolean | undefined;
1783
1992
  /**
@@ -1858,10 +2067,12 @@ declare const useNetwork: UseNetwork;
1858
2067
  * @title useObjectUrl
1859
2068
  * @returns 返回一个由 Blob 或 MediaSource 对象生成的 URL(如果存在),否则返回 undefined
1860
2069
  * @returns_en Returns a URL created from the Blob or MediaSource object, or undefined if none exists
2070
+ * @returns_zh-Hant 返回一個由 Blob 或 MediaSource 對象生成的 URL(如果存在),否則返回 undefined
1861
2071
  */
1862
2072
  type UseObjectUrl = (
1863
2073
  /**
1864
2074
  * @zh 文件或者媒体对象
2075
+ * @zh-Hant 檔案或者媒體對象
1865
2076
  * @en file or media source
1866
2077
  */
1867
2078
  object: Blob | MediaSource) => string | undefined;
@@ -1876,6 +2087,7 @@ declare const useOnceLayoutEffect: typeof react.useEffect | typeof useLayoutEffe
1876
2087
  * @title useOnline
1877
2088
  * @returns 网络是否在线
1878
2089
  * @returns_en whether netwotk is online
2090
+ * @returns_zh-Hant 網路是否在線
1879
2091
  */
1880
2092
  type UseOnline = () => boolean | undefined;
1881
2093
 
@@ -1891,10 +2103,15 @@ declare const useOnline: UseOnline;
1891
2103
  * - orientation type.
1892
2104
  * - lock orientation.
1893
2105
  * - unlock orientation.
2106
+ * @returns_zh-Hant 包含以下元素的元組:
2107
+ * - 方向狀態。
2108
+ * - 鎖定方向。
2109
+ * - 解鎖方向。
1894
2110
  */
1895
2111
  type UseOrientation = (
1896
2112
  /**
1897
2113
  * @zh 初始值
2114
+ * @zh-Hant 初始值
1898
2115
  * @en initial value
1899
2116
  */
1900
2117
  initialState?: UseOrientationState) => readonly [
@@ -1934,10 +2151,12 @@ declare function usePageLeave(): boolean;
1934
2151
  * @title usePermission
1935
2152
  * @returns 权限状态
1936
2153
  * @returns_en permission state
2154
+ * @returns_zh-Hant 權限狀態
1937
2155
  */
1938
2156
  type UsePermission = (
1939
2157
  /**
1940
2158
  * @zh 权限描述符
2159
+ * @zh-Hant 權限描述符
1941
2160
  * @en permission desc
1942
2161
  */
1943
2162
  permissionDesc: UsePermissionGeneralPermissionDescriptor | UsePermissionGeneralPermissionDescriptor['name']) => UsePermissionState;
@@ -1962,10 +2181,12 @@ declare const usePermission: UsePermission;
1962
2181
  * @title usePreferredColorScheme
1963
2182
  * @returns prefers-color-scheme的媒体查询值
1964
2183
  * @returns_en value of prefers-color-scheme media query
2184
+ * @returns_zh-Hant prefers-color-scheme的媒體查詢值
1965
2185
  */
1966
2186
  type UsePreferredColorScheme = (
1967
2187
  /**
1968
2188
  * @zh 默认值
2189
+ * @zh-Hant 預設值
1969
2190
  * @en default value
1970
2191
  * @defaultValue no-preference
1971
2192
  */
@@ -1983,6 +2204,7 @@ declare const usePreferredColorScheme: UsePreferredColorScheme;
1983
2204
  type UsePreferredContrast = (
1984
2205
  /**
1985
2206
  * @zh 默认值
2207
+ * @zh-Hant 預設值
1986
2208
  * @en default value
1987
2209
  * @defaultValue no-preference
1988
2210
  */
@@ -2008,10 +2230,15 @@ declare function usePrevious<T>(value: T): T | undefined;
2008
2230
  * - stop function
2009
2231
  * - start function
2010
2232
  * whether function is running
2233
+ * @returns_zh-Hant 包含以下元素的元組:
2234
+ * - 停止函數。
2235
+ * - 開始函數。
2236
+ * - 函數是否在執行中。
2011
2237
  */
2012
2238
  type UseRafFn = (
2013
2239
  /**
2014
2240
  * @zh 回调
2241
+ * @zh-Hant 回調
2015
2242
  * @en callback
2016
2243
  */
2017
2244
  callback: FrameRequestCallback,
@@ -2033,11 +2260,13 @@ declare function useReducedMotion(defaultState?: boolean): boolean;
2033
2260
  type UseResizeObserver = (
2034
2261
  /**
2035
2262
  * @zh dom元素
2263
+ * @zh-Hant dom元素
2036
2264
  * @en dom element
2037
2265
  */
2038
2266
  target: BasicTarget<Element>,
2039
2267
  /**
2040
2268
  * @zh 回调
2269
+ * @zh-Hant 回調
2041
2270
  * @en callback
2042
2271
  */
2043
2272
  callback: ResizeObserverCallback,
@@ -2051,6 +2280,153 @@ declare const useResizeObserver: UseResizeObserver;
2051
2280
 
2052
2281
  declare function useScreenSafeArea(): readonly [string, string, string, string, lodash.DebouncedFunc<() => void>];
2053
2282
 
2283
+ /**
2284
+ * @title UseScratchState
2285
+ */
2286
+ interface UseScratchState {
2287
+ /**
2288
+ * @zh 是否正在刮擦
2289
+ * @zh-Hant 是否正在刮擦
2290
+ * @en Whether scratching is in progress
2291
+ */
2292
+ isScratching: boolean;
2293
+ /**
2294
+ * @zh 开始时间戳
2295
+ * @zh-Hant 開始時間戳
2296
+ * @en Start timestamp
2297
+ */
2298
+ start?: number;
2299
+ /**
2300
+ * @zh 结束时间戳
2301
+ * @zh-Hant 結束時間戳
2302
+ * @en End timestamp
2303
+ */
2304
+ end?: number;
2305
+ /**
2306
+ * @zh 相对于元素的 x 坐标
2307
+ * @zh-Hant 相對於元素的 x 座標
2308
+ * @en x coordinate relative to element
2309
+ */
2310
+ x?: number;
2311
+ /**
2312
+ * @zh 相对于元素的 y 坐标
2313
+ * @zh-Hant 相對於元素的 y 座標
2314
+ * @en y coordinate relative to element
2315
+ */
2316
+ y?: number;
2317
+ /**
2318
+ * @zh x 方向的增量
2319
+ * @zh-Hant x 方向的增量
2320
+ * @en Delta in x direction
2321
+ */
2322
+ dx?: number;
2323
+ /**
2324
+ * @zh y 方向的增量
2325
+ * @zh-Hant y 方向的增量
2326
+ * @en Delta in y direction
2327
+ */
2328
+ dy?: number;
2329
+ /**
2330
+ * @zh 文档中的 x 坐标
2331
+ * @zh-Hant 文檔中的 x 座標
2332
+ * @en x coordinate in document
2333
+ */
2334
+ docX?: number;
2335
+ /**
2336
+ * @zh 文档中的 y 坐标
2337
+ * @zh-Hant 文檔中的 y 座標
2338
+ * @en y coordinate in document
2339
+ */
2340
+ docY?: number;
2341
+ /**
2342
+ * @zh 元素在文档中的 x 位置
2343
+ * @zh-Hant 元素在文檔中的 x 位置
2344
+ * @en Element x position in document
2345
+ */
2346
+ posX?: number;
2347
+ /**
2348
+ * @zh 元素在文档中的 y 位置
2349
+ * @zh-Hant 元素在文檔中的 y 位置
2350
+ * @en Element y position in document
2351
+ */
2352
+ posY?: number;
2353
+ /**
2354
+ * @zh 元素高度
2355
+ * @zh-Hant 元素高度
2356
+ * @en Element height
2357
+ */
2358
+ elH?: number;
2359
+ /**
2360
+ * @zh 元素宽度
2361
+ * @zh-Hant 元素寬度
2362
+ * @en Element width
2363
+ */
2364
+ elW?: number;
2365
+ /**
2366
+ * @zh 元素 x 位置
2367
+ * @zh-Hant 元素 x 位置
2368
+ * @en Element x position
2369
+ */
2370
+ elX?: number;
2371
+ /**
2372
+ * @zh 元素 y 位置
2373
+ * @zh-Hant 元素 y 位置
2374
+ * @en Element y position
2375
+ */
2376
+ elY?: number;
2377
+ }
2378
+ /**
2379
+ * @title UseScratchOptions
2380
+ */
2381
+ interface UseScratchOptions {
2382
+ /**
2383
+ * @zh 是否禁用
2384
+ * @zh-Hant 是否禁用
2385
+ * @en Whether to disable
2386
+ * @default false
2387
+ */
2388
+ disabled?: boolean;
2389
+ /**
2390
+ * @zh 刮擦时的回调
2391
+ * @zh-Hant 刮擦時的回調
2392
+ * @en Callback during scratching
2393
+ */
2394
+ onScratch?: (state: UseScratchState) => void;
2395
+ /**
2396
+ * @zh 开始刮擦时的回调
2397
+ * @zh-Hant 開始刮擦時的回調
2398
+ * @en Callback when scratching starts
2399
+ */
2400
+ onScratchStart?: (state: UseScratchState) => void;
2401
+ /**
2402
+ * @zh 结束刮擦时的回调
2403
+ * @zh-Hant 結束刮擦時的回調
2404
+ * @en Callback when scratching ends
2405
+ */
2406
+ onScratchEnd?: (state: UseScratchState) => void;
2407
+ }
2408
+ /**
2409
+ * @title useScratch
2410
+ * @returns 刮擦状态
2411
+ * @returns_en Scratch state
2412
+ * @returns_zh-Hant 刮擦狀態
2413
+ */
2414
+ type UseScratch = (
2415
+ /**
2416
+ * @zh 目标元素
2417
+ * @zh-Hant 目標元素
2418
+ * @en Target element
2419
+ */
2420
+ target: BasicTarget<HTMLElement>,
2421
+ /**
2422
+ * @zh 配置项
2423
+ * @zh-Hant 配置項
2424
+ * @en Options
2425
+ */
2426
+ options?: UseScratchOptions) => UseScratchState;
2427
+
2428
+ declare const useScratch: UseScratch;
2429
+
2054
2430
  /**
2055
2431
  * @title useScriptTag
2056
2432
  * @returns 包含以下元素的元组:
@@ -2063,20 +2439,28 @@ declare function useScreenSafeArea(): readonly [string, string, string, string,
2063
2439
  * - Resource loading status.
2064
2440
  * - Resource loading function.
2065
2441
  * - Resource unloading function
2442
+ * @returns_zh-Hant 包含以下元素的元組:
2443
+ * - 用來加載資源的 html 元素。
2444
+ * - 資源加載狀態。
2445
+ * - 資源加載函數。
2446
+ * - 資源卸載函數
2066
2447
  */
2067
2448
  type UseScriptTag = (
2068
2449
  /**
2069
2450
  * @zh 资源地址
2451
+ * @zh-Hant 資源地址
2070
2452
  * @en source
2071
2453
  */
2072
2454
  src: string,
2073
2455
  /**
2074
2456
  * @zh 资源加载完成的回调
2457
+ * @zh-Hant 資源加載完成的回調
2075
2458
  * @en source loaded callback
2076
2459
  */
2077
2460
  onLoaded?: (el: HTMLScriptElement) => void,
2078
2461
  /**
2079
2462
  * @zh 可选参数
2463
+ * @zh-Hant 可選參數
2080
2464
  * @en optional params
2081
2465
  */
2082
2466
  options?: UseScriptTagOptions) => readonly [
@@ -2092,50 +2476,59 @@ interface UseScriptTagOptions {
2092
2476
  /**
2093
2477
  * @en Load the script immediately
2094
2478
  * @zh 立即加载资源
2479
+ * @zh-Hant 立即加載資源
2095
2480
  * @defaultValue true
2096
2481
  */
2097
2482
  immediate?: boolean;
2098
2483
  /**
2099
2484
  * @en Add `async` attribute to the script tag
2100
2485
  * @zh 在 `script` 标签上加上 `async`
2486
+ * @zh-Hant 在 `script` 標籤上加上 `async`
2101
2487
  * @defaultValue true
2102
2488
  */
2103
2489
  async?: boolean;
2104
2490
  /**
2105
2491
  * @en Script type
2106
2492
  * @zh 脚本类型
2493
+ * @zh-Hant 腳本類型
2107
2494
  * @defaultValue 'text/javascript'
2108
2495
  */
2109
2496
  type?: string;
2110
2497
  /**
2111
2498
  * @en Manual controls the timing of loading and unloading
2112
2499
  * @zh 手动控制加载和卸载时机
2500
+ * @zh-Hant 手動控制加載和卸載時機
2113
2501
  * @defaultValue false
2114
2502
  */
2115
2503
  manual?: boolean;
2116
2504
  /**
2117
2505
  * @zh 跨域属性
2506
+ * @zh-Hant 跨域屬性
2118
2507
  * @en cross origin
2119
2508
  */
2120
2509
  crossOrigin?: 'anonymous' | 'use-credentials';
2121
2510
  /**
2122
2511
  * @en referrer policy
2123
2512
  * @zh 来源属性
2513
+ * @zh-Hant 來源屬性
2124
2514
  */
2125
2515
  referrerPolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
2126
2516
  /**
2127
2517
  * @en Add `noModule` attribute to the script tag
2128
2518
  * @zh 在 `script` 标签上加上 `noModule`
2519
+ * @zh-Hant 在 `script` 標籤上加上 `noModule`
2129
2520
  */
2130
2521
  noModule?: boolean;
2131
2522
  /**
2132
2523
  * @en Add `defer` attribute to the script tag
2133
2524
  * @zh 在 `script` 标签上加上 `defer`
2525
+ * @zh-Hant 在 `script` 標籤上加上 `defer`
2134
2526
  */
2135
2527
  defer?: boolean;
2136
2528
  /**
2137
2529
  * @en Add custom attribute to the script tag
2138
2530
  * @zh 在 script 标签上添加自定义属性
2531
+ * @zh-Hant 在 script 標籤上添加自定義屬性
2139
2532
  */
2140
2533
  attrs?: Record<string, string>;
2141
2534
  }
@@ -2156,10 +2549,14 @@ declare const useScroll: UseScroll;
2156
2549
  * @returns_en A object with the following elements:
2157
2550
  * - scrollIntoView: scroll target element into viewport
2158
2551
  * - cancel: cancel scroll function
2552
+ * @returns_zh-Hant 包含以下元素的對象:
2553
+ * - scrollIntoView:滚動進入視口函數。
2554
+ * - cancel: 取消滚動函數。
2159
2555
  */
2160
2556
  type UseScrollIntoView = (
2161
2557
  /**
2162
2558
  * @zh dom对象
2559
+ * @zh-Hant dom對象
2163
2560
  * @en dom element
2164
2561
  */
2165
2562
  targetElement: BasicTarget<HTMLElement>,
@@ -2241,10 +2638,14 @@ declare const useScrollIntoView: UseScrollIntoView;
2241
2638
  * @returns_en A tuple with the following elements:
2242
2639
  * - whether scroll is locked.
2243
2640
  * - A function to update the value of lock state.
2641
+ * @returns_zh-Hant 包含以下元素的元組:
2642
+ * - 是否鎖定。
2643
+ * - 更新鎖定值的函數。
2244
2644
  */
2245
2645
  type UseScrollLock = (
2246
2646
  /**
2247
2647
  * @zh dom元素
2648
+ * @zh-Hant dom元素
2248
2649
  * @en dom element
2249
2650
  */
2250
2651
  target: BasicTarget<HTMLElement>,
@@ -2271,10 +2672,14 @@ declare function useSessionStorage<T = unknown>(key: string, defaults: null, opt
2271
2672
  * @returns_en A tuple with the following elements:
2272
2673
  * - The current value of the state.
2273
2674
  * - A function to update the value of the state.
2675
+ * @returns_zh-Hant 包含以下元素的元組:
2676
+ * - state 的當前值。
2677
+ * - 更新 state 值的函數。
2274
2678
  */
2275
2679
  type UseSetState = <T extends Record<string, any>>(
2276
2680
  /**
2277
2681
  * @zh 初始值
2682
+ * @zh-Hant 初始值
2278
2683
  * @en initial value
2279
2684
  */
2280
2685
  initialState: T) => readonly [
@@ -2292,10 +2697,14 @@ declare const useSetState: UseSetState;
2292
2697
  * @returns_en A tuple with the following elements:
2293
2698
  * - The current state of sticky.
2294
2699
  * - A function to update the value of sticky.
2700
+ * @returns_zh-Hant 包含以下元素的元組:
2701
+ * - 當前是否粘滞。
2702
+ * - 更新粘滞值的函數。
2295
2703
  */
2296
2704
  type UseSticky = (
2297
2705
  /**
2298
2706
  * @zh dom元素
2707
+ * @zh-Hant dom元素
2299
2708
  * @en dom element
2300
2709
  */
2301
2710
  targetElement: BasicTarget<HTMLElement>,
@@ -2339,10 +2748,14 @@ declare function useSupported(callback: () => unknown, sync?: boolean): boolean;
2339
2748
  * @returns_en A tuple with the following elements:
2340
2749
  * - The current value of the text direction.
2341
2750
  * - A function to update the value of the text direction.
2751
+ * @returns_zh-Hant 包含以下元素的元組:
2752
+ * - 文字方向。
2753
+ * - 更新文字方向值的函數。
2342
2754
  */
2343
2755
  type UseTextDirection = (
2344
2756
  /**
2345
2757
  * @zh 可选参数
2758
+ * @zh-Hant 可選參數
2346
2759
  * @en optional params
2347
2760
  */
2348
2761
  options?: UseTextDirectionOptions) => readonly [UseTextDirectionValue, (value: UseTextDirectionValue) => void];
@@ -2353,12 +2766,14 @@ interface UseTextDirectionOptions {
2353
2766
  /**
2354
2767
  * @en CSS Selector for the target element applying to
2355
2768
  * @zh 适用于目标元素的 CSS 选择器
2769
+ * @zh-Hant 適用於目標元素的 CSS 選擇器
2356
2770
  * @defaultValue 'html'
2357
2771
  */
2358
2772
  selector?: string;
2359
2773
  /**
2360
2774
  * @en Initial value
2361
2775
  * @zh 初始值
2776
+ * @zh-Hant 初始值
2362
2777
  * @defaultValue 'ltr'
2363
2778
  */
2364
2779
  initialValue?: UseTextDirectionValue;
@@ -2374,6 +2789,7 @@ declare const useTextDirection: UseTextDirection;
2374
2789
  * @title useTextSelection
2375
2790
  * @returns 选择的文本对象
2376
2791
  * @returns_en selected text object
2792
+ * @returns_zh-Hant 選擇的文本對象
2377
2793
  */
2378
2794
  type UseTextSelection = () => Selection | null;
2379
2795
 
@@ -2385,11 +2801,13 @@ declare const useTextSelection: UseTextSelection;
2385
2801
  type UseThrottle = <T>(
2386
2802
  /**
2387
2803
  * @zh 要节流的值
2804
+ * @zh-Hant 要節流的值
2388
2805
  * @en the value need to throttle
2389
2806
  */
2390
2807
  value: T,
2391
2808
  /**
2392
2809
  * @zh 间隔时间
2810
+ * @zh-Hant 間隔時間
2393
2811
  * @en wait time
2394
2812
  */
2395
2813
  wait?: number,
@@ -2417,15 +2835,21 @@ declare function useThrottleFn<T extends (...args: any) => any>(fn: T, wait?: nu
2417
2835
  * - Whether to wait for the timer to execute.
2418
2836
  * - Set timer.
2419
2837
  * - Cancel timer.
2838
+ * @returns_zh-Hant 包含以下元素的元組:
2839
+ * - 是否等待定時器執行。
2840
+ * - 設定定時器。
2841
+ * - 取消定時器。
2420
2842
  */
2421
2843
  type UseTimeout = (
2422
2844
  /**
2423
2845
  * @zh 间隔时间
2846
+ * @zh-Hant 間隔時間
2424
2847
  * @en wait time
2425
2848
  */
2426
2849
  ms?: number
2427
2850
  /**
2428
2851
  * @zh 可选参数
2852
+ * @zh-Hant 可選參數
2429
2853
  * @en optional param
2430
2854
  */ , options?: UseTimeoutOptions) => Stoppable;
2431
2855
  /**
@@ -2435,6 +2859,7 @@ interface UseTimeoutOptions {
2435
2859
  /**
2436
2860
  * @en Start the timer immediate after calling this function
2437
2861
  * @zh 立即设置定时器
2862
+ * @zh-Hant 立即設定定時器
2438
2863
  * @defaultValue true
2439
2864
  */
2440
2865
  immediate?: boolean;
@@ -2452,20 +2877,27 @@ declare const useTimeout: UseTimeout;
2452
2877
  * - Whether to wait for the timer to execute.
2453
2878
  * - Set timer.
2454
2879
  * - Cancel timer.
2880
+ * @returns_zh-Hant 包含以下元素的元組:
2881
+ * - 是否等待定時器執行。
2882
+ * - 設置定時器。
2883
+ * - 取消定時器。
2455
2884
  */
2456
2885
  type UseTimeoutFn = (
2457
2886
  /**
2458
2887
  * @zh 回调
2888
+ * @zh-Hant 回調
2459
2889
  * @en callback
2460
2890
  */
2461
2891
  cb: (...args: unknown[]) => any,
2462
2892
  /**
2463
2893
  * @zh 间隔时间
2894
+ * @zh-Hant 間隔時間
2464
2895
  * @en wait time
2465
2896
  */
2466
2897
  interval: number,
2467
2898
  /**
2468
2899
  * @zh 可选参数
2900
+ * @zh-Hant 可選參數
2469
2901
  * @en optional param
2470
2902
  */
2471
2903
  options?: UseTimeoutFnOptions) => Stoppable;
@@ -2476,6 +2908,7 @@ interface UseTimeoutFnOptions {
2476
2908
  /**
2477
2909
  * @en Start the timer immediate after calling this function
2478
2910
  * @zh 立即设置定时器
2911
+ * @zh-Hant 立即設置定時器
2479
2912
  * @defaultValue true
2480
2913
  */
2481
2914
  immediate?: boolean;
@@ -2496,6 +2929,7 @@ declare const useTimeoutFn: UseTimeoutFn;
2496
2929
  type UseTitle = (
2497
2930
  /**
2498
2931
  * @zh 标题
2932
+ * @zh-Hant 標題
2499
2933
  * @en title
2500
2934
  */
2501
2935
  title: string) => void;
@@ -2510,10 +2944,14 @@ declare const useTitle: UseTitle;
2510
2944
  * @returns_en A tuple with the following elements:
2511
2945
  * - The current value of the bool state.
2512
2946
  * - A function to update the value of the bool state.
2947
+ * @returns_zh-Hant 包含以下元素的元組:
2948
+ * - 布林狀態的當前值。
2949
+ * - 切換布林狀態值的函數。
2513
2950
  */
2514
2951
  type UseToggle = (
2515
2952
  /**
2516
2953
  * @zh 初始值
2954
+ * @zh-Hant 初始值
2517
2955
  * @en initialValue
2518
2956
  */
2519
2957
  initialValue: boolean) => [boolean, (nextValue?: any) => void];
@@ -2534,6 +2972,7 @@ declare const useUpdateLayoutEffect: typeof react.useEffect | typeof useLayoutEf
2534
2972
  type UseWebNotification = (
2535
2973
  /**
2536
2974
  * @zh 自动请求权限
2975
+ * @zh-Hant 自動請求權限
2537
2976
  * @en auto request permission
2538
2977
  */
2539
2978
  requestPermissions?: boolean) => UseWebNotificationReturn;
@@ -2543,6 +2982,7 @@ requestPermissions?: boolean) => UseWebNotificationReturn;
2543
2982
  interface UseWebNotificationReturn {
2544
2983
  /**
2545
2984
  * @zh 浏览器是否支持
2985
+ * @zh-Hant 瀏覽器是否支援
2546
2986
  * @en whether browser support
2547
2987
  */
2548
2988
  readonly isSupported: boolean;
@@ -2597,11 +3037,13 @@ type UseWindowScroll = () => UseWindowScrollState;
2597
3037
  interface UseWindowScrollState {
2598
3038
  /**
2599
3039
  * @zh 水平滚动的像素值
3040
+ * @zh-Hant 水平滚動的像素值
2600
3041
  * @en pixel value of horizontal scrolling
2601
3042
  */
2602
3043
  x: number;
2603
3044
  /**
2604
3045
  * @zh 垂直滚动的像素值
3046
+ * @zh-Hant 垂直滚動的像素值
2605
3047
  * @en pixel value of vertical scrolling
2606
3048
  */
2607
3049
  y: number;
@@ -2617,6 +3059,9 @@ declare function useWindowScroll(): UseWindowScrollState;
2617
3059
  * @returns 包含以下元素的对象:
2618
3060
  * - width:当前视窗宽度。
2619
3061
  * - height: 当前视窗高度。
3062
+ * @returns_zh-Hant 包含以下元素的對象:
3063
+ * - width:當前視窗寬度。
3064
+ * - height: 當前視窗高度。
2620
3065
  */
2621
3066
  type UseWindowSize = () => {
2622
3067
  readonly width: number;
@@ -2629,6 +3074,7 @@ declare const useWindowSize: UseWindowSize;
2629
3074
  * @title useClipBoard
2630
3075
  * @returns_en Returns a readonly tuple.
2631
3076
  * @returns 返回只读元组.
3077
+ * @returns_zh-Hant 返回唯讀元組.
2632
3078
  */
2633
3079
  type UseClipboard = () => readonly [string, (txt: string) => Promise<void>];
2634
3080
 
@@ -2641,6 +3087,7 @@ type Platform = 'ios' | 'android' | 'unknown';
2641
3087
  interface UsePlatformProps {
2642
3088
  /**
2643
3089
  * @zh 服务端渲染时,需要传递 `userAgent`
3090
+ * @zh-Hant 服務端渲染時,需要傳遞 `userAgent`
2644
3091
  * @en When server rendering, you need to pass `userAgent`
2645
3092
  */
2646
3093
  userAgent?: string;
@@ -2689,21 +3136,27 @@ declare function useMobileLandscape(): boolean;
2689
3136
  * @returns 包含以下元素的元组:
2690
3137
  * - 当前值。
2691
3138
  * - 更新当前值的函数。
3139
+ * @returns_zh-Hant 包含以下元素的元組:
3140
+ * - 當前值。
3141
+ * - 更新當前值的函數。
2692
3142
  */
2693
3143
  type UseControlled = <T>(
2694
3144
  /**
2695
3145
  * @en controlled value
2696
3146
  * @zh 受控值
3147
+ * @zh-Hant 受控值
2697
3148
  */
2698
3149
  value: T | undefined,
2699
3150
  /**
2700
3151
  * @en default value
2701
3152
  * @zh 默认值
3153
+ * @zh-Hant 預設值
2702
3154
  */
2703
3155
  defaultValue: T,
2704
3156
  /**
2705
3157
  * @en callback when value change
2706
3158
  * @zh 值改变时的回调
3159
+ * @zh-Hant 值改變時的回調
2707
3160
  */
2708
3161
  onChange?: ((v: T, ...args: any[]) => void) | undefined) => [T, (value: T) => void];
2709
3162
 
@@ -2716,26 +3169,31 @@ interface UseDisclosureProps {
2716
3169
  /**
2717
3170
  * @en Whether the disclosure is open, if passed, it will be controlled
2718
3171
  * @zh 是否打开,传了则为受控
3172
+ * @zh-Hant 是否打開,傳了則為受控
2719
3173
  */
2720
3174
  isOpen?: boolean;
2721
3175
  /**
2722
3176
  * @en default open state
2723
3177
  * @zh 默认打开状态
3178
+ * @zh-Hant 預設打開狀態
2724
3179
  */
2725
3180
  defaultOpen?: boolean;
2726
3181
  /**
2727
3182
  * @en Callback when disclosure is closed
2728
3183
  * @zh 关闭时的回调
3184
+ * @zh-Hant 關閉時的回調
2729
3185
  */
2730
3186
  onClose?: () => void;
2731
3187
  /**
2732
3188
  * @en Callback when disclosure is opened
2733
3189
  * @zh 打开时的回调
3190
+ * @zh-Hant 打開時的回調
2734
3191
  */
2735
3192
  onOpen?: () => void;
2736
3193
  /**
2737
3194
  * @en Callback when disclosure is changed
2738
3195
  * @zh 状态改变时的回调
3196
+ * @zh-Hant 狀態改變時的回調
2739
3197
  */
2740
3198
  onChange?: (isOpen: boolean | undefined) => void;
2741
3199
  }
@@ -2766,11 +3224,13 @@ interface UseEventSourceOptions extends EventSourceInit {
2766
3224
  /**
2767
3225
  * @en immediately open the connection, enabled by default
2768
3226
  * @zh 立即打开连接, 默认打开
3227
+ * @zh-Hant 立即打開連接, 預設打開
2769
3228
  */
2770
3229
  immediate?: boolean;
2771
3230
  /**
2772
3231
  * @en Automatically reconnect when the connection is disconnected
2773
3232
  * @zh 连接断开时自动重连
3233
+ * @zh-Hant 連接斷開時自動重連
2774
3234
  */
2775
3235
  autoReconnect?: UseEventSourceAutoReconnectOptions;
2776
3236
  }
@@ -2860,6 +3320,9 @@ declare const useEventSource: UseEventSource;
2860
3320
 
2861
3321
  /**
2862
3322
  * @title useMergedRef
3323
+ * @returns 合并多个 ref 的函数
3324
+ * @returns_en A function that merges multiple refs
3325
+ * @returns_zh-Hant 合併多個 ref 的函數
2863
3326
  */
2864
3327
  type UseMergedRef = <T>(...refs: PossibleRef<T>[]) => (node: T | null) => void;
2865
3328
  type PossibleRef<T> = Ref<T> | undefined;
@@ -2877,10 +3340,12 @@ declare const use: any;
2877
3340
  * @title UsePreferredLanguages
2878
3341
  * @returns 语言偏好
2879
3342
  * @returns_en preferred languages
3343
+ * @returns_zh-Hant 語言偏好
2880
3344
  */
2881
3345
  type UsePreferredLanguages = (
2882
3346
  /**
2883
3347
  * @zh 默认值
3348
+ * @zh-Hant 預設值
2884
3349
  * @en defaule value
2885
3350
  */ defaultLanguages?: string[]) => string[];
2886
3351
 
@@ -2892,6 +3357,7 @@ declare const usePreferredLanguages: UsePreferredLanguages;
2892
3357
  interface UseBroadcastChannelOptions {
2893
3358
  /**
2894
3359
  * @zh 频道名称
3360
+ * @zh-Hant 頻道名稱
2895
3361
  * @en channel name
2896
3362
  */
2897
3363
  name: string;
@@ -2902,6 +3368,7 @@ interface UseBroadcastChannelOptions {
2902
3368
  type UseBroadcastChannel = <D, P>(
2903
3369
  /**
2904
3370
  * @zh 选项
3371
+ * @zh-Hant 選項
2905
3372
  * @en options
2906
3373
  */
2907
3374
  options: UseBroadcastChannelOptions) => UseBroadcastChannelReturn<D, P>;
@@ -2911,41 +3378,49 @@ options: UseBroadcastChannelOptions) => UseBroadcastChannelReturn<D, P>;
2911
3378
  interface UseBroadcastChannelReturn<D, P> {
2912
3379
  /**
2913
3380
  * @zh 是否支持
3381
+ * @zh-Hant 是否支援
2914
3382
  * @en is supported
2915
3383
  */
2916
3384
  readonly isSupported: boolean;
2917
3385
  /**
2918
3386
  * @zh 频道
3387
+ * @zh-Hant 頻道
2919
3388
  * @en channel
2920
3389
  */
2921
3390
  readonly channel: BroadcastChannel | undefined;
2922
3391
  /**
2923
3392
  * @zh 数据
3393
+ * @zh-Hant 資料
2924
3394
  * @en data
2925
3395
  */
2926
3396
  readonly data: D | undefined;
2927
3397
  /**
2928
3398
  * @zh 发送数据
3399
+ * @zh-Hant 發送資料
2929
3400
  * @en post data
2930
3401
  */
2931
3402
  readonly post: (data: P) => void;
2932
3403
  /**
2933
3404
  * @zh 关闭
3405
+ * @zh-Hant 關閉
2934
3406
  * @en close
2935
3407
  */
2936
3408
  readonly close: () => void;
2937
3409
  /**
2938
3410
  * @zh 错误
3411
+ * @zh-Hant 錯誤
2939
3412
  * @en error
2940
3413
  */
2941
3414
  readonly error: Event | null;
2942
3415
  /**
2943
3416
  * @zh 是否关闭
3417
+ * @zh-Hant 是否關閉
2944
3418
  * @en is closed
2945
3419
  */
2946
3420
  readonly isClosed: boolean;
2947
3421
  /**
2948
3422
  * @zh 时间戳
3423
+ * @zh-Hant 時間戳
2949
3424
  * @en timestamp
2950
3425
  */
2951
3426
  readonly timeStamp: number;
@@ -2967,10 +3442,17 @@ declare const useBroadcastChannel: UseBroadcastChannel;
2967
3442
  * - setTrue: 将值设置为 true 的函数。
2968
3443
  * - setFalse: 将值设置为 false 的函数。
2969
3444
  * - toggle: 切换布尔值的函数。
3445
+ * @returns_zh-Hant 包含以下屬性的物件:
3446
+ * - value: 當前的布林值。
3447
+ * - setValue: 直接設定布林值的函數。
3448
+ * - setTrue: 將值設定為 true 的函數。
3449
+ * - setFalse: 將值設定為 false 的函數。
3450
+ * - toggle: 切換布林值的函數。
2970
3451
  */
2971
3452
  type UseBoolean = (
2972
3453
  /**
2973
3454
  * @zh 初始值,默认为 false
3455
+ * @zh-Hant 初始值,預設為 false
2974
3456
  * @en The initial boolean value. Defaults to false.
2975
3457
  */
2976
3458
  initialValue?: boolean) => {
@@ -2993,6 +3475,7 @@ type UseDevicePixelRatio = () => UseDevicePixelRatioReturn;
2993
3475
  interface UseDevicePixelRatioReturn {
2994
3476
  /**
2995
3477
  * @zh 像素比率
3478
+ * @zh-Hant 像素比率
2996
3479
  * @en Pixel ratio
2997
3480
  */
2998
3481
  pixelRatio: number;
@@ -3007,6 +3490,7 @@ type UseElementByPoint = <M extends boolean = false>(
3007
3490
  /**
3008
3491
  * @en options
3009
3492
  * @zh 配置项
3493
+ * @zh-Hant 配置項
3010
3494
  */
3011
3495
  options: UseElementByPointOptions<M>) => UseElementByPointReturn<M>;
3012
3496
  /**
@@ -3074,16 +3558,19 @@ interface UseFetchEventSourceAutoReconnectOptions {
3074
3558
  /**
3075
3559
  * @en The number of retries, if it is a function, it will be called to determine whether to retry
3076
3560
  * @zh 重试次数,如果是函数,会调用来判断是否重试
3561
+ * @zh-Hant 重試次數,如果是函數,會調用來判斷是否重試
3077
3562
  */
3078
3563
  retries?: number | (() => boolean);
3079
3564
  /**
3080
3565
  * @en The delay time before reconnecting (ms)
3081
3566
  * @zh 重连前的延迟时间(毫秒)
3567
+ * @zh-Hant 重連前的延遲時間(毫秒)
3082
3568
  */
3083
3569
  delay?: number;
3084
3570
  /**
3085
3571
  * @en Callback when reconnection fails
3086
3572
  * @zh 重连失败时的回调
3573
+ * @zh-Hant 重連失敗時的回調
3087
3574
  */
3088
3575
  onFailed?: () => void;
3089
3576
  }
@@ -3234,15 +3721,20 @@ declare const useFetchEventSource: UseFetchEventSource;
3234
3721
  * - map: 当前的 Map 实例。
3235
3722
  * - set: 在 map 中设置键值对的函数。
3236
3723
  * - get: 通过键从 map 中获取值的函数。
3237
- * - remove: 从 map 中删除键并返回是否存在的函数。
3238
- * - has: 检查键是否存在于 map 中的函数。
3239
- * - clear: 清除 map 中所有条目的函数。
3240
- * - reset: map 重置为其初始状态的函数。
3241
- * - size: map 的当前大小。
3724
+ * @returns_zh-Hant 包含以下屬性的對象:
3725
+ * - map: 當前的 Map 實例。
3726
+ * - set: map 中設定鍵值對的函數。
3727
+ * - get: 通過鍵從 map 中獲取值的函數。
3728
+ * - remove: map 中刪除鍵並返回是否存在的函數。
3729
+ * - has: 檢查鍵是否存在於 map 中的函數。
3730
+ * - clear: 清除 map 中所有條目的函數。
3731
+ * - reset: 將 map 重置為其初始狀態的函數。
3732
+ * - size: map 的當前大小。
3242
3733
  */
3243
3734
  type UseMap<K = any, V = any> = (
3244
3735
  /**
3245
3736
  * @zh 初始值,可以为 Map 实例、数组或者一个初始化的函数
3737
+ * @zh-Hant 初始值,可以為 Map 實例、數組或者一個初始化的函數
3246
3738
  * @en The initial value of the map. It can be a Map instance, an array of key-value pairs, or a function that returns initial entries.
3247
3739
  */
3248
3740
  initialValue?: Map<K, V> | readonly (readonly [K, V])[] | (() => Map<K, V> | readonly (readonly [K, V])[])) => {
@@ -3265,45 +3757,53 @@ interface UseColorModeOptions<T extends string = string> {
3265
3757
  /**
3266
3758
  * @en CSS Selector for the target element applying to
3267
3759
  * @zh 适用于目标元素的 CSS 选择器
3760
+ * @zh-Hant 適用於目標元素的 CSS 選擇器
3268
3761
  * @defaultValue 'html'
3269
3762
  */
3270
3763
  selector?: string;
3271
3764
  /**
3272
3765
  * @en HTML attribute applying the target element
3273
3766
  * @zh 应用到目标元素的 html 属性
3767
+ * @zh-Hant 應用到目標元素的 html 屬性
3274
3768
  * @defaultValue 'class'
3275
3769
  */
3276
3770
  attribute?: string;
3277
3771
  /**
3278
3772
  * @en Available color modes
3279
3773
  * @zh 可用的颜色模式
3774
+ * @zh-Hant 可用的顏色模式
3280
3775
  */
3281
3776
  modes: T[];
3282
3777
  /**
3283
3778
  * @en Default color mode
3284
3779
  * @zh 默认颜色模式
3780
+ * @zh-Hant 預設顏色模式
3285
3781
  */
3286
3782
  defaultValue?: T;
3287
3783
  /**
3288
3784
  * @en Key to persist the data into localStorage/sessionStorage.
3289
3785
  * @zh 将数据持久保存到 localStorage/sessionStorage 的键值
3786
+ * @zh-Hant 將資料持久保存到 localStorage/sessionStorage 的鍵值
3290
3787
  * @defaultValue 'reactuses-color-mode'
3291
3788
  */
3292
3789
  storageKey?: string;
3293
3790
  /**
3294
3791
  * @en Storage object, can be localStorage or sessionStorage
3295
3792
  * @zh 存储对象,可以是localStorage或sessionStorage
3793
+ * @zh-Hant 儲存對象,可以是localStorage或sessionStorage
3296
3794
  * @defaultValue `localStorage`
3297
3795
  */
3298
3796
  storage?: () => Storage | undefined;
3299
3797
  /**
3300
3798
  * @en Function to get initial color mode from system preference
3301
3799
  * @zh 从系统偏好获取初始颜色模式的函数
3800
+ * @zh-Hant 從系統偏好獲取初始顏色模式的函數
3302
3801
  */
3303
3802
  initialValueDetector?: () => T;
3304
3803
  /**
3305
3804
  * @en Mapping of color modes to their corresponding class names or attribute values
3306
3805
  * @zh 颜色模式到对应类名或属性值的映射
3806
+ * @zh-Hant 顏色模式到對應類名或屬性值的映射
3307
3807
  */
3308
3808
  modeClassNames?: Partial<Record<T, string>>;
3309
3809
  }
@@ -3317,6 +3817,10 @@ interface UseColorModeOptions<T extends string = string> {
3317
3817
  * - 当前颜色模式值。
3318
3818
  * - 设置颜色模式的函数。
3319
3819
  * - 循环切换可用模式的函数。
3820
+ * @returns_zh-Hant 包含以下元素的元組:
3821
+ * - 當前顏色模式值。
3822
+ * - 設定顏色模式的函數。
3823
+ * - 循環切換可用模式的函數。
3320
3824
  */
3321
3825
  type UseColorMode<T extends string = string> = (options: UseColorModeOptions<T>) => readonly [
3322
3826
  T | null,
@@ -3386,6 +3890,7 @@ interface UseSpeechRecognitionOptions {
3386
3890
  * Controls whether continuous results are returned for each recognition, or only a single result.
3387
3891
  *
3388
3892
  * @zh 控制是否为每次识别返回连续结果,或仅返回单个结果
3893
+ * @zh-Hant 控制是否為每次識別返回連續結果,或僅返回單個結果
3389
3894
  * @en Controls whether continuous results are returned for each recognition, or only a single result
3390
3895
  * @default true
3391
3896
  */
@@ -3394,6 +3899,7 @@ interface UseSpeechRecognitionOptions {
3394
3899
  * Controls whether interim results should be returned (true) or not (false.) Interim results are results that are not yet final
3395
3900
  *
3396
3901
  * @zh 控制是否应返回临时结果(true)或不返回(false)。临时结果是尚未最终确定的结果
3902
+ * @zh-Hant 控制是否應返回臨時結果(true)或不返回(false)。臨時結果是尚未最終確定的結果
3397
3903
  * @en Controls whether interim results should be returned (true) or not (false.) Interim results are results that are not yet final
3398
3904
  * @default true
3399
3905
  */
@@ -3402,6 +3908,7 @@ interface UseSpeechRecognitionOptions {
3402
3908
  * Language for SpeechRecognition
3403
3909
  *
3404
3910
  * @zh 语音识别的语言
3911
+ * @zh-Hant 語音識別的語言
3405
3912
  * @en Language for SpeechRecognition
3406
3913
  * @default 'en-US'
3407
3914
  */
@@ -3410,6 +3917,7 @@ interface UseSpeechRecognitionOptions {
3410
3917
  * A number representing the maximum returned alternatives for each result.
3411
3918
  *
3412
3919
  * @zh 表示每个结果返回的最大备选项数量的数字
3920
+ * @zh-Hant 表示每個結果返回的最大備選項數量的數字
3413
3921
  * @en A number representing the maximum returned alternatives for each result
3414
3922
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition/maxAlternatives
3415
3923
  * @default 1
@@ -3438,55 +3946,75 @@ interface UseSpeechRecognitionOptions {
3438
3946
  * - Function to toggle listening state.
3439
3947
  * - Function to start listening.
3440
3948
  * - Function to stop listening.
3949
+ * @returns_zh-Hant 包含以下元素的對象:
3950
+ * - 是否支持語音識別。
3951
+ * - 是否正在監聽。
3952
+ * - 識別結果是否為最終結果。
3953
+ * - SpeechRecognition 實例。
3954
+ * - 識別結果文本。
3955
+ * - 錯誤信息。
3956
+ * - 切換監聽狀態的函數。
3957
+ * - 開始監聽的函數。
3958
+ * - 停止監聽的函數。
3441
3959
  */
3442
3960
  type UseSpeechRecognition = (
3443
3961
  /**
3444
3962
  * @zh 可选的语音识别配置参数
3963
+ * @zh-Hant 可選的語音識別配置參數
3445
3964
  * @en Optional speech recognition configuration options
3446
3965
  */
3447
3966
  options?: UseSpeechRecognitionOptions) => {
3448
3967
  /**
3449
3968
  * @zh 浏览器是否支持语音识别
3969
+ * @zh-Hant 瀏覽器是否支持語音識別
3450
3970
  * @en Whether the browser supports speech recognition
3451
3971
  */
3452
3972
  readonly isSupported: boolean;
3453
3973
  /**
3454
3974
  * @zh 是否正在监听
3975
+ * @zh-Hant 是否正在監聽
3455
3976
  * @en Whether currently listening
3456
3977
  */
3457
3978
  readonly isListening: boolean;
3458
3979
  /**
3459
3980
  * @zh 识别结果是否为最终结果
3981
+ * @zh-Hant 識別結果是否為最終結果
3460
3982
  * @en Whether the recognition result is final
3461
3983
  */
3462
3984
  readonly isFinal: boolean;
3463
3985
  /**
3464
3986
  * @zh SpeechRecognition 实例
3987
+ * @zh-Hant SpeechRecognition 實例
3465
3988
  * @en SpeechRecognition instance
3466
3989
  */
3467
3990
  readonly recognition: SpeechRecognition | undefined;
3468
3991
  /**
3469
3992
  * @zh 识别结果文本
3993
+ * @zh-Hant 識別結果文本
3470
3994
  * @en Recognition result text
3471
3995
  */
3472
3996
  readonly result: string;
3473
3997
  /**
3474
3998
  * @zh 错误信息
3999
+ * @zh-Hant 錯誤信息
3475
4000
  * @en Error information
3476
4001
  */
3477
4002
  readonly error: SpeechRecognitionErrorEvent | undefined;
3478
4003
  /**
3479
4004
  * @zh 切换监听状态
4005
+ * @zh-Hant 切換監聽狀態
3480
4006
  * @en Toggle listening state
3481
4007
  */
3482
4008
  readonly toggle: (value?: boolean, startOptions?: Partial<UseSpeechRecognitionOptions>) => void;
3483
4009
  /**
3484
4010
  * @zh 开始监听
4011
+ * @zh-Hant 開始監聽
3485
4012
  * @en Start listening
3486
4013
  */
3487
4014
  readonly start: (startOptions?: Partial<UseSpeechRecognitionOptions>) => void;
3488
4015
  /**
3489
4016
  * @zh 停止监听
4017
+ * @zh-Hant 停止監聽
3490
4018
  * @en Stop listening
3491
4019
  */
3492
4020
  readonly stop: () => void;
@@ -3499,10 +4027,12 @@ declare const useSpeechRecognition: UseSpeechRecognition;
3499
4027
  * @title useDocumentVisiblity
3500
4028
  * @returns_en document visibility
3501
4029
  * @returns 文档可见性
4030
+ * @returns_zh-Hant 文檔可見性
3502
4031
  */
3503
4032
  type UseDocumentVisibility = (
3504
4033
  /**
3505
4034
  * @zh 默认值
4035
+ * @zh-Hant 預設值
3506
4036
  * @en default value
3507
4037
  */
3508
4038
  defaultValue?: DocumentVisibilityState) => DocumentVisibilityState;
@@ -3513,11 +4043,13 @@ defaultValue?: DocumentVisibilityState) => DocumentVisibilityState;
3513
4043
  type UseEventListener = (
3514
4044
  /**
3515
4045
  * @zh 事件名称
4046
+ * @zh-Hant 事件名稱
3516
4047
  * @en event name
3517
4048
  */
3518
4049
  eventName: string,
3519
4050
  /**
3520
4051
  * @zh 事件处理器
4052
+ * @zh-Hant 事件處理器
3521
4053
  * @en event handler
3522
4054
  */
3523
4055
  handler: (event: any) => void,
@@ -3539,16 +4071,19 @@ options?: boolean | AddEventListenerOptions | undefined) => void;
3539
4071
  type UseFavicon = (
3540
4072
  /**
3541
4073
  * @zh 图标路径
4074
+ * @zh-Hant 圖標路徑
3542
4075
  * @en icon href
3543
4076
  */
3544
4077
  href: string,
3545
4078
  /**
3546
4079
  * @zh 基础 url
4080
+ * @zh-Hant 基礎 url
3547
4081
  * @en base url
3548
4082
  */
3549
4083
  baseUrl?: string,
3550
4084
  /**
3551
4085
  * @zh 设置 link 标签的 rel 属性
4086
+ * @zh-Hant 設定 link 標籤的 rel 屬性
3552
4087
  * @en set rel attribute to link element
3553
4088
  * @defaultValue icon
3554
4089
  */
@@ -3562,20 +4097,26 @@ rel?: string) => void;
3562
4097
  * @returns_en A tuple with the following elements:
3563
4098
  * - The current value of the localStorage.
3564
4099
  * - A function to update the value of the localStorage.
4100
+ * @returns_zh-Hant 包含以下元素的元組:
4101
+ * - localStorage 的當前值。
4102
+ * - 更新 localStorage 值的函數。
3565
4103
  */
3566
4104
  type UseLocalStorage = <T extends string | number | boolean | object | null>(
3567
4105
  /**
3568
4106
  * @zh 键值
4107
+ * @zh-Hant 鍵值
3569
4108
  * @en key
3570
4109
  */
3571
4110
  key: string,
3572
4111
  /**
3573
4112
  * @zh 默认值
4113
+ * @zh-Hant 預設值
3574
4114
  * @en default value
3575
4115
  */
3576
4116
  defaultValue?: T,
3577
4117
  /**
3578
4118
  * @zh 可选参数
4119
+ * @zh-Hant 可選參數
3579
4120
  * @en optional params
3580
4121
  */
3581
4122
  options?: UseLocalStorageOptions<T>) => readonly [T | null, Dispatch<SetStateAction<T | null>>];
@@ -3586,28 +4127,33 @@ interface UseLocalStorageOptions<T> {
3586
4127
  /**
3587
4128
  * @en Custom data serialization
3588
4129
  * @zh 自定义数据序列化
4130
+ * @zh-Hant 自訂資料序列化
3589
4131
  */
3590
4132
  serializer?: UseLocalStorageSerializer<T>;
3591
4133
  /**
3592
4134
  * @en On error callback
3593
4135
  * @zh 错误回调
4136
+ * @zh-Hant 錯誤回呼
3594
4137
  * @defaultValue `console.error`
3595
4138
  */
3596
4139
  onError?: (error: unknown) => void;
3597
4140
  /**
3598
4141
  * @en set to storage when nodata in first mount, deprecated
3599
4142
  * @zh 首次挂载时没有数据时设置到 storage, 已弃用
4143
+ * @zh-Hant 首次掛載時沒有資料時設定到 storage,已棄用
3600
4144
  * @deprecated
3601
4145
  */
3602
4146
  effectStorageValue?: T | (() => T);
3603
4147
  /**
3604
4148
  * @en set to storage when nodata in first mount
3605
4149
  * @zh 首次挂载时没有数据时设置到 storage
4150
+ * @zh-Hant 首次掛載時沒有資料時設定到 storage
3606
4151
  */
3607
4152
  mountStorageValue?: T | (() => T);
3608
4153
  /**
3609
4154
  * @en listen to storage changes
3610
4155
  * @zh 监听 storage 变化
4156
+ * @zh-Hant 監聽 storage 變化
3611
4157
  * @defaultValue `true`
3612
4158
  */
3613
4159
  listenToStorageChanges?: boolean;
@@ -3619,11 +4165,13 @@ interface UseLocalStorageSerializer<T> {
3619
4165
  /**
3620
4166
  * @en Custom data read
3621
4167
  * @zh 自定义数据读取
4168
+ * @zh-Hant 自訂資料讀取
3622
4169
  */
3623
4170
  read: (raw: string) => T;
3624
4171
  /**
3625
4172
  * @en Custom data write
3626
4173
  * @zh 自定义数据写入
4174
+ * @zh-Hant 自訂資料寫入
3627
4175
  */
3628
4176
  write: (value: T) => string;
3629
4177
  }
@@ -3632,6 +4180,7 @@ interface UseLocalStorageSerializer<T> {
3632
4180
  * @title useMountedState
3633
4181
  * @returns 组件的挂载状态
3634
4182
  * @returns_en component mounted state
4183
+ * @returns_zh-Hant 組件的挂載狀態
3635
4184
  */
3636
4185
  type UseMountedState = () => () => boolean;
3637
4186
 
@@ -3639,6 +4188,7 @@ type UseMountedState = () => () => boolean;
3639
4188
  * @title usePageLeave
3640
4189
  * @returns 鼠标是否离开页面
3641
4190
  * @returns_en whether the mouse leave page
4191
+ * @returns_zh-Hant 滑鼠是否離開頁面
3642
4192
  */
3643
4193
  type UsePageLeave = () => boolean;
3644
4194
 
@@ -3646,10 +4196,12 @@ type UsePageLeave = () => boolean;
3646
4196
  * @title usePreferredDark
3647
4197
  * @returns 是否偏好黑色
3648
4198
  * @returns_en whether prefer dark
4199
+ * @returns_zh-Hant 是否偏好黑色
3649
4200
  */
3650
4201
  type UsePreferredDark = (
3651
4202
  /**
3652
4203
  * @zh 默认值
4204
+ * @zh-Hant 預設值
3653
4205
  * @en defaule value
3654
4206
  */
3655
4207
  defaultState?: boolean) => boolean;
@@ -3658,10 +4210,12 @@ defaultState?: boolean) => boolean;
3658
4210
  * @title usePrevious
3659
4211
  * @returns 更新前的值
3660
4212
  * @returns_en previous value
4213
+ * @returns_zh-Hant 更新前的值
3661
4214
  */
3662
4215
  type UsePrevious = <T>(
3663
4216
  /**
3664
4217
  * @zh 状态值
4218
+ * @zh-Hant 狀態值
3665
4219
  * @en state value
3666
4220
  */
3667
4221
  state: T) => T | undefined;
@@ -3674,10 +4228,14 @@ state: T) => T | undefined;
3674
4228
  * @returns_en A tuple with the following elements:
3675
4229
  * - the state value
3676
4230
  * - a function to update state in `requestAnimationFrame`
4231
+ * @returns_zh-Hant 包含以下元素的元組:
4232
+ * - state 的當前值。
4233
+ * - 在 `requestAnimationFrame` 中更新 state 值的函數。
3677
4234
  */
3678
4235
  type UseRafState = <S>(
3679
4236
  /**
3680
4237
  * @zh 状态值
4238
+ * @zh-Hant 狀態值
3681
4239
  * @en state value
3682
4240
  */
3683
4241
  initialState: S | (() => S)) => readonly [S, Dispatch<SetStateAction<S>>];
@@ -3686,10 +4244,12 @@ initialState: S | (() => S)) => readonly [S, Dispatch<SetStateAction<S>>];
3686
4244
  * @title useReducedMotion
3687
4245
  * @returns 是否偏好减少动画
3688
4246
  * @returns_en whether prefer reduced motion
4247
+ * @returns_zh-Hant 是否偏好減少動畫
3689
4248
  */
3690
4249
  type UseReducedMotion = (
3691
4250
  /**
3692
4251
  * @zh 默认值
4252
+ * @zh-Hant 預設值
3693
4253
  * @en default value
3694
4254
  */
3695
4255
  defaultState?: boolean) => boolean;
@@ -3707,6 +4267,12 @@ defaultState?: boolean) => boolean;
3707
4267
  * - right safe distance
3708
4268
  * - bottom safe distance
3709
4269
  * - left safe distance
4270
+ * @returns_zh-Hant 包含以下元素的元組:
4271
+ * - 頂部安全距離。
4272
+ * - 右邊安全距離。
4273
+ * - 底部安全距離。
4274
+ * - 左邊安全距離,
4275
+ * - 手動更新函數
3710
4276
  * - munual update function
3711
4277
  */
3712
4278
  type UseScreenSafeArea = () => readonly [string, string, string, string, DebouncedFunc$1<() => void>];
@@ -3719,20 +4285,26 @@ type UseScreenSafeArea = () => readonly [string, string, string, string, Debounc
3719
4285
  * @returns_en A tuple with the following elements:
3720
4286
  * - The current value of the sessionStorage.
3721
4287
  * - A function to update the value of the sessionStorage.
4288
+ * @returns_zh-Hant 包含以下元素的元組:
4289
+ * - sessionStorage 的當前值。
4290
+ * - 更新 sessionStorage 值的函數。
3722
4291
  */
3723
4292
  type UseSessionStorage = <T extends string | number | boolean | object | null>(
3724
4293
  /**
3725
4294
  * @zh 键值
4295
+ * @zh-Hant 鍵值
3726
4296
  * @en key
3727
4297
  */
3728
4298
  key: string,
3729
4299
  /**
3730
4300
  * @zh 默认值
4301
+ * @zh-Hant 預設值
3731
4302
  * @en default value
3732
4303
  */
3733
4304
  defaultValue?: T,
3734
4305
  /**
3735
4306
  * @zh 可选参数
4307
+ * @zh-Hant 可選參數
3736
4308
  * @en optional params
3737
4309
  */
3738
4310
  options?: UseSessionStorageOptions<T>) => readonly [T | null, Dispatch<SetStateAction<T | null>>];
@@ -3743,28 +4315,33 @@ interface UseSessionStorageOptions<T> {
3743
4315
  /**
3744
4316
  * @en Custom data serialization
3745
4317
  * @zh 自定义数据序列化
4318
+ * @zh-Hant 自定義數據序列化
3746
4319
  */
3747
4320
  serializer?: UseSessionStorageSerializer<T>;
3748
4321
  /**
3749
4322
  * @en On error callback
3750
4323
  * @zh 错误回调
4324
+ * @zh-Hant 錯誤回調
3751
4325
  * @defaultValue `console.error`
3752
4326
  */
3753
4327
  onError?: (error: unknown) => void;
3754
4328
  /**
3755
4329
  * @en set to storage when nodata in first mount, deprecated
3756
4330
  * @zh 首次挂载时没有数据时设置到 storage, 已弃用
4331
+ * @zh-Hant 首次掛載時沒有數據時設置到 storage, 已棄用
3757
4332
  * @deprecated
3758
4333
  */
3759
4334
  effectStorageValue?: T | (() => T);
3760
4335
  /**
3761
4336
  * @en set to storage when nodata in first mount
3762
4337
  * @zh 首次挂载时没有数据时设置到 storage
4338
+ * @zh-Hant 首次掛載時沒有數據時設置到 storage
3763
4339
  */
3764
4340
  mountStorageValue?: T | (() => T);
3765
4341
  /**
3766
4342
  * @en listen to storage changes
3767
4343
  * @zh 监听 storage 变化
4344
+ * @zh-Hant 監聽 storage 變化
3768
4345
  * @defaultValue `true`
3769
4346
  */
3770
4347
  listenToStorageChanges?: boolean;
@@ -3776,11 +4353,13 @@ interface UseSessionStorageSerializer<T> {
3776
4353
  /**
3777
4354
  * @en Custom data read
3778
4355
  * @zh 自定义数据读取
4356
+ * @zh-Hant 自定義數據讀取
3779
4357
  */
3780
4358
  read: (raw: string) => T;
3781
4359
  /**
3782
4360
  * @en Custom data write
3783
4361
  * @zh 自定义数据写入
4362
+ * @zh-Hant 自定義數據寫入
3784
4363
  */
3785
4364
  write: (value: T) => string;
3786
4365
  }
@@ -3789,15 +4368,18 @@ interface UseSessionStorageSerializer<T> {
3789
4368
  * @title useSupported
3790
4369
  * @returns 浏览器是否支持
3791
4370
  * @returns_en whether the browser support
4371
+ * @returns_zh-Hant 瀏覽器是否支援
3792
4372
  */
3793
4373
  type UseSupported = (
3794
4374
  /**
3795
4375
  * @zh 测试回调
4376
+ * @zh-Hant 測試回調
3796
4377
  * @en test callback
3797
4378
  */
3798
4379
  callback: () => unknown,
3799
4380
  /**
3800
4381
  * @zh 使用 useLayoutEffect来进行测试
4382
+ * @zh-Hant 使用 useLayoutEffect來進行測試
3801
4383
  * @en use useLayoutEffect to test
3802
4384
  * @defaultValue false
3803
4385
  */
@@ -3813,20 +4395,27 @@ sync?: boolean) => boolean;
3813
4395
  * - run:执行函数。
3814
4396
  * - cancel:取消执行函数。
3815
4397
  * - flush: 立即执行函数
4398
+ * @returns_zh-Hant 具有以下元素的對象:
4399
+ * - run:執行函數。
4400
+ * - cancel:取消執行函數。
4401
+ * - flush: 立即執行函數
3816
4402
  */
3817
4403
  type UseThrottleFn = <T extends (...args: any) => any>(
3818
4404
  /**
3819
4405
  * @zh 要节流的函数
4406
+ * @zh-Hant 要節流的函數
3820
4407
  * @en Throttle function
3821
4408
  */
3822
4409
  fn: T,
3823
4410
  /**
3824
4411
  * @zh 间隔时间
4412
+ * @zh-Hant 間隔時間
3825
4413
  * @en wait time
3826
4414
  */
3827
4415
  wait?: number,
3828
4416
  /**
3829
4417
  * @zh 传递给 `lodash.throttle` 的属性
4418
+ * @zh-Hant 傳遞給 `lodash.throttle` 的屬性
3830
4419
  * @en options passed to `lodash.throttle`
3831
4420
  */
3832
4421
  options?: ThrottleSettings$1) => {
@@ -3841,6 +4430,7 @@ options?: ThrottleSettings$1) => {
3841
4430
  type UseUnmount = (
3842
4431
  /**
3843
4432
  * @zh 清理函数
4433
+ * @zh-Hant 清理函數
3844
4434
  * @en clear function
3845
4435
  */
3846
4436
  fn: () => void) => void;
@@ -3849,6 +4439,7 @@ fn: () => void) => void;
3849
4439
  * @title useUpdate
3850
4440
  * @returns 强制更新函数
3851
4441
  * @returns_en rerender trigger function
4442
+ * @returns_zh-Hant 強制更新函數
3852
4443
  */
3853
4444
  type UseUpdate = () => () => void;
3854
4445
 
@@ -3856,10 +4447,12 @@ type UseUpdate = () => () => void;
3856
4447
  * @title useWindowsFocus
3857
4448
  * @returns 窗口是否聚焦
3858
4449
  * @returns_en whether window focus
4450
+ * @returns_zh-Hant 窗口是否聚焦
3859
4451
  */
3860
4452
  type UseWindowsFocus = (
3861
4453
  /**
3862
4454
  * @zh 默认值
4455
+ * @zh-Hant 預設值
3863
4456
  * @en defauleValue
3864
4457
  */
3865
4458
  defauleValue?: boolean) => boolean;
@@ -3868,6 +4461,7 @@ defauleValue?: boolean) => boolean;
3868
4461
  * @title useMobileLandscape
3869
4462
  * @returns 是否是移动端横屏
3870
4463
  * @returns_en whether is mobile landscape
4464
+ * @returns_zh-Hant 是否是行動端橫屏
3871
4465
  */
3872
4466
  type UseMobileLandscape = () => boolean;
3873
4467
 
@@ -3894,13 +4488,15 @@ type Usable<T> = Thenable<T> | Context<T>;
3894
4488
  * @title Use
3895
4489
  * @returns 解析状态值
3896
4490
  * @returns_en resolved state value
4491
+ * @returns_zh-Hant 解析狀態值
3897
4492
  */
3898
4493
  type Use = <T>(
3899
4494
  /**
3900
4495
  * @zh promise 或者 context
4496
+ * @zh-Hant promise 或者 context
3901
4497
  * @en promise or context
3902
4498
  */
3903
4499
  usable: Usable<T>) => T;
3904
4500
 
3905
- export { assignRef, defaultOptions, mergeRefs, use, useActiveElement, useAsyncEffect, useBoolean, useBroadcastChannel, useClickOutside as useClickAway, useClickOutside, useClipboard, useColorMode, useControlled, useCookie, useClipboard as useCopyToClipboard, useCountDown, useCounter, useCssVar, useCustomCompareEffect, useCycleList, useDarkMode, useDebounce, useDebounceFn, useDeepCompareEffect, useDevicePixelRatio, useDisclosure, useDocumentVisibility, useDoubleClick, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementSize, useElementVisibility, useEvent, useEventEmitter, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetchEventSource, useFileDialog, useFirstMountState, useFocus, useFps, useFullscreen, useGeolocation, useHover, useIdle, useInfiniteScroll, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyModifier, useLatest, useLocalStorage, useLocationSelector, useLongPress, useMap, useMeasure, useMediaDevices, useMediaQuery, useMergedRefs, useMobileLandscape, useMount, useMountedState, useMouse, useMousePressed, useMutationObserver, useNetwork, useObjectUrl, useOnceEffect, useOnceLayoutEffect, useOnline, useOrientation, usePageLeave, usePermission, usePlatform, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePrevious, useRafFn, useRafState, useReducedMotion, useResizeObserver, useScreenSafeArea, useScriptTag, useScroll, useScrollIntoView, useScrollLock, useSessionStorage, useSetState, useSpeechRecognition, useSticky, useSupported, useTextDirection, useTextSelection, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useTitle, useToggle, useUnmount, useUpdate, useUpdateEffect, useUpdateLayoutEffect, useWebNotification, useWindowScroll, useWindowSize, useWindowsFocus };
3906
- export type { ColorScheme, Contrast, DepsEqualFnType, EventSourceStatus, EventType, INetworkInformation, IUseNetworkState, KeyModifier, Pausable, Platform, PossibleRef, Use, UseActiveElement, UseAsyncEffect, UseBoolean, UseBroadcastChannel, UseBroadcastChannelOptions, UseBroadcastChannelReturn, UseClickOutside, UseClipboard, UseColorMode, UseColorModeOptions, UseControlled, UseCookie, UseCookieState, UseCountDown, UseCounter, UseCssVar, UseCssVarOptions, UseCustomCompareEffect, UseCycleList, UseDarkMode, UseDarkOptions, UseDebounce, UseDebounceFn, UseDeepCompareEffect, UseDevicePixelRatio, UseDevicePixelRatioReturn, UseDisclosure, UseDisclosureProps, UseDocumentVisibility, UseDoubleClick, UseDoubleClickProps, UseDraggable, UseDraggableOptions, UseDropZone, UseElementBounding, UseElementBoundingOptions, UseElementBoundingReturn, UseElementByPoint, UseElementByPointOptions, UseElementByPointReturn, UseElementSize, UseElementVisibility, UseEvent, UseEventEmitter, UseEventEmitterDisposable, UseEventEmitterEvent, UseEventEmitterEventOnce, UseEventEmitterListener, UseEventEmitterReturn, UseEventListener, UseEventSource, UseEventSourceAutoReconnectOptions, UseEventSourceOptions, UseEventSourceReturn, UseEyeDropper, UseEyeDropperOpenOptions, UseEyeDropperOpenReturnType, UseFavicon, UseFetchEventSource, UseFetchEventSourceAutoReconnectOptions, UseFetchEventSourceMessage, UseFetchEventSourceOptions, UseFetchEventSourceReturn, UseFetchEventSourceStatus, UseFileDialog, UseFileDialogOptions, UseFirstMountState, UseFocus, UseFps, UseFpsOptions, UseFullScreenOptions, UseFullscreen, UseGeolocation, UseHover, UseIdle, UseInfiniteScroll, UseInfiniteScrollArrivedState, UseInfiniteScrollDirection, UseInfiniteScrollLoadMore, UseInfiniteScrollOptions, UseIntersectionObserver, UseInterval, UseIntervalOptions, UseKeyModifier, UseLatest, UseLocalStorage, UseLocalStorageOptions, UseLocalStorageSerializer, UseLocationSelector, UseLongPress, UseLongPressOptions, UseMap, UseMeasure, UseMeasureRect, UseMediaDeviceOptions, UseMediaDevices, UseMediaQuery, UseMergedRef, UseMobileLandscape, UseModifierOptions, UseMount, UseMountedState, UseMouse, UseMouseCursorState, UseMousePressed, UseMousePressedOptions, UseMousePressedSourceType, UseMutationObserver, UseNetwork, UseObjectUrl, UseOnline, UseOrientation, UseOrientationLockType, UseOrientationState, UseOrientationType, UsePageLeave, UsePermission, UsePermissionDescriptorNamePolyfill, UsePermissionGeneralPermissionDescriptor, UsePermissionState, UsePlatform, UsePlatformProps, UsePlatformReturn, UsePreferredColorScheme, UsePreferredContrast, UsePreferredDark, UsePreferredLanguages, UsePrevious, UseRafFn, UseRafState, UseReducedMotion, UseResizeObserver, UseScreenSafeArea, UseScriptTag, UseScriptTagOptions, UseScriptTagStatus, UseScroll, UseScrollArrivedState, UseScrollDirection, UseScrollIntoView, UseScrollIntoViewAnimation, UseScrollIntoViewParams, UseScrollLock, UseScrollOffset, UseScrollOptions, UseSessionStorage, UseSessionStorageOptions, UseSessionStorageSerializer, UseSetState, UseSpeechRecognition, UseSpeechRecognitionOptions, UseSpeechRecognitionReturn, UseSticky, UseStickyParams, UseSupported, UseTextDirection, UseTextDirectionOptions, UseTextDirectionValue, UseTextSelection, UseThrottle, UseThrottleFn, UseTimeout, UseTimeoutFn, UseTimeoutFnOptions, UseTimeoutOptions, UseTitle, UseToggle, UseUnmount, UseUpdate, UseWebNotification, UseWebNotificationReturn, UseWebNotificationShow, UseWindowScroll, UseWindowScrollState, UseWindowSize, UseWindowsFocus };
4501
+ export { assignRef, defaultOptions, mergeRefs, use, useActiveElement, useAsyncEffect, useBoolean, useBroadcastChannel, useClickOutside as useClickAway, useClickOutside, useClipboard, useColorMode, useControlled, useCookie, useClipboard as useCopyToClipboard, useCountDown, useCounter, useCssVar, useCustomCompareEffect, useCycleList, useDarkMode, useDebounce, useDebounceFn, useDeepCompareEffect, useDevicePixelRatio, useDisclosure, useDocumentVisibility, useDoubleClick, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementSize, useElementVisibility, useEvent, useEventEmitter, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetchEventSource, useFileDialog, useFirstMountState, useFocus, useFps, useFullscreen, useGeolocation, useHover, useIdle, useInfiniteScroll, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyModifier, useLatest, useLocalStorage, useLocationSelector, useLongPress, useMap, useMeasure, useMediaDevices, useMediaQuery, useMergedRefs, useMobileLandscape, useMount, useMountedState, useMouse, useMousePressed, useMutationObserver, useNetwork, useObjectUrl, useOnceEffect, useOnceLayoutEffect, useOnline, useOrientation, usePageLeave, usePermission, usePlatform, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePrevious, useRafFn, useRafState, useReducedMotion, useResizeObserver, useScratch, useScreenSafeArea, useScriptTag, useScroll, useScrollIntoView, useScrollLock, useSessionStorage, useSetState, useSpeechRecognition, useSticky, useSupported, useTextDirection, useTextSelection, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useTitle, useToggle, useUnmount, useUpdate, useUpdateEffect, useUpdateLayoutEffect, useWebNotification, useWindowScroll, useWindowSize, useWindowsFocus };
4502
+ export type { ColorScheme, Contrast, DepsEqualFnType, EventSourceStatus, EventType, INetworkInformation, IUseNetworkState, KeyModifier, Pausable, Platform, PossibleRef, Use, UseActiveElement, UseAsyncEffect, UseBoolean, UseBroadcastChannel, UseBroadcastChannelOptions, UseBroadcastChannelReturn, UseClickOutside, UseClipboard, UseColorMode, UseColorModeOptions, UseControlled, UseCookie, UseCookieState, UseCountDown, UseCounter, UseCssVar, UseCssVarOptions, UseCustomCompareEffect, UseCycleList, UseDarkMode, UseDarkOptions, UseDebounce, UseDebounceFn, UseDeepCompareEffect, UseDevicePixelRatio, UseDevicePixelRatioReturn, UseDisclosure, UseDisclosureProps, UseDocumentVisibility, UseDoubleClick, UseDoubleClickProps, UseDraggable, UseDraggableOptions, UseDropZone, UseElementBounding, UseElementBoundingOptions, UseElementBoundingReturn, UseElementByPoint, UseElementByPointOptions, UseElementByPointReturn, UseElementSize, UseElementVisibility, UseEvent, UseEventEmitter, UseEventEmitterDisposable, UseEventEmitterEvent, UseEventEmitterEventOnce, UseEventEmitterListener, UseEventEmitterReturn, UseEventListener, UseEventSource, UseEventSourceAutoReconnectOptions, UseEventSourceOptions, UseEventSourceReturn, UseEyeDropper, UseEyeDropperOpenOptions, UseEyeDropperOpenReturnType, UseFavicon, UseFetchEventSource, UseFetchEventSourceAutoReconnectOptions, UseFetchEventSourceMessage, UseFetchEventSourceOptions, UseFetchEventSourceReturn, UseFetchEventSourceStatus, UseFileDialog, UseFileDialogOptions, UseFirstMountState, UseFocus, UseFps, UseFpsOptions, UseFullScreenOptions, UseFullscreen, UseGeolocation, UseHover, UseIdle, UseInfiniteScroll, UseInfiniteScrollArrivedState, UseInfiniteScrollDirection, UseInfiniteScrollLoadMore, UseInfiniteScrollOptions, UseIntersectionObserver, UseInterval, UseIntervalOptions, UseKeyModifier, UseLatest, UseLocalStorage, UseLocalStorageOptions, UseLocalStorageSerializer, UseLocationSelector, UseLongPress, UseLongPressOptions, UseMap, UseMeasure, UseMeasureRect, UseMediaDeviceOptions, UseMediaDevices, UseMediaQuery, UseMergedRef, UseMobileLandscape, UseModifierOptions, UseMount, UseMountedState, UseMouse, UseMouseCursorState, UseMousePressed, UseMousePressedOptions, UseMousePressedSourceType, UseMutationObserver, UseNetwork, UseObjectUrl, UseOnline, UseOrientation, UseOrientationLockType, UseOrientationState, UseOrientationType, UsePageLeave, UsePermission, UsePermissionDescriptorNamePolyfill, UsePermissionGeneralPermissionDescriptor, UsePermissionState, UsePlatform, UsePlatformProps, UsePlatformReturn, UsePreferredColorScheme, UsePreferredContrast, UsePreferredDark, UsePreferredLanguages, UsePrevious, UseRafFn, UseRafState, UseReducedMotion, UseResizeObserver, UseScratch, UseScratchOptions, UseScratchState, UseScreenSafeArea, UseScriptTag, UseScriptTagOptions, UseScriptTagStatus, UseScroll, UseScrollArrivedState, UseScrollDirection, UseScrollIntoView, UseScrollIntoViewAnimation, UseScrollIntoViewParams, UseScrollLock, UseScrollOffset, UseScrollOptions, UseSessionStorage, UseSessionStorageOptions, UseSessionStorageSerializer, UseSetState, UseSpeechRecognition, UseSpeechRecognitionOptions, UseSpeechRecognitionReturn, UseSticky, UseStickyParams, UseSupported, UseTextDirection, UseTextDirectionOptions, UseTextDirectionValue, UseTextSelection, UseThrottle, UseThrottleFn, UseTimeout, UseTimeoutFn, UseTimeoutFnOptions, UseTimeoutOptions, UseTitle, UseToggle, UseUnmount, UseUpdate, UseWebNotification, UseWebNotificationReturn, UseWebNotificationShow, UseWindowScroll, UseWindowScrollState, UseWindowSize, UseWindowsFocus };