UNPKG

1.42 kBJavaScriptView Raw
1/**
2 * Flowtype definitions for List
3 * Generated by Flowgen from a Typescript Definition
4 * Flowgen v1.3.0
5 * Author: [Joar Wilk](http://twitter.com/joarwilk)
6 * Repo: http://github.com/joarwilk/flowgen
7 */
8
9export 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}
16declare 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}
26declare 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}
50declare type TEvent = React.MouseEvent | React.TouchEvent | React.KeyboardEvent;
51declare module.exports: typeof List;