Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

117
node_modules/@mantine/hooks/lib/index.d.mts generated vendored Normal file
View File

@@ -0,0 +1,117 @@
export * from './utils/index.js';
export { useDebouncedCallback } from './use-debounced-callback/use-debounced-callback.js';
export { useClickOutside } from './use-click-outside/use-click-outside.js';
export { useClipboard } from './use-clipboard/use-clipboard.js';
export { useColorScheme } from './use-color-scheme/use-color-scheme.js';
export { useCounter } from './use-counter/use-counter.js';
export { useDebouncedState } from './use-debounced-state/use-debounced-state.js';
export { useDebouncedValue } from './use-debounced-value/use-debounced-value.js';
export { useDocumentTitle } from './use-document-title/use-document-title.js';
export { useDocumentVisibility } from './use-document-visibility/use-document-visibility.js';
export { useFocusReturn } from './use-focus-return/use-focus-return.js';
export { useDidUpdate } from './use-did-update/use-did-update.js';
export { useFocusTrap } from './use-focus-trap/use-focus-trap.js';
export { useForceUpdate } from './use-force-update/use-force-update.js';
export { useId } from './use-id/use-id.js';
export { useIdle } from './use-idle/use-idle.js';
export { useInterval } from './use-interval/use-interval.js';
export { useIsomorphicEffect } from './use-isomorphic-effect/use-isomorphic-effect.js';
export { useListState } from './use-list-state/use-list-state.js';
export { useLocalStorage, readLocalStorageValue } from './use-local-storage/use-local-storage.js';
export { useSessionStorage, readSessionStorageValue, } from './use-session-storage/use-session-storage.js';
export { useMediaQuery } from './use-media-query/use-media-query.js';
export { useMergedRef, mergeRefs, assignRef } from './use-merged-ref/use-merged-ref.js';
export { useMouse } from './use-mouse/use-mouse.js';
export { useMove, clampUseMovePosition } from './use-move/use-move.js';
export { usePagination } from './use-pagination/use-pagination.js';
export { useQueue } from './use-queue/use-queue.js';
export { usePageLeave } from './use-page-leave/use-page-leave.js';
export { useReducedMotion } from './use-reduced-motion/use-reduced-motion.js';
export { useScrollIntoView } from './use-scroll-into-view/use-scroll-into-view.js';
export { useResizeObserver, useElementSize } from './use-resize-observer/use-resize-observer.js';
export { useShallowEffect } from './use-shallow-effect/use-shallow-effect.js';
export { useToggle } from './use-toggle/use-toggle.js';
export { useUncontrolled } from './use-uncontrolled/use-uncontrolled.js';
export { useViewportSize } from './use-viewport-size/use-viewport-size.js';
export { useWindowEvent } from './use-window-event/use-window-event.js';
export { useWindowScroll } from './use-window-scroll/use-window-scroll.js';
export { useIntersection } from './use-intersection/use-intersection.js';
export { useHash } from './use-hash/use-hash.js';
export { useHotkeys, getHotkeyHandler } from './use-hotkeys/use-hotkeys.js';
export { useFullscreen } from './use-fullscreen/use-fullscreen.js';
export { useLogger } from './use-logger/use-logger.js';
export { useHover } from './use-hover/use-hover.js';
export { useValidatedState } from './use-validated-state/use-validated-state.js';
export { useOs } from './use-os/use-os.js';
export { useSetState } from './use-set-state/use-set-state.js';
export { useInputState } from './use-input-state/use-input-state.js';
export { useEventListener } from './use-event-listener/use-event-listener.js';
export { useDisclosure } from './use-disclosure/use-disclosure.js';
export { useFocusWithin } from './use-focus-within/use-focus-within.js';
export { useNetwork } from './use-network/use-network.js';
export { useTimeout } from './use-timeout/use-timeout.js';
export { useTextSelection } from './use-text-selection/use-text-selection.js';
export { usePrevious } from './use-previous/use-previous.js';
export { useFavicon } from './use-favicon/use-favicon.js';
export { useHeadroom } from './use-headroom/use-headroom.js';
export { useEyeDropper } from './use-eye-dropper/use-eye-dropper.js';
export { useInViewport } from './use-in-viewport/use-in-viewport.js';
export { useMutationObserver } from './use-mutation-observer/use-mutation-observer.js';
export { useMounted } from './use-mounted/use-mounted.js';
export { useStateHistory } from './use-state-history/use-state-history.js';
export { useMap } from './use-map/use-map.js';
export { useSet } from './use-set/use-set.js';
export { useThrottledCallback } from './use-throttled-callback/use-throttled-callback.js';
export { useThrottledState } from './use-throttled-state/use-throttled-state.js';
export { useThrottledValue } from './use-throttled-value/use-throttled-value.js';
export { useIsFirstRender } from './use-is-first-render/use-is-first-render.js';
export { useOrientation } from './use-orientation/use-orientation.js';
export { useFetch } from './use-fetch/use-fetch.js';
export { useRadialMove, normalizeRadialValue } from './use-radial-move/use-radial-move.js';
export { useScrollSpy } from './use-scroll-spy/use-scroll-spy.js';
export { useFileDialog } from './use-file-dialog/use-file-dialog.js';
export { useLongPress } from './use-long-press/use-long-press.js';
export { useSelection } from './use-selection/use-selection.js';
export type { UseMediaQueryOptions } from './use-media-query/use-media-query';
export type { UseClipboardOptions, UseClipboardReturnValue } from './use-clipboard/use-clipboard';
export type { UseColorSchemeValue } from './use-color-scheme/use-color-scheme';
export type { UseCounterOptions, UseCounterHandlers, UseCounterReturnValue, } from './use-counter/use-counter';
export type { UseDebouncedCallbackOptions, UseDebouncedCallbackReturnValue, } from './use-debounced-callback/use-debounced-callback';
export type { UseDebouncedStateOptions, UseDebouncedStateReturnValue, } from './use-debounced-state/use-debounced-state';
export type { UseDebouncedValueOptions, UseDebouncedValueReturnValue, } from './use-debounced-value/use-debounced-value';
export type { UseDisclosureOptions, UseDisclosureHandlers, UseDisclosureReturnValue, } from './use-disclosure/use-disclosure';
export type { EyeDropperOpenOptions, EyeDropperOpenReturnType, UseEyeDropperReturnValue, } from './use-eye-dropper/use-eye-dropper';
export type { UseFetchOptions, UseFetchReturnValue } from './use-fetch/use-fetch';
export type { UseFileDialogOptions, UseFileDialogReturnValue, } from './use-file-dialog/use-file-dialog';
export type { UseFocusReturnOptions, UseFocusReturnReturnValue, } from './use-focus-return/use-focus-return';
export type { UseFocusWithinOptions, UseFocusWithinReturnValue, } from './use-focus-within/use-focus-within';
export type { UseFullscreenReturnValue } from './use-fullscreen/use-fullscreen';
export type { UseHashOptions, UseHashReturnValue } from './use-hash/use-hash';
export type { UseHeadroomOptions } from './use-headroom/use-headroom';
export type { HotkeyItemOptions, HotkeyItem } from './use-hotkeys/use-hotkeys';
export type { UseHoverReturnValue } from './use-hover/use-hover';
export type { UseIdleOptions } from './use-idle/use-idle';
export type { UseInViewportReturnValue } from './use-in-viewport/use-in-viewport';
export type { UseInputStateReturnValue } from './use-input-state/use-input-state';
export type { UseIntersectionReturnValue } from './use-intersection/use-intersection';
export type { UseIntervalOptions, UseIntervalReturnValue } from './use-interval/use-interval';
export type { UseListStateReturnValue, UseListStateHandlers, } from './use-list-state/use-list-state';
export type { UseStorageOptions, UseStorageReturnValue } from './use-local-storage/create-storage';
export type { UseMovePosition, UseMoveHandlers, UseMoveReturnValue } from './use-move/use-move';
export type { UserNetworkReturnValue } from './use-network/use-network';
export type { UseOrientationOptions, UseOrientationReturnType, } from './use-orientation/use-orientation';
export type { UseOSReturnValue as OS, UseOSReturnValue, UseOsOptions } from './use-os/use-os';
export type { UsePaginationOptions, UsePaginationReturnValue, } from './use-pagination/use-pagination';
export type { UseQueueOptions, UseQueueReturnValue } from './use-queue/use-queue';
export type { UseRadialMoveOptions, UseRadialMoveReturnValue, } from './use-radial-move/use-radial-move';
export type { UseScrollIntoViewOptions, UseScrollIntoViewReturnValue, } from './use-scroll-into-view/use-scroll-into-view';
export type { UseScrollSpyOptions, UseScrollSpyHeadingData, UseScrollSpyReturnType, } from './use-scroll-spy/use-scroll-spy';
export type { UseSetStateCallback, UseSetStateReturnValue } from './use-set-state/use-set-state';
export type { UseStateHistoryHandlers, UseStateHistoryValue as StateHistory, UseStateHistoryValue, UseStateHistoryReturnValue, } from './use-state-history/use-state-history';
export type { UseTimeoutOptions, UseTimeoutReturnValue } from './use-timeout/use-timeout';
export type { UseToggleReturnValue } from './use-toggle/use-toggle';
export type { UseUncontrolledOptions, UseUncontrolledReturnValue, } from './use-uncontrolled/use-uncontrolled';
export type { UseValidatedStateValue, UseValidatedStateReturnValue, } from './use-validated-state/use-validated-state';
export type { UseWindowScrollPosition, UseWindowScrollTo, UseWindowScrollReturnValue, } from './use-window-scroll/use-window-scroll';
export type { UseLongPressOptions, UseLongPressReturnValue } from './use-long-press/use-long-press';
export type { UseSelectionHandlers, UseSelectionInput, UseSelectionReturnValue, } from './use-selection/use-selection';

