@reactuses/core 5.0.17 → 5.0.19-beta.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/README.md +13 -13
- package/dist/index.cjs +231 -11
- package/dist/index.d.cts +189 -3
- package/dist/index.d.mts +189 -3
- package/dist/index.d.ts +189 -3
- package/dist/index.mjs +228 -12
- package/dist/useQRCode.cjs +95 -0
- package/dist/useQRCode.d.cts +36 -0
- package/dist/useQRCode.d.mts +36 -0
- package/dist/useQRCode.mjs +88 -0
- package/package.json +19 -1
package/dist/index.d.mts
CHANGED
|
@@ -446,6 +446,26 @@ interface Position {
|
|
|
446
446
|
x: number;
|
|
447
447
|
y: number;
|
|
448
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* @title Pausable
|
|
451
|
+
*/
|
|
452
|
+
interface Pausable$1 {
|
|
453
|
+
/**
|
|
454
|
+
* @en A ref indicate whether a pausable instance is active
|
|
455
|
+
* @zh 一个 ref,表示一个 pausable 实例是否处于激活状态
|
|
456
|
+
*/
|
|
457
|
+
isActive: boolean;
|
|
458
|
+
/**
|
|
459
|
+
* @en Temporary pause the effect from executing
|
|
460
|
+
* @zh 暂时暂停效果的执行
|
|
461
|
+
*/
|
|
462
|
+
pause: Fn;
|
|
463
|
+
/**
|
|
464
|
+
* @en Resume the effects
|
|
465
|
+
* @zh 恢复效果
|
|
466
|
+
*/
|
|
467
|
+
resume: Fn;
|
|
468
|
+
}
|
|
449
469
|
|
|
450
470
|
/**
|
|
451
471
|
* @title useDraggable
|
|
@@ -981,14 +1001,16 @@ declare const useFullscreen: UseFullscreen;
|
|
|
981
1001
|
|
|
982
1002
|
/**
|
|
983
1003
|
* @title useGeoLocation
|
|
984
|
-
* @returns
|
|
1004
|
+
* @returns 包含以下元素的对象:
|
|
985
1005
|
* - 坐标。
|
|
986
1006
|
* - 获取坐标的时间戳。
|
|
987
1007
|
* - 错误。
|
|
988
|
-
*
|
|
1008
|
+
* - 浏览器是否支持 `geolocation`。
|
|
1009
|
+
* @returns_en A object with the following elements:
|
|
989
1010
|
* - coordinates.
|
|
990
1011
|
* - timestamp when get coordinates.
|
|
991
1012
|
* - errors.
|
|
1013
|
+
* - Whether the browser supports `geolocation`.
|
|
992
1014
|
*/
|
|
993
1015
|
type UseGeolocation = (
|
|
994
1016
|
/**
|
|
@@ -999,6 +1021,11 @@ options?: Partial<PositionOptions>) => {
|
|
|
999
1021
|
readonly coordinates: GeolocationCoordinates;
|
|
1000
1022
|
readonly locatedAt: number | null;
|
|
1001
1023
|
readonly error: GeolocationPositionError | null;
|
|
1024
|
+
/**
|
|
1025
|
+
* @zh 浏览器是否支持 `geolocation`
|
|
1026
|
+
* @en Whether the browser supports `geolocation`
|
|
1027
|
+
*/
|
|
1028
|
+
readonly isSupported: boolean;
|
|
1002
1029
|
};
|
|
1003
1030
|
|
|
1004
1031
|
declare const useGeolocation: UseGeolocation;
|
|
@@ -2831,6 +2858,165 @@ declare function useMergedRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) =
|
|
|
2831
2858
|
*/
|
|
2832
2859
|
declare const use: any;
|
|
2833
2860
|
|
|
2861
|
+
/**
|
|
2862
|
+
* @title UsePreferredLanguages
|
|
2863
|
+
* @returns 语言偏好
|
|
2864
|
+
* @returns_en preferred languages
|
|
2865
|
+
*/
|
|
2866
|
+
type UsePreferredLanguages = (
|
|
2867
|
+
/**
|
|
2868
|
+
* @zh 默认值
|
|
2869
|
+
* @en defaule value
|
|
2870
|
+
*/ defaultLanguages?: string[]) => string[];
|
|
2871
|
+
|
|
2872
|
+
declare const usePreferredLanguages: UsePreferredLanguages;
|
|
2873
|
+
|
|
2874
|
+
/**
|
|
2875
|
+
* @title UseBroadcastChannelOptions
|
|
2876
|
+
*/
|
|
2877
|
+
interface UseBroadcastChannelOptions {
|
|
2878
|
+
/**
|
|
2879
|
+
* @zh 频道名称
|
|
2880
|
+
* @en channel name
|
|
2881
|
+
*/
|
|
2882
|
+
name: string;
|
|
2883
|
+
}
|
|
2884
|
+
/**
|
|
2885
|
+
* @title UseBroadcastChannel
|
|
2886
|
+
*/
|
|
2887
|
+
type UseBroadcastChannel = <D, P>(
|
|
2888
|
+
/**
|
|
2889
|
+
* @zh 选项
|
|
2890
|
+
* @en options
|
|
2891
|
+
*/
|
|
2892
|
+
options: UseBroadcastChannelOptions) => UseBroadcastChannelReturn<D, P>;
|
|
2893
|
+
/**
|
|
2894
|
+
* @title UseBroadcastChannelReturn
|
|
2895
|
+
*/
|
|
2896
|
+
interface UseBroadcastChannelReturn<D, P> {
|
|
2897
|
+
/**
|
|
2898
|
+
* @zh 是否支持
|
|
2899
|
+
* @en is supported
|
|
2900
|
+
*/
|
|
2901
|
+
readonly isSupported: boolean;
|
|
2902
|
+
/**
|
|
2903
|
+
* @zh 频道
|
|
2904
|
+
* @en channel
|
|
2905
|
+
*/
|
|
2906
|
+
readonly channel: BroadcastChannel | undefined;
|
|
2907
|
+
/**
|
|
2908
|
+
* @zh 数据
|
|
2909
|
+
* @en data
|
|
2910
|
+
*/
|
|
2911
|
+
readonly data: D | undefined;
|
|
2912
|
+
/**
|
|
2913
|
+
* @zh 发送数据
|
|
2914
|
+
* @en post data
|
|
2915
|
+
*/
|
|
2916
|
+
readonly post: (data: P) => void;
|
|
2917
|
+
/**
|
|
2918
|
+
* @zh 关闭
|
|
2919
|
+
* @en close
|
|
2920
|
+
*/
|
|
2921
|
+
readonly close: () => void;
|
|
2922
|
+
/**
|
|
2923
|
+
* @zh 错误
|
|
2924
|
+
* @en error
|
|
2925
|
+
*/
|
|
2926
|
+
readonly error: Event | null;
|
|
2927
|
+
/**
|
|
2928
|
+
* @zh 是否关闭
|
|
2929
|
+
* @en is closed
|
|
2930
|
+
*/
|
|
2931
|
+
readonly isClosed: boolean;
|
|
2932
|
+
/**
|
|
2933
|
+
* @zh 时间戳
|
|
2934
|
+
* @en timestamp
|
|
2935
|
+
*/
|
|
2936
|
+
readonly timeStamp: number;
|
|
2937
|
+
}
|
|
2938
|
+
|
|
2939
|
+
declare const useBroadcastChannel: UseBroadcastChannel;
|
|
2940
|
+
|
|
2941
|
+
/**
|
|
2942
|
+
* @title UseDevicePixelRatio
|
|
2943
|
+
*/
|
|
2944
|
+
type UseDevicePixelRatio = () => UseDevicePixelRatioReturn;
|
|
2945
|
+
/**
|
|
2946
|
+
* @title UseDevicePixelRatioReturn
|
|
2947
|
+
*/
|
|
2948
|
+
interface UseDevicePixelRatioReturn {
|
|
2949
|
+
/**
|
|
2950
|
+
* @zh 像素比率
|
|
2951
|
+
* @en Pixel ratio
|
|
2952
|
+
*/
|
|
2953
|
+
pixelRatio: number;
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
declare const useDevicePixelRatio: UseDevicePixelRatio;
|
|
2957
|
+
|
|
2958
|
+
/**
|
|
2959
|
+
* @title UseElementByPoint
|
|
2960
|
+
*/
|
|
2961
|
+
type UseElementByPoint = <M extends boolean = false>(
|
|
2962
|
+
/**
|
|
2963
|
+
* @en options
|
|
2964
|
+
* @zh 配置项
|
|
2965
|
+
*/
|
|
2966
|
+
options: UseElementByPointOptions<M>) => UseElementByPointReturn<M>;
|
|
2967
|
+
/**
|
|
2968
|
+
* @title UseElementByPointOptions
|
|
2969
|
+
*/
|
|
2970
|
+
interface UseElementByPointOptions<M extends boolean = false> {
|
|
2971
|
+
/**
|
|
2972
|
+
* @en The x coordinate of the point
|
|
2973
|
+
* @zh 点的 x 坐标
|
|
2974
|
+
*/
|
|
2975
|
+
x: number | (() => number);
|
|
2976
|
+
/**
|
|
2977
|
+
* @en The y coordinate of the point
|
|
2978
|
+
* @zh 点的 y 坐标
|
|
2979
|
+
*/
|
|
2980
|
+
y: number | (() => number);
|
|
2981
|
+
/**
|
|
2982
|
+
* @en The document to query
|
|
2983
|
+
* @zh 要查询的文档
|
|
2984
|
+
*/
|
|
2985
|
+
document?: Document | null;
|
|
2986
|
+
/**
|
|
2987
|
+
* @en Whether to query multiple elements
|
|
2988
|
+
* @zh 是否查询多个元素
|
|
2989
|
+
*/
|
|
2990
|
+
multiple?: M;
|
|
2991
|
+
/**
|
|
2992
|
+
* @en The interval to query the element
|
|
2993
|
+
* @zh 查询元素的间隔
|
|
2994
|
+
*/
|
|
2995
|
+
interval?: number | 'requestAnimationFrame';
|
|
2996
|
+
/**
|
|
2997
|
+
* @en Whether to query the element immediately
|
|
2998
|
+
* @zh 是否立即查询元素
|
|
2999
|
+
*/
|
|
3000
|
+
immediate?: boolean;
|
|
3001
|
+
}
|
|
3002
|
+
/**
|
|
3003
|
+
* @title UseElementByPointReturn
|
|
3004
|
+
*/
|
|
3005
|
+
interface UseElementByPointReturn<M extends boolean> extends Pausable$1 {
|
|
3006
|
+
/**
|
|
3007
|
+
* @en Whether the feature is supported
|
|
3008
|
+
* @zh 功能是否支持
|
|
3009
|
+
*/
|
|
3010
|
+
isSupported: boolean;
|
|
3011
|
+
/**
|
|
3012
|
+
* @en The queried element
|
|
3013
|
+
* @zh 查询到的元素
|
|
3014
|
+
*/
|
|
3015
|
+
element: M extends true ? Element[] : Element | null;
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
declare const useElementByPoint: UseElementByPoint;
|
|
3019
|
+
|
|
2834
3020
|
/**
|
|
2835
3021
|
* @title useDocumentVisiblity
|
|
2836
3022
|
* @returns_en document visibility
|
|
@@ -3214,4 +3400,4 @@ type Use = <T>(
|
|
|
3214
3400
|
*/
|
|
3215
3401
|
usable: Usable<T>) => T;
|
|
3216
3402
|
|
|
3217
|
-
export { type ColorScheme, type Contrast, type DepsEqualFnType, type EventSourceStatus, type EventType, type INetworkInformation, type IUseNetworkState, type KeyModifier, type Pausable, type Platform, type PossibleRef, type Use, type UseActiveElement, type UseAsyncEffect, type UseClickOutside, type UseClipboard, type UseControlled, type UseCookie, type UseCookieState, type UseCountDown, type UseCounter, type UseCssVar, type UseCssVarOptions, type UseCustomCompareEffect, type UseCycleList, type UseDarkMode, type UseDarkOptions, type UseDebounce, type UseDebounceFn, type UseDeepCompareEffect, type UseDisclosure, type UseDisclosureProps, type UseDocumentVisibility, type UseDoubleClick, type UseDoubleClickProps, type UseDraggable, type UseDraggableOptions, type UseDropZone, type UseElementBounding, type UseElementBoundingOptions, type UseElementBoundingReturn, type UseElementSize, type UseElementVisibility, type UseEvent, type UseEventEmitter, type UseEventEmitterDisposable, type UseEventEmitterEvent, type UseEventEmitterEventOnce, type UseEventEmitterListener, type UseEventEmitterReturn, type UseEventListener, type UseEventSource, type UseEventSourceAutoReconnectOptions, type UseEventSourceOptions, type UseEventSourceReturn, type UseEyeDropper, type UseEyeDropperOpenOptions, type UseEyeDropperOpenReturnType, type UseFavicon, type UseFileDialog, type UseFileDialogOptions, type UseFirstMountState, type UseFocus, type UseFps, type UseFpsOptions, type UseFullScreenOptions, type UseFullscreen, type UseGeolocation, type UseHover, type UseIdle, type UseInfiniteScroll, type UseInfiniteScrollArrivedState, type UseInfiniteScrollDirection, type UseInfiniteScrollLoadMore, type UseInfiniteScrollOptions, type UseIntersectionObserver, type UseInterval, type UseIntervalOptions, type UseKeyModifier, type UseLatest, type UseLocalStorage, type UseLocalStorageOptions, type UseLocalStorageSerializer, type UseLocationSelector, type UseLongPress, type UseLongPressOptions, type UseMeasure, type UseMeasureRect, type UseMediaDeviceOptions, type UseMediaDevices, type UseMediaQuery, type UseMergedRef, type UseMobileLandscape, type UseModifierOptions, type UseMount, type UseMountedState, type UseMouse, type UseMouseCursorState, type UseMousePressed, type UseMousePressedOptions, type UseMousePressedSourceType, type UseMutationObserver, type UseNetwork, type UseObjectUrl, type UseOnline, type UseOrientation, type UseOrientationLockType, type UseOrientationState, type UseOrientationType, type UsePageLeave, type UsePermission, type UsePermissionDescriptorNamePolyfill, type UsePermissionGeneralPermissionDescriptor, type UsePermissionState, type UsePlatform, type UsePlatformProps, type UsePlatformReturn, type UsePreferredColorScheme, type UsePreferredContrast, type UsePreferredDark, type UsePrevious, type UseRafFn, type UseRafState, type UseReducedMotion, type UseResizeObserver, type UseScreenSafeArea, type UseScriptTag, type UseScriptTagOptions, type UseScriptTagStatus, type UseScroll, type UseScrollArrivedState, type UseScrollDirection, type UseScrollIntoView, type UseScrollIntoViewAnimation, type UseScrollIntoViewParams, type UseScrollLock, type UseScrollOffset, type UseScrollOptions, type UseSessionStorage, type UseSessionStorageOptions, type UseSessionStorageSerializer, type UseSetState, type UseSticky, type UseStickyParams, type UseSupported, type UseTextDirection, type UseTextDirectionOptions, type UseTextDirectionValue, type UseTextSelection, type UseThrottle, type UseThrottleFn, type UseTimeout, type UseTimeoutFn, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseTitle, type UseToggle, type UseUnmount, type UseUpdate, type UseWebNotification, type UseWebNotificationReturn, type UseWebNotificationShow, type UseWindowScroll, type UseWindowScrollState, type UseWindowSize, type UseWindowsFocus, assignRef, defaultOptions, mergeRefs, use, useActiveElement, useAsyncEffect, useClickOutside, useClipboard, useControlled, useCookie, useCountDown, useCounter, useCssVar, useCustomCompareEffect, useCycleList, useDarkMode, useDebounce, useDebounceFn, useDeepCompareEffect, useDisclosure, useDocumentVisibility, useDoubleClick, useDraggable, useDropZone, useElementBounding, useElementSize, useElementVisibility, useEvent, useEventEmitter, useEventListener, useEventSource, useEyeDropper, useFavicon, useFileDialog, useFirstMountState, useFocus, useFps, useFullscreen, useGeolocation, useHover, useIdle, useInfiniteScroll, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyModifier, useLatest, useLocalStorage, useLocationSelector, useLongPress, useMeasure, useMediaDevices, useMediaQuery, useMergedRefs, useMobileLandscape, useMount, useMountedState, useMouse, useMousePressed, useMutationObserver, useNetwork, useObjectUrl, useOnceEffect, useOnceLayoutEffect, useOnline, useOrientation, usePageLeave, usePermission, usePlatform, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePrevious, useRafFn, useRafState, useReducedMotion, useResizeObserver, useScreenSafeArea, useScriptTag, useScroll, useScrollIntoView, useScrollLock, useSessionStorage, useSetState, useSticky, useSupported, useTextDirection, useTextSelection, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useTitle, useToggle, useUnmount, useUpdate, useUpdateEffect, useUpdateLayoutEffect, useWebNotification, useWindowScroll, useWindowSize, useWindowsFocus };
|
|
3403
|
+
export { type ColorScheme, type Contrast, type DepsEqualFnType, type EventSourceStatus, type EventType, type INetworkInformation, type IUseNetworkState, type KeyModifier, type Pausable, type Platform, type PossibleRef, type Use, type UseActiveElement, type UseAsyncEffect, type UseBroadcastChannel, type UseBroadcastChannelOptions, type UseBroadcastChannelReturn, type UseClickOutside, type UseClipboard, type UseControlled, type UseCookie, type UseCookieState, type UseCountDown, type UseCounter, type UseCssVar, type UseCssVarOptions, type UseCustomCompareEffect, type UseCycleList, type UseDarkMode, type UseDarkOptions, type UseDebounce, type UseDebounceFn, type UseDeepCompareEffect, type UseDevicePixelRatio, type UseDevicePixelRatioReturn, type UseDisclosure, type UseDisclosureProps, type UseDocumentVisibility, type UseDoubleClick, type UseDoubleClickProps, type UseDraggable, type UseDraggableOptions, type UseDropZone, type UseElementBounding, type UseElementBoundingOptions, type UseElementBoundingReturn, type UseElementByPoint, type UseElementByPointOptions, type UseElementByPointReturn, type UseElementSize, type UseElementVisibility, type UseEvent, type UseEventEmitter, type UseEventEmitterDisposable, type UseEventEmitterEvent, type UseEventEmitterEventOnce, type UseEventEmitterListener, type UseEventEmitterReturn, type UseEventListener, type UseEventSource, type UseEventSourceAutoReconnectOptions, type UseEventSourceOptions, type UseEventSourceReturn, type UseEyeDropper, type UseEyeDropperOpenOptions, type UseEyeDropperOpenReturnType, type UseFavicon, type UseFileDialog, type UseFileDialogOptions, type UseFirstMountState, type UseFocus, type UseFps, type UseFpsOptions, type UseFullScreenOptions, type UseFullscreen, type UseGeolocation, type UseHover, type UseIdle, type UseInfiniteScroll, type UseInfiniteScrollArrivedState, type UseInfiniteScrollDirection, type UseInfiniteScrollLoadMore, type UseInfiniteScrollOptions, type UseIntersectionObserver, type UseInterval, type UseIntervalOptions, type UseKeyModifier, type UseLatest, type UseLocalStorage, type UseLocalStorageOptions, type UseLocalStorageSerializer, type UseLocationSelector, type UseLongPress, type UseLongPressOptions, type UseMeasure, type UseMeasureRect, type UseMediaDeviceOptions, type UseMediaDevices, type UseMediaQuery, type UseMergedRef, type UseMobileLandscape, type UseModifierOptions, type UseMount, type UseMountedState, type UseMouse, type UseMouseCursorState, type UseMousePressed, type UseMousePressedOptions, type UseMousePressedSourceType, type UseMutationObserver, type UseNetwork, type UseObjectUrl, type UseOnline, type UseOrientation, type UseOrientationLockType, type UseOrientationState, type UseOrientationType, type UsePageLeave, type UsePermission, type UsePermissionDescriptorNamePolyfill, type UsePermissionGeneralPermissionDescriptor, type UsePermissionState, type UsePlatform, type UsePlatformProps, type UsePlatformReturn, type UsePreferredColorScheme, type UsePreferredContrast, type UsePreferredDark, type UsePreferredLanguages, type UsePrevious, type UseRafFn, type UseRafState, type UseReducedMotion, type UseResizeObserver, type UseScreenSafeArea, type UseScriptTag, type UseScriptTagOptions, type UseScriptTagStatus, type UseScroll, type UseScrollArrivedState, type UseScrollDirection, type UseScrollIntoView, type UseScrollIntoViewAnimation, type UseScrollIntoViewParams, type UseScrollLock, type UseScrollOffset, type UseScrollOptions, type UseSessionStorage, type UseSessionStorageOptions, type UseSessionStorageSerializer, type UseSetState, type UseSticky, type UseStickyParams, type UseSupported, type UseTextDirection, type UseTextDirectionOptions, type UseTextDirectionValue, type UseTextSelection, type UseThrottle, type UseThrottleFn, type UseTimeout, type UseTimeoutFn, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseTitle, type UseToggle, type UseUnmount, type UseUpdate, type UseWebNotification, type UseWebNotificationReturn, type UseWebNotificationShow, type UseWindowScroll, type UseWindowScrollState, type UseWindowSize, type UseWindowsFocus, assignRef, defaultOptions, mergeRefs, use, useActiveElement, useAsyncEffect, useBroadcastChannel, useClickOutside, useClipboard, useControlled, useCookie, 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, useFileDialog, useFirstMountState, useFocus, useFps, useFullscreen, useGeolocation, useHover, useIdle, useInfiniteScroll, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyModifier, useLatest, useLocalStorage, useLocationSelector, useLongPress, 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, useSticky, useSupported, useTextDirection, useTextSelection, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useTitle, useToggle, useUnmount, useUpdate, useUpdateEffect, useUpdateLayoutEffect, useWebNotification, useWindowScroll, useWindowSize, useWindowsFocus };
|
package/dist/index.d.ts
CHANGED
|
@@ -446,6 +446,26 @@ interface Position {
|
|
|
446
446
|
x: number;
|
|
447
447
|
y: number;
|
|
448
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* @title Pausable
|
|
451
|
+
*/
|
|
452
|
+
interface Pausable$1 {
|
|
453
|
+
/**
|
|
454
|
+
* @en A ref indicate whether a pausable instance is active
|
|
455
|
+
* @zh 一个 ref,表示一个 pausable 实例是否处于激活状态
|
|
456
|
+
*/
|
|
457
|
+
isActive: boolean;
|
|
458
|
+
/**
|
|
459
|
+
* @en Temporary pause the effect from executing
|
|
460
|
+
* @zh 暂时暂停效果的执行
|
|
461
|
+
*/
|
|
462
|
+
pause: Fn;
|
|
463
|
+
/**
|
|
464
|
+
* @en Resume the effects
|
|
465
|
+
* @zh 恢复效果
|
|
466
|
+
*/
|
|
467
|
+
resume: Fn;
|
|
468
|
+
}
|
|
449
469
|
|
|
450
470
|
/**
|
|
451
471
|
* @title useDraggable
|
|
@@ -981,14 +1001,16 @@ declare const useFullscreen: UseFullscreen;
|
|
|
981
1001
|
|
|
982
1002
|
/**
|
|
983
1003
|
* @title useGeoLocation
|
|
984
|
-
* @returns
|
|
1004
|
+
* @returns 包含以下元素的对象:
|
|
985
1005
|
* - 坐标。
|
|
986
1006
|
* - 获取坐标的时间戳。
|
|
987
1007
|
* - 错误。
|
|
988
|
-
*
|
|
1008
|
+
* - 浏览器是否支持 `geolocation`。
|
|
1009
|
+
* @returns_en A object with the following elements:
|
|
989
1010
|
* - coordinates.
|
|
990
1011
|
* - timestamp when get coordinates.
|
|
991
1012
|
* - errors.
|
|
1013
|
+
* - Whether the browser supports `geolocation`.
|
|
992
1014
|
*/
|
|
993
1015
|
type UseGeolocation = (
|
|
994
1016
|
/**
|
|
@@ -999,6 +1021,11 @@ options?: Partial<PositionOptions>) => {
|
|
|
999
1021
|
readonly coordinates: GeolocationCoordinates;
|
|
1000
1022
|
readonly locatedAt: number | null;
|
|
1001
1023
|
readonly error: GeolocationPositionError | null;
|
|
1024
|
+
/**
|
|
1025
|
+
* @zh 浏览器是否支持 `geolocation`
|
|
1026
|
+
* @en Whether the browser supports `geolocation`
|
|
1027
|
+
*/
|
|
1028
|
+
readonly isSupported: boolean;
|
|
1002
1029
|
};
|
|
1003
1030
|
|
|
1004
1031
|
declare const useGeolocation: UseGeolocation;
|
|
@@ -2831,6 +2858,165 @@ declare function useMergedRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) =
|
|
|
2831
2858
|
*/
|
|
2832
2859
|
declare const use: any;
|
|
2833
2860
|
|
|
2861
|
+
/**
|
|
2862
|
+
* @title UsePreferredLanguages
|
|
2863
|
+
* @returns 语言偏好
|
|
2864
|
+
* @returns_en preferred languages
|
|
2865
|
+
*/
|
|
2866
|
+
type UsePreferredLanguages = (
|
|
2867
|
+
/**
|
|
2868
|
+
* @zh 默认值
|
|
2869
|
+
* @en defaule value
|
|
2870
|
+
*/ defaultLanguages?: string[]) => string[];
|
|
2871
|
+
|
|
2872
|
+
declare const usePreferredLanguages: UsePreferredLanguages;
|
|
2873
|
+
|
|
2874
|
+
/**
|
|
2875
|
+
* @title UseBroadcastChannelOptions
|
|
2876
|
+
*/
|
|
2877
|
+
interface UseBroadcastChannelOptions {
|
|
2878
|
+
/**
|
|
2879
|
+
* @zh 频道名称
|
|
2880
|
+
* @en channel name
|
|
2881
|
+
*/
|
|
2882
|
+
name: string;
|
|
2883
|
+
}
|
|
2884
|
+
/**
|
|
2885
|
+
* @title UseBroadcastChannel
|
|
2886
|
+
*/
|
|
2887
|
+
type UseBroadcastChannel = <D, P>(
|
|
2888
|
+
/**
|
|
2889
|
+
* @zh 选项
|
|
2890
|
+
* @en options
|
|
2891
|
+
*/
|
|
2892
|
+
options: UseBroadcastChannelOptions) => UseBroadcastChannelReturn<D, P>;
|
|
2893
|
+
/**
|
|
2894
|
+
* @title UseBroadcastChannelReturn
|
|
2895
|
+
*/
|
|
2896
|
+
interface UseBroadcastChannelReturn<D, P> {
|
|
2897
|
+
/**
|
|
2898
|
+
* @zh 是否支持
|
|
2899
|
+
* @en is supported
|
|
2900
|
+
*/
|
|
2901
|
+
readonly isSupported: boolean;
|
|
2902
|
+
/**
|
|
2903
|
+
* @zh 频道
|
|
2904
|
+
* @en channel
|
|
2905
|
+
*/
|
|
2906
|
+
readonly channel: BroadcastChannel | undefined;
|
|
2907
|
+
/**
|
|
2908
|
+
* @zh 数据
|
|
2909
|
+
* @en data
|
|
2910
|
+
*/
|
|
2911
|
+
readonly data: D | undefined;
|
|
2912
|
+
/**
|
|
2913
|
+
* @zh 发送数据
|
|
2914
|
+
* @en post data
|
|
2915
|
+
*/
|
|
2916
|
+
readonly post: (data: P) => void;
|
|
2917
|
+
/**
|
|
2918
|
+
* @zh 关闭
|
|
2919
|
+
* @en close
|
|
2920
|
+
*/
|
|
2921
|
+
readonly close: () => void;
|
|
2922
|
+
/**
|
|
2923
|
+
* @zh 错误
|
|
2924
|
+
* @en error
|
|
2925
|
+
*/
|
|
2926
|
+
readonly error: Event | null;
|
|
2927
|
+
/**
|
|
2928
|
+
* @zh 是否关闭
|
|
2929
|
+
* @en is closed
|
|
2930
|
+
*/
|
|
2931
|
+
readonly isClosed: boolean;
|
|
2932
|
+
/**
|
|
2933
|
+
* @zh 时间戳
|
|
2934
|
+
* @en timestamp
|
|
2935
|
+
*/
|
|
2936
|
+
readonly timeStamp: number;
|
|
2937
|
+
}
|
|
2938
|
+
|
|
2939
|
+
declare const useBroadcastChannel: UseBroadcastChannel;
|
|
2940
|
+
|
|
2941
|
+
/**
|
|
2942
|
+
* @title UseDevicePixelRatio
|
|
2943
|
+
*/
|
|
2944
|
+
type UseDevicePixelRatio = () => UseDevicePixelRatioReturn;
|
|
2945
|
+
/**
|
|
2946
|
+
* @title UseDevicePixelRatioReturn
|
|
2947
|
+
*/
|
|
2948
|
+
interface UseDevicePixelRatioReturn {
|
|
2949
|
+
/**
|
|
2950
|
+
* @zh 像素比率
|
|
2951
|
+
* @en Pixel ratio
|
|
2952
|
+
*/
|
|
2953
|
+
pixelRatio: number;
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
declare const useDevicePixelRatio: UseDevicePixelRatio;
|
|
2957
|
+
|
|
2958
|
+
/**
|
|
2959
|
+
* @title UseElementByPoint
|
|
2960
|
+
*/
|
|
2961
|
+
type UseElementByPoint = <M extends boolean = false>(
|
|
2962
|
+
/**
|
|
2963
|
+
* @en options
|
|
2964
|
+
* @zh 配置项
|
|
2965
|
+
*/
|
|
2966
|
+
options: UseElementByPointOptions<M>) => UseElementByPointReturn<M>;
|
|
2967
|
+
/**
|
|
2968
|
+
* @title UseElementByPointOptions
|
|
2969
|
+
*/
|
|
2970
|
+
interface UseElementByPointOptions<M extends boolean = false> {
|
|
2971
|
+
/**
|
|
2972
|
+
* @en The x coordinate of the point
|
|
2973
|
+
* @zh 点的 x 坐标
|
|
2974
|
+
*/
|
|
2975
|
+
x: number | (() => number);
|
|
2976
|
+
/**
|
|
2977
|
+
* @en The y coordinate of the point
|
|
2978
|
+
* @zh 点的 y 坐标
|
|
2979
|
+
*/
|
|
2980
|
+
y: number | (() => number);
|
|
2981
|
+
/**
|
|
2982
|
+
* @en The document to query
|
|
2983
|
+
* @zh 要查询的文档
|
|
2984
|
+
*/
|
|
2985
|
+
document?: Document | null;
|
|
2986
|
+
/**
|
|
2987
|
+
* @en Whether to query multiple elements
|
|
2988
|
+
* @zh 是否查询多个元素
|
|
2989
|
+
*/
|
|
2990
|
+
multiple?: M;
|
|
2991
|
+
/**
|
|
2992
|
+
* @en The interval to query the element
|
|
2993
|
+
* @zh 查询元素的间隔
|
|
2994
|
+
*/
|
|
2995
|
+
interval?: number | 'requestAnimationFrame';
|
|
2996
|
+
/**
|
|
2997
|
+
* @en Whether to query the element immediately
|
|
2998
|
+
* @zh 是否立即查询元素
|
|
2999
|
+
*/
|
|
3000
|
+
immediate?: boolean;
|
|
3001
|
+
}
|
|
3002
|
+
/**
|
|
3003
|
+
* @title UseElementByPointReturn
|
|
3004
|
+
*/
|
|
3005
|
+
interface UseElementByPointReturn<M extends boolean> extends Pausable$1 {
|
|
3006
|
+
/**
|
|
3007
|
+
* @en Whether the feature is supported
|
|
3008
|
+
* @zh 功能是否支持
|
|
3009
|
+
*/
|
|
3010
|
+
isSupported: boolean;
|
|
3011
|
+
/**
|
|
3012
|
+
* @en The queried element
|
|
3013
|
+
* @zh 查询到的元素
|
|
3014
|
+
*/
|
|
3015
|
+
element: M extends true ? Element[] : Element | null;
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
declare const useElementByPoint: UseElementByPoint;
|
|
3019
|
+
|
|
2834
3020
|
/**
|
|
2835
3021
|
* @title useDocumentVisiblity
|
|
2836
3022
|
* @returns_en document visibility
|
|
@@ -3214,4 +3400,4 @@ type Use = <T>(
|
|
|
3214
3400
|
*/
|
|
3215
3401
|
usable: Usable<T>) => T;
|
|
3216
3402
|
|
|
3217
|
-
export { type ColorScheme, type Contrast, type DepsEqualFnType, type EventSourceStatus, type EventType, type INetworkInformation, type IUseNetworkState, type KeyModifier, type Pausable, type Platform, type PossibleRef, type Use, type UseActiveElement, type UseAsyncEffect, type UseClickOutside, type UseClipboard, type UseControlled, type UseCookie, type UseCookieState, type UseCountDown, type UseCounter, type UseCssVar, type UseCssVarOptions, type UseCustomCompareEffect, type UseCycleList, type UseDarkMode, type UseDarkOptions, type UseDebounce, type UseDebounceFn, type UseDeepCompareEffect, type UseDisclosure, type UseDisclosureProps, type UseDocumentVisibility, type UseDoubleClick, type UseDoubleClickProps, type UseDraggable, type UseDraggableOptions, type UseDropZone, type UseElementBounding, type UseElementBoundingOptions, type UseElementBoundingReturn, type UseElementSize, type UseElementVisibility, type UseEvent, type UseEventEmitter, type UseEventEmitterDisposable, type UseEventEmitterEvent, type UseEventEmitterEventOnce, type UseEventEmitterListener, type UseEventEmitterReturn, type UseEventListener, type UseEventSource, type UseEventSourceAutoReconnectOptions, type UseEventSourceOptions, type UseEventSourceReturn, type UseEyeDropper, type UseEyeDropperOpenOptions, type UseEyeDropperOpenReturnType, type UseFavicon, type UseFileDialog, type UseFileDialogOptions, type UseFirstMountState, type UseFocus, type UseFps, type UseFpsOptions, type UseFullScreenOptions, type UseFullscreen, type UseGeolocation, type UseHover, type UseIdle, type UseInfiniteScroll, type UseInfiniteScrollArrivedState, type UseInfiniteScrollDirection, type UseInfiniteScrollLoadMore, type UseInfiniteScrollOptions, type UseIntersectionObserver, type UseInterval, type UseIntervalOptions, type UseKeyModifier, type UseLatest, type UseLocalStorage, type UseLocalStorageOptions, type UseLocalStorageSerializer, type UseLocationSelector, type UseLongPress, type UseLongPressOptions, type UseMeasure, type UseMeasureRect, type UseMediaDeviceOptions, type UseMediaDevices, type UseMediaQuery, type UseMergedRef, type UseMobileLandscape, type UseModifierOptions, type UseMount, type UseMountedState, type UseMouse, type UseMouseCursorState, type UseMousePressed, type UseMousePressedOptions, type UseMousePressedSourceType, type UseMutationObserver, type UseNetwork, type UseObjectUrl, type UseOnline, type UseOrientation, type UseOrientationLockType, type UseOrientationState, type UseOrientationType, type UsePageLeave, type UsePermission, type UsePermissionDescriptorNamePolyfill, type UsePermissionGeneralPermissionDescriptor, type UsePermissionState, type UsePlatform, type UsePlatformProps, type UsePlatformReturn, type UsePreferredColorScheme, type UsePreferredContrast, type UsePreferredDark, type UsePrevious, type UseRafFn, type UseRafState, type UseReducedMotion, type UseResizeObserver, type UseScreenSafeArea, type UseScriptTag, type UseScriptTagOptions, type UseScriptTagStatus, type UseScroll, type UseScrollArrivedState, type UseScrollDirection, type UseScrollIntoView, type UseScrollIntoViewAnimation, type UseScrollIntoViewParams, type UseScrollLock, type UseScrollOffset, type UseScrollOptions, type UseSessionStorage, type UseSessionStorageOptions, type UseSessionStorageSerializer, type UseSetState, type UseSticky, type UseStickyParams, type UseSupported, type UseTextDirection, type UseTextDirectionOptions, type UseTextDirectionValue, type UseTextSelection, type UseThrottle, type UseThrottleFn, type UseTimeout, type UseTimeoutFn, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseTitle, type UseToggle, type UseUnmount, type UseUpdate, type UseWebNotification, type UseWebNotificationReturn, type UseWebNotificationShow, type UseWindowScroll, type UseWindowScrollState, type UseWindowSize, type UseWindowsFocus, assignRef, defaultOptions, mergeRefs, use, useActiveElement, useAsyncEffect, useClickOutside, useClipboard, useControlled, useCookie, useCountDown, useCounter, useCssVar, useCustomCompareEffect, useCycleList, useDarkMode, useDebounce, useDebounceFn, useDeepCompareEffect, useDisclosure, useDocumentVisibility, useDoubleClick, useDraggable, useDropZone, useElementBounding, useElementSize, useElementVisibility, useEvent, useEventEmitter, useEventListener, useEventSource, useEyeDropper, useFavicon, useFileDialog, useFirstMountState, useFocus, useFps, useFullscreen, useGeolocation, useHover, useIdle, useInfiniteScroll, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyModifier, useLatest, useLocalStorage, useLocationSelector, useLongPress, useMeasure, useMediaDevices, useMediaQuery, useMergedRefs, useMobileLandscape, useMount, useMountedState, useMouse, useMousePressed, useMutationObserver, useNetwork, useObjectUrl, useOnceEffect, useOnceLayoutEffect, useOnline, useOrientation, usePageLeave, usePermission, usePlatform, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePrevious, useRafFn, useRafState, useReducedMotion, useResizeObserver, useScreenSafeArea, useScriptTag, useScroll, useScrollIntoView, useScrollLock, useSessionStorage, useSetState, useSticky, useSupported, useTextDirection, useTextSelection, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useTitle, useToggle, useUnmount, useUpdate, useUpdateEffect, useUpdateLayoutEffect, useWebNotification, useWindowScroll, useWindowSize, useWindowsFocus };
|
|
3403
|
+
export { type ColorScheme, type Contrast, type DepsEqualFnType, type EventSourceStatus, type EventType, type INetworkInformation, type IUseNetworkState, type KeyModifier, type Pausable, type Platform, type PossibleRef, type Use, type UseActiveElement, type UseAsyncEffect, type UseBroadcastChannel, type UseBroadcastChannelOptions, type UseBroadcastChannelReturn, type UseClickOutside, type UseClipboard, type UseControlled, type UseCookie, type UseCookieState, type UseCountDown, type UseCounter, type UseCssVar, type UseCssVarOptions, type UseCustomCompareEffect, type UseCycleList, type UseDarkMode, type UseDarkOptions, type UseDebounce, type UseDebounceFn, type UseDeepCompareEffect, type UseDevicePixelRatio, type UseDevicePixelRatioReturn, type UseDisclosure, type UseDisclosureProps, type UseDocumentVisibility, type UseDoubleClick, type UseDoubleClickProps, type UseDraggable, type UseDraggableOptions, type UseDropZone, type UseElementBounding, type UseElementBoundingOptions, type UseElementBoundingReturn, type UseElementByPoint, type UseElementByPointOptions, type UseElementByPointReturn, type UseElementSize, type UseElementVisibility, type UseEvent, type UseEventEmitter, type UseEventEmitterDisposable, type UseEventEmitterEvent, type UseEventEmitterEventOnce, type UseEventEmitterListener, type UseEventEmitterReturn, type UseEventListener, type UseEventSource, type UseEventSourceAutoReconnectOptions, type UseEventSourceOptions, type UseEventSourceReturn, type UseEyeDropper, type UseEyeDropperOpenOptions, type UseEyeDropperOpenReturnType, type UseFavicon, type UseFileDialog, type UseFileDialogOptions, type UseFirstMountState, type UseFocus, type UseFps, type UseFpsOptions, type UseFullScreenOptions, type UseFullscreen, type UseGeolocation, type UseHover, type UseIdle, type UseInfiniteScroll, type UseInfiniteScrollArrivedState, type UseInfiniteScrollDirection, type UseInfiniteScrollLoadMore, type UseInfiniteScrollOptions, type UseIntersectionObserver, type UseInterval, type UseIntervalOptions, type UseKeyModifier, type UseLatest, type UseLocalStorage, type UseLocalStorageOptions, type UseLocalStorageSerializer, type UseLocationSelector, type UseLongPress, type UseLongPressOptions, type UseMeasure, type UseMeasureRect, type UseMediaDeviceOptions, type UseMediaDevices, type UseMediaQuery, type UseMergedRef, type UseMobileLandscape, type UseModifierOptions, type UseMount, type UseMountedState, type UseMouse, type UseMouseCursorState, type UseMousePressed, type UseMousePressedOptions, type UseMousePressedSourceType, type UseMutationObserver, type UseNetwork, type UseObjectUrl, type UseOnline, type UseOrientation, type UseOrientationLockType, type UseOrientationState, type UseOrientationType, type UsePageLeave, type UsePermission, type UsePermissionDescriptorNamePolyfill, type UsePermissionGeneralPermissionDescriptor, type UsePermissionState, type UsePlatform, type UsePlatformProps, type UsePlatformReturn, type UsePreferredColorScheme, type UsePreferredContrast, type UsePreferredDark, type UsePreferredLanguages, type UsePrevious, type UseRafFn, type UseRafState, type UseReducedMotion, type UseResizeObserver, type UseScreenSafeArea, type UseScriptTag, type UseScriptTagOptions, type UseScriptTagStatus, type UseScroll, type UseScrollArrivedState, type UseScrollDirection, type UseScrollIntoView, type UseScrollIntoViewAnimation, type UseScrollIntoViewParams, type UseScrollLock, type UseScrollOffset, type UseScrollOptions, type UseSessionStorage, type UseSessionStorageOptions, type UseSessionStorageSerializer, type UseSetState, type UseSticky, type UseStickyParams, type UseSupported, type UseTextDirection, type UseTextDirectionOptions, type UseTextDirectionValue, type UseTextSelection, type UseThrottle, type UseThrottleFn, type UseTimeout, type UseTimeoutFn, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseTitle, type UseToggle, type UseUnmount, type UseUpdate, type UseWebNotification, type UseWebNotificationReturn, type UseWebNotificationShow, type UseWindowScroll, type UseWindowScrollState, type UseWindowSize, type UseWindowsFocus, assignRef, defaultOptions, mergeRefs, use, useActiveElement, useAsyncEffect, useBroadcastChannel, useClickOutside, useClipboard, useControlled, useCookie, 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, useFileDialog, useFirstMountState, useFocus, useFps, useFullscreen, useGeolocation, useHover, useIdle, useInfiniteScroll, useIntersectionObserver, useInterval, useIsomorphicLayoutEffect, useKeyModifier, useLatest, useLocalStorage, useLocationSelector, useLongPress, 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, useSticky, useSupported, useTextDirection, useTextSelection, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useTitle, useToggle, useUnmount, useUpdate, useUpdateEffect, useUpdateLayoutEffect, useWebNotification, useWindowScroll, useWindowSize, useWindowsFocus };
|