import { CSSResult, TemplateResult, nothing, PropertyValues } from "lit";
import { DataAssociation, DataEntity, DataNamespace, DataProperty } from "@api-client/core/build/browser.js";
import ApiElement from "../ApiElement.js";
import '../../define/ui/ui-button.js';
import '../../define/ui/ui-icon-button.js';
import '../../define/ui/ui-icon.js';
import '../../define/ui/ui-radio.js';
type UnionType = "anyOf" | "allOf" | "oneOf" | "not";
/**
 * An element that renders a documentation view for a data entity.
 *
 * @fires edit - When a property is selected for editing. This is only possible when the `editable` property is set.
 * @fires change - When the entity has changed. This is only possible when the `editable` property is set.
 */
export default class DataSchemaDocument extends ApiElement {
    static get styles(): CSSResult[];
    /**
     * The read data namespace.
     */
    root?: DataNamespace;
    /**
     * The entity key to render the schema documentation for
     * @attribute
     */
    key?: string;
    /**
     * The read data entity when the "selected" change.
     */
    protected _entity?: DataEntity;
    /**
     * The key of the property being highlighted.
     * @attribute
     */
    selectedProperty?: string;
    /**
     * When set it activates the drop zone in the properties list to drop an entity as an association.
     * This has no effect when `editable` is not set.
     * @attribute
     */
    associationDropZone?: boolean;
    /**
     * Whether to render the view in the edit-ready model.
     * This mode allows to add new property, create an association, or remove those.
     * It does not allow to manipulate properties of association or properties.
     * @attribute
     */
    editable?: boolean;
    /**
     * When dragging an entity over an existing association this is the key
     * of the association hovered.
     */
    protected _dropAssociationTarget?: string;
    protected willUpdate(cp: PropertyValues<this>): void;
    /**
     * Computes the view value for the property.
     * This should be called before the update is complete so this won't trigger another update.
     */
    protected computeEntity(): void;
    /**
     * Adds an entity with the given key as an association to this entity.
     * This does nothing when the view is not in the `editable` model.
     *
     * Note, we allow to create an association to self. Also note, an entity can have multiple associations to the same target.
     *
     * @param foreignKey The key of the target entity to add.
     * @param parentAssociation When set, it adds another target to an existing association.
     */
    addAssociation(foreignKey: string, parentAssociation?: string): void;
    /**
     * Removes an association from the entity.
     * This does nothing when the view is not in the `editable` model.
     *
     * @param key The key of the association to remove.
     */
    removeAssociation(key: string): void;
    addProperty(name?: string): void;
    removeProperty(key: string): void;
    protected _addPropertyHandler(): void;
    protected _findParentKeyedElement(node: HTMLElement): HTMLElement | null;
    protected _removeHandler(e: Event): void;
    protected _editHandler(e: Event): void;
    protected _associationDragOver(e: DragEvent): void;
    protected _associationDragLeave(e: DragEvent): void;
    protected _associationDrop(e: DragEvent): void;
    protected _dragoverHandler(e: DragEvent): void;
    protected _dropHandler(e: DragEvent): void;
    /**
     * @returns the list of keys of properties that are expanded (children are rendered).
     */
    protected _getExpandedKeys(): string[];
    protected _expandHandler(e: Event): void;
    protected _expandKeydownHandler(e: KeyboardEvent): void;
    /**
     * Toggles an "expanded" state for a property children.
     *
     * @param id Parent property id that has children to toggle visibility of.
     */
    protected _toggleExpandedProperty(id: string): void;
    protected _isRecursive(association: DataAssociation, target: string): boolean;
    protected _unionSelectedHandler(e: Event): void;
    protected render(): TemplateResult | typeof nothing;
    protected _headerTemplate(entity: DataEntity): TemplateResult;
    protected _descriptionTemplate(entity: DataEntity): TemplateResult;
    protected _propertiesTemplate(properties: DataProperty[], associations: DataAssociation[], readonly?: boolean): TemplateResult;
    protected _propertyTemplate(item: DataProperty, readonly?: boolean): TemplateResult;
    /**
     * A template for the data association list item view.
     * Depending on the number of targets of the association it renders the "empty target", single association, or a union association view.
     *
     * @param item The association item to render.
     * @param parent The parent entity of the association.
     * @param readonly Whether to render the view as "read only" (no edit controls). We do not show controls for properties inherited from parents.
     */
    protected _associationTemplate(item: DataAssociation, readonly?: boolean): TemplateResult;
    /**
     * Renders the template for the an association that has one target. This is a classic association where a property
     * is associated with an object.
     */
    protected _singleAssociationTemplate(item: DataAssociation, readonly?: boolean): TemplateResult;
    /**
     * Renders the template for the an association that has multiple targets. This association represents
     * an union of shapes. This means the property can be any, one of, or either of the union shapes.
     */
    protected _unionAssociationTemplate(item: DataAssociation, readonly?: boolean): TemplateResult;
    /**
     * Renders the template for an association that has no target set.
     */
    protected _noTargetAssociationTemplate(item: DataAssociation, readonly?: boolean): TemplateResult;
    protected _associationPropertiesTemplate(item: DataAssociation): TemplateResult;
    protected _unionPropertiesTemplate(item: DataAssociation, type: UnionType): TemplateResult;
    /**
     * Depending on the union type, it renders the union type label and a selector of the union member.
     *
     * This template is intended to use when multiple targets in association were detected.
     *
     * @param item The association item
     * @param type The read from the adapted entity association type.
     * @param entities The list of association targets.
     * @param selected The key of the currently selected association target
     * @returns The template for the union selection in the list of properties.
     */
    protected _unionSelector(item: DataAssociation, type: UnionType, entities: DataEntity[], selected?: string): TemplateResult;
    protected _propertyDescriptionTemplate(description?: string): TemplateResult;
    /**
     * Adds the delete and edit buttons to the tree item.
     * This renders nothing when the property is readonly or the element is not `editable`.
     *
     * @param readonly Indicates the property is a readonly mode (e.g. belongs to an external entity.)
     */
    protected _propertyListActions(type: 'property' | 'association', readonly?: boolean): TemplateResult | typeof nothing;
    /**
     * A template for the display name of a property.
     * @param item The property to render the name filed for
     * @returns The template for the property name.
     */
    protected _paramNameTemplate(item: DataProperty): TemplateResult;
    /**
     * A template for the display name of an association.
     * @param item The property to render the name filed for
     * @returns The template for the property name.
     */
    protected _assocNameTemplate(item: DataAssociation): TemplateResult;
    protected _pillTemplate(label: string, title: string, test: unknown, className?: string): TemplateResult | string;
    /**
     * Renders the template for the parents of the entity.
     *
     * @param parents The parents of the entity. This is an unordered list.
     */
    protected _parentsProperties(parents: DataEntity[]): TemplateResult[] | typeof nothing;
    protected _addButtonTemplate(): TemplateResult | typeof nothing;
}
export {};
//# sourceMappingURL=DataSchemaDocument.d.ts.map