import { type DataDomain, DomainEntityKind, DomainModelKind, DomainNamespaceKind } from '@api-client/core/browser.js';
import type { SupportedInputTypes } from '../types/input.js';
/**
 * Names of the operations supported in the API modeling.
 */
export type ApiModelOperationName = 'list' | 'read' | 'create' | 'update' | 'delete' | 'search';
/**
 * The target of the access configuration.
 */
export type ApiModelAccessTarget = 'api' | 'action' | 'endpoint';
export interface DomainPropertyInputConfig {
    /**
     * The input's type
     */
    type: SupportedInputTypes;
    /**
     * The `pattern` to set on the input.
     */
    pattern?: string;
    /**
     * The `min` to set on the input.
     */
    min?: number;
    /**
     * The `max` to set on the input.
     */
    max?: number;
    /**
     * The `step` to set on the input.
     */
    step?: number;
    /**
     * The `supportingText` to set on the Material Text Field.
     */
    help?: string;
}
/**
 * Information about the selected item in the domain/schema editor.
 */
export interface DomainSelectionInfo {
    /**
     * The key of the selected item
     */
    key: string;
    /**
     * THe kind of the selected item
     */
    kind: string;
    /**
     * Optionally, the parent odf the selected item, if any.
     */
    parent?: string;
    /**
     * The domain of the selected item
     */
    domain: string;
}
/**
 * In the schema editor, information about the current selection
 * and field selection.
 */
export interface SchemaSelectionInfo {
    /**
     * The selection to apply to the current domain.
     */
    selection?: DomainSelectionInfo;
    /**
     * The field selection to apply to the current domain.
     */
    field?: DomainSelectionInfo;
}
/**
 * Items allowed to pick in the Domain Browser.
 *
 * - `entity` - allows to pick an entity from the local domain or external one
 *              when configured by the `withExternal` property.
 * - `data-model` - allows to pick a data model from the local domain or external one
 *                  when configured by the `withExternal` property.
 * - `data-namespace` - Only valid when `withExternal` is set.
 */
export type DomainBrowserPickItem = typeof DomainEntityKind | typeof DomainModelKind | typeof DomainNamespaceKind;
/**
 * The reason to browse the domain:
 * - `pick` - to select a domain element specified in the `allowed` property.
 *
 * More options may be introduced in the future, like 'move' or 'link'.
 */
export type DomainBrowserPickReason = 'pick';
/**
 * The configuration to initialize the Domain Browser element.
 */
export interface DomainBrowseInit {
    /**
     * The reason to browse the domain.
     */
    reason: DomainBrowserPickReason;
    /**
     * The data domain to browse.
     */
    domain: DataDomain;
    /**
     * Specifies which items are allowed to select in the UI to return the result
     * back to the application. By default all data domain items are allowed.
     */
    allowed?: DomainBrowserPickItem[];
    /**
     * When set, it presents the user with the list of recently picked
     * values. This improves the user experience when the pick action
     * happens multiple times in a workflow.
     *
     * Note, when `withExternal` is not set then it will filter out recent items
     * belonging to other namespace.
     */
    withRecent?: boolean;
}
export type DomainBrowseResult = {
    /**
     * The user has picked the value.
     */
    result: 'ok';
    /**
     * The key of the selected item.
     */
    selected: string;
    /**
     * The kind of the selected item.
     */
    kind: string;
    /**
     * The key of the parent data domain.
     */
    domain: string;
} | {
    /**
     * The user has canceled the dialog.
     */
    result: 'canceled';
};
export interface DomainBrowseRecentItem {
    /**
     * The key of the item.
     */
    key: string;
    /**
     * The kind of the item.
     */
    kind: string;
    /**
     * The label of the item.
     */
    label: string;
    /**
     * The domain key of the item.
     */
    domain: string;
    /**
     * The last time the item was picked represented as a timestamp.
     * This is used to sort the items in the list.
     * The most recent item is always at the top of the list.
     */
    used: number;
}
export interface DomainBrowseRecentItems {
    /**
     * The list of recent items.
     */
    items: DomainBrowseRecentItem[];
    /**
     * The last time the list was updated.
     * It is the timestamp of the last time the list was saved to the local storage.
     */
    updated: number;
}
export interface DomainRenameEventDetail {
    /**
     * The key of the domain element that was renamed.
     */
    key: string;
    /**
     * The new label of the domain element.
     */
    label: string;
    /**
     * The namespace of the domain element.
     */
    namespace: string;
    /**
     * The kind of the domain element.
     */
    kind: string;
}
export interface DomainBrowseEventDetail extends DomainBrowseInit {
    /**
     * The promise set by the event listener to return the domain browse result.
     * If undefined after the event is dispatched, it means the event was not handled.
     */
    result?: Promise<DomainBrowseResult | undefined>;
}
/**
 * The detail of the custom event dispatched to request the domain recent items.
 */
export interface DomainRecentEventDetail {
    /**
     * The key of the data domain to load recent items for.
     */
    domain: string;
    /**
     * The allowed items to pick, if any.
     */
    allowed?: DomainBrowserPickItem[];
    /**
     * The promise set by the event listener to return the recent items.
     * If undefined after the event is dispatched, it means the event was not handled.
     */
    result?: Promise<DomainBrowseRecentItem[] | undefined>;
}
/**
 * Event detail for the auto fields selection result
 */
export interface AutoFieldsSelectionResult {
    selectedFields: string[];
}
/**
 * Auto field definition
 */
export interface AutoFieldDefinition {
    id: string;
    name: string;
    description: string;
}
/**
 * Auto field category definition
 */
export interface AutoFieldCategory {
    name: string;
    fields: AutoFieldDefinition[];
}
/**
 * Information about the selected item in the Domain Browser.
 * Used with the `select` custom event as the detail.
 */
export interface DomainBrowseSelectedItem {
    /**
     * The key of the selected item.
     */
    key: string;
    /**
     * The kind of the selected item.
     */
    kind: string;
    /**
     * The namespace key of the selected item.
     */
    namespace: string;
    /**
     * Whether the selected item is a parent item.
     * This is set to true for `DomainModel` and `DomainNamespace` kinds.
     */
    isParent?: boolean;
}
//# sourceMappingURL=types.d.ts.map