@autorest/go
Version:
AutoRest Go Generator
42 lines • 1.39 kB
TypeScript
import * as go from '../../codemodel.go/src/index.js';
/** abstractions over various file handling facilities */
export interface FsFacilities {
/** checks if a file exists */
exists: (name: string) => Promise<boolean>;
/**
* reads the contents of a file.
* this function assumes the file exists.
*/
read: (name: string) => Promise<string>;
/** writes contents to a file */
write: (name: string, content: string) => Promise<void>;
}
/** used to write a Go code model to disk */
export declare class Emitter {
private readonly codeModel;
private readonly fs;
private readonly filePrefix;
constructor(codeModel: go.CodeModel, fs: FsFacilities, options?: {
filePrefix?: string;
});
/**
* writes the core code model content.
* this content is common to both emitters.
*/
emit(): Promise<void>;
/** writes the cloud_config.go file */
emitCloudConfig(): Promise<void>;
/** writes the *_example_test.go files */
emitExamples(): Promise<void>;
/** writes the LICENSE.txt file */
emitLicenseFile(): Promise<void>;
/** writes the emitter metadata file */
emitMetadataFile(): Promise<void>;
/**
* recursively emits package contents.
*
* @param emitForPkg the package contents to emit
*/
private recursiveEmit;
}
//# sourceMappingURL=emitter.d.ts.map