1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export interface IVoiceover {
|
10 | item: (position: number) => string;
|
11 | lifted: (position: number) => string;
|
12 | dropped: (from: number, to: number) => string;
|
13 | moved: (position: number, up: boolean) => string;
|
14 | canceled: (position: number) => string;
|
15 | }
|
16 | declare interface IItemProps {
|
17 | key?: number;
|
18 | tabIndex?: number;
|
19 | onKeyDown?: (e: React.KeyboardEvent) => void;
|
20 | onMouseDown?: (e: React.MouseEvent) => void;
|
21 | onTouchStart?: (e: React.TouchEvent) => void;
|
22 | onWheel?: (e: React.WheelEvent) => void;
|
23 | style?: React.CSSProperties;
|
24 | ref?: React.RefObject<any>;
|
25 | }
|
26 | declare interface IListProps<Value> {
|
27 | renderItem: (params: {
|
28 | value: Value,
|
29 | props: IItemProps,
|
30 | index?: number,
|
31 | isDragged: boolean,
|
32 | isSelected: boolean
|
33 | }) => React.ReactNode;
|
34 | renderList: (props: {
|
35 | children: any,
|
36 | isDragged: boolean,
|
37 | props: {
|
38 | ref: React.RefObject<any>
|
39 | }
|
40 | }) => React.ReactNode;
|
41 | values: Value[];
|
42 | onChange: (meta: {
|
43 | oldIndex: number,
|
44 | newIndex: number
|
45 | }) => void;
|
46 | transitionDuration: number;
|
47 | lockVertically: boolean;
|
48 | voiceover: IVoiceover;
|
49 | }
|
50 | declare type TEvent = React.MouseEvent | React.TouchEvent | React.KeyboardEvent;
|
51 | declare module.exports: typeof List;
|