import { Messages } from '@salesforce/core'; import type { CreateResult } from '../../operations/DefinitionCreateOperation.js'; import type { SummaryEntry } from './command-display.js'; /** * Callback result shape from the operation's onObjectComplete callback. * Captures per-object status for post-execution rendering. */ export type CallbackResult = { objectName: string; objectLabel?: string; status: 'success' | 'skip' | 'fail' | 'preview'; type?: 'metadata' | 'historical' | 'comparative' | 'outcome'; definitionKey?: string; category?: string; timeCategory?: string; segmentCategory?: string; fieldCount?: number; }; /** * Returns column definitions for the definition results table. */ export declare function getTableColumns(): Array<{ key: string; name: string; }>; /** * Builds table data rows from callback results for table rendering. * * @param results - The callback results to render * @param recordCounts - Optional record counts by object name * @returns Array of row data records */ export declare function buildTableData(results: Array<{ objectName: string; objectLabel?: string; type?: string; category?: string; timeCategory?: string; segmentCategory?: string; }>, recordCounts?: Map): Array>; /** * Displays the Org Context section using the shared renderOrgContext utility. * * @param log - The logging function * @param orgIdentity - The org identity data * @param instanceUrl - The org instance URL */ export declare function displayOrgContext(log: (msg: string) => void, orgIdentity: { organizationName?: string; organizationId: string; organizationType?: string; isSandbox?: boolean; }, instanceUrl?: string): void; /** * Displays separate Created and Skipped tables, plus summary footer. * * @param log - The logging function * @param warn - The warning function * @param callbackResults - The per-object callback results * @param data - The operation result data * @param dryRun - Whether this is a dry run * @param recordCounts - Optional record counts by object name */ export declare function displayResultsTables(log: (msg: string) => void, warn: (msg: string) => void, callbackResults: CallbackResult[], data: CreateResult, dryRun: boolean, recordCounts?: Map): void; /** * Error code to i18n message key mapping for operation errors. */ export declare const ERROR_CODE_MAP: Record; /** * Handles operation failure by translating error codes to user-friendly messages. * * Returns a structured object indicating the action to take: * - `type: 'exit'` — set process.exitCode and return a result * - `type: 'error'` — throw via command's this.error() * * @param result - The failed operation result * @param targetOrg - The target org identifier * @param dryRun - Whether this is a dry run * @param resolveErrorMessage - The error message resolution function from CuneiformCommand * @returns An action descriptor for the command to execute */ export declare function resolveOperationFailure(result: { success: boolean; errorCode?: string; message?: string; }, targetOrg: string, dryRun: boolean, resolveErrorMessage: (errorCodeMap: Record, errorCode: string | undefined, fallbackMessage: string, msgs: Messages) => string): { type: 'exit' | 'error'; result?: { success: boolean; created: number; failed: number; skipped: number; total: number; dryRun: boolean; failures: Array<{ objectName: string; error: string; errorCode: string; }>; results: Array<{ objectName: string; status: string; }>; }; message?: string; code?: string; log?: string; }; /** * Builds the pre-confirmation summary box entries for the preview stage. * * @param uniqueObjects - Number of unique objects * @param method - The profiling method * @param toCreateCount - Number of definitions to create * @param toSkipCount - Number of definitions to skip * @returns Array of summary entries for renderSummaryBox */ export declare function buildPreConfirmSummary(uniqueObjects: number, method: string, toCreateCount: number, toSkipCount: number): SummaryEntry[];