/**
 * Widget Type Definitions
 *
 * Core types for the dashboard widget system including widget interfaces,
 * layout configuration, and tier-gating support.
 *
 * @since v1.56.0
 */
import type { ReactNode } from 'react';
import type { Tier } from '../../core/types/auth.js';
/**
 * Widget size options
 */
export type WidgetSize = 'small' | 'medium' | 'large' | 'full';
/**
 * Widget category for organization
 */
export type WidgetCategory = 'status' | 'analytics' | 'health' | 'actions' | 'logs';
/**
 * Widget refresh state
 */
export type WidgetRefreshState = 'idle' | 'refreshing' | 'error';
/**
 * Size configuration mapping
 */
export declare const WIDGET_SIZE_CONFIG: Record<WidgetSize, {
    columns: number;
    rows: number;
}>;
/**
 * Grid column configuration based on terminal width
 */
export declare const GRID_COLUMN_CONFIG: {
    readonly narrow: {
        readonly minWidth: 60;
        readonly maxWidth: 80;
        readonly columns: 2;
    };
    readonly medium: {
        readonly minWidth: 81;
        readonly maxWidth: 120;
        readonly columns: 3;
    };
    readonly wide: {
        readonly minWidth: 121;
        readonly maxWidth: number;
        readonly columns: 4;
    };
};
/**
 * Get column count based on terminal width
 */
export declare function getColumnCount(terminalWidth: number): number;
/**
 * Widget definition interface
 */
export interface WidgetDefinition {
    /** Unique widget identifier */
    id: string;
    /** Display name */
    name: string;
    /** Description */
    description: string;
    /** Widget category */
    category: WidgetCategory;
    /** Minimum tier required to use this widget */
    minTier: Tier;
    /** Default size */
    defaultSize: WidgetSize;
    /** Auto-refresh interval in ms (0 = no auto-refresh) */
    refreshInterval: number;
    /** Whether widget can be collapsed */
    collapsible: boolean;
    /** Whether widget can be resized */
    resizable: boolean;
    /** Icon character */
    icon: string;
}
/**
 * Widget state for runtime
 */
export interface WidgetState {
    /** Whether widget is collapsed */
    collapsed: boolean;
    /** Current size (may differ from default if resized) */
    size: WidgetSize;
    /** Refresh state */
    refreshState: WidgetRefreshState;
    /** Last refresh timestamp */
    lastRefresh: number;
    /** Error message if refresh failed */
    error?: string;
    /** Widget-specific data */
    data?: unknown;
}
/**
 * Widget placement in the grid
 */
export interface WidgetPlacement {
    /** Widget ID */
    widgetId: string;
    /** Column position (0-indexed) */
    column: number;
    /** Row position (0-indexed) */
    row: number;
    /** Whether widget is visible */
    visible: boolean;
    /** Collapsed state */
    collapsed: boolean;
    /** Custom size (overrides default) */
    customSize?: WidgetSize;
}
/**
 * Dashboard layout configuration
 */
export interface DashboardLayout {
    /** Layout identifier */
    id: string;
    /** Layout name */
    name: string;
    /** Widget placements */
    widgets: WidgetPlacement[];
    /** Number of columns (may be auto-calculated) */
    columns?: number;
    /** Whether this is a preset layout */
    isPreset: boolean;
    /** Minimum tier required for this layout */
    minTier: Tier;
}
/**
 * Preset layout names
 */
export type PresetLayoutName = 'compact' | 'standard' | 'detailed';
/**
 * Widget render context passed to render function
 */
export interface WidgetRenderContext {
    /** Widget definition */
    definition: WidgetDefinition;
    /** Current state */
    state: WidgetState;
    /** Current placement */
    placement: WidgetPlacement;
    /** User's tier */
    tier: Tier;
    /** Terminal width */
    terminalWidth: number;
    /** Terminal height */
    terminalHeight: number;
    /** Calculated widget width in characters */
    widgetWidth: number;
    /** Calculated widget height in rows */
    widgetHeight: number;
    /** Trigger a refresh */
    onRefresh: () => void;
    /** Update widget data */
    onDataUpdate: (data: unknown) => void;
}
/**
 * Widget component props
 */
export interface WidgetProps {
    /** Render context */
    context: WidgetRenderContext;
}
/**
 * Widget render function type
 */
export type WidgetRenderFn = (context: WidgetRenderContext) => ReactNode;
/**
 * Registered widget with render function
 */
export interface RegisteredWidget {
    /** Widget definition */
    definition: WidgetDefinition;
    /** Render function */
    render: WidgetRenderFn;
    /** Optional data fetcher */
    fetchData?: () => Promise<unknown>;
}
/**
 * Dashboard configuration stored in user settings
 */
export interface DashboardConfig {
    /** Active layout ID */
    activeLayoutId: string;
    /** Custom layouts */
    customLayouts: DashboardLayout[];
    /** Widget states (persisted separately from placement) */
    widgetStates: Record<string, Partial<WidgetState>>;
    /** Per-server configurations */
    serverConfigs?: Record<string, {
        layoutId: string;
    }>;
}
/**
 * Default dashboard configuration
 */
export declare const DEFAULT_DASHBOARD_CONFIG: DashboardConfig;
/**
 * Widget event types
 */
export type WidgetEventType = 'refresh' | 'collapse' | 'expand' | 'resize' | 'move' | 'hide' | 'show';
/**
 * Widget event
 */
export interface WidgetEvent {
    type: WidgetEventType;
    widgetId: string;
    timestamp: number;
    payload?: unknown;
}
/**
 * Check if tier meets minimum requirement
 */
export declare function tierMeetsMinimum(userTier: Tier, minTier: Tier): boolean;
/**
 * Get effective widget size accounting for column constraints
 */
export declare function getEffectiveSize(size: WidgetSize, availableColumns: number): WidgetSize;
/**
 * Calculate widget dimensions in characters
 */
export declare function calculateWidgetDimensions(size: WidgetSize, terminalWidth: number, totalColumns: number): {
    width: number;
    height: number;
};
//# sourceMappingURL=widget-types.d.ts.map