@@ -11,44 +11,44 @@ interface ResizeObserverEntry {
11
11
readonly target : Element ;
12
12
readonly contentRect : DOMRectReadOnly ;
13
13
readonly borderBoxSize : Array < ResizeObserverBoxSize > | ResizeObserverBoxSize ;
14
- readonly contentBoxSize : Arrray < ResizeObserverBoxSize > | ResizeObserverBoxSize ;
15
- readonly devicePixelContentBoxSize : Arrray < ResizeObserverBoxSize > | ResizeObserverBoxSize ;
14
+ readonly contentBoxSize : Array < ResizeObserverBoxSize > | ResizeObserverBoxSize ;
15
+ readonly devicePixelContentBoxSize : Array < ResizeObserverBoxSize > | ResizeObserverBoxSize ;
16
16
}
17
17
18
- interface Breakpoints < T > {
19
- [ key : number ] : T ;
18
+ interface Breakpoints {
19
+ [ key : number ] : any ;
20
20
}
21
21
22
- interface BreakpointsOptions < W , H > {
22
+ interface BreakpointsOptions {
23
23
box ?: BoxOptions ;
24
- widths ?: Breakpoints < W > ;
25
- heights ?: Breakpoints < H > ;
24
+ widths ?: Breakpoints ;
25
+ heights ?: Breakpoints ;
26
26
fragment ?: number ;
27
27
}
28
28
29
- interface ObservedElementProps < T > {
30
- ref : React . RefObject < T > ;
29
+ interface ObservedElementProps {
30
+ ref : ( ) => React . RefObject < HTMLElement > ;
31
31
}
32
32
33
- interface ObserveRenderArgs < E , W , H > {
34
- observedElementProps : ObservedElementProps < E > ;
35
- widthMatch : W ;
36
- heightMatch : H ;
33
+ interface ObserveRenderArgs {
34
+ observedElementProps : ObservedElementProps ;
35
+ widthMatch : any ;
36
+ heightMatch : any ;
37
37
}
38
38
39
- interface ObserveProps < E , W , H > {
39
+ interface ObserveProps {
40
40
box ?: BoxOptions ;
41
- breakpoints ?: BreakpointsOptions < W , H > ;
41
+ breakpoints ?: BreakpointsOptions ;
42
42
render : ( {
43
43
observedElementProps,
44
44
widthMatch,
45
45
heightMatch
46
- } : ObserveRenderArgs < E , W , H > ) => JSX . Element ;
46
+ } : ObserveRenderArgs ) => React . ReactNode ;
47
47
}
48
48
49
- export const Observe : < E , W , H > ( props : ObserveProps < E , W , H > ) => JSX . Element ;
49
+ export const Observe : ( props : ObserveProps ) => React . ReactNode ;
50
50
51
- export const useBreakpoints : < W extends any , H extends any > ( options : BreakpointsOptions < W , H > ) => [ W , H ] ;
51
+ export const useBreakpoints : ( options : BreakpointsOptions , injectResizeObserverEntry ?: ResizeObserverEntry ) => [ any , any ] ;
52
52
53
53
export const useResizeObserverEntry : ( injectResizeObserverEntry ?: ResizeObserverEntry ) => ResizeObserverEntry | null ;
54
54
0 commit comments