@enact/ui
Version:
A collection of simplified unstyled cross-platform UI components for Enact
32 lines (27 loc) • 941 B
TypeScript
// Type definitions for ui/Resizable
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 ResizableConfig extends Object {
/**
* A handler to process the `resize` event.
*
* It should return a truthy value if the event should trigger a resize.
*/
filter?: Function;
/**
* The name of the event on the wrapped component to listen to for size changes.
*
* This event name will be passed to the wrapped component and will also be forwarded (if
needed) to the parent component.
*/
resize: string;
}
export interface ResizableProps {}
export function Resizable<P>(
config: ResizableConfig,
Component: React.ComponentType<P> | string,
): React.ComponentType<P & ResizableProps>;
export function Resizable<P>(
Component: React.ComponentType<P> | string,
): React.ComponentType<P & ResizableProps>;
export default Resizable;