117
node_modules/@mantine/hooks/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,117 @@
export * from './utils/index.js';
export { useDebouncedCallback } from './use-debounced-callback/use-debounced-callback.js';
export { useClickOutside } from './use-click-outside/use-click-outside.js';
export { useClipboard } from './use-clipboard/use-clipboard.js';
export { useColorScheme } from './use-color-scheme/use-color-scheme.js';
export { useCounter } from './use-counter/use-counter.js';
export { useDebouncedState } from './use-debounced-state/use-debounced-state.js';
export { useDebouncedValue } from './use-debounced-value/use-debounced-value.js';
export { useDocumentTitle } from './use-document-title/use-document-title.js';
export { useDocumentVisibility } from './use-document-visibility/use-document-visibility.js';
export { useFocusReturn } from './use-focus-return/use-focus-return.js';
export { useDidUpdate } from './use-did-update/use-did-update.js';
export { useFocusTrap } from './use-focus-trap/use-focus-trap.js';
export { useForceUpdate } from './use-force-update/use-force-update.js';
export { useId } from './use-id/use-id.js';
export { useIdle } from './use-idle/use-idle.js';
export { useInterval } from './use-interval/use-interval.js';
export { useIsomorphicEffect } from './use-isomorphic-effect/use-isomorphic-effect.js';
export { useListState } from './use-list-state/use-list-state.js';
export { useLocalStorage, readLocalStorageValue } from './use-local-storage/use-local-storage.js';
export { useSessionStorage, readSessionStorageValue, } from './use-session-storage/use-session-storage.js';
export { useMediaQuery } from './use-media-query/use-media-query.js';
export { useMergedRef, mergeRefs, assignRef } from './use-merged-ref/use-merged-ref.js';
export { useMouse } from './use-mouse/use-mouse.js';
export { useMove, clampUseMovePosition } from './use-move/use-move.js';
export { usePagination } from './use-pagination/use-pagination.js';
export { useQueue } from './use-queue/use-queue.js';
export { usePageLeave } from './use-page-leave/use-page-leave.js';
export { useReducedMotion } from './use-reduced-motion/use-reduced-motion.js';
export { useScrollIntoView } from './use-scroll-into-view/use-scroll-into-view.js';
export { useResizeObserver, useElementSize } from './use-resize-observer/use-resize-observer.js';
export { useShallowEffect } from './use-shallow-effect/use-shallow-effect.js';
export { useToggle } from './use-toggle/use-toggle.js';
export { useUncontrolled } from './use-uncontrolled/use-uncontrolled.js';
export { useViewportSize } from './use-viewport-size/use-viewport-size.js';
export { useWindowEvent } from './use-window-event/use-window-event.js';
export { useWindowScroll } from './use-window-scroll/use-window-scroll.js';
export { useIntersection } from './use-intersection/use-intersection.js';
export { useHash } from './use-hash/use-hash.js';
export { useHotkeys, getHotkeyHandler } from './use-hotkeys/use-hotkeys.js';
export { useFullscreen } from './use-fullscreen/use-fullscreen.js';
export { useLogger } from './use-logger/use-logger.js';
export { useHover } from './use-hover/use-hover.js';
export { useValidatedState } from './use-validated-state/use-validated-state.js';
export { useOs } from './use-os/use-os.js';
export { useSetState } from './use-set-state/use-set-state.js';
export { useInputState } from './use-input-state/use-input-state.js';
export { useEventListener } from './use-event-listener/use-event-listener.js';
export { useDisclosure } from './use-disclosure/use-disclosure.js';
export { useFocusWithin } from './use-focus-within/use-focus-within.js';
export { useNetwork } from './use-network/use-network.js';
export { useTimeout } from './use-timeout/use-timeout.js';
export { useTextSelection } from './use-text-selection/use-text-selection.js';
export { usePrevious } from './use-previous/use-previous.js';
export { useFavicon } from './use-favicon/use-favicon.js';
export { useHeadroom } from './use-headroom/use-headroom.js';
export { useEyeDropper } from './use-eye-dropper/use-eye-dropper.js';
export { useInViewport } from './use-in-viewport/use-in-viewport.js';
export { useMutationObserver } from './use-mutation-observer/use-mutation-observer.js';
export { useMounted } from './use-mounted/use-mounted.js';
export { useStateHistory } from './use-state-history/use-state-history.js';
export { useMap } from './use-map/use-map.js';
export { useSet } from './use-set/use-set.js';
export { useThrottledCallback } from './use-throttled-callback/use-throttled-callback.js';
export { useThrottledState } from './use-throttled-state/use-throttled-state.js';
export { useThrottledValue } from './use-throttled-value/use-throttled-value.js';
export { useIsFirstRender } from './use-is-first-render/use-is-first-render.js';
export { useOrientation } from './use-orientation/use-orientation.js';
export { useFetch } from './use-fetch/use-fetch.js';
export { useRadialMove, normalizeRadialValue } from './use-radial-move/use-radial-move.js';
export { useScrollSpy } from './use-scroll-spy/use-scroll-spy.js';
export { useFileDialog } from './use-file-dialog/use-file-dialog.js';
export { useLongPress } from './use-long-press/use-long-press.js';
export { useSelection } from './use-selection/use-selection.js';
export type { UseMediaQueryOptions } from './use-media-query/use-media-query';
export type { UseClipboardOptions, UseClipboardReturnValue } from './use-clipboard/use-clipboard';
export type { UseColorSchemeValue } from './use-color-scheme/use-color-scheme';
export type { UseCounterOptions, UseCounterHandlers, UseCounterReturnValue, } from './use-counter/use-counter';
export type { UseDebouncedCallbackOptions, UseDebouncedCallbackReturnValue, } from './use-debounced-callback/use-debounced-callback';
export type { UseDebouncedStateOptions, UseDebouncedStateReturnValue, } from './use-debounced-state/use-debounced-state';
export type { UseDebouncedValueOptions, UseDebouncedValueReturnValue, } from './use-debounced-value/use-debounced-value';
export type { UseDisclosureOptions, UseDisclosureHandlers, UseDisclosureReturnValue, } from './use-disclosure/use-disclosure';
export type { EyeDropperOpenOptions, EyeDropperOpenReturnType, UseEyeDropperReturnValue, } from './use-eye-dropper/use-eye-dropper';
export type { UseFetchOptions, UseFetchReturnValue } from './use-fetch/use-fetch';
export type { UseFileDialogOptions, UseFileDialogReturnValue, } from './use-file-dialog/use-file-dialog';
export type { UseFocusReturnOptions, UseFocusReturnReturnValue, } from './use-focus-return/use-focus-return';
export type { UseFocusWithinOptions, UseFocusWithinReturnValue, } from './use-focus-within/use-focus-within';
export type { UseFullscreenReturnValue } from './use-fullscreen/use-fullscreen';
export type { UseHashOptions, UseHashReturnValue } from './use-hash/use-hash';
export type { UseHeadroomOptions } from './use-headroom/use-headroom';
export type { HotkeyItemOptions, HotkeyItem } from './use-hotkeys/use-hotkeys';
export type { UseHoverReturnValue } from './use-hover/use-hover';
export type { UseIdleOptions } from './use-idle/use-idle';
export type { UseInViewportReturnValue } from './use-in-viewport/use-in-viewport';
export type { UseInputStateReturnValue } from './use-input-state/use-input-state';
export type { UseIntersectionReturnValue } from './use-intersection/use-intersection';
export type { UseIntervalOptions, UseIntervalReturnValue } from './use-interval/use-interval';
export type { UseListStateReturnValue, UseListStateHandlers, } from './use-list-state/use-list-state';
export type { UseStorageOptions, UseStorageReturnValue } from './use-local-storage/create-storage';
export type { UseMovePosition, UseMoveHandlers, UseMoveReturnValue } from './use-move/use-move';
export type { UserNetworkReturnValue } from './use-network/use-network';
export type { UseOrientationOptions, UseOrientationReturnType, } from './use-orientation/use-orientation';
export type { UseOSReturnValue as OS, UseOSReturnValue, UseOsOptions } from './use-os/use-os';
export type { UsePaginationOptions, UsePaginationReturnValue, } from './use-pagination/use-pagination';
export type { UseQueueOptions, UseQueueReturnValue } from './use-queue/use-queue';
export type { UseRadialMoveOptions, UseRadialMoveReturnValue, } from './use-radial-move/use-radial-move';
export type { UseScrollIntoViewOptions, UseScrollIntoViewReturnValue, } from './use-scroll-into-view/use-scroll-into-view';
export type { UseScrollSpyOptions, UseScrollSpyHeadingData, UseScrollSpyReturnType, } from './use-scroll-spy/use-scroll-spy';
export type { UseSetStateCallback, UseSetStateReturnValue } from './use-set-state/use-set-state';
export type { UseStateHistoryHandlers, UseStateHistoryValue as StateHistory, UseStateHistoryValue, UseStateHistoryReturnValue, } from './use-state-history/use-state-history';
export type { UseTimeoutOptions, UseTimeoutReturnValue } from './use-timeout/use-timeout';
export type { UseToggleReturnValue } from './use-toggle/use-toggle';
export type { UseUncontrolledOptions, UseUncontrolledReturnValue, } from './use-uncontrolled/use-uncontrolled';
export type { UseValidatedStateValue, UseValidatedStateReturnValue, } from './use-validated-state/use-validated-state';
export type { UseWindowScrollPosition, UseWindowScrollTo, UseWindowScrollReturnValue, } from './use-window-scroll/use-window-scroll';
export type { UseLongPressOptions, UseLongPressReturnValue } from './use-long-press/use-long-press';
export type { UseSelectionHandlers, UseSelectionInput, UseSelectionReturnValue, } from './use-selection/use-selection';

