2.0.12 • Published 1 year ago
@types/react-measure v2.0.12
Installation
npm install --save @types/react-measure
Summary
This package contains type definitions for react-measure (https://github.com/souporserious/react-measure).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-measure.
index.d.ts
// Type definitions for react-measure 2.0
// Project: https://github.com/souporserious/react-measure
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>, Marc Fallows <https://github.com/marcfallows>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from "react";
export type MeasurementType = "client" | "offset" | "scroll" | "bounds" | "margin";
interface TopLeft {
readonly top: number;
readonly left: number;
}
interface BottomRight {
readonly bottom: number;
readonly right: number;
}
interface Dimensions {
readonly width: number;
readonly height: number;
}
export type Margin = TopLeft & BottomRight;
export type Rect = TopLeft & Dimensions;
export type BoundingRect = Dimensions & Margin;
export interface ContentRect {
client?: Rect | undefined;
offset?: Rect | undefined;
scroll?: Rect | undefined;
bounds?: BoundingRect | undefined;
margin?: Margin | undefined;
entry?: any;
}
export interface MeasuredComponentProps {
measureRef(ref: Element | null): void;
measure(): void;
contentRect: ContentRect;
}
type MeasuredComponent<T> = React.ComponentType<T & MeasuredComponentProps>;
export interface MeasureProps {
client?: boolean | undefined;
offset?: boolean | undefined;
scroll?: boolean | undefined;
bounds?: boolean | undefined;
margin?: boolean | undefined;
innerRef?: React.Ref<Element> | undefined;
onResize?(contentRect: ContentRect): void;
children?: React.FC<MeasuredComponentProps> | undefined;
}
export function withContentRect(types: ReadonlyArray<MeasurementType> | MeasurementType):
<T extends {}>(fn: MeasuredComponent<T>) => React.ComponentType<T>;
declare class Measure extends React.Component<MeasureProps> {}
export default Measure;
Additional Details
- Last updated: Thu, 21 Oct 2021 02:01:33 GMT
- Dependencies: @types/react
- Global values: none
Credits
These definitions were written by Alexey Svetliakov, and Marc Fallows.
2.0.11
1 year ago
2.0.12
1 year ago
2.0.9
1 year ago
2.0.10
1 year ago
2.0.8
3 years ago
2.0.7
3 years ago
2.0.6
5 years ago
2.0.5
6 years ago
2.0.4
6 years ago
2.0.3
6 years ago
2.0.2
7 years ago
2.0.1
7 years ago
2.0.0
7 years ago
0.4.8
7 years ago
0.4.7
8 years ago
0.4.6
8 years ago
0.4.5
8 years ago
0.4.4
8 years ago
0.4.3
8 years ago
0.4.2
8 years ago
0.4.1
8 years ago