import { RoleInfo } from '../permissions'; export interface PluginInfo { id: string; name: string; /** Name to show in the UI; the platform falls back to the plugin ID. Absent before MINT 1.3. */ display_name?: string; version: string; plugin_type?: string; description?: string; icon?: string; color?: string; route_prefix: string; api_prefix: string; /** Settings route selected by the platform for this plugin runtime. */ settings_api?: 'plugin' | 'platform'; /** Content identity of the HTML that booted this integrated plugin tab. */ frontend_revision?: string; nav_items?: PluginNavItem[]; settings?: PluginSettings; } export interface PluginNavItem { id?: string; label: string; path: string; icon?: string; description?: string; requiresAuth?: boolean; requiresAdmin?: boolean; requiresFeature?: string; children?: PluginNavItem[]; } export interface PluginSettings { [key: string]: PluginSettingField; } export interface PluginSettingField { type: 'string' | 'number' | 'boolean' | 'select' | 'multiselect'; label: string; description?: string; default?: unknown; options?: Array<{ value: string; label: string; }>; validation?: { required?: boolean; min?: number; max?: number; pattern?: string; }; } export interface UserSummary { id: number; username: string; shortname?: string; first_name?: string; last_name?: string; } export interface PlatformContext { isIntegrated: boolean; plugin?: PluginInfo; platformApiUrl?: string; platformOrigin?: string; user?: { id: number; username: string; role: string; role_obj?: RoleInfo | null; roleObj?: RoleInfo | null; shortname?: string; }; theme: 'light' | 'dark' | 'system'; allowedExperimentTypes?: string[] | null; features?: { admin?: boolean; experiments?: boolean; samples?: boolean; passkey?: boolean; multiUser?: boolean; }; } export interface PlatformContextOptions { allowedOrigins?: string[]; allowAnyOrigin?: boolean; } export type PlatformEventType = 'mint:theme-changed' | 'mint:user-changed' | 'mint:navigate' | 'mint:notification'; export interface PlatformEvent { type: PlatformEventType; payload: T; } export type ThemeMode = 'light' | 'dark' | 'system'; export type ColorPalette = 'default' | 'colorblind' | 'viridis' | 'pastel'; export type TableDensity = 'compact' | 'normal' | 'comfortable';