View File

@@ -0,0 +1,3 @@
type EventType = MouseEvent | TouchEvent;
export declare function useClickOutside<T extends HTMLElement = any>(callback: (event: EventType) => void, events?: string[] | null, nodes?: (HTMLElement | null)[]): import("react").RefObject<T | null>;
export {};

View File

@@ -0,0 +1,15 @@
export interface UseClipboardOptions {
/** Time in ms after which the copied state will reset, `2000` by default */
timeout?: number;
}
export interface UseClipboardReturnValue {
/** Function to copy value to clipboard */
copy: (value: any) => void;
/** Function to reset copied state and error */
reset: () => void;
/** Error if copying failed */
error: Error | null;
/** Boolean indicating if the value was copied successfully */
copied: boolean;
}
export declare function useClipboard(options?: UseClipboardOptions): UseClipboardReturnValue;

View File

@@ -0,0 +1,3 @@
import { UseMediaQueryOptions } from '../use-media-query/use-media-query';
export type UseColorSchemeValue = 'dark' | 'light';
export declare function useColorScheme(initialValue?: UseColorSchemeValue, options?: UseMediaQueryOptions): UseColorSchemeValue;

View File

@@ -0,0 +1,12 @@
export interface UseCounterOptions {
min?: number;
max?: number;
}
export interface UseCounterHandlers {
increment: () => void;
decrement: () => void;
set: (value: number) => void;
reset: () => void;
}
export type UseCounterReturnValue = [number, UseCounterHandlers];
export declare function useCounter(initialValue?: number, options?: UseCounterOptions): [number, UseCounterHandlers];

