/** * IModSourcePort - Outbound port for mod source adapters * * This interface defines the contract for mod source implementations. * Each mod source (Modrinth, CurseForge, Spiget, etc.) must implement this interface. * * @example * ```typescript * class ModrinthAdapter implements IModSourcePort { * readonly sourceName = 'modrinth'; * * async search(query: string): Promise { * // Implementation * } * } * ``` */ import type { ModProject, ModVersion, ModSearchResult, ModSearchOptions, ModVersionOptions } from '../../../domain/mod/index.js'; /** * Port interface for mod source adapters */ export interface IModSourcePort { /** * Unique identifier for this source * @example 'modrinth', 'curseforge', 'spiget' */ readonly sourceName: string; /** * Human-readable display name * @example 'Modrinth', 'CurseForge', 'SpigotMC' */ readonly displayName: string; /** * Search for mods/plugins * @param query - Search query string * @param options - Search options (pagination, filters) * @returns Paginated search results */ search(query: string, options?: ModSearchOptions): Promise; /** * Get project details by slug or ID * @param slugOrId - Project slug or ID * @returns Project details or null if not found */ getProject(slugOrId: string): Promise; /** * Get available versions for a project * @param slugOrId - Project slug or ID * @param options - Version filter options * @returns List of versions */ getVersions(slugOrId: string, options?: ModVersionOptions): Promise; /** * Check if this source is available (API accessible, credentials valid) * @returns true if the source is ready to use */ isAvailable(): Promise; /** * Get multiple projects by slugs or IDs (batch) * Optional: not all sources support batch retrieval * @param slugsOrIds - Array of project slugs or IDs * @returns Map of slug → ModProject */ getProjects?(slugsOrIds: string[]): Promise>; /** * Detect client-only mods bundled in a modpack. * Optional: only sources that support modpack inspection implement this. * Returns partial file names (for MODRINTH_EXCLUDE_FILES / CF_EXCLUDE_MODS) of * mods whose canonical server-side support is `unsupported`. * @param slugOrId - Modpack slug or ID * @param versionId - Specific modpack version (defaults to latest) */ getModpackClientOnlyMods?(slugOrId: string, versionId?: string): Promise; /** * Get the environment variable key for this source * Used for config.env configuration * @example 'MODRINTH_PROJECTS', 'CURSEFORGE_FILES', 'SPIGET_RESOURCES' */ getEnvKey(): string; /** * Format a project reference for config.env * @param project - Project to format * @returns Formatted string for environment variable */ formatForEnv(project: ModProject): string; } //# sourceMappingURL=IModSourcePort.d.ts.map