File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change 33 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
55import * as React from 'react' ;
6- import type { Milliseconds } from 'firefox-profiler/types' ;
76
8- export type OnMove = (
9- originalValue : {
10- readonly selectionEnd : Milliseconds ;
11- readonly selectionStart : Milliseconds ;
12- } ,
7+ export type OnMove < T > = (
8+ originalValue : T ,
139 dx : number ,
1410 dy : number ,
1511 isModifying : boolean
1612) => void ;
1713
18- type Props = {
19- value : {
20- readonly selectionStart : Milliseconds ;
21- readonly selectionEnd : Milliseconds ;
22- } ;
23- onMove : OnMove ;
14+ type Props < T > = {
15+ value : T ;
16+ onMove : OnMove < T > ;
2417 className : string ;
2518 children ?: React . ReactNode ;
2619} ;
@@ -37,7 +30,7 @@ type State = {
3730 * x and y deltas compared to the mouse position at mousedown.
3831 * During the drag, the additional className 'dragging' is set on the element.
3932 */
40- export class Draggable extends React . PureComponent < Props , State > {
33+ export class Draggable < T > extends React . PureComponent < Props < T > , State > {
4134 _container : HTMLDivElement | null = null ;
4235 _handlers : {
4336 mouseMoveHandler : ( param : MouseEvent ) => void ;
You can’t perform that action at this time.
0 commit comments