View File

@@ -0,0 +1,14 @@
export interface UseDebouncedCallbackOptions {
delay: number;
flushOnUnmount?: boolean;
leading?: boolean;
}
export type UseDebouncedCallbackReturnValue<T extends (...args: any[]) => any> = ((...args: Parameters<T>) => void) & {
flush: () => void;
cancel: () => void;
};
export declare function useDebouncedCallback<T extends (...args: any[]) => any>(callback: T, options: number | UseDebouncedCallbackOptions): ((...args: Parameters<T>) => void) & {
flush: () => void;
cancel: () => void;
_isFirstCall: boolean;
};

View File

@@ -0,0 +1,6 @@
import { SetStateAction } from 'react';
export interface UseDebouncedStateOptions {
leading?: boolean;
}
export type UseDebouncedStateReturnValue<T> = [T, (newValue: SetStateAction<T>) => void];
export declare function useDebouncedState<T = any>(defaultValue: T, wait: number, options?: UseDebouncedStateOptions): UseDebouncedStateReturnValue<T>;

View File

@@ -0,0 +1,5 @@
export interface UseDebouncedValueOptions {
leading?: boolean;
}
export type UseDebouncedValueReturnValue<T> = [T, () => void];
export declare function useDebouncedValue<T = any>(value: T, wait: number, options?: UseDebouncedValueOptions): UseDebouncedValueReturnValue<T>;

View File

@@ -0,0 +1,2 @@
import { DependencyList, EffectCallback } from 'react';
export declare function useDidUpdate(fn: EffectCallback, dependencies?: DependencyList): void;

View File

@@ -0,0 +1,11 @@
export interface UseDisclosureOptions {
onOpen?: () => void;
onClose?: () => void;
}
export interface UseDisclosureHandlers {
open: () => void;
close: () => void;
toggle: () => void;
}
export type UseDisclosureReturnValue = [boolean, UseDisclosureHandlers];
export declare function useDisclosure(initialState?: boolean, options?: UseDisclosureOptions): UseDisclosureReturnValue;

View File

@@ -0,0 +1 @@
export declare function useDocumentTitle(title: string): void;

View File

@@ -0,0 +1 @@
export declare function useDocumentVisibility(): DocumentVisibilityState;

View File

@@ -0,0 +1 @@
export declare function useEventListener<K extends keyof HTMLElementEventMap, T extends HTMLElement = any>(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): React.RefCallback<T | null>;

View File

@@ -0,0 +1,11 @@
export interface EyeDropperOpenOptions {
signal?: AbortSignal;
}
export interface EyeDropperOpenReturnType {
sRGBHex: string;
}
export interface UseEyeDropperReturnValue {
supported: boolean;
open: (options?: EyeDropperOpenOptions) => Promise<EyeDropperOpenReturnType | undefined>;
}
export declare function useEyeDropper(): UseEyeDropperReturnValue;

View File

@@ -0,0 +1 @@
export declare function useFavicon(url: string): void;

View File

@@ -0,0 +1,11 @@
export interface UseFetchOptions extends RequestInit {
autoInvoke?: boolean;
}
export interface UseFetchReturnValue<T> {
data: T | null;
loading: boolean;
error: Error | null;
refetch: () => Promise<any>;
abort: () => void;
}
export declare function useFetch<T>(url: string, { autoInvoke, ...options }?: UseFetchOptions): UseFetchReturnValue<T>;

View File

@@ -0,0 +1,24 @@
export interface UseFileDialogOptions {
/** Determines whether multiple files are allowed, `true` by default */
multiple?: boolean;
/** `accept` attribute of the file input, '*' by default */
accept?: string;
/** `capture` attribute of the file input */
capture?: string;
/** Determines whether the user can pick a directory instead of file, `false` by default */
directory?: boolean;
/** Determines whether the file input state should be reset when the file dialog is opened, `false` by default */
resetOnOpen?: boolean;
/** Initial selected files */
initialFiles?: FileList | File[];
/** Called when files are selected */
onChange?: (files: FileList | null) => void;
/** Called when file dialog is canceled */
onCancel?: () => void;
}
export interface UseFileDialogReturnValue {
files: FileList | null;
open: () => void;
reset: () => void;
}
export declare function useFileDialog(input?: UseFileDialogOptions): UseFileDialogReturnValue;

View File

@@ -0,0 +1,6 @@
export interface UseFocusReturnOptions {
opened: boolean;
shouldReturnFocus?: boolean;
}
export type UseFocusReturnReturnValue = () => void;
export declare function useFocusReturn({ opened, shouldReturnFocus, }: UseFocusReturnOptions): UseFocusReturnReturnValue;

View File

@@ -0,0 +1 @@
export declare function scopeTab(node: HTMLElement, event: KeyboardEvent): void;

View File

@@ -0,0 +1,4 @@
export declare const FOCUS_SELECTOR = "a, input, select, textarea, button, object, [tabindex]";
export declare function focusable(element: HTMLElement): boolean | "";
export declare function tabbable(element: HTMLElement): boolean | "";
export declare function findTabbableDescendants(element: HTMLElement): HTMLElement[];

View File

@@ -0,0 +1 @@
export declare function useFocusTrap(active?: boolean): React.RefCallback<HTMLElement | null>;

View File

@@ -0,0 +1,9 @@
export interface UseFocusWithinOptions {
onFocus?: (event: FocusEvent) => void;
onBlur?: (event: FocusEvent) => void;
}
export interface UseFocusWithinReturnValue<T extends HTMLElement = any> {
ref: React.RefCallback<T | null>;
focused: boolean;
}
export declare function useFocusWithin<T extends HTMLElement = any>({ onBlur, onFocus, }?: UseFocusWithinOptions): UseFocusWithinReturnValue<T>;

