import { LayoutSection, NestedRoutePosition, InjectionZone } from '@medusajs/admin-shared';
import { ComponentType } from 'react';

interface WidgetConfig {
    /**
     * The injection zone or zones that the widget should be injected into.
     */
    zone: InjectionZone | InjectionZone[];
    /**
     * An optional stable identifier for the widget, used to persist the user's
     * layout customizations (ordering, section, visibility) for this widget.
     *
     * If omitted, a stable id is derived from the widget's source file path at
     * build time. Provide an explicit id when you want customizations to survive
     * the file being renamed or moved. Plugins should include a unique prefix
     * in their widget ids to avoid collisions with other plugins.
     */
    id?: string;
}
interface LayoutConfig {
    /**
     * A unique identifier for the layout, e.g. `"my-plugin:three-column"`.
     */
    id: string;
    /**
     * The sections that the layout's component exposes. Each section can be
     * targeted by widgets and customized (reordered/hidden) by users.
     */
    sections: LayoutSection[];
}
interface RouteConfig {
    /**
     * An optional label to display in the sidebar. If not provided, the route will not be displayed in the sidebar.
     */
    label?: string;
    /**
     * An optional icon to display in the sidebar together with the label. If no label is provided, the icon will be ignored.
     */
    icon?: ComponentType;
    /**
     * The nested route to display under existing route in the sidebar.
     */
    nested?: NestedRoutePosition;
    /**
     * The ranking of the route among sibling routes. Routes are sorted in ascending order (lower rank appears first).
     * If not provided, the route will be ranked after all routes with explicit ranks.
     */
    rank?: number;
    /**
     * An optional i18n namespace for translating the label. When provided, the label will be treated as a translation key.
     * @example
     * ```ts
     * label: "menuItems.customFeature"
     * translationNs: "my-plugin"
     * // Will translate using: t("menuItems.customFeature", { ns: "my-plugin" })
     * ```
     */
    translationNs?: string;
}

/**
 * Define a widget configuration.
 *
 * @param config The widget configuration.
 * @returns The widget configuration.
 */
declare function defineWidgetConfig(config: WidgetConfig): WidgetConfig;
/**
 * Define a route configuration.
 *
 * @param config The route configuration.
 * @returns The route configuration.
 */
declare function defineRouteConfig(config: RouteConfig): RouteConfig;
/**
 * Define a custom layout configuration.
 *
 * @param config The layout configuration.
 * @returns The layout configuration.
 */
declare function defineLayoutConfig(config: LayoutConfig): LayoutConfig;

export { type LayoutConfig, type RouteConfig, type WidgetConfig, defineLayoutConfig, defineRouteConfig, defineWidgetConfig };
