import { ReactNode } from "react"; import React from "react"; /** Generic editor for a list of items that shows the items within a Bootstrap 3 list-group. * Adding and editing are done via a popup if present */ export declare function ListEditorComponent(props: { items: T[]; onItemsChange: (items: T[]) => void; /** Render the item in the list. Already inside a list-group-item */ renderItem: (item: T, index: number, onItemChange: (item: T) => void) => ReactNode; /** Render the editor in the popup modal */ renderEditor?: (item: Partial, onItemChange: (item: Partial) => void) => ReactNode; /** Create a new item. Doesn't allow add if not present. If editor not present, must return valid item */ createNew?: () => Partial; /** Validate an item. True for valid */ validateItem?: (item: Partial) => boolean; /** Override label of add button */ addLabel?: string; /** Prompt to confirm deletion */ deleteConfirmPrompt?: string | ((item: T) => string); /** Allows list to be re-ordered by dragging. Returns unique key for each item. * Can just return index for simplicity. */ getReorderableKey?: (item: T, index: number) => any; /** Puts an edit on the right which must be clicked to edit */ editLink?: boolean; /** Selected item is highlighted */ selectedIndex?: number; /** Modal size. Default is "large" */ modalSize?: "large" | "full" | "normal" | "small" | "x-large"; /** Title of the modal */ modalTitle?: React.ReactNode; }): React.JSX.Element;