import { QdTooltip } from '../../core/core.module';
import { QdSearchOptions } from '../../search/model/search-options.interface';
import { QdFilterConfigData } from '../../filter/model/filter-config.interface';
export interface QdSectionConfig {
    /**
     * @description Defines the title of the section.
     *
     * - The `i18n` property specifies the translation key for the title.
     */
    title?: QdSectionTitle;
    /**
     * @description Configures the action for the section.
     *
     * **Note**: `action` and `actions` cannot be used together. Only `actions` should be used.
     *
     * @deprecated Use `actions` instead. The `action` key will be removed in v18.
     */
    action?: QdLegacySectionActionConfig;
    /**
     * @description Configures the actions of the section
     *
     * - **Single Action**: If only one action is defined, a standard QdButton is displayed with an optional specified icon.
     * - **Multiple Actions**: If multiple action types are defined, a QdMenuButton is used, showing each action as a dropdown menu item.
     */
    actions?: (QdPredefinedSectionActionConfig | QdSectionActionConfig)[];
    /**
     * @description All Actions can be disabled at once by setting the isDisabled property.
     *
     * - @default false
     */
    areActionsDisabled?: boolean;
    /**
     * @description Configures the search functionality in the section toolbar.
     *
     * - To enable the search with default configuration, set this property to an empty object `{}`.
     */
    search?: QdSearchOptions;
    /**
     * @description Configures the filter functionality in the section toolbar.
     */
    filter?: QdFilterConfigData;
    /**
     * @description Configures collapsible sections.
     */
    collapse?: QdSectionCollapse;
}
interface QdSectionTitle {
    /**
     * @description Specifies the translation key for the title of the section.
     */
    i18n?: string;
    /**
     * @description Tooltip configuration for the section title.
     *
     * Renders an info icon next to the section title only when `tooltip` is provided.
     */
    tooltip?: QdTooltip;
}
export interface QdLegacySectionActionConfig {
    /**
     * @description Defines the icon to display for the action. Leave empty if no icon is needed.
     *
     * - For a list of available icons, see {@link https://quadrel.ezv.admin.ch/?path=/story/components-icon--icons-set}.
     */
    icon?: string;
    /**
     * @description Specifies the type of the action. This value will be emitted in the action output callback.
     *
     * - Predefined type: `"addNew"` automatically applies a plus icon and a default i18n key.
     */
    type?: QdSectionActionType;
    /**
     * @description Specifies the translation key for the action label.
     */
    i18n?: string;
}
/**
 * @description Configuration for predefined actions like `"addNew"`.
 *
 * - These actions have default configurations, including a plus icon and a default translation key, but these defaults can be overridden as needed.
 * - Predefined actions are typically used for standardized actions such as adding new items or files.
 *
 *  * - **Extensible**: This configuration is designed to allow the addition of more predefined actions in the future.
 */
export interface QdPredefinedSectionActionConfig {
    /**
     * @description Specifies the action type. Restricted to `"addNew"`.
     *
     * - The type `"addNew"` ensures that the action is recognized as a predefined action and automatically applies default settings unless overridden.
     */
    type: 'addNew';
    /**
     * @description Defines the icon to display for the action.
     *
     * - By default, a plus icon is applied, but this can be overridden by specifying a custom icon.
     * - If left undefined, the `plus` icon will be used.
     */
    icon?: string;
    /**
     * @description Defines the label for the action, including the translation key.
     *
     * - The label provides the text to display in the UI and is localized using the provided `i18n` key.
     * - If left undefined, a default translation key will be used.
     */
    label?: {
        i18n: string;
    };
    /**
     * @description Specifies the function to execute when the action is triggered.
     *
     * - This handler allows custom behavior for the action, enabling integration with other components like the **QdFileCollector**.
     * - For example, clicking the action could trigger an additional callback or emit an event.
     */
    handler?: () => void;
    /**
     * @description Indicates whether the action is disabled.
     *
     * - A disabled action will appear grayed out and cannot be interacted with.
     *
     * - @default `false`
     */
    isDisabled?: boolean;
    /**
     * @description Indicates whether the action is hidden.
     *
     * - @default `false`
     */
    isHidden?: boolean;
    /**
     * @description Controls in which operation mode this action is shown. May be set by the QLS ('edit' or 'view').
     *
     * - Use `'edit'` to show the action only in editable mode.
     * - Use `'view'` to show the action only in viewonly mode.
     * - If not set, the action is shown in **both modes**.
     *
     * **Note:** The `viewonly` flag in the table configuration overrides any external operation mode.
     *
     * * @example
     * ```ts
     * {
     *   type: 'addNew',
     *   operationMode: 'edit',
     *   handler: ...
     * }
     * ```
     */
    operationMode?: QdSectionActionOperationMode;
}
/**
 * @description Configuration for custom actions.
 *
 * - Custom actions allow users to define specific behaviors and properties for actions that are not predefined (e.g., `"addNew"`).
 * - These actions are flexible and can include custom labels, handlers, icons, and other settings.
 */
