Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A demo declaration file of react-resizable
declare module 'react-resizable' {
import * as React from 'react';
type Axis = 'both' | 'x' | 'y' | 'none';
type ResizeCallbackData = {
node: HTMLElement,
size: {width: number, height: number}
};
interface IResizableProps {
children?: React.ReactElement<any>;
className?: string;
width: number;
height: number;
handleSize?: [number, number];
lockAspectRatio?: boolean;
axis?: Axis;
minConstraints?: [number, number];
maxConstraints?: [number, number];
onResizeStop?: (e: React.SyntheticEvent<any>, data: ResizeCallbackData) => any,
onResizeStart?: (e: React.SyntheticEvent<any>, data: ResizeCallbackData) => any,
onResize?: (e: React.SyntheticEvent<any>, data: ResizeCallbackData) => any,
draggableOpts?: any;
}
export class Resizable extends React.Component<IResizableProps, any> {
constructor(props: IResizableProps);
componentDidMount(): void;
componentDidUpdate(prevProps: IResizableProps): void;
componentWillUnmount(): void;
render(): JSX.Element;
}
export class ResizableBox extends React.Component<IResizableProps, any> {
constructor(props: IResizableProps);
componentDidMount(): void;
componentDidUpdate(prevProps: IResizableProps): void;
componentWillUnmount(): void;
render(): JSX.Element;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.