1234567891011121314151617181920212223 |
- module.exports = class PromptModuleAPI {
- constructor (creator) {
- this.creator = creator
- }
- injectFeature (feature) {
- this.creator.featurePrompt.choices.push(feature)
- }
- injectPrompt (prompt) {
- this.creator.injectedPrompts.push(prompt)
- }
- injectOptionForPrompt (name, option) {
- this.creator.injectedPrompts.find(f => {
- return f.name === name
- }).choices.push(option)
- }
- onPromptComplete (cb) {
- this.creator.promptCompleteCbs.push(cb)
- }
- }
|