import { ReactNode } from 'react'; import { CreateParameters, CreateResult, ID, IFolder, UpdateParameters, UpdateResult } from '@edifice.io/client'; import { UseMutationResult } from '@tanstack/react-query'; export interface FormInputs { title: string; description: string; enablePublic: boolean; formSlug: string; allowReplies: boolean; } /** * Custom translations interface for overriding default translations */ export interface ResourceModalTranslations { title?: string; description?: string; cancel?: string; create?: string; save?: string; header?: { create?: string; edit?: string; }; heading?: { general?: string; access?: string; }; placeholder?: { title?: string; description?: string; }; imagepicker?: { add?: string; delete?: string; }; success?: { created?: string; updated?: string; }; } interface BaseProps { /** Controls modal visibility */ isOpen: boolean; /** Custom content to be displayed after the form fields */ children?: ReactNode | ((...props: any) => ReactNode); /** Maximum length for the title input */ inputMaxLength?: number; /** Maximum length for the description textarea */ textareaMaxLength?: number; /** Callback when operation succeeds, with operation result as parameter */ onSuccess: (result: CreateResult | UpdateResult, param: CreateParameters | UpdateParameters) => void; /** Callback when operation is cancelled */ onCancel: () => void; /** Override application code (uses EdificeClient context by default) */ appCode?: string; /** Custom translations for the modal */ translations?: ResourceModalTranslations; } interface CreateProps extends BaseProps { mode: 'create'; createResource?: UseMutationResult; currentFolder: Partial; } interface UpdateProps extends BaseProps { mode: 'update'; updateResource?: UseMutationResult; resourceId: ID; } type Props = CreateProps | UpdateProps; /** * ResourceModal component for creating or updating resources * * @component * @example * ```tsx * setOpen(false)} * onSuccess={(result) => console.log('Resource created:', result)} * currentFolder={{ id: 'default' }} * /> * ``` */ export declare const ResourceModal: ({ isOpen, onCancel, onSuccess, children, appCode: customAppCode, translations: customT, inputMaxLength, textareaMaxLength, ...props }: Props) => import("react/jsx-runtime").JSX.Element; export default ResourceModal;