/**
 * Workflow Result Type
 *
 * Standardized result type for workflows that can have partial failures.
 * Workflows that process multiple items (e.g., syncing plugins, checking updates)
 * should use this pattern to report both successes and failures.
 */
import type { PluginatorError } from './error-types.js';
/**
 * Workflow result with typed data and error handling
 */
export interface WorkflowResult<T> {
    /** Whether the workflow completed successfully (no critical errors) */
    success: boolean;
    /** Result data (may be partial if some items failed) */
    data?: T;
    /** Errors that occurred during execution */
    errors: PluginatorError[];
    /** Non-critical warnings */
    warnings: string[];
    /** Duration in milliseconds */
    duration: number;
}
/**
 * Item-level result for batch operations
 */
export interface ItemResult<T> {
    /** Item identifier (e.g., plugin name) */
    id: string;
    /** Whether this item succeeded */
    success: boolean;
    /** Item data if successful */
    data?: T;
    /** Error if failed */
    error?: PluginatorError;
    /** Warning message if applicable */
    warning?: string;
}
/**
 * Batch workflow result for operations on multiple items
 */
export interface BatchWorkflowResult<T> extends WorkflowResult<T[]> {
    /** Results for each item */
    items: ItemResult<T>[];
    /** Count of successful items */
    successCount: number;
    /** Count of failed items */
    failureCount: number;
    /** Count of skipped items */
    skippedCount: number;
}
/**
 * Create a successful workflow result
 */
export declare function successResult<T>(data: T, duration: number, warnings?: string[]): WorkflowResult<T>;
/**
 * Create a failed workflow result
 */
export declare function failureResult<T>(errors: PluginatorError[], duration: number, partialData?: T, warnings?: string[]): WorkflowResult<T>;
/**
 * Create a batch workflow result from item results
 */
export declare function batchResult<T>(items: ItemResult<T>[], duration: number): BatchWorkflowResult<T>;
/**
 * Process items in batch with error handling
 * Executes the processor for each item and collects results
 */
export declare function processBatch<TInput, TOutput>(items: TInput[], getId: (item: TInput) => string, processor: (item: TInput) => Promise<TOutput>, options?: {
    /** Continue processing remaining items after an error */
    continueOnError?: boolean;
    /** Called for each item with progress */
    onProgress?: (current: number, total: number, id: string) => void;
}): Promise<BatchWorkflowResult<TOutput>>;
/**
 * Combine multiple workflow results into one
 */
export declare function combineResults<T>(results: WorkflowResult<T>[]): WorkflowResult<T[]>;
/**
 * Get a summary of workflow result for logging/display
 */
export declare function getResultSummary<T>(result: WorkflowResult<T>): string;
/**
 * Get batch result summary
 */
export declare function getBatchSummary<T>(result: BatchWorkflowResult<T>): string;
//# sourceMappingURL=workflow-result.d.ts.map