|
22 | 22 | //
|
23 | 23 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
24 | 24 |
|
25 |
| -/// <reference types="react" /> |
26 |
| - |
27 | 25 | /// <reference path="globals.d.ts" />
|
28 | 26 |
|
| 27 | +import * as React from 'react'; |
| 28 | + |
29 | 29 | export type MeasureOnSuccessCallback = (
|
30 | 30 | x: number,
|
31 | 31 | y: number,
|
@@ -3635,48 +3635,6 @@ export interface FlatListProperties<ItemT> extends VirtualizedListProperties<Ite
|
3635 | 3635 | removeClippedSubviews?: boolean;
|
3636 | 3636 | }
|
3637 | 3637 |
|
3638 |
| -export interface FlatListStatic<ItemT> extends React.ComponentClass<FlatListProperties<ItemT>> { |
3639 |
| - /** |
3640 |
| - * Exports some data, e.g. for perf investigations or analytics. |
3641 |
| - */ |
3642 |
| - getMetrics: () => { |
3643 |
| - contentLength: number; |
3644 |
| - totalRows: number; |
3645 |
| - renderedRows: number; |
3646 |
| - visibleRows: number; |
3647 |
| - }; |
3648 |
| - |
3649 |
| - /** |
3650 |
| - * Scrolls to the end of the content. May be janky without `getItemLayout` prop. |
3651 |
| - */ |
3652 |
| - scrollToEnd: (params?: { animated?: boolean }) => void; |
3653 |
| - |
3654 |
| - /** |
3655 |
| - * Scrolls to the item at the specified index such that it is positioned in the viewable area |
3656 |
| - * such that viewPosition 0 places it at the top, 1 at the bottom, and 0.5 centered in the middle. |
3657 |
| - * Cannot scroll to locations outside the render window without specifying the getItemLayout prop. |
3658 |
| - */ |
3659 |
| - scrollToIndex: (params: { animated?: boolean; index: number; viewOffset?: number; viewPosition?: number }) => void; |
3660 |
| - |
3661 |
| - /** |
3662 |
| - * Requires linear scan through data - use `scrollToIndex` instead if possible. |
3663 |
| - * May be janky without `getItemLayout` prop. |
3664 |
| - */ |
3665 |
| - scrollToItem: (params: { animated?: boolean; item: ItemT; viewPosition?: number }) => void; |
3666 |
| - |
3667 |
| - /** |
3668 |
| - * Scroll to a specific content pixel offset, like a normal `ScrollView`. |
3669 |
| - */ |
3670 |
| - scrollToOffset: (params: { animated?: boolean; offset: number }) => void; |
3671 |
| - |
3672 |
| - /** |
3673 |
| - * Tells the list an interaction has occured, which should trigger viewability calculations, |
3674 |
| - * e.g. if waitForInteractions is true and the user has not scrolled. This is typically called |
3675 |
| - * by taps on items or by navigation actions. |
3676 |
| - */ |
3677 |
| - recordInteraction: () => void; |
3678 |
| -} |
3679 |
| - |
3680 | 3638 | /**
|
3681 | 3639 | * @see https://facebook.github.io/react-native/docs/sectionlist.html
|
3682 | 3640 | */
|
@@ -8370,8 +8328,47 @@ export type ImageBackground = ImageBackgroundStatic;
|
8370 | 8328 | export var ImagePickerIOS: ImagePickerIOSStatic;
|
8371 | 8329 | export type ImagePickerIOS = ImagePickerIOSStatic;
|
8372 | 8330 |
|
8373 |
| -export var FlatList: FlatListStatic<any>; |
8374 |
| -export type FlatList<ItemT> = FlatListStatic<ItemT>; |
| 8331 | +export class FlatList<ItemT> extends React.Component<FlatListProperties<ItemT>> { |
| 8332 | + /** |
| 8333 | + * Exports some data, e.g. for perf investigations or analytics. |
| 8334 | + */ |
| 8335 | + getMetrics(): { |
| 8336 | + contentLength: number; |
| 8337 | + totalRows: number; |
| 8338 | + renderedRows: number; |
| 8339 | + visibleRows: number; |
| 8340 | + }; |
| 8341 | + |
| 8342 | + /** |
| 8343 | + * Scrolls to the end of the content. May be janky without `getItemLayout` prop. |
| 8344 | + */ |
| 8345 | + scrollToEnd(params?: { animated?: boolean }): void; |
| 8346 | + |
| 8347 | + /** |
| 8348 | + * Scrolls to the item at the specified index such that it is positioned in the viewable area |
| 8349 | + * such that viewPosition 0 places it at the top, 1 at the bottom, and 0.5 centered in the middle. |
| 8350 | + * Cannot scroll to locations outside the render window without specifying the getItemLayout prop. |
| 8351 | + */ |
| 8352 | + scrollToIndex(params: { animated?: boolean; index: number; viewOffset?: number; viewPosition?: number }): void; |
| 8353 | + |
| 8354 | + /** |
| 8355 | + * Requires linear scan through data - use `scrollToIndex` instead if possible. |
| 8356 | + * May be janky without `getItemLayout` prop. |
| 8357 | + */ |
| 8358 | + scrollToItem(params: { animated?: boolean; item: ItemT; viewPosition?: number }): void; |
| 8359 | + |
| 8360 | + /** |
| 8361 | + * Scroll to a specific content pixel offset, like a normal `ScrollView`. |
| 8362 | + */ |
| 8363 | + scrollToOffset(params: { animated?: boolean; offset: number }): void; |
| 8364 | + |
| 8365 | + /** |
| 8366 | + * Tells the list an interaction has occured, which should trigger viewability calculations, |
| 8367 | + * e.g. if waitForInteractions is true and the user has not scrolled. This is typically called |
| 8368 | + * by taps on items or by navigation actions. |
| 8369 | + */ |
| 8370 | + recordInteraction(): void; |
| 8371 | +} |
8375 | 8372 |
|
8376 | 8373 | export var LayoutAnimation: LayoutAnimationStatic;
|
8377 | 8374 | export type LayoutAnimation = LayoutAnimationStatic;
|
|
0 commit comments