UNPKG

654 BTypeScriptView Raw
1import * as React from 'react';
2import { ComponentType } from 'react';
3import { ComponentsProps } from './ResizeDetector';
4declare function withResizeDetector<P, ElementT extends HTMLElement = HTMLElement>(ComponentInner: ComponentType<P>, options?: ComponentsProps<ElementT>): React.ForwardRefExoticComponent<React.PropsWithoutRef<Without<Without<OptionalKey<P, "targetRef">, "width">, "height">> & React.RefAttributes<HTMLElement>>;
5declare type Without<T, Key> = Key extends keyof T ? Omit<T, Key> : T;
6declare type OptionalKey<T, Key> = Key extends keyof T ? Omit<T, Key> & {
7 [K in Key]?: T[K];
8} : T;
9export default withResizeDetector;