import { VoidFunc, VoidFuncNoParam } from "../../../fd-toolbox/functions/internal-getter-setter-functions";
import { JSX } from "react";
import { WithId } from "../../../fd-toolbox-core/types/resource-with-id";
import { WithIndexer } from "../../../fd-toolbox-core/types/with-indexer";
import { UiResourceMeta } from "../ui-resource-meta";
import { TabsName } from "./edit-resource-constants";
import { EditResourceConfig } from "./config/edit-resource-config";
/**
 * Props for {@link EditResource}
 */
export interface EditResourceProps {
    /**
     * Unique identifier for the resource being edited, or an empty Uuid when creating a new resource
     */
    resourceId?: string;
    /**
     * Indicates if this form is for creating a new resource
     */
    isNew?: boolean;
    /**
     * Event handler called when resource is successfully deleted
     */
    onDeleteComplete?: VoidFuncNoParam;
    /**
     * Event handler called when the cancel button is clicked
     */
    onCancelClick?: VoidFuncNoParam;
    /**
     * Event handler called when the resource is saved, receiving the saved resource object with all form values, but with an empty Uuid in the id field
     */
    onSaveClick?: VoidFunc<WithId>;
    /**
     * Event handler called when resource is successfully saved
     */
    onSaveComplete?: VoidFunc<boolean, string>;
    /**
     * Event handler called when resource loading completes
     */
    onLoadComplete?: VoidFuncNoParam;
    /**
     * Event handler called when refreshing data display is required (e.g., updating tables/lists after creating or updating a resource)
     */
    onRefreshResource?: VoidFuncNoParam;
    /**
     * Pre-loaded resource data (if not provided, will be loaded using resourceId)
     */
    resource?: WithId;
    /**
     * Complete Ui metadata definition for the resource that provides structural information and rendering rules
     */
    uiResourceMeta: UiResourceMeta;
    /**
     * Uuid value of the related resource that will be automatically filled in the field specified by {@link relatedResourceName}
     */
    relatedResourceId?: string;
    /**
     * Name of the field that should be automatically filled with the related resource's Uuid when creating a related resource
     */
    relatedResourceName?: string;
    /**
     * Event handler called when form validity changes
     */
    onFormValidityChange?: VoidFunc<boolean>;
    /**
     * Event handler called when the updated property data has been saved
     */
    onPropertyUpdateComplete?: VoidFuncNoParam;
    /**
     * Event handler called when a new saving process is initiated
     */
    onSavingStarting?: VoidFuncNoParam;
    /**
     * Event handler called when a saving process completes
     */
    onSavingEnding?: VoidFuncNoParam;
    /**
     * Configuration for the EditResource component
     */
    config?: EditResourceConfig;
    /**
     * Default active tab
     */
    defaultTab?: TabsName;
    /**
     * Ref exposing save / getAllFormValues methods (same as before)
     */
    ref?: React.Ref<EditResourceHandle>;
}
/**
 * Methods of {@link EditResource} component available via ref
 */
export interface EditResourceHandle {
    /**
     * Triggers form field validation and saves the resource.
     * Requires onSaveComplete prop to be provided.
     */
    save: (shouldCancel: boolean) => Promise<void>;
    /**
     * Returns all form field values from react-hook-form as a key-value object where field names are keys
     */
    getAllFormValues: () => WithIndexer<unknown>;
}
export declare const EditResourceDisplayName = "EditResource";
/**
 * Form component for creating or editing resources
 *
 * @see {@link EditResourceProps} for all available props
 * @see {@link EditResourceHandle} for methods available via ref
 * @see {@link EditResourceConfig} for customization options
 */
export declare function EditResource({ resourceId, uiResourceMeta: uiResourceMetaProp, resource: resourceFromProp, isNew: isNewProp, onDeleteComplete, onCancelClick, onSaveClick, onSaveComplete, onLoadComplete, onRefreshResource, relatedResourceId, relatedResourceName, onFormValidityChange, onPropertyUpdateComplete, onSavingStarting, onSavingEnding, config, defaultTab, ref, }: EditResourceProps & {
    ref?: React.Ref<EditResourceHandle>;
}): JSX.Element;
export declare namespace EditResource {
    var displayName: string;
}
