import { type ServiceResult } from '../models/service-result.js'; import { ProfilingSummaryService, type PurgeSummaryRecord } from '../services/ProfilingSummaryService.js'; import type { BulkSummaryResult } from '../models/summary-bulk-types.js'; /** * Options for the summary stop operation. */ export type SummaryStopOptions = { /** Specific summary IDs to stop — exclusive mode */ ids?: string[]; /** Stop all in-progress summaries */ all?: boolean; /** Filter by object API names */ objects?: string[]; /** Preview mode — show what would be stopped without executing */ dryRun?: boolean; /** Skip interactive confirmation prompt */ noPrompt?: boolean; /** Callback when in-progress summaries are found */ onSummariesFound?: (count: number) => void; /** Callback for user confirmation before stopping */ onConfirm?: (count: number) => Promise; }; /** * Result of a summary stop operation. */ export type SummaryStopResult = { /** Number of summaries successfully stopped */ stopped: number; /** Number of summaries that failed to stop */ failed: number; /** Total number of summaries processed */ total: number; /** Whether the operation was cancelled by the user */ cancelled?: boolean; /** Whether dry-run mode was active */ dryRun?: boolean; /** Preview data (summaries that would be stopped) */ preview?: PurgeSummaryRecord[]; /** Per-item results from the API */ apiResults?: BulkSummaryResult; }; /** * Error codes for summary stop operations. * Re-exported from ServiceErrorCodes (E4520-E4527) for convenience. */ export declare const SummaryStopErrorCodes: { readonly NO_SELECTION_CRITERIA: "E4520"; readonly MUTUALLY_EXCLUSIVE: "E4521"; readonly QUERY_FAILED: "E4522"; readonly NO_ELIGIBLE_SUMMARIES: "E4523"; readonly STOP_FAILED: "E4524"; readonly USER_CANCELLED: "E4525"; readonly OPERATION_FAILED: "E4526"; readonly INVALID_IDS: "E4527"; }; /** * Orchestrates stopping of in-progress profiling summaries. * * Supports three selection modes: * 1. ID mode: Stop specific summaries by ID * 2. All mode: Stop all in-progress summaries * 3. Object mode: Stop summaries for specific objects * * These modes are mutually exclusive. */ export declare class SummaryStopOperation { private readonly summaryService; private readonly logger?; constructor(summaryService: ProfilingSummaryService, logger?: Console | undefined); /** * Creates the empty result structure. */ private static emptyResult; /** * Validates selection options and returns a failure result if invalid. * Returns undefined when validation passes. */ private static validateOptions; /** * Executes the summary stop operation. */ execute(options: SummaryStopOptions): Promise>; /** * Queries in-progress summaries based on the selection mode. */ private querySummaries; }