@grouparoo/core
Version:
The Grouparoo Core
43 lines (42 loc) • 1.48 kB
TypeScript
export interface ConfigTemplateParams {
id?: string;
[key: string]: string | number | boolean;
}
/**
* This will then be used to write the files (and deciding if we overwrite or not)
*/
export interface ConfigTemplateRunResponse {
[relativeFileName: string]: string;
}
export declare abstract class ConfigTemplate {
name: string;
description: string;
params: ConfigTemplateParams;
inputs?: {
[name: string]: {
required: boolean;
default?: string | number | boolean;
description: string;
copyDefaultFrom?: string;
formatter?: (param: string) => any;
};
};
files: string[];
destinationDir: string;
parentId?: string;
constructor();
/** The main 'do something' method. Throw is there was an error */
abstract run({ params, }: {
params: ConfigTemplateParams;
}): Promise<ConfigTemplateRunResponse>;
prepareParams(params: ConfigTemplateParams): ConfigTemplateParams;
formatForFilesystem(s: string): string;
formatId(s: string): string;
/**
* The nominal case where all provided mustache files are computed and copied into the client project
*/
mustacheAllFiles(params: ConfigTemplateParams, files?: string[], destinationDir?: string): Promise<ConfigTemplateRunResponse>;
resolveFiles(filesList: string[]): Promise<string[]>;
unquotedId(): null | string;
extendId(extension: string): null | string;
}