import { ServerName, ServerType, McVersion, Memory, WorldOptions, Server, World } from '../../domain/index.js'; import type { IPromptPort, TextPromptOptions, SelectPromptOptions, ConfirmPromptOptions, PasswordPromptOptions, Spinner } from '../../application/ports/outbound/IPromptPort.js'; import type { WorldWithServerStatus } from '../../application/ports/outbound/IWorldRepository.js'; /** * World setup types for API options */ export type WorldSetupType = 'new' | 'existing' | 'download'; /** * Options for ApiPromptAdapter * Pre-configured values that would normally be collected via interactive prompts */ export interface ApiPromptOptions { /** Server name (e.g., "myserver") */ serverName?: string; /** Server type (e.g., "PAPER", "FORGE") */ serverType?: string; /** Minecraft version (e.g., "1.21.1", "LATEST") */ mcVersion?: string; /** Memory allocation (e.g., "4G", "2048M") */ memory?: string; /** World setup type */ worldSetup?: WorldSetupType; /** World name for existing world */ worldName?: string; /** World seed for new world */ worldSeed?: string; /** World download URL */ worldDownloadUrl?: string; /** Password value for password prompts */ password?: string; /** Default value for confirm prompts (defaults to true) */ confirmValue?: boolean; /** Modpack slug (for MODRINTH/AUTO_CURSEFORGE types) */ modpackSlug?: string; /** Modpack version (optional) */ modpackVersion?: string; /** Mod loader (optional) */ modLoader?: string; /** Mods to exclude from modpack installation (optional) */ modpackExcludeFiles?: string[]; } /** * Message types for collected output */ export type MessageType = 'intro' | 'outro' | 'success' | 'error' | 'warn' | 'info' | 'note'; /** * Collected message */ export interface CollectedMessage { type: MessageType; message: string; title?: string; } /** * Error thrown when API mode operation is not supported */ export declare class ApiModeError extends Error { constructor(message: string); } /** * ApiPromptAdapter * Implements IPromptPort for API/non-interactive contexts. * Returns pre-configured values instead of interactive prompts. * * Usage: * ```typescript * const adapter = new ApiPromptAdapter({ * serverName: 'myserver', * serverType: 'PAPER', * mcVersion: '1.21.1', * memory: '4G', * worldSetup: 'new', * }); * * // Use with UseCase * const useCase = new CreateServerUseCase(adapter, serverRepo, settings, provision); * await useCase.execute(); // Uses pre-configured values * ``` */ export declare class ApiPromptAdapter implements IPromptPort { private readonly options; private readonly messages; constructor(options: ApiPromptOptions); intro(message: string): void; outro(message: string): void; text(options: TextPromptOptions): Promise; select(options: SelectPromptOptions): Promise; confirm(_options: ConfirmPromptOptions): Promise; password(_options: PasswordPromptOptions): Promise; promptServerName(): Promise; promptServerType(): Promise; promptMcVersion(_serverType: ServerType): Promise; promptMemory(): Promise; promptWorldOptions(): Promise; promptServerSelection(servers: Server[]): Promise; promptWorldSelection(worlds: World[]): Promise; promptExistingWorldSelection(worlds: WorldWithServerStatus[]): Promise; promptWhitelistPlayers(): Promise; promptModpackSlug(): Promise; promptModpackVersion(): Promise; promptModpackLoader(_availableLoaders?: string[]): Promise; promptModpackExcludeFiles(): Promise; spinner(): Spinner; success(message: string): void; error(message: string): void; warn(message: string): void; info(message: string): void; note(message: string, title?: string): void; isCancel(_value: unknown): boolean; handleCancel(): never; /** * Get all collected messages */ getMessages(): CollectedMessage[]; /** * Clear collected messages */ clearMessages(): void; /** * Resolve text prompt value from options based on message context */ private resolveTextValue; /** * Resolve select prompt value from options based on message context */ private resolveSelectValue; } //# sourceMappingURL=ApiPromptAdapter.d.ts.map