/**
 * Configuration Type Definitions
 *
 * TypeScript interfaces and types for application configuration.
 * These provide type safety and auto-completion for config files.
 */
import type { IconName } from './icon-map';
/**
 * Teams Mode
 *
 * Defines how teams work in the application.
 */
export type TeamsMode = 'single-user' | 'single-tenant' | 'multi-tenant';
/**
 * Teams Configuration Options
 */
export interface TeamsConfigOptions {
    /** Maximum number of teams a user can create */
    maxTeamsPerUser?: number | null;
    /** Maximum members per team */
    maxMembersPerTeam?: number | null;
    /** Allow users to leave all teams */
    allowLeaveAllTeams?: boolean;
    /**
     * Allow users to create additional teams in multi-tenant mode
     * - true (default): Users can create multiple teams without limit
     * - false: Users can only be owner of maximum 1 team
     * Note: Only applies to multi-tenant mode. Signup team is always created.
     */
    allowCreateTeams?: boolean;
}
/**
 * Teams Configuration
 */
export interface TeamsConfig {
    /** Teams mode */
    mode: TeamsMode;
    /** Additional options */
    options?: TeamsConfigOptions;
}
/**
 * Mobile Navigation Item
 *
 * Represents a single item in the mobile bottom navigation bar.
 */
export interface MobileNavItem {
    /** Unique identifier for the nav item */
    id: string;
    /** Translation key for the label (e.g., 'common.mobileNav.home') */
    labelKey: string;
    /** Navigation href (optional if item triggers an action) */
    href?: string;
    /** Icon name from Lucide icons */
    icon: IconName;
    /** Whether this item is enabled and should be displayed */
    enabled: boolean;
    /** Whether this is the central elevated button (e.g., Quick Create) */
    isCentral?: boolean;
    /** Action to trigger instead of navigation */
    action?: 'quickCreate' | 'moreSheet';
}
/**
 * Mobile "More" Sheet Item
 *
 * Represents a single item in the mobile "More" options sheet.
 */
export interface MobileNavMoreItem {
    /** Unique identifier for the more sheet item */
    id: string;
    /** Translation key for the label */
    labelKey: string;
    /** Navigation href */
    href: string;
    /** Icon name from Lucide icons */
    icon: IconName;
    /** Whether this item is enabled and should be displayed */
    enabled: boolean;
    /** Whether this link opens in a new tab */
    external?: boolean;
    /**
     * Permission required to display this item.
     * If set, the item is only shown to users who have this permission in the current team.
     * If not set, the item is shown to all users (backward compatible).
     * Example: 'schedules.list', 'analytics.list'
     */
    requiresPermission?: string;
}
/**
 * Mobile Navigation Configuration
 *
 * Complete configuration for mobile navigation system.
 */
export interface MobileNavConfig {
    /** Bottom navigation bar items */
    items: MobileNavItem[];
    /** "More" sheet secondary navigation items */
    moreSheetItems: MobileNavMoreItem[];
}
/**
 * Topbar Feature Flags
 *
 * Controls which features are enabled in the desktop topbar.
 */
export interface TopbarConfig {
    features: {
        quickCreate: boolean;
        search: boolean;
        notifications: boolean;
        help: boolean;
        theme: boolean;
        admin: boolean;
        userMenu: boolean;
    };
}
/**
 * Settings Page Configuration
 */
export interface SettingsPageConfig {
    enabled: boolean;
    order?: number;
}
export interface SettingsConfig {
    pages: {
        profile: SettingsPageConfig;
        billing: SettingsPageConfig;
        apiKeys: SettingsPageConfig;
        password: SettingsPageConfig;
    };
}
/**
 * Documentation Category Configuration
 *
 * Configuration for a single documentation category (public or superadmin).
 */
export interface DocsCategoryConfig {
    /** Enable/disable this documentation level in the sidebar */
    enabled: boolean;
    /** Whether this category should be expanded by default on page load */
    open?: boolean;
    /** Custom label displayed in the sidebar for this category */
    label: string;
}
/**
 * Documentation System Configuration
 *
 * Controls documentation system behavior including visibility,
 * search functionality, and category-specific settings.
 *
 * Structure:
 * - public: User-facing documentation at /docs
 * - superadmin: Admin documentation at /superadmin/docs
 *
 * NOTE: Plugin docs are NOT in the registry - they are for developer reference only (IDE/LLM).
 */
export interface DocsConfig {
    /** Enable/disable the entire documentation system */
    enabled: boolean;
    /** Make public documentation accessible without authentication */
    publicAccess?: boolean;
    /** Enable search functionality in the sidebar */
    searchEnabled: boolean;
    /** Show breadcrumbs navigation in documentation pages */
    breadcrumbs: boolean;
    /** Public documentation configuration (for /docs routes) */
    public?: DocsCategoryConfig;
    /** Superadmin documentation configuration (for /superadmin/docs routes) */
    superadmin?: DocsCategoryConfig;
}
/**
 * DevKeyring User Configuration
 *
 * Represents a test user for quick login during development.
 */
