|
4 | 4 | // TypeScript Version: 2.3.2 |
5 | 5 |
|
6 | 6 | import * as React from 'react' |
7 | | -import { ScrollViewProperties, ListViewProperties, FlatListProperties } from 'react-native' |
| 7 | +import { ScrollViewProperties, ListViewProperties, FlatListProperties, SectionListProperties } from 'react-native' |
8 | 8 |
|
9 | 9 | interface KeyboardAwareProps { |
10 | 10 | /** |
@@ -98,21 +98,40 @@ interface KeyboardAwareScrollViewProps |
98 | 98 | interface KeyboardAwareFlatListProps<ItemT> |
99 | 99 | extends KeyboardAwareProps, |
100 | 100 | FlatListProperties<ItemT> {} |
| 101 | +interface KeyboardAwareSectionListProps<ItemT> |
| 102 | + extends KeyboardAwareProps, |
| 103 | + SectionListProperties<ItemT> {} |
101 | 104 |
|
102 | 105 | interface KeyboardAwareState { |
103 | 106 | keyboardSpace: number |
104 | 107 | } |
105 | 108 |
|
| 109 | +declare class ScrollableComponent<P, S> extends React.Component<P, S> { |
| 110 | + getScrollResponder: () => void; |
| 111 | + scrollToPosition: (x: number, y: number, animated?: boolean) => void; |
| 112 | + scrollToEnd: (animated?: boolean) => void; |
| 113 | + scrollForExtraHeightOnAndroid: (extraHeight: number) => void; |
| 114 | + scrollToFocusedInput: ( |
| 115 | + reactNode: Object, |
| 116 | + extraHeight: number, |
| 117 | + keyboardOpeningTime: number |
| 118 | + ) => void |
| 119 | +} |
| 120 | + |
106 | 121 | export class KeyboardAwareMixin {} |
107 | | -export class KeyboardAwareListView extends React.Component< |
| 122 | +export class KeyboardAwareListView extends ScrollableComponent< |
108 | 123 | KeyboardAwareListViewProps, |
109 | 124 | KeyboardAwareState |
110 | | -> {} |
111 | | -export class KeyboardAwareScrollView extends React.Component< |
| 125 | + > {} |
| 126 | +export class KeyboardAwareScrollView extends ScrollableComponent< |
112 | 127 | KeyboardAwareScrollViewProps, |
113 | 128 | KeyboardAwareState |
114 | | -> {} |
115 | | -export class KeyboardAwareFlatList extends React.Component< |
116 | | -KeyboardAwareFlatListProps<any>, |
117 | | -KeyboardAwareState |
118 | | -> {} |
| 129 | + > {} |
| 130 | +export class KeyboardAwareFlatList extends ScrollableComponent< |
| 131 | + KeyboardAwareFlatListProps<any>, |
| 132 | + KeyboardAwareState |
| 133 | + > {} |
| 134 | +export class KeyboardAwareSectionList extends ScrollableComponent< |
| 135 | + KeyboardAwareSectionListProps<any>, |
| 136 | + KeyboardAwareState |
| 137 | + > {} |
0 commit comments