UNPKG

flipper-plugin

Version:

Flipper Desktop plugin SDK and components

65 lines 2.73 kB
/** * 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/DataTableWithPowerSearch'; import { DataTableManager } from './data-table/DataTableWithPowerSearchManager'; 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>; }>; /** * Size of the sidebar, can be controlled by listening to onResize, otherwise the initial size */ sidebarSize?: number; /** * Fired when user changes sidebar, allows you to control size of side bar and have it persist at whatever level is appropriate */ onResize?: (width: number, height: number) => void; /** * 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 MasterDetailWithPowerSearch<T extends object>({ dataSource, records, sidebarComponent, sidebarPosition, sidebarSize, onResize, onSelect, actionsTop, extraActions, enableMenuEntries, enableClear, isPaused, selection, onClear, actionsRight, ...tableProps }: MasterDetailProps<T> & DataTableProps<T>): JSX.Element; export declare namespace MasterDetailWithPowerSearch { var defaultProps: Partial<MasterDetailProps<any>>; } export {}; //# sourceMappingURL=MasterDetailWithPowerSearch.d.ts.map