export interface DevKeyringUser {
    /** Unique identifier for the user */
    id: string;
    /** User's email address */
    email: string;
    /** User's display name */
    name: string;
    /** User's password (for auto-fill) */
    password: string;
    /** Team roles description (e.g., "TeamA (admin), TeamB (member)") */
    teamRoles?: string;
}
/**
 * DevKeyring Configuration
 *
 * Configuration for development/QA quick login feature.
 * Only rendered in non-production environments.
 */
export interface DevKeyringConfig {
    /** Enable/disable the DevKeyring feature */
    enabled: boolean;
    /** List of test users available for quick login */
    users: DevKeyringUser[];
}
/**
 * Team Roles Configuration
 *
 * Defines roles within teams (team_members.role).
 * Separate from global user roles (users.role).
 *
 * NOTE: Team PERMISSIONS are now defined in permissions.config.ts
 * under the `teams` section. This is the SINGLE SOURCE OF TRUTH
 * for all permissions. Use PermissionService.canDoAction() to check.
 */
export interface TeamRolesConfig {
    /** Protected core team roles - CANNOT be removed by themes */
    coreTeamRoles: readonly string[];
    /** Default role for new team members */
    defaultTeamRole: string;
    /** All available team roles */
    availableTeamRoles: readonly string[];
    /** Role hierarchy (higher = more permissions within team) */
    hierarchy: Record<string, number>;
    /** Role display names (translation keys) */
    displayNames: Record<string, string>;
    /** Role descriptions */
    descriptions: Record<string, string>;
}
/**
 * Webhook Endpoint Configuration
 *
 * Represents a single webhook endpoint with its URL source and event patterns.
 */
export interface WebhookEndpointConfig {
    /** Environment variable name containing the URL (security best practice) */
    envVar: string;
    /** Description of this webhook's purpose */
    description?: string;
    /**
     * Event patterns this webhook matches (for auto-routing)
     * Examples: 'task:*', 'subscription:created', '*:created'
     * Uses glob-like matching: * matches any segment
     */
    patterns?: string[];
    /** Whether this endpoint is enabled */
    enabled?: boolean;
}
/**
 * Webhooks Configuration
 *
 * Defines multiple webhook endpoints, each identified by a unique key.
 * URLs are read from environment variables for security.
 */
export interface WebhooksConfig {
    /** Named webhook endpoints */
    endpoints: Record<string, WebhookEndpointConfig>;
    /** Default endpoint key for fallback when no pattern matches */
    defaultEndpoint?: string;
}
/**
 * Scheduled Actions Configuration
 *
 * Controls the scheduled actions system behavior.
 * Core provides defaults, themes can override.
 */
export interface ScheduledActionsConfig {
    /** Enable/disable scheduled actions system */
    enabled: boolean;
    /** Retention period for completed/failed actions in days */
    retentionDays: number;
    /** Maximum actions to process per cron run */
    batchSize: number;
    /** Default timeout per action in milliseconds */
    defaultTimeout: number;
    /**
     * Maximum number of actions to execute in parallel.
     * Actions are executed concurrently up to this limit.
     * Default: 1 (sequential execution for backward compatibility)
     *
     * @example
     * concurrencyLimit: 5 -> Up to 5 actions run simultaneously
     */
    concurrencyLimit?: number;
    /**
     * @deprecated Use webhooks.endpoints instead for multi-endpoint support
     * Legacy single webhook URL for backward compatibility
     */
    webhookUrl?: string;
    /** Multi-endpoint webhook configuration */
    webhooks?: WebhooksConfig;
    /**
     * Deduplication settings to prevent duplicate actions
     * Uses time-window approach: same entityId within window = duplicate
     *
     * Behavior:
     * - windowSeconds > 0: Updates existing action's payload (override)
     * - windowSeconds = 0: Disables deduplication (track all changes)
     */
    deduplication?: {
        /** Time window in seconds to detect duplicates (default: 5). Set to 0 to disable. */
        windowSeconds: number;
    };
}
/**
 * Media Library Configuration
 *
 * Controls file upload limits and accepted types for the media system.
 * Themes can override these defaults in their app.config.ts.
 */
export interface MediaConfig {
    /** Maximum upload file size in MB (general fallback) */
    maxSizeMB: number;
    /** Maximum image file size in MB (overrides maxSizeMB for images). Falls back to maxSizeMB if not set. */
    maxSizeImageMB?: number;
    /** Maximum video file size in MB (overrides maxSizeMB for videos). Falls back to maxSizeMB if not set. */
    maxSizeVideoMB?: number;
    /** Accepted MIME type patterns for the file input (e.g., ['image/*', 'video/*']) */
    acceptedTypes: string[];
    /** Specific MIME types allowed by the server-side upload endpoint */
    allowedMimeTypes: string[];
}
/**
 * Registration Mode
 *
 * Controls how new users can register in the application.
 *
 * - 'open': Anyone can register via email+password and Google OAuth (default)
 * - 'domain-restricted': Only Google OAuth for specific email domains. No email+password signup.
 *   Users with allowed domains are auto-created on first Google sign-in.
 * - 'domain-open': Email+password AND Google OAuth, but restricted to specific email domains.
 *   Both signup and login require an email from allowedDomains.
 * - 'invitation-only': Registration only via invitation link. First user bootstraps the team;
 *   subsequent users require an invite. Google OAuth is configurable.
 */
