UNPKG

486 BJavaScriptView Raw
1module.exports = class PromptModuleAPI {
2 constructor (creator) {
3 this.creator = creator
4 }
5
6 injectFeature (feature) {
7 this.creator.featurePrompt.choices.push(feature)
8 }
9
10 injectPrompt (prompt) {
11 this.creator.injectedPrompts.push(prompt)
12 }
13
14 injectOptionForPrompt (name, option) {
15 this.creator.injectedPrompts.find(f => {
16 return f.name === name
17 }).choices.push(option)
18 }
19
20 onPromptComplete (cb) {
21 this.creator.promptCompleteCbs.push(cb)
22 }
23}