Skip to content

Commit a334067

Browse files
committed
Update index.d.ts
1 parent 5f42766 commit a334067

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/index.d.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,44 @@ interface ResizeObserverEntry {
1111
readonly target: Element;
1212
readonly contentRect: DOMRectReadOnly;
1313
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;
1616
}
1717

18-
interface Breakpoints<T> {
19-
[key: number]: T;
18+
interface Breakpoints {
19+
[key: number]: any;
2020
}
2121

22-
interface BreakpointsOptions<W, H> {
22+
interface BreakpointsOptions {
2323
box?: BoxOptions;
24-
widths?: Breakpoints<W>;
25-
heights?: Breakpoints<H>;
24+
widths?: Breakpoints;
25+
heights?: Breakpoints;
2626
fragment?: number;
2727
}
2828

29-
interface ObservedElementProps<T> {
30-
ref: React.RefObject<T>;
29+
interface ObservedElementProps {
30+
ref: () => React.RefObject<HTMLElement>;
3131
}
3232

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;
3737
}
3838

39-
interface ObserveProps<E, W, H> {
39+
interface ObserveProps {
4040
box?: BoxOptions;
41-
breakpoints?: BreakpointsOptions<W, H>;
41+
breakpoints?: BreakpointsOptions;
4242
render: ({
4343
observedElementProps,
4444
widthMatch,
4545
heightMatch
46-
}: ObserveRenderArgs<E, W, H>) => JSX.Element;
46+
}: ObserveRenderArgs) => React.ReactNode;
4747
}
4848

49-
export const Observe: <E, W, H>(props: ObserveProps<E, W, H>) => JSX.Element;
49+
export const Observe: (props: ObserveProps) => React.ReactNode;
5050

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];
5252

5353
export const useResizeObserverEntry: (injectResizeObserverEntry?: ResizeObserverEntry) => ResizeObserverEntry | null;
5454

0 commit comments

Comments
 (0)