export type RegistrationMode = 'open' | 'domain-restricted' | 'domain-open' | 'invitation-only';
/**
 * Auth Registration Configuration
 */
export interface AuthRegistrationConfig {
    /** Registration mode */
    mode: RegistrationMode;
    /**
     * Allowed email domains for 'domain-restricted' mode.
     * Only the domain part without @. e.g., ['nextspark.dev', 'mycompany.com']
     * Ignored for other modes.
     */
    allowedDomains?: string[];
}
/**
 * Auth Providers Configuration
 */
export interface AuthProvidersConfig {
    google?: {
        /**
         * Whether Google OAuth button is shown in login/signup.
         * Defaults to true when GOOGLE_CLIENT_ID env var is set.
         */
        enabled?: boolean;
    };
}
/**
 * Auth Configuration
 *
 * Controls authentication behavior including registration modes
 * and provider visibility. Configured at theme level.
 */
export interface AuthConfig {
    /** Registration settings */
    registration: AuthRegistrationConfig;
    /** OAuth provider settings */
    providers?: AuthProvidersConfig;
    /**
     * Whether Better Auth should automatically send the built-in
     * verification email when a user signs up via `/api/auth/sign-up/email`.
     *
     * - `true` (default): preserves Better Auth's standard behavior — users
     *   receive a "Verify Your Email Address" link email immediately on signup.
     * - `false`: suppresses the automatic email. Use this when the project
     *   verifies email ownership through other means (OTP code, invitation
     *   token, claim-account flow, etc.) before or after signup.
     *
     * Note: this only controls the AUTOMATIC dispatch on signup.
     * `requireEmailVerification: true` and the `sendVerificationEmail`
     * function remain available regardless — projects can still trigger
     * link-based verification explicitly when they need to.
     */
    sendVerificationEmailOnSignup?: boolean;
}
/**
 * Public Auth Config
 *
 * Subset of AuthConfig safe to expose to client components.
 * Does NOT include allowedDomains (security: prevents domain enumeration).
 */
export interface PublicAuthConfig {
    registration: {
        mode: RegistrationMode;
    };
    providers: {
        google: {
            enabled: boolean;
        };
    };
}
/**
 * Complete Application Configuration
 *
 * Root configuration object structure.
 *
 * Note: This interface defines the core required types for type safety.
 * Additional properties can be added in app.config.ts and will be validated at runtime.
 */
export interface AppConfig {
    app: {
        name: string;
        version: string;
    };
    i18n: {
        supportedLocales: string[];
        defaultLocale: string;
        cookie: {
            name: string;
            maxAge: number;
            httpOnly: boolean;
            secure: string | boolean;
            sameSite: 'lax' | 'strict' | 'none';
            path: string;
        };
        namespaces: string[];
        performance: {
            preloadCriticalNamespaces: string[];
        };
    };
    topbar: TopbarConfig;
    settings: SettingsConfig;
    mobileNav: MobileNavConfig;
    /** Documentation system configuration */
    docs?: DocsConfig;
    /**
     * DevKeyring configuration for development/QA quick login
     *
     * @deprecated DevKeyring configuration has moved to dev.config.ts
     * This property is kept for backwards compatibility but should not be used.
     * Use DEV_CONFIG from config-sync.ts instead.
     */
    devKeyring?: DevKeyringConfig;
    /** Team roles configuration (for team_members.role) */
    teamRoles?: TeamRolesConfig;
    /** Scheduled actions system configuration */
    scheduledActions?: ScheduledActionsConfig;
    /** Media library configuration */
    media?: MediaConfig;
    /** Authentication and registration configuration */
    auth?: AuthConfig;
    [key: string]: any;
}
/**
 * Development Configuration
 *
 * Contains development-only settings that should never affect production.
 * This configuration is loaded from dev.config.ts in each theme.
 *
 * @example
 * ```typescript
 * // contents/themes/my-theme/config/dev.config.ts
 * export const DEV_CONFIG_OVERRIDES: DevConfig = {
 *   devKeyring: {
 *     enabled: true,
 *     users: [
 *       { id: 'dev', email: 'dev@test.com', name: 'Developer', password: 'test123' },
 *     ],
 *   },
 * }
 * ```
 */
export interface DevConfig {
    /** DevKeyring configuration for quick login in development */
    devKeyring?: DevKeyringConfig;
}
//# sourceMappingURL=types.d.ts.map