View File

@@ -0,0 +1 @@
export declare function useForceUpdate(): () => void;

View File

@@ -0,0 +1,6 @@
export interface UseFullscreenReturnValue<T extends HTMLElement = any> {
ref: React.RefCallback<T | null>;
toggle: () => Promise<void>;
fullscreen: boolean;
}
export declare function useFullscreen<T extends HTMLElement = any>(): UseFullscreenReturnValue<T>;

View File

@@ -0,0 +1,5 @@
export interface UseHashOptions {
getInitialValueInEffect?: boolean;
}
export type UseHashReturnValue = [string, (value: string) => void];
export declare function useHash({ getInitialValueInEffect, }?: UseHashOptions): UseHashReturnValue;

View File

@@ -0,0 +1,16 @@
export declare const isFixed: (current: number, fixedAt: number) => boolean;
export declare const isPinned: (current: number, previous: number) => boolean;
export declare const isReleased: (current: number, previous: number, fixedAt: number) => boolean;
export declare const isPinnedOrReleased: (current: number, fixedAt: number, isCurrentlyPinnedRef: React.RefObject<boolean>, isScrollingUp: boolean, onPin?: () => void, onRelease?: () => void) => void;
export declare const useScrollDirection: () => boolean;
export interface UseHeadroomOptions {
/** Number in px at which element should be fixed */
fixedAt?: number;
/** Called when element is pinned */
onPin?: () => void;
/** Called when element is at fixed position */
onFix?: () => void;
/** Called when element is unpinned */
onRelease?: () => void;
}
export declare function useHeadroom({ fixedAt, onPin, onFix, onRelease }?: UseHeadroomOptions): boolean;

View File

@@ -0,0 +1,21 @@
export type KeyboardModifiers = {
alt: boolean;
ctrl: boolean;
meta: boolean;
mod: boolean;
shift: boolean;
plus: boolean;
};
export type Hotkey = KeyboardModifiers & {
key?: string;
};
type CheckHotkeyMatch = (event: KeyboardEvent) => boolean;
export declare function parseHotkey(hotkey: string): Hotkey;
export declare function getHotkeyMatcher(hotkey: string, usePhysicalKeys?: boolean): CheckHotkeyMatch;
export interface HotkeyItemOptions {
preventDefault?: boolean;
usePhysicalKeys?: boolean;
}
type HotkeyItem = [string, (event: any) => void, HotkeyItemOptions?];
export declare function getHotkeyHandler(hotkeys: HotkeyItem[]): (event: React.KeyboardEvent<HTMLElement> | KeyboardEvent) => void;
export {};

View File

@@ -0,0 +1,5 @@
import { getHotkeyHandler, HotkeyItemOptions } from './parse-hotkey';
export type { HotkeyItemOptions };
export { getHotkeyHandler };
export type HotkeyItem = [string, (event: KeyboardEvent) => void, HotkeyItemOptions?];
export declare function useHotkeys(hotkeys: HotkeyItem[], tagsToIgnore?: string[], triggerOnContentEditable?: boolean): void;

View File

@@ -0,0 +1,5 @@
export interface UseHoverReturnValue<T extends HTMLElement = any> {
hovered: boolean;
ref: React.RefCallback<T | null>;
}
export declare function useHover<T extends HTMLElement = any>(): UseHoverReturnValue<T>;

1
node_modules/@mantine/hooks/lib/use-id/use-id.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function useId(staticId?: string): string;

View File

@@ -0,0 +1 @@
export declare function useReactId(): string;

View File

@@ -0,0 +1,5 @@
export interface UseIdleOptions {
events?: (keyof DocumentEventMap)[];
initialState?: boolean;
}
export declare function useIdle(timeout: number, options?: UseIdleOptions): boolean;

View File

@@ -0,0 +1,5 @@
export interface UseInViewportReturnValue<T extends HTMLElement = any> {
inViewport: boolean;
ref: React.RefCallback<T | null>;
}
export declare function useInViewport<T extends HTMLElement = any>(): UseInViewportReturnValue<T>;

View File

@@ -0,0 +1,6 @@
export declare function getInputOnChange<T>(setValue: (value: null | undefined | T | ((current: T) => T)) => void): (val: null | undefined | T | React.ChangeEvent<any> | ((current: T) => T)) => void;
export type UseInputStateReturnValue<T> = [
T,
(value: null | undefined | T | React.ChangeEvent<any>) => void
];
export declare function useInputState<T>(initialState: T): UseInputStateReturnValue<T>;

View File

@@ -0,0 +1,5 @@
export interface UseIntersectionReturnValue<T> {
ref: React.RefCallback<T | null>;
entry: IntersectionObserverEntry | null;
}
export declare function useIntersection<T extends HTMLElement = any>(options?: IntersectionObserverInit): UseIntersectionReturnValue<T>;

View File

@@ -0,0 +1,15 @@
export interface UseIntervalOptions {
/** If set, the interval will start automatically when the component is mounted, `false` by default */
autoInvoke?: boolean;
}
export interface UseIntervalReturnValue {
/** Starts the interval */
start: () => void;
/** Stops the interval */
stop: () => void;
/** Toggles the interval */
toggle: () => void;
/** Indicates if the interval is active */
active: boolean;
}
export declare function useInterval(fn: () => void, interval: number, { autoInvoke }?: UseIntervalOptions): UseIntervalReturnValue;

View File

@@ -0,0 +1 @@
export declare function useIsFirstRender(): boolean;

View File

@@ -0,0 +1,2 @@
import { useEffect } from 'react';
export declare const useIsomorphicEffect: typeof useEffect;

View File

@@ -0,0 +1,24 @@
export interface UseListStateHandlers<T> {
setState: React.Dispatch<React.SetStateAction<T[]>>;
append: (...items: T[]) => void;
prepend: (...items: T[]) => void;
insert: (index: number, ...items: T[]) => void;
pop: () => void;
shift: () => void;
apply: (fn: (item: T, index?: number) => T) => void;
applyWhere: (condition: (item: T, index: number) => boolean, fn: (item: T, index?: number) => T) => void;
remove: (...indices: number[]) => void;
reorder: ({ from, to }: {
from: number;
to: number;
}) => void;
swap: ({ from, to }: {
from: number;
to: number;
}) => void;
setItem: (index: number, item: T) => void;
setItemProp: <K extends keyof T, U extends T[K]>(index: number, prop: K, value: U) => void;
filter: (fn: (item: T, i: number) => boolean) => void;
}
export type UseListStateReturnValue<T> = [T[], UseListStateHandlers<T>];
export declare function useListState<T>(initialValue?: T[] | (() => T[])): UseListStateReturnValue<T>;

View File

