import type { InitSummary } from './types/InitSummary.js'; import type { GeneratedPackageChanges } from './types/GeneratedPackageChanges.js'; import type { InitPackageResult } from './types/InitPackageResult.js'; import type { InitOptions } from './types/InitOptions.js'; import type { BundleMessage } from '@ms-cloudpack/common-types'; import { type GeneratedChange } from './types/GeneratedChange.js'; import type { EnsurePackageBundledResult } from '@ms-cloudpack/api-server'; /** * Creates a summary tracking helper for the `init` verb to use to record statistics about results and needed * changes. The `record*` methods of the returned object will be used within init to add the stats, and the * `summarize` method will return the final tally. The resulting `InitSummary` object can be used in the * `formatInitSummary` helper to convert it to a string for the user. */ export declare class InitSummaryData { /** Set this to indicate that the generated config was deleted. */ deletedGeneratedConfig: boolean; /** Mapping from absolute package path to results */ private _packageResults; /** Mapping from absolute package path to generated config updates */ private _generatedUpdates; private _startTime; private _appPath; private _check; constructor(params: Pick & { appPath: string; }); /** * Returns whether any generated changes have been recorded. */ hasChanges(): boolean; /** * Saves a package bundle result. Overwrites the previous result if there was one. * @param packagePath - Absolute package path */ recordResult(packagePath: string, result: Pick): void; /** * Record an exception for a given package path. * This creates a bundle message like "Error thrown while (context): (error)". * * (Unlike `addErrors`, this will create an overall package result if one doesn't exist yet.) */ recordException(params: { /** Absolute package path */ packagePath: string; /** Error object or other caught item */ error: unknown; /** Bundler or step that generated this message. */ source: string; /** Description of the context in which the error was thrown, e.g. "evaluating package" */ context: string; /** Package name in case no result has been recorded for this package yet */ name?: string; /** Package version in case no result has been recorded for this package yet */ version?: string; }): void; /** * Record more errors for a given package path. * @param packagePath - Absolute package path */ addErrors(packagePath: string, errors: BundleMessage[]): void; /** * Record more warnings for a given package path. * @param packagePath - Absolute package path */ addWarnings(packagePath: string, warnings: BundleMessage[]): void; /** * Get the recorded package results. * @returns Mapping from absolute package path to results */ getResults(): Record; /** * Get the recorded generated config updates. * @returns Mapping from absolute package path to generated config updates */ getGeneratedChanges(): Record; /** * Save generated config updates, potentially from multiple packages. * @param allChanges - The generated config update to save. */ recordGeneratedChanges(allChanges: GeneratedPackageChanges[]): void; /** * Returns the summary of the results. */ summarize(): InitSummary; } /** * Sort generated changes in-place alphabetically by `.change` (description). * Returns the array for convenience (though it's the same object). */ export declare function sortChanges(changes: GeneratedChange[]): GeneratedChange[]; //# sourceMappingURL=InitSummaryData.d.ts.map