UNPKG

1.36 kBTypeScriptView Raw
1import { ApplicationContract } from '@ioc:Adonis/Core/Application';
2import * as sink from '../../../index';
3import { TemplateNode } from '../../Contracts';
4/**
5 * Templates manager to copy one or more templates to the user project.
6 */
7export declare class TemplatesManager {
8 private projectRoot;
9 private templatesSourceDir;
10 private application;
11 private logger;
12 constructor(projectRoot: string, templatesSourceDir: string, application: ApplicationContract);
13 /**
14 * Normalizes the template node to its object version
15 */
16 private normalizeTemplateNode;
17 /**
18 * Returns directory for the template key. It is defined inside the adonisrc file.
19 */
20 private getDirectoryFor;
21 /**
22 * Copy templates for a given pre-defined directory within the rcfile.
23 */
24 private copyTemplateFor;
25 /**
26 * Copy one or more templates for a given pre-defined directory within the rc file.
27 */
28 private copyTemplatesFor;
29 /**
30 * Define a custom logger to use
31 */
32 useLogger(logger: typeof sink.logger): this;
33 /**
34 * Copy multiple templates to the destination. It takes the input of templates
35 * defined inside the package.json file.
36 */
37 copy(templates: {
38 [key: string]: TemplateNode | TemplateNode[];
39 }): Promise<void>;
40}