import { nothing, type PropertyValues, type TemplateResult } from 'lit';
import { DomainEntity } from '@api-client/core/modeling/DomainEntity.js';
import type { DomainAssociation } from '@api-client/core/modeling/DomainAssociation.js';
import type { DomainProperty } from '@api-client/core/modeling/DomainProperty.js';
import { ModelingElement } from './ModelingElement.js';
import { type EntitySemantic } from '@api-client/core/modeling/Semantics.js';
import type { UiListSelection } from '../../md/list/ui-list.js';
/**
 * Dispatched when a field (either a `DomainProperty` or a `DomainAssociation`) within the entity is selected.
 *
 * @event DomainEntityEditor#select
 * @type {CustomEvent}
 * @property {object} detail - The event details.
 * @property {string} detail.key - The key of the selected field.
 * @property {string} detail.kind - The kind of the selected field (e.g., `DomainPropertyKind`,
 * `DomainAssociationKind`).
 */
/**
 * Dispatched when the user wants to navigate to a parent entity.
 *
 * @event DomainEntityEditor#openentity
 * @type {CustomEvent}
 * @property {object} detail - The event details.
 * @property {string} detail.key - The key of the parent entity to navigate to.
 * @property {string} detail.kind - The kind of the parent entity. It will always be `DomainEntityKind`.
 */
/**
 * An element that provides an editor interface for a domain entity.
 * @fires DomainEntityEditor#select - A custom event with the `key` and `type` when a property was selected.
 * @fires DomainEntityEditor#openentity - A custom event with the `key` and `type` when a property was selected.
 * @fires domainbrowserbrowse - Dispatched when the user clicks on the "choose parent" button. The detail object
 *                              has the full intent configuration.
 * @fires domainrename - Dispatched when the user renames the entity.
 */
export default class DomainEntityEditor extends ModelingElement {
    protected domainElement: DomainEntity | undefined;
    /**
     * The currently selected tab in the editor.
     * @attribute
     */
    accessor contentTab: 'design' | 'preview';
    /**
     * The key of the currently selected property.
     * @attribute
     */
    accessor selectedProperty: string | undefined;
    /**
     * The mime type of the preview to render.
     * @attribute
     */
    accessor mime: string;
    /**
     * When set, the preview tab will generate example (mock) data.
     * By default it only render values as defined in the schema.
     * @attribute
     */
    accessor mockValues: boolean;
    /**
     * The generated schema preview.
     */
    accessor schemaPreview: string | undefined;
    protected willUpdate(cp: PropertyValues<this>): void;
    protected computeEntity(): void;
    handleMetaChange(e: Event): void;
    handleContentTabChange(e: Event): void;
    /**
     * Generates the example data for the preview tab.
     */
    generateExample(): void;
    notifyChange(): void;
    /**
     * A handler for the mime type change event.
     */
    handleMimeChange(e: Event): void;
    /**
     * A handler for the field item click to select a field.
     * @param e The click event.
     */
    handleFieldListSelect(e: CustomEvent<UiListSelection>): void;
    /**
     * Selects a field in the editor and dispatches a custom event with the key and kind of the field.
     * @param key The key of the field to select.
     * @param kind The kind of the field to select.
     */
    select(key: string, kind: string): void;
    addProperty(name?: string): void;
    addAssociation(name?: string): void;
    handleFieldMenuSelect(e: CustomEvent<{
        item: HTMLElement;
    }>): void;
    /**
     * Opens the auto fields selection dialog
     */
    openAutoFieldsDialog(): void;
    protected handleChooseParent(): Promise<void>;
    protected handleDeleteParent(e: Event): void;
    protected handleNavigateParent(e: Event): void;
    addParentEntity(key: string, domain?: string): void;
    protected handleInheritanceDragEnter(e: DragEvent): void;
    protected handleInheritanceDragOver(e: DragEvent): void;
    protected handleInheritanceDragLeave(e: DragEvent): void;
    protected handleInheritanceDrop(e: DragEvent): void;
    protected handleTaxonomyChange(e: Event): void;
    protected handleTaxonomyClear(e: Event): void;
    protected handleFieldContextMenuSelect(e: CustomEvent<{
        item: HTMLElement;
    }>): void;
    /**
     * Duplicates a field (property or association).
     * Creates a copy with the same properties but a new unique name.
     * @param key The key of the field to duplicate.
     * @param kind The kind of the field to duplicate.
     */
    duplicateField(key: string, kind: string): void;
    /**
     * Duplicates a property field.
     * @param key The key of the property to duplicate.
     */
    protected duplicateProperty(key: string): void;
    /**
     * Duplicates an association field.
     * @param key The key of the association to duplicate.
     */
    private duplicateAssociation;
    /**
     * Generates a unique name by appending a number to the base name.
     * @param baseName The base name to make unique.
     * @returns A unique name within the current entity.
     */
    protected generateUniqueName(baseName: string): string;
    deleteField(key: string, kind: string): void;
    openEntity(key: string): void;
    /**
     * Converts a property to an association.
     * Keeps as many properties as possible.
     * @param key The key of the property to convert.
     */
    convertToAssociation(key: string): void;
    /**
     * Converts an association to a property.
     * Keeps as many properties as possible.
     * @param key The key of the association to convert.
     */
    convertToProperty(key: string): void;
    protected handleTaxonomySelect(e: CustomEvent<{
        item: HTMLElement;
    }>): void;
    protected handleDeleteTaxonomy(e: Event): void;
    protected render(): TemplateResult | typeof nothing;
    protected renderForm(model: DomainEntity): TemplateResult;
    protected renderMetaInputs(model: DomainEntity): TemplateResult;
    protected renderParentEntity(model: DomainEntity): TemplateResult;
    protected renderParentItems(model: DomainEntity): TemplateResult | typeof nothing;
    protected renderContentTabs(): TemplateResult;
    protected renderTabsContent(model: DomainEntity): TemplateResult;
    protected renderDesignTabContent(model: DomainEntity): TemplateResult;
    protected renderPreviewTabContent(): TemplateResult;
    protected renderPreviewMimeSelector(): TemplateResult;
    protected renderFieldsSection(model: DomainEntity): TemplateResult;
    protected renderFieldAddButton(): TemplateResult;
    protected renderFieldsEmptyState(): TemplateResult;
    protected renderFieldsList(items: DomainEntity): TemplateResult;
    protected renderField(item: DomainAssociation | DomainProperty): TemplateResult;
    protected createFieldContextualMenu(item: DomainAssociation | DomainProperty): TemplateResult;
    protected renderDataGovernanceSection(model: DomainEntity): TemplateResult;
    protected renderTaxonomyInput(model: DomainEntity): TemplateResult | typeof nothing;
    protected renderSelectedSemantics(selected: EntitySemantic[]): TemplateResult | typeof nothing;
    protected renderTaxonomyItem(semantic: EntitySemantic): TemplateResult;
    protected renderTaxonomyCategories(categories: Record<string, EntitySemantic[]>): TemplateResult[];
}
//# sourceMappingURL=DomainEntityEditor.d.ts.map