@@ -0,0 +1,22 @@
export type StorageType = 'localStorage' | 'sessionStorage';
export interface UseStorageOptions<T> {
/** Storage key */
key: string;
/** Default value that will be set if value is not found in storage */
defaultValue?: T;
/** If set to true, value will be updated in useEffect after mount. Default value is true. */
getInitialValueInEffect?: boolean;
/** Determines whether the value must be synced between browser tabs, `true` by default */
sync?: boolean;
/** Function to serialize value into string to be save in storage */
serialize?: (value: T) => string;
/** Function to deserialize string value from storage to value */
deserialize?: (value: string | undefined) => T;
}
export type UseStorageReturnValue<T> = [
T,
(val: T | ((prevState: T) => T)) => void,
() => void
];
export declare function createStorage<T>(type: StorageType, hookName: string): ({ key, defaultValue, getInitialValueInEffect, sync, deserialize, serialize, }: UseStorageOptions<T>) => UseStorageReturnValue<T>;
export declare function readValue(type: StorageType): <T>({ key, defaultValue, deserialize, }: UseStorageOptions<T>) => T;

View File

@@ -0,0 +1,3 @@
import { UseStorageOptions } from './create-storage';
export declare function useLocalStorage<T = string>(props: UseStorageOptions<T>): import("./create-storage").UseStorageReturnValue<T>;
export declare const readLocalStorageValue: <T>({ key, defaultValue, deserialize, }: UseStorageOptions<T>) => T;

View File

@@ -0,0 +1 @@
export declare function useLogger(componentName: string, props: any[]): null;

View File

@@ -0,0 +1,19 @@
import React from 'react';
export interface UseLongPressOptions {
/** Time in milliseconds to trigger the long press, default is 400ms */
threshold?: number;
/** Callback triggered when the long press starts */
onStart?: (event: React.MouseEvent | React.TouchEvent) => void;
/** Callback triggered when the long press finishes */
onFinish?: (event: React.MouseEvent | React.TouchEvent) => void;
/** Callback triggered when the long press is canceled */
onCancel?: (event: React.MouseEvent | React.TouchEvent) => void;
}
export interface UseLongPressReturnValue {
onMouseDown: (event: React.MouseEvent) => void;
onMouseUp: (event: React.MouseEvent) => void;
onMouseLeave: (event: React.MouseEvent) => void;
onTouchStart: (event: React.TouchEvent) => void;
onTouchEnd: (event: React.TouchEvent) => void;
}
export declare function useLongPress(onLongPress: (event: React.MouseEvent | React.TouchEvent) => void, options?: UseLongPressOptions): UseLongPressReturnValue;

1
node_modules/@mantine/hooks/lib/use-map/use-map.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function useMap<T, V>(initialState?: [T, V][]): Map<T, V>;

View File

@@ -0,0 +1,4 @@
export interface UseMediaQueryOptions {
getInitialValueInEffect: boolean;
}
export declare function useMediaQuery(query: string, initialValue?: boolean, { getInitialValueInEffect }?: UseMediaQueryOptions): boolean;

View File

@@ -0,0 +1,7 @@
import { Ref, type RefCallback } from 'react';
type PossibleRef<T> = Ref<T> | undefined;
type RefCleanup<T> = ReturnType<RefCallback<T>>;
export declare function assignRef<T>(ref: PossibleRef<T>, value: T): RefCleanup<T>;
export declare function mergeRefs<T>(...refs: PossibleRef<T>[]): RefCallback<T>;
export declare function useMergedRef<T>(...refs: PossibleRef<T>[]): RefCallback<T>;
export {};

View File

@@ -0,0 +1 @@
export declare function useMounted(): boolean;

View File

@@ -0,0 +1,7 @@
export declare function useMouse<T extends HTMLElement = any>(options?: {
resetOnExit?: boolean;
}): {
x: number;
y: number;
ref: import("react").RefObject<T | null>;
};

17
node_modules/@mantine/hooks/lib/use-move/use-move.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
export interface UseMovePosition {
x: number;
y: number;
}
export declare function clampUseMovePosition(position: UseMovePosition): {
x: number;
y: number;
};
export interface UseMoveHandlers {
onScrubStart?: () => void;
onScrubEnd?: () => void;
}
export interface UseMoveReturnValue<T extends HTMLElement = any> {
ref: React.RefCallback<T | null>;
active: boolean;
}
export declare function useMove<T extends HTMLElement = any>(onChange: (value: UseMovePosition) => void, handlers?: UseMoveHandlers, dir?: 'ltr' | 'rtl'): UseMoveReturnValue<T>;

View File

@@ -0,0 +1 @@
export declare function useMutationObserver<T extends HTMLElement = any>(callback: MutationCallback, options: MutationObserverInit, target?: HTMLElement | (() => HTMLElement) | null): import("react").RefObject<T | null>;

View File

@@ -0,0 +1,10 @@
export interface UserNetworkReturnValue {
online: boolean;
downlink?: number;
downlinkMax?: number;
effectiveType?: 'slow-2g' | '2g' | '3g' | '4g';
rtt?: number;
saveData?: boolean;
type?: 'bluetooth' | 'cellular' | 'ethernet' | 'wifi' | 'wimax' | 'none' | 'other' | 'unknown';
}
export declare function useNetwork(): UserNetworkReturnValue;

View File

@@ -0,0 +1,22 @@
export interface UseOrientationOptions {
/** Default angle value, used until the real can be retrieved
* (during server side rendering and before js executes on the page)
* If not provided, the default value is `0`
* */
defaultAngle?: number;
/** Default angle value, used until the real can be retrieved
* (during server side rendering and before js executes on the page)
* If not provided, the default value is `'landscape-primary'`
* */
defaultType?: OrientationType;
/** If true, the initial value will be resolved in useEffect (ssr safe)
* If false, the initial value will be resolved in useLayoutEffect (ssr unsafe)
* True by default.
*/
getInitialValueInEffect?: boolean;
}
export interface UseOrientationReturnType {
angle: number;
type: OrientationType;
}
export declare function useOrientation({ defaultAngle, defaultType, getInitialValueInEffect, }?: UseOrientationOptions): UseOrientationReturnType;

5
node_modules/@mantine/hooks/lib/use-os/use-os.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export type UseOSReturnValue = 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux' | 'chromeos';
export interface UseOsOptions {
getValueInEffect: boolean;
}
export declare function useOs(options?: UseOsOptions): UseOSReturnValue;

View File

@@ -0,0 +1 @@
export declare function usePageLeave(onPageLeave: () => void): void;

View File

