Created
September 28, 2018 05:02
-
-
Save navono/51c5a705289946210290c8f7777b43e1 to your computer and use it in GitHub Desktop.
A demo declaration file of react-resizable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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