flipper-plugin
Version:
Flipper Desktop plugin SDK and components
40 lines • 1.63 kB
TypeScript
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import React from 'react';
import { DataSourceView } from './DataSource';
type DataSourceProps<T extends object, C> = {
/**
* The data view to render
*/
dataView: DataSourceView<T, T[keyof T]>;
/**
* additional context that will be passed verbatim to the itemRenderer, so that it can be easily memoized
*/
context?: C;
/**
* Takes care of rendering an item
* @param item The item as stored in the dataSource
* @param index The index of the item being rendered. The index represents the offset in the _visible_ items of the dataSource
* @param context The optional context passed into this DataSourceRenderer
*/
itemRenderer(item: T, index: number, context: C): React.ReactElement;
useFixedRowHeight: boolean;
defaultRowHeight: number;
maxRecords: number;
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
onUpdateAutoScroll?(autoScroll: boolean): void;
emptyRenderer?: null | ((dataView: DataSourceView<T, T[keyof T]>) => React.ReactElement);
};
/**
* This component is UI agnostic, and just takes care of rendering all items in the DataSource.
* This component does not apply virtualization, so don't use it for large datasets!
*/
export declare const DataSourceRendererStatic: <T extends object, C>(props: DataSourceProps<T, C>) => React.ReactElement;
export {};
//# sourceMappingURL=DataSourceRendererStatic.d.ts.map