import { Dispatch, SetStateAction, useEffect } from 'react'; export type InitialState = boolean | (() => boolean); declare function useBoolean(initialState?: InitialState): readonly [ boolean, { readonly on: () => void; readonly off: () => void; readonly toggle: () => void; } ]; declare function useCallbackRef unknown>(fn: T | undefined): T; export type UseEffectParams = Parameters; export type UseEffectReturn = ReturnType; export type EffectCallback = UseEffectParams[0]; export type DependencyList = UseEffectParams[1]; declare function useDeepCompareEffect(callback: EffectCallback, dependencies: DependencyList, updatePhase?: boolean): UseEffectReturn; declare function useCustomCompareEffect(callback: EffectCallback, dependencies: T, equal: (newDep: T, oldDep: T) => boolean, updatePhase?: boolean): void; declare function useConst(init: (() => T) | T): T; declare function useCountdownCallback(callback: (...args: any[]) => void, totalSeconds: number, options?: { intervalTime?: number; }): () => void; declare function useDebounceCallback unknown>(callback: T | undefined, wait?: number, leading?: boolean, trailing?: boolean): T; declare function useForceUpdate(): () => void; declare function useId(idProp?: string, prefix?: string): string; declare function useIds(idProp?: string, ...prefixes: string[]): string[]; declare function useInterval(callback: () => void, delay: number | null): void; declare function useIsInitialRender(): boolean; declare function useIsMounted(): import("react").MutableRefObject; declare function useLockBodyScroll(lock?: boolean): void; /** * We need to make sure that callbacks return one Promise<....> if it's async callback. * @example * ```ts * // correct * hooks.useModelEffect([menuActions.loadMenus], true); * // correct * hooks.useModelEffect([() => moduleActions.loadModuleNormals({})], true); * // bad example * hooks.useModelEffect([() => { * moduleActions.loadModuleNormals({}) * // bad, it return undefined, but loadModuleNormals is async data fetching. * }], true); * ``` */ export type ModelEffectCallbacks = (() => unknown) | Array<() => unknown>; declare function useModelEffect(callbacks: ModelEffectCallbacks, global?: boolean): void; declare function useOutsideClick(ref: any, onEvent: () => void): void; declare function usePrevious(value: T): T | undefined; declare function useThrottleCallback unknown>(callback: T | undefined, fps?: number, leading?: boolean): T; declare function useThrottle(initialState: State | (() => State), fps?: number, leading?: boolean): [ State, Dispatch> ]; declare function useTimeout(callback: (...args: unknown[]) => void, delay: number | null): void; declare function useUnmountEffect(fn: () => void, deps?: DependencyList): void; declare function useWindowEvent(type: TType, listener: (this: Window, ev: WindowEventMap[TType]) => unknown, options?: boolean | AddEventListenerOptions): void; export type WindowSize = undefined | { width: number; height: number; }; declare function useWindowSize(): WindowSize | undefined; export type ScrollPosition = { scrollX: number; scrollY: number; }; export declare const hooks: { useId: typeof useId; useIds: typeof useIds; useBoolean: typeof useBoolean; useTimeout: typeof useTimeout; useInterval: typeof useInterval; useConst: typeof useConst; useDebounce: (initialState: State | (() => State), wait?: number, leading?: boolean) => [ State, import("react").Dispatch> ]; useDebounceClick: (callback: (...args: any) => void, wait?: number) => (...args: any[]) => void; useDebounceCallback: typeof useDebounceCallback; useCountdownCallback: typeof useCountdownCallback; useCountdown: (timeToCount?: number, interval?: number) => [ number, { start: (newTimeToCount?: any) => void; pause: () => void; resume: () => void; reset: () => void; } ]; useGlobal: () => T; useCallbackRef: typeof useCallbackRef; useModelEffect: typeof useModelEffect; useForceUpdate: typeof useForceUpdate; useUpdateEffect: (effect: EffectCallback, deps: DependencyList) => UseEffectReturn; useEffectOnce: (effect: EffectCallback, dep?: any) => UseEffectReturn; useUnmountEffect: typeof useUnmountEffect; useDeepCompareEffect: typeof useDeepCompareEffect; useCustomCompareEffect: typeof useCustomCompareEffect; useSafeLayoutEffect: typeof import("react").useEffect; useThrottle: typeof useThrottle; useThrottleCallback: typeof useThrottleCallback; useWindowSize: typeof useWindowSize; useLockBodyScroll: typeof useLockBodyScroll; useScrollPosition: (effect?: (position: ScrollPosition, lastPosition: ScrollPosition | null) => void, deps?: unknown[]) => void; useWindowEvent: typeof useWindowEvent; useIsMounted: typeof useIsMounted; useIsInitialRender: typeof useIsInitialRender; useOutsideClick: typeof useOutsideClick; usePrevious: typeof usePrevious; }; export {};