@@ -0,0 +1,32 @@
export declare const DOTS = "dots";
export interface UsePaginationOptions {
/** Page selected on initial render, defaults to 1 */
initialPage?: number;
/** Controlled active page number */
page?: number;
/** Total amount of pages */
total: number;
/** Siblings amount on left/right side of selected page, defaults to 1 */
siblings?: number;
/** Amount of elements visible on left/right edges, defaults to 1 */
boundaries?: number;
/** Callback fired after change of each page */
onChange?: (page: number) => void;
}
export interface UsePaginationReturnValue {
/** Array of page numbers and dots */
range: (number | 'dots')[];
/** Active page number */
active: number;
/** Function to set active page */
setPage: (page: number) => void;
/** Function to go to next page */
next: () => void;
/** Function to go to previous page */
previous: () => void;
/** Function to go to first page */
first: () => void;
/** Function to go to last page */
last: () => void;
}
export declare function usePagination({ total, siblings, boundaries, page, initialPage, onChange, }: UsePaginationOptions): UsePaginationReturnValue;

View File

@@ -0,0 +1 @@
export declare function usePrevious<T>(value: T): T | undefined;

View File

@@ -0,0 +1,19 @@
export interface UseQueueOptions<T> {
/** Initial values to be added to the queue */
initialValues?: T[];
/** Maximum number of items in the state */
limit: number;
}
export interface UseQueueReturnValue<T> {
/** Array of items in the queue */
queue: T[];
/** Array of items in the state */
state: T[];
/** Function to add items to state or queue */
add: (...items: T[]) => void;
/** Function to apply updates to current items */
update: (fn: (state: T[]) => T[]) => void;
/** Function to clear the queue */
cleanQueue: () => void;
}
export declare function useQueue<T>({ initialValues, limit, }: UseQueueOptions<T>): UseQueueReturnValue<T>;

View File

@@ -0,0 +1,18 @@
export declare function normalizeRadialValue(degree: number, step: number): number;
export interface UseRadialMoveOptions {
/** Number by which value is incremented/decremented with mouse and touch events, `0.01` by default */
step?: number;
/** Called in `onMouseUp` and `onTouchEnd` events with the current value */
onChangeEnd?: (value: number) => void;
/** Called in `onMouseDown` and `onTouchStart` events */
onScrubStart?: () => void;
/** Called in `onMouseUp` and `onTouchEnd` events */
onScrubEnd?: () => void;
}
export interface UseRadialMoveReturnValue<T extends HTMLElement = any> {
/** Ref to be passed to the element that should be used for radial move */
ref: React.RefCallback<T | null>;
/** Indicates whether the radial move is active */
active: boolean;
}
export declare function useRadialMove<T extends HTMLElement = any>(onChange: (value: number) => void, { step, onChangeEnd, onScrubStart, onScrubEnd }?: UseRadialMoveOptions): UseRadialMoveReturnValue<T>;

View File

@@ -0,0 +1,2 @@
import { UseMediaQueryOptions } from '../use-media-query/use-media-query';
export declare function useReducedMotion(initialValue?: boolean, options?: UseMediaQueryOptions): boolean;

View File

@@ -0,0 +1,8 @@
type ObserverRect = Omit<DOMRectReadOnly, 'toJSON'>;
export declare function useResizeObserver<T extends HTMLElement = any>(options?: ResizeObserverOptions): readonly [import("react").RefObject<T | null>, ObserverRect];
export declare function useElementSize<T extends HTMLElement = any>(options?: ResizeObserverOptions): {
ref: import("react").RefObject<T | null>;
width: number;
height: number;
};
export {};

View File

@@ -0,0 +1,28 @@
interface UseScrollIntoViewAnimation {
/** Target element alignment relatively to parent based on current axis */
alignment?: 'start' | 'end' | 'center';
}
export interface UseScrollIntoViewOptions {
/** Callback fired after scroll */
onScrollFinish?: () => void;
/** Duration of scroll in milliseconds */
duration?: number;
/** Axis of scroll */
axis?: 'x' | 'y';
/** Custom mathematical easing function */
easing?: (t: number) => number;
/** Additional distance between nearest edge and element */
offset?: number;
/** Indicator if animation may be interrupted by user scrolling */
cancelable?: boolean;
/** Prevents content jumping in scrolling lists with multiple targets */
isList?: boolean;
}
export interface UseScrollIntoViewReturnValue<Target extends HTMLElement = any, Parent extends HTMLElement | null = null> {
scrollableRef: React.RefObject<Parent | null>;
targetRef: React.RefObject<Target | null>;
scrollIntoView: (params?: UseScrollIntoViewAnimation) => void;
cancel: () => void;
}
export declare function useScrollIntoView<Target extends HTMLElement = any, Parent extends HTMLElement | null = null>({ duration, axis, onScrollFinish, easing, offset, cancelable, isList, }?: UseScrollIntoViewOptions): UseScrollIntoViewReturnValue<Target, Parent>;
export {};

View File

@@ -0,0 +1,33 @@
export interface UseScrollSpyHeadingData {
/** Heading depth, 1-6 */
depth: number;
/** Heading text content value */
value: string;
/** Heading id */
id: string;
/** Function to get heading node */
getNode: () => HTMLElement;
}
export interface UseScrollSpyOptions {
/** Selector to get headings, `'h1, h2, h3, h4, h5, h6'` by default */
selector?: string;
/** A function to retrieve depth of heading, by default depth is calculated based on tag name */
getDepth?: (element: HTMLElement) => number;
/** A function to retrieve heading value, by default `element.textContent` is used */
getValue?: (element: HTMLElement) => string;
/** Host element to attach scroll event listener, if not provided, `window` is used */
scrollHost?: HTMLElement;
/** Offset from the top of the viewport to use when determining the active heading, `0` by default */
offset?: number;
}
export interface UseScrollSpyReturnType {
/** Index of the active heading in the `data` array */
active: number;
/** Headings data. If not initialize, data is represented by an empty array. */
data: UseScrollSpyHeadingData[];
/** True if headings value have been retrieved from the DOM. */
initialized: boolean;
/** Function to update headings values after the parent component has mounted. */
reinitialize: () => void;
}
export declare function useScrollSpy({ selector, getDepth, getValue, offset, scrollHost, }?: UseScrollSpyOptions): UseScrollSpyReturnType;

View File

@@ -0,0 +1,26 @@
export interface UseSelectionInput<T> {
/** The array of items to select from */
data: T[];
/** The initial selection, empty array by default */
defaultSelection?: T[];
/** If true, selection is reset when data changes */
resetSelectionOnDataChange?: boolean;
}
export interface UseSelectionHandlers<T> {
/** Add an item to the selection */
select: (selected: T) => void;
/** Remove an item from the selection */
deselect: (deselected: T) => void;
/** Toggle an item's selection state */
toggle: (toggled: T) => void;
/** Returns true if all items from the `data` are selected */
isAllSelected: () => boolean;
/** Returns true if at least one item from the `data` is selected */
isSomeSelected: () => boolean;
/** Set the selection to a specific array of items */
setSelection: (selection: T[]) => void;
/** Clear all selections */
resetSelection: () => void;
}
export type UseSelectionReturnValue<T> = readonly [T[], UseSelectionHandlers<T>];
export declare function useSelection<T>(input: UseSelectionInput<T>): UseSelectionReturnValue<T>;

