-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
40 lines (29 loc) · 1.28 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
declare module "jack-o-hook" {
import * as React from "react";
type HandleCopy = (content: string, callback: () => void) => void;
export function useCopyboard(): { handleCopy: HandleCopy };
type GoToId = (id: string, distance?: number) => void;
type GoToTop = () => void;
export function useScroll(): { goToId: GoToId; goToTop: GoToTop };
export function useScrollPosition(): [boolean, boolean];
type MousePos = { x: number; y: number };
export function useMouse(): MousePos;
export function useWindowWidth(): number;
export function useHasRendered(): boolean;
type UseToggleStateReturn = {
isOn: boolean;
handleToggle: () => void;
handleOn: () => void;
handleOff: () => void;
};
export function useToggleState(initialState?: boolean): UseToggleStateReturn;
type WindowDimensions = { width: number | undefined; height: number | undefined };
export function useWindowDimensions(debounceDelay?: number): WindowDimensions;
export function useLockScroll(): void;
type IntersectionObserverOptions = IntersectionObserverInit;
export function useIntersectionObserver(
ref: React.RefObject<Element>,
options: IntersectionObserverOptions
): boolean;
function debounce(func: Function, wait: number, immediate?: boolean): () => void;
}