diff --git a/types/react-rnd/index.d.ts b/types/react-rnd/index.d.ts index 9164b409ce..31d477ca5e 100644 --- a/types/react-rnd/index.d.ts +++ b/types/react-rnd/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-rnd 7.3 +// Type definitions for react-rnd 7.4 // Project: https://github.com/bokuweb/react-rnd // Definitions by: Ragg +// fsubal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 import React = require('react'); @@ -18,6 +19,17 @@ declare namespace Rnd { | 'topLeft' | 'topRight'; + interface Enable { + bottom?: boolean; + bottomLeft?: boolean; + bottomRight?: boolean; + left?: boolean; + right?: boolean; + top?: boolean; + topLeft?: boolean; + topRight?: boolean; + } + interface HandleClasses { bottom?: string; bottomLeft?: string; @@ -90,7 +102,8 @@ declare namespace Rnd { resizeHandleStyles: HandleStyles; lockAspectRatio: boolean; - enableResizing: boolean; + enableResizing?: Enable; + disableDragging?: boolean; onResizeStart: () => void; onResize: () => void; diff --git a/types/react-rnd/react-rnd-tests.tsx b/types/react-rnd/react-rnd-tests.tsx index ee434117fe..9f1cbc593c 100644 --- a/types/react-rnd/react-rnd-tests.tsx +++ b/types/react-rnd/react-rnd-tests.tsx @@ -13,7 +13,13 @@ const onResize: Rnd.ResizeHandler = (e, direction, ref, delta, position) => { className="class" lockAspectRatio maxWidth={100} - enableResizing={false} + enableResizing={{ + bottom: true, + bottomLeft: true, + bottomRight: false, + left: false + }} + disableDragging={false} resizeHandleStyles={{ top: { background: '#000' } }}