flipper-plugin
Version:
Flipper Desktop plugin SDK and components
61 lines • 2.36 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 * as React from 'react';
import { DataTableProps } from './data-table/DataTable';
import { DataTableManager } from './data-table/DataTableManager';
import { Atom } from '../state/atom';
type MasterDetailProps<T> = {
/**
* Where to display the details of the currently selected record?
* 'main' (default): show the details in the standard, centrally controlled right sidebar
* 'right': show a resizable pane to the right
* 'bottom': show a resizable pane to the bottom
* 'none': don't show details at all
*/
sidebarPosition?: 'bottom' | 'right' | 'main' | 'overlay' | 'none';
/**
* Component that accepts a 'record' prop that is used to render details.
* If none is provided, a standard `DataInspector` component will be used to display the entire record.
*/
sidebarComponent?: React.FC<{
record: T;
tableManagerRef?: React.RefObject<DataTableManager<T> | undefined>;
}>;
/**
* Default size of the sidebar.
*/
sidebarSize?: number;
/**
* If provided, this atom will be used to store selection in.
*/
selection?: Atom<T | undefined>;
/**
* If provided, this atom will be used to store pause/resume state in, and a pause/resume toggle will be shown
*/
isPaused?: Atom<boolean>;
/**
* If set, a clear button will be shown.
* By default this will clear the dataSource (if applicable).
*/
enableClear?: boolean;
/**
* Callback to be called when clear action is used.
*/
onClear?: () => void;
/**
* If provided, standard menu entries will be created for clear, goToBottom and createPaste
*/
enableMenuEntries?: boolean;
};
export declare function MasterDetail<T extends object>({ dataSource, records, sidebarComponent, sidebarPosition, sidebarSize, onSelect, extraActions, enableMenuEntries, enableClear, isPaused, selection, onClear, ...tableProps }: MasterDetailProps<T> & DataTableProps<T>): JSX.Element;
export declare namespace MasterDetail {
var defaultProps: Partial<MasterDetailProps<any>>;
}
export {};
//# sourceMappingURL=MasterDetail.d.ts.map