forked from plopjs/node-plop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
56 lines (47 loc) · 1.66 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import inquirer = require("inquirer");
interface NodePlopAPI{
getGenerator(name:string):PlopGenerator;
setGenerator(name:string, config:PlopGenerator):PlopGenerator;
setPrompt(name: string, prompt: inquirer.PromptModule): void;
setWelcomeMessage(message:string):void;
getWelcomeMessage():string;
getGeneratorList():{name:string,description:string}[];
setPartial(name:string, str:string):void;
getPartial(name:string):string,
getPartialList():string[];
setHelper(name:string,fn:Function):void;
getHelper(name:string):Function;
getHelperList():string[];
setActionType(name:string, fn:Function):Function;
getActionType(name:string):Function;
getActionTypeList():string[];
setPlopfilePath(filePath:string):void;
getPlopfilePath():string;
getDestBasePath():string;
// plop.load functionality
load(target:string[] | string,loadCfg:PlopCfg, includeOverride:boolean):void;
setDefaultInclude(inc:object):void;
getDefaultInclude():object;
renderString(template:string, data:any):String;//set to any matching handlebars declaration
// passthroughs for backward compatibility
addPrompt(name:string, prompt:inquirer.PromptModule): void;
addPartial(name:string, str:string):void;
addHelper(name:string,fn:Function):void;
}
interface PlopGenerator{
description:string;
prompts:inquirer.Question[];
actions:ActionConfig[];
}
interface ActionConfig{
type:string;
force:boolean;
data:object;
abortOnFail:boolean;
}
interface PlopCfg{
force:boolean;
destBasePath:string;
}
declare function nodePlop(plopfilePath:string, plopCfg:PlopCfg):NodePlopAPI;
export = nodePlop;