@react-native-ohos/flash-list
Version:
FlashList is a more performant FlatList replacement
49 lines • 2.4 kB
TypeScript
/**
* MIT License
*
* Copyright (C) 2024 Huawei Device Co., Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import { ViewabilityConfig } from "react-native";
import { Dimension, Layout } from "recyclerlistview";
/**
* Helper class for computing viewable items based on the passed `viewabilityConfig`.
* Note methods in this class will be invoked on every scroll and should be optimized for performance.
*/
declare class ViewabilityHelper {
/**
* Viewable indices regardless of the viewability config
*/
possiblyViewableIndices: number[];
hasInteracted: boolean;
private viewableIndices;
private lastReportedViewableIndices;
private viewabilityConfig;
private viewableIndicesChanged;
private timers;
constructor(viewabilityConfig: ViewabilityConfig | null | undefined, viewableIndicesChanged: (indices: number[], newlyVisibleIndicies: number[], newlyNonvisibleIndices: number[]) => void);
dispose(): void;
updateViewableItems(horizontal: boolean, scrollOffset: number, listSize: Dimension, getLayout: (index: number) => Layout | undefined, viewableIndices?: number[]): void;
checkViewableIndicesChanges(newViewableIndices: number[]): void;
clearLastReportedViewableIndices(): void;
private isItemViewable;
}
export default ViewabilityHelper;
//# sourceMappingURL=ViewabilityHelper.d.ts.map