View File

@@ -0,0 +1,3 @@
import { UseStorageOptions } from '../use-local-storage/create-storage';
export declare function useSessionStorage<T = string>(props: UseStorageOptions<T>): import("..").UseStorageReturnValue<T>;
export declare const readSessionStorageValue: <T>({ key, defaultValue, deserialize, }: UseStorageOptions<T>) => T;

View File

@@ -0,0 +1,3 @@
export type UseSetStateCallback<T> = (state: Partial<T> | ((currentState: T) => Partial<T>)) => void;
export type UseSetStateReturnValue<T> = [T, UseSetStateCallback<T>];
export declare function useSetState<T extends Record<string, any>>(initialState: T): UseSetStateReturnValue<T>;

2
node_modules/@mantine/hooks/lib/use-set/use-set.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare function readonlySetLikeToSet<T>(input: ReadonlySetLike<T>): Set<T>;
export declare function useSet<T>(values?: T[]): Set<T>;

View File

@@ -0,0 +1 @@
export declare function useShallowEffect(cb: () => void, dependencies?: React.DependencyList): void;

View File

@@ -0,0 +1,16 @@
export interface UseStateHistoryHandlers<T> {
set: (value: T) => void;
back: (steps?: number) => void;
forward: (steps?: number) => void;
reset: () => void;
}
export interface UseStateHistoryValue<T> {
history: T[];
current: number;
}
export type UseStateHistoryReturnValue<T> = [
T,
UseStateHistoryHandlers<T>,
UseStateHistoryValue<T>
];
export declare function useStateHistory<T>(initialValue: T): UseStateHistoryReturnValue<T>;

View File

@@ -0,0 +1 @@
export declare function useTextSelection(): Selection | null;

View File

@@ -0,0 +1,2 @@
export declare function useThrottledCallbackWithClearTimeout<T extends (...args: any[]) => any>(callback: T, wait: number): readonly [(...args: Parameters<T>) => void, () => void];
export declare function useThrottledCallback<T extends (...args: any[]) => any>(callback: T, wait: number): (...args: Parameters<T>) => void;

View File

@@ -0,0 +1 @@
export declare function useThrottledState<T = any>(defaultValue: T, wait: number): readonly [T, (value: import("react").SetStateAction<T>) => void];

View File

@@ -0,0 +1 @@
export declare function useThrottledValue<T>(value: T, wait: number): T;

View File

@@ -0,0 +1,8 @@
export interface UseTimeoutOptions {
autoInvoke: boolean;
}
export interface UseTimeoutReturnValue {
start: (...args: any[]) => void;
clear: () => void;
}
export declare function useTimeout(callback: (...args: any[]) => void, delay: number, options?: UseTimeoutOptions): UseTimeoutReturnValue;

View File

@@ -0,0 +1,4 @@
type UseToggleAction<T> = (value?: React.SetStateAction<T>) => void;
export type UseToggleReturnValue<T> = [T, UseToggleAction<T>];
export declare function useToggle<T = boolean>(options?: readonly T[]): UseToggleReturnValue<T>;
export {};

View File

@@ -0,0 +1,19 @@
export interface UseUncontrolledOptions<T> {
/** Value for controlled state */
value?: T;
/** Initial value for uncontrolled state */
defaultValue?: T;
/** Final value for uncontrolled state when value and defaultValue are not provided */
finalValue?: T;
/** Controlled state onChange handler */
onChange?: (value: T, ...payload: any[]) => void;
}
export type UseUncontrolledReturnValue<T> = [
/** Current value */
T,
/** Handler to update the state, passes `value` and `payload` to `onChange` */
(value: T, ...payload: any[]) => void,
/** True if the state is controlled, false if uncontrolled */
boolean
];
export declare function useUncontrolled<T>({ value, defaultValue, finalValue, onChange, }: UseUncontrolledOptions<T>): UseUncontrolledReturnValue<T>;

View File

@@ -0,0 +1,15 @@
export interface UseValidatedStateValue<T> {
/** Current value */
value: T;
/** Last valid value */
lastValidValue: T | undefined;
/** True if the current value is valid, false otherwise */
valid: boolean;
}
export type UseValidatedStateReturnValue<T> = [
/** Current value */
UseValidatedStateValue<T>,
/** Handler to update the state, passes `value` and `payload` to `onChange` */
(value: T) => void
];
export declare function useValidatedState<T>(initialValue: T, validate: (value: T) => boolean, initialValidationState?: boolean): UseValidatedStateReturnValue<T>;

View File

@@ -0,0 +1,4 @@
export declare function useViewportSize(): {
width: number;
height: number;
};

View File

@@ -0,0 +1 @@
export declare function useWindowEvent<K extends string>(type: K, listener: K extends keyof WindowEventMap ? (this: Window, ev: WindowEventMap[K]) => void : (this: Window, ev: CustomEvent) => void, options?: boolean | AddEventListenerOptions): void;

View File

@@ -0,0 +1,7 @@
export interface UseWindowScrollPosition {
x: number;
y: number;
}
export type UseWindowScrollTo = (position: Partial<UseWindowScrollPosition>) => void;
export type UseWindowScrollReturnValue = [UseWindowScrollPosition, UseWindowScrollTo];
export declare function useWindowScroll(): UseWindowScrollReturnValue;

View File

@@ -0,0 +1 @@
export declare function clamp(value: number, min: number | undefined, max: number | undefined): number;

7
node_modules/@mantine/hooks/lib/utils/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export { clamp } from './clamp/clamp';
export { lowerFirst } from './lower-first/lower-first';
export { randomId } from './random-id/random-id';
export { range } from './range/range';
export { shallowEqual } from './shallow-equal/shallow-equal';
export { upperFirst } from './upper-first/upper-first';
export { useCallbackRef } from './use-callback-ref/use-callback-ref';

View File

@@ -0,0 +1 @@
export declare function lowerFirst(value: string): string;

View File

@@ -0,0 +1 @@
export declare function randomId(prefix?: string): string;

View File

@@ -0,0 +1 @@
export declare function range(start: number, end: number): number[];

View File

@@ -0,0 +1 @@
export declare function shallowEqual(a: any, b: any): boolean;

View File

@@ -0,0 +1 @@
export declare function upperFirst(value: string): string;

View File

@@ -0,0 +1 @@
export declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T;