@baseplate-dev/sync
Version:
Library for syncing Baseplate descriptions
46 lines • 1.5 kB
TypeScript
import type { Logger } from '#src/utils/index.js';
import type { GeneratorOutputFormatter } from './formatter.js';
import type { GeneratorTaskOutput, WriteFileOptions } from './generator-task-output.js';
/**
* Options for formatting generator output
*/
export interface FormatGeneratorOutputOptions {
/**
* Output directory for the files (used by formatters)
*/
outputDirectory: string;
/**
* Logger to use for formatting operations
*/
logger?: Logger;
}
/**
* Result of formatting generator output
*/
export interface FormatGeneratorOutputResult {
/**
* Map of file paths to formatted file data
*/
files: Map<string, {
id: string;
contents: Buffer | string;
options?: WriteFileOptions;
}>;
/**
* The commands to run after the files are written
*/
postWriteCommands: GeneratorTaskOutput['postWriteCommands'];
/**
* The formatters that will be applied to all files depending on their extension
*/
globalFormatters: GeneratorOutputFormatter[];
}
/**
* Format all files in a generator task output using the available formatters
*
* @param output - The generator task output to format
* @param options - Options for formatting
* @returns The formatted generator output
*/
export declare function formatGeneratorOutput(output: GeneratorTaskOutput, options: FormatGeneratorOutputOptions): Promise<FormatGeneratorOutputResult>;
//# sourceMappingURL=format-generator-output.d.ts.map