export interface JSONObject {
    [key: string]: any;
}
/**
 * Decision emitted when a user resolves AI-generated metadata approval records.
 */
export type RoCrateApprovalDecision = "accept" | "reject" | "manual-edit";
export interface EntityTemplatesParams {
    type?: Array<any> | string;
    queryString?: string;
    limit?: number;
}
export interface Lookup {
    /**
     * Look up entity templates in the host application.
     *
     * The component passes the requested `@type`, the user's search string, and a
     * result limit. Most host applications should search at least `@id` and
     * `name`.
     */
    entityTemplates(params: EntityTemplatesParams): Promise<void>;
}
export interface RoCrateApprovalSaveData {
    /**
     * Updated approval data after the decision has been applied.
     */
    roCrateApproval: JSONObject | JSONObject[] | undefined;
    /**
     * Entity whose approval records were changed.
     */
    entityId: string;
    /**
     * Property whose approval records were changed. Entity-level bulk decisions
     * use `"*"`.
     */
    propertyName: string;
    /**
     * User decision that caused the approval data update.
     */
    decision: RoCrateApprovalDecision;
    /**
     * Approval records affected by the decision.
     */
    approvalRecords: JSONObject[];
    /**
     * Optional edited value associated with a manual decision.
     */
    value?: any;
}
export interface RemoveProfilePayload {
    /**
     * Entity currently being edited.
     */
    entityId: string;
    /**
     * Profile tab selected for removal.
     */
    tab: {
        name?: string;
        label?: string;
        hasData?: boolean;
        missingRequiredData?: boolean;
        description?: string;
        inputs?: JSONObject[];
        profileUrl?: string;
    };
}
export type RecrateCrateBuilderProps = {
    /**
     * RO-Crate JSON to display and edit.
     */
    crate?: JSONObject;
    /**
     * Optional AI metadata approval records, usually loaded from
     * `ro-crate-approval.json`.
     *
     * Records may be supplied as an array, as `{ items: [...] }`, or as a single
     * entity approval object with an `approval` array. Pending records drive the
     * AI review banner, field-level diffs, edited-field badges, deleted entity
     * review cards, and the AI-edited quick filter.
     */
    roCrateApproval?: JSONObject | JSONObject[];
    /**
     * Profile to use when editing the crate.
     */
    profile?: JSONObject;
    /**
     * Initially selected entity id.
     */
    entityId?: string;
    /**
     * Host-provided lookup callbacks for template and data-pack searches.
     */
    lookup?: Lookup;
    /**
     * Enable context editor functionality. Only used at component initialization
     * time.
     */
    enableContextEditor?: boolean;
    /**
     * Enable crate preview functionality. Only used at component initialization
     * time.
     */
    enableCratePreview?: boolean;
    /**
     * Enable entity browser functionality. Only used at component initialization
     * time.
     */
    enableBrowseEntities?: boolean;
    /**
     * Enable entity template save functionality. Only used at component
     * initialization time.
     */
    enableTemplateSave?: boolean;
    /**
     * Enable bulk-add functionality. Only used at component initialization time.
     */
    enableBulkAdd?: boolean;
    /**
     * Show add/remove profile controls in the profile tab rail.
     *
     * When omitted, the component enables these controls automatically if
     * `onAddNewProfileRequest` or `onRemoveProfile` is supplied.
     */
    enableProfileActions?: boolean;
    /**
     * If true, the component does not allow edits and does not call save
     * callbacks.
     */
    readonly?: boolean;
    /**
     * Enable the reverse link browser sidebar.
     */
    enableReverseLinkBrowser?: boolean;
    /**
     * Whether the component is hosted as a web component.
     */
    webComponent?: boolean;
    /**
     * Let the component manage browser history internally.
     */
    enableInternalRouting?: boolean;
    /**
     * Purge unlinked entities from the crate before emitting it for saving.
     */
    purgeUnlinkedEntities?: boolean;
    /**
     * Localization language. Supported values are `en` and `hu`; defaults to
     * `en`.
     */
    language?: string;
    /**
     * Called when the component is ready.
     */
    onReady?: () => void;
    /**
     * Called when the component reports an error.
     */
    onError?: (message: any) => void;
    /**
     * Called when the component reports a warning.
     */
    onWarning?: (warnings: any) => void;
    /**
     * Called when the crate has changed.
     */
    onSaveCrate?: (saveData: {
        crate: JSONObject;
        entityId?: string;
    }) => void;
    /**
     * Called when AI approval records change.
     *
     * Accepting a field marks its matching approval records as approved.
     * Rejecting a field or choosing manual edit removes those pending approval
     * records from the approval state. The host application is responsible for
     * persisting the returned `roCrateApproval` payload.
     */
    onSaveRoCrateApproval?: (saveData: RoCrateApprovalSaveData) => void;
    /**
     * Called when the crate is to be saved as a template.
     *
     * If implemented, also pass a `Lookup` object with `entityTemplates` so saved
     * templates can be looked up and reused in the component.
     */
    onSaveCrateAsTemplate?: (name: string, crate: JSONObject) => void;
    /**
     * Called when the entity is to be saved as a template.
     *
     * This is the current React component prop.
     */
    onSaveEntityTemplate?: (entity: JSONObject) => void;
    /**
     * Legacy entity-template callback name kept for consumers that still import
     * the public type.
     */
    onSaveEntityAsTemplate?: (name: string, entity: JSONObject) => void;
    /**
     * Called when the quick filter/settings panel visibility changes.
     */
    onQuickSettingsVisibleChange?: (visible: boolean) => void;
    /**
     * Called when the editor requests that the host add a profile to the current
     * entity.
     *
     * The host should update `profile` and/or `crate` as needed; the component
     * remembers existing profile tabs and selects the newly added tab after the
     * update.
     */
    onAddNewProfileRequest?: (requested: boolean) => void;
    /**
     * Called when the editor requests removal of a profile tab from the current
     * entity.
     *
     * The payload includes the entity id and the tab metadata, including whether
     * the tab currently has data or missing required fields.
     */
    onRemoveProfile?: (payload: RemoveProfilePayload) => void;
    /**
     * Called when the crate builder navigates to a context entity.
     */
    onNavigation?: (entity: {
        "@id": string;
        "@type"?: string[];
        name?: string;
    }) => void;
    /**
     * Location of layout tabs.
     */
    tabLocation?: "left" | "right" | "top" | "bottom";
    /**
     * Show or hide the main control bar.
     */
    showControls?: boolean;
    /**
     * When the crate/entity is updated, stay on the selected tab instead of
     * jumping back to About.
     */
    resetTabOnEntityChange?: boolean;
    /**
     * When the profile is updated, stay on the selected tab instead of jumping
     * back to About.
     */
    resetTabOnProfileChange?: boolean;
    /**
     * Optionally control quick filter/settings panel visibility from a custom
     * header.
     *
     * When visible, the panel lets users toggle field help, filter fields by name
     * or value, hide empty fields, and, when AI approval data exists, show only
     * AI-edited fields.
     */
    quickSettingsVisible?: boolean;
    /**
     * Optional scope identifier used to isolate editor state between multiple
     * concurrent component instances.
     */
    stateScopeKey?: string;
    /**
     * If true, text fields containing a URL are marked up with an entity link. If
     * false, the URL is shown as plain text.
     */
    enableUrlMarkup?: boolean;
    /**
     * If true, add timestamps reflecting the last time an entity was updated.
     */
    enableEntityTimestamps?: boolean;
};
