/** * Export Service * * Handles exporting and importing Pluginator configuration. * * @since v1.31.0 */ import { type ExportData, type ExportOptions, type FavoritesExportStore, type GroupsExportStore, type ImportOptions, type ImportPreview, type ImportResult, type ImportSummary, type PluginExportConfig, type ServerExportConfig, type SettingsExport, type TagsExportStore } from './export-types.js'; /** * Data providers interface for collecting export data */ export interface ExportDataProviders { getPlugins?: () => PluginExportConfig[]; getServers?: () => ServerExportConfig[]; getFavorites?: () => FavoritesExportStore; getTags?: () => TagsExportStore; getGroups?: () => GroupsExportStore; getSettings?: () => SettingsExport; getFilterPreferences?: () => { defaultFilters?: string[]; savedFilterSets?: Array<{ name: string; filters: string[]; }>; }; } /** * Data importers interface for applying import data */ export interface ImportDataHandlers { importPlugins?: (plugins: PluginExportConfig[], mode: 'merge' | 'replace') => ImportSummary; importServers?: (servers: ServerExportConfig[], mode: 'merge' | 'replace') => ImportSummary; importFavorites?: (favorites: FavoritesExportStore, mode: 'merge' | 'replace') => ImportSummary; importTags?: (tags: TagsExportStore, mode: 'merge' | 'replace') => ImportSummary; importGroups?: (groups: GroupsExportStore, mode: 'merge' | 'replace') => ImportSummary; importSettings?: (settings: SettingsExport, mode: 'merge' | 'replace') => void; } /** * Current data providers interface for preview comparison */ export interface CurrentDataProviders { getPluginNames?: () => string[]; getServerNames?: () => string[]; getFavoriteNames?: () => string[]; getTagIds?: () => string[]; getGroupIds?: () => string[]; } /** * Export service for configuration import/export */ export declare class ExportService { private pluginatorVersion; private providers; private handlers; private currentData; constructor(pluginatorVersion: string, providers?: ExportDataProviders, handlers?: ImportDataHandlers, currentData?: CurrentDataProviders); /** * Set data providers */ setProviders(providers: ExportDataProviders): void; /** * Set import handlers */ setHandlers(handlers: ImportDataHandlers): void; /** * Set current data providers for preview */ setCurrentDataProviders(providers: CurrentDataProviders): void; /** * Create export data */ export(options?: ExportOptions): ExportData; /** * Export to string */ exportToString(options?: ExportOptions): string; /** * Export to file */ exportToFile(path: string, options?: ExportOptions): Promise; /** * Import from data object */ import(data: ExportData, options?: ImportOptions): ImportResult; /** * Import from string */ importFromString(content: string, options?: ImportOptions): ImportResult; /** * Import from file */ importFromFile(path: string, options?: ImportOptions): Promise; /** * Import from URL */ importFromUrl(url: string, options?: ImportOptions): Promise; /** * Preview import changes */ preview(data: ExportData, sourceName?: string): ImportPreview; /** * Preview from string */ previewFromString(content: string, sourceName?: string): ImportPreview | null; /** * Validate export data */ validate(data: unknown): { valid: boolean; errors: string[]; warnings: string[]; }; /** * Verify checksum */ verifyChecksum(data: ExportData): boolean; /** * Calculate checksum for data */ private calculateChecksum; /** * Get change type based on whether item exists */ private getChangeType; /** * Simulate import for dry run */ private simulateImport; /** * Merge import summary into result */ private mergeImportSummary; } /** * Get the singleton export service */ export declare function getExportService(pluginatorVersion?: string): ExportService; /** * Reset the singleton */ export declare function resetExportService(): void; //# sourceMappingURL=export-service.d.ts.map