export interface QdSectionActionConfig {
    /**
     * @description Specifies the action type. Excludes `"addNew"`.
     *
     * - Custom types should be unique strings representing the action's purpose (e.g., `"delete"`, `"edit"`).
     * - This ensures that `"addNew"` is reserved for predefined actions.
     */
    type?: Exclude<QdSectionActionType, 'addNew'>;
    /**
     * @description Defines the label for the action, including the translation key.
     *
     * - The `i18n` key provides the localized text for the action's label, which is displayed in the UI.
     */
    label: {
        i18n: string;
    };
    /**
     * @description Specifies the function to execute when the action is triggered.
     *
     * - This is a mandatory property to ensure that every custom action has a defined behavior.
     */
    handler: () => void;
    /**
     * @description Defines the icon to display for the action.
     *
     * - The icon visually represents the action in the UI.
     * - **Note**: If multiple actions are present, the icon is ignored because the actions are displayed in a dropdown menu (MenuButton).
     */
    icon?: string;
    /**
     * @description Indicates whether the action is disabled.
     *
     * - Disabled actions are visible in the UI but grayed out and cannot be interacted with.
     *
     * - @default `false`
     */
    isDisabled?: boolean;
    /**
     * @description Indicates whether the action is hidden.
     *
     * - @default `false`
     */
    isHidden?: boolean;
    /**
     * @description Controls in which operation mode this action is shown. May be set by the QLS ('edit' or 'view').
     *
     * - Use `'edit'` to show the action only in editable mode.
     * - Use `'view'` to show the action only in viewonly mode.
     * - If not set, the action is shown in **both modes**.
     *
     * **Note:** The `viewonly` flag in the table configuration overrides any external operation mode.
     *
     * * @example
     * ```ts
     * {
     *   type: 'MyAction',
     *   operationMode: 'edit',
     *   handler: ...
     * }
     * ```
     */
    operationMode?: QdSectionActionOperationMode;
}
/**
 * @description Operation mode provided by the Quadrel Layout System (QLS)
 */
export type QdSectionActionOperationMode = 'edit' | 'view';
/**
 * Action type for sections defined in the configuration.
 *
 * - **"addNew"**: A pre-configured action type that automatically displays a plus icon and uses a default i18n key.
 *   This type is also used for communication between components, such as in the `FileCollector` component.
 * - **Custom Action Types**: For other actions, specify a unique string to define custom action types.
 *
 * - **Note**: When a QdMenuButton is rendered, the button does not display any icons.
 * - Additionally, only one action of type `"addNew"` is permitted if multiple actions are defined.
 */
export type QdSectionActionType = 'addNew' | string;
/**
 * @description Controls if a section can collapse and if its content starts hidden.
 */
export interface QdSectionCollapse {
    /**
     * @description Allows the section to collapse.
     *
     * - @default false
     */
    isEnabled: boolean;
    /**
     * @description Sets if the content is hidden. Only applies if `isEnabled` is `true`.
     *
     * - @default false
     */
    isContentHidden?: boolean;
}
export {};
//# sourceMappingURL=section-config.interface.d.ts.map