mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #26070 from fsubal/fix/react-rnd
[react-rnd] Mistakenly typed react-rnd enableResizing, & added disableDragging
This commit is contained in:
Vendored
+15
-2
@@ -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 <https://github.com/Ragg->
|
||||
// fsubal <https://github.com/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;
|
||||
|
||||
@@ -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' }
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user