@enact/ui
Version:
A collection of simplified unstyled cross-platform UI components for Enact
27 lines (22 loc) • 786 B
TypeScript
// Type definitions for ui/Measurable
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
export interface MeasurableConfig extends Object {
/**
* Configures the prop name to pass the measurement object.
*/
measurementProp?: string;
/**
* Configures the prop name to pass a function to capture a reference to the element to measure.
*/
refProp?: string;
}
export interface MeasurableProps {}
export function Measurable<P>(
config: MeasurableConfig,
Component: React.ComponentType<P> | string,
): React.ComponentType<P & MeasurableProps>;
export function Measurable<P>(
Component: React.ComponentType<P> | string,
): React.ComponentType<P & MeasurableProps>;
export default Measurable;