@sanpjs/generator
Version:
@sanpjs/generator
45 lines (44 loc) • 1.01 kB
TypeScript
import {Logger} from '@sanpjs/utils';
export interface Action {
type: string;
files?: string | string[] | {
(templateVars: any): string | string[];
};
filters?: {
[key: string]: string;
};
patterns?:
| {
[key: string]: string;
}
| {
[key: string]: (from: string, vars: any) => string;
};
handler?: {
(content: string, filePath: string): string;
};
templateDir?: string;
outputDir?: string;
templateVars?: {
[key: string]: any;
};
cwdbase?: boolean;
}
export interface GConfig {
configFile?: string | boolean;
actions: Action[];
outputDir: string;
templateDir: string;
lodashTemplateSettings?: {
[key: string]: any;
};
templateVars?: {
[key: string]: any;
};
before?: {
(config: GConfig, utils?: {logger: Logger}): void;
};
after?: {
(config: GConfig, utils?: {logger: Logger}): void;
}
}