import React from 'react'; type GetContainerProps = (props?: Record) => { ref: React.RefCallback; onMouseOver: (event: React.MouseEvent) => void; onMouseOut: (event: React.MouseEvent) => void; onMouseDown?: (event: React.MouseEvent) => void; onKeyUp?: (event: React.KeyboardEvent) => void; readOnly?: boolean; } & Record; type GetViewerProps = (props?: Record) => { mode: 'view' | 'edit'; readOnly?: boolean; } & Record; type GetEditorProps = (props?: Record) => { mode: 'view' | 'edit'; onBlur: () => void; editorRef: (el: HTMLElement | null) => void; readOnly?: boolean; } & Record; type GetEditButtonProps = (props?: Record) => { onClick: () => void; onFocus: () => void; onBlur: () => void; isVisible: boolean; buttonRef: (el: Element) => void; readOnly?: boolean; } & Record; type EditableRenderProps = { mode: string; getContainerProps: GetContainerProps; getViewerProps: GetViewerProps; getEditorProps: GetEditorProps; getEditButtonProps: GetEditButtonProps; }; type EditableOwnProps = { /** * If `'view'`: the view component is rendered, * if `'edit'`: the edit component is rendered */ mode: 'view' | 'edit'; /** * Called when the component's mode changes. */ onChangeMode: (newMode: string) => void; /** * Function that you can supply that will return the children of this component. * It has one parameter has the following fields: * - mode: `view` or `edit`, depending on whether the view or the editor should be rendered. * - getContainerProps(props) - Props to be spread onto the container element * - getEditorProps(props) - Props to be spread onto the editor element * - getEditButtonProps(props) - Props to be spread onto the edit button element */ children?: (props: EditableRenderProps) => React.ReactNode; /** * Identical to children */ render?: (props: EditableRenderProps) => React.ReactNode; /** * The current value. * The value is managed by the consuming app, but we need to tell Editable * it's changed or it won't re-render */ value?: any; /** * Called when Editable switches from edit to view mode and the value has changed. */ onChange?: (value: any) => void; /** * The mode is fixed as 'view' */ readOnly?: boolean; /** * provides a reference to the underlying html root element (container) */ elementRef?: (element: Element | null) => void; }; type PropKeys = keyof EditableOwnProps; type AllowedPropKeys = Readonly>; type EditableProps = EditableOwnProps; declare const allowedProps: AllowedPropKeys; type EditableState = { showModeToggle: boolean; valueOnEdit: any; }; export type { EditableProps, EditableRenderProps, EditableState, GetContainerProps, GetEditButtonProps, GetEditorProps, GetViewerProps }; export { allowedProps }; //# sourceMappingURL=props.d.ts.map