import type { ComponentType, LazyExoticComponent, ReactNode } from 'react';
/**
 * Extension configuration for SmartStack frontend
 */
export interface ExtensionConfig {
    /**
     * Page component overrides
     * Key: NavRoute path (e.g., 'administration.users')
     * Value: React component to render instead of the default page
     *
     * @example
     * ```tsx
     * pages: {
     *   'administration.users': CustomUsersPage,
     *   'administration.users.detail': CustomUserDetailPage,
     * }
     * ```
     */
    pages?: Record<string, ComponentType<PageProps>>;
    /**
     * Slot content injections
     * Key: Slot name (e.g., 'users.form.fields.after')
     * Value: React component, render function, or array of components
     *
     * @example
     * ```tsx
     * slots: {
     *   'users.form.fields.after': UserExtensionFields,
     *   'users.table.columns.after': [EmployeeColumn, DepartmentColumn],
     * }
     * ```
     */
    slots?: Record<string, SlotContent>;
    /**
     * Table column extensions
     * Key: Table identifier (e.g., 'users', 'roles')
     * Value: Array of column definitions to add
     */
    tableColumns?: Record<string, ColumnExtension[]>;
    /**
     * Form field extensions
     * Key: Form identifier (e.g., 'user-form', 'role-form')
     * Value: Array of field definitions to add
     */
    formFields?: Record<string, FormFieldExtension[]>;
    /**
     * Event handlers for extension hooks
     */
    hooks?: ExtensionHooks;
}
/**
 * Props passed to page components (both default and overridden)
 */
export interface PageProps {
    readonly pageKey: string;
    readonly params?: Record<string, string>;
}
/**
 * Content that can be injected into a slot
 */
export type SlotContent = ComponentType<SlotProps> | ((props: SlotProps) => ReactNode) | ReactNode | SlotContent[];
/**
 * Props passed to slot content components
 */
export interface SlotProps {
    readonly slotName: string;
    readonly context?: Record<string, unknown>;
}
/**
 * Column extension definition for DataTable
 */
export interface ColumnExtension {
    key: string;
    label: string;
    sortable?: boolean;
    width?: string;
    render: (item: Record<string, unknown>, context: ColumnContext) => ReactNode;
    position?: 'before' | 'after';
    insertAfter?: string;
    insertBefore?: string;
}
/**
 * Context passed to column renderers
 */
export interface ColumnContext {
    tableId: string;
    rowIndex: number;
}
/**
 * Form field extension definition
 */
export interface FormFieldExtension {
    name: string;
    label: string;
    type: 'text' | 'number' | 'select' | 'checkbox' | 'textarea' | 'custom';
    required?: boolean;
    placeholder?: string;
    options?: Array<{
        value: string;
        label: string;
    }>;
    validate?: (value: unknown) => string | undefined;
    render?: (props: FormFieldProps) => ReactNode;
    position?: 'before' | 'after';
    insertAfter?: string;
    insertBefore?: string;
}
/**
 * Props passed to custom form field renderers
 */
export interface FormFieldProps {
    readonly name: string;
    readonly value: unknown;
    readonly onChange: (value: unknown) => void;
    readonly error?: string;
    readonly disabled?: boolean;
    readonly formData: Record<string, unknown>;
}
/**
 * Extension lifecycle hooks
 */
export interface ExtensionHooks {
    onPageLoad?: (pageKey: string) => void | Promise<void>;
    onFormSubmit?: (formId: string, data: Record<string, unknown>) => Record<string, unknown> | Promise<Record<string, unknown>>;
    onTableRowClick?: (tableId: string, row: Record<string, unknown>) => void;
    onBeforeSave?: (entityType: string, data: Record<string, unknown>) => Record<string, unknown> | Promise<Record<string, unknown>>;
    onAfterSave?: (entityType: string, data: Record<string, unknown>, result: unknown) => void | Promise<void>;
}
/**
 * Available slot names in SmartStack pages
 */
export type SlotName = 'users.header.actions' | 'users.table.columns.before' | 'users.table.columns.after' | 'users.table.row.actions' | 'users.form.fields.before' | 'users.form.fields.after' | 'users.card.content' | 'users.detail.header' | 'users.detail.tabs.after' | 'users.detail.sidebar' | 'roles.header.actions' | 'roles.table.columns.after' | 'roles.form.fields.after' | 'permissions.header.actions' | string;
/**
 * A component that can be registered in the PageRegistry.
 * Supports both regular components and lazy-loaded components (React.lazy).
 */
export type RegisterableComponent = ComponentType<any> | LazyExoticComponent<ComponentType<any>>;
/**
 * Page registry entry
 */
export interface PageRegistryEntry {
    key: string;
    defaultComponent: RegisterableComponent;
    slots: SlotName[];
}
/**
 * Extension context value
 */
export interface ExtensionContextValue {
    config: ExtensionConfig;
    getPage: (key: string) => ComponentType<PageProps> | undefined;
    getSlotContent: (slotName: string) => SlotContent | undefined;
    getTableColumns: (tableId: string) => ColumnExtension[];
    getFormFields: (formId: string) => FormFieldExtension[];
    hasExtension: (key: string) => boolean;
}
//# sourceMappingURL=types.d.ts.map