当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript prompt.get函数代码示例

本文整理汇总了TypeScript中prompt.get函数的典型用法代码示例。如果您正苦于以下问题:TypeScript get函数的具体用法?TypeScript get怎么用?TypeScript get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: Promise

        return new Promise((resolve, reject) => {
            prompt.message = '';
            prompt.start();

            let schema = {
                properties: {
                    clientId: {
                        default: this.clientId,
                    },
                    clientSecret: {
                        default: this.clientSecret,
                    },
                    endpoint: {
                        default: this.endpoint,
                    },
                },
            };

            prompt.get(schema, (err, result) => {
                if (result === undefined) {
                    return;
                }

                this.copyFrom(result);
                this.write();
                resolve(this);
            });
        });
开发者ID:victorjacobs,项目名称:chullo-client,代码行数:28,代码来源:configuration.ts

示例2: _startPrompt

	return new Promise<void>(function(fulfill, reject) {


		_startPrompt();

		let schema = {
			properties: {
				key: {
					description: 'Client key to delete:',
					required: true
				}
			}
		};

		Prompt.get(schema, function(err, result) {
			if (err) {
				reject(err);
			}
			else {
				let key = result['key'];
				_deleteClient(authenticator, key).then(fulfill).catch(reject);
			}
		});

	});
开发者ID:bitpi,项目名称:Obsidian-Server,代码行数:25,代码来源:client_manager.ts

示例3: resolve

 return new Promise<IAnswers>(resolve => {
   prompt.get(this.createQuestions(), (err, result) => {
     if (err != null) {
       console.error(err)
       process.exit(1)
     } else {
       resolve(result)
     }
   })
 })
开发者ID:elentok,项目名称:dotfiles,代码行数:10,代码来源:extension_syncer.ts

示例4: promptToUse

function promptToUse(): Q.IPromise<boolean> {
    var dfd = Q.defer<boolean>();
    prompt.get(use, function (err, result) {
        handleError(err);

        var useIt = result.use === "y" || result.use === "yes";
        dfd.resolve(useIt);
    });
    return dfd.promise;
}
开发者ID:aintgoin2goa,项目名称:recap,代码行数:10,代码来源:ConfigGenerator.ts

示例5: promptForWaitTime

function promptForWaitTime(): Q.IPromise<boolean> {
    var dfd = Q.defer<boolean>();
    prompt.get(wait, function (err, result) {
        handleError(err);

        config.urls[Object.keys(config.urls)[0]].waitTime = result.wait;
        dfd.resolve(true);
    });
    return dfd.promise;
}
开发者ID:aintgoin2goa,项目名称:recap,代码行数:10,代码来源:ConfigGenerator.ts

示例6: promptForDest

function promptForDest(): Q.IPromise<boolean> {
    var dfd = Q.defer<boolean>();
    prompt.get(dest, function (err, result) {
        handleError(err);

        config.dest = result.dest;
        dfd.resolve(true);
    });
    return dfd.promise;
}
开发者ID:aintgoin2goa,项目名称:recap,代码行数:10,代码来源:ConfigGenerator.ts

示例7: promptForWidths

function promptForWidths(): Q.IPromise<boolean> {
    var dfd = Q.defer<boolean>();
    prompt.get(widths, function (err, result) {
        handleError(err);

        config.widths = result.widths.split(",");
        dfd.resolve(true);
    });
    return dfd.promise;
}
开发者ID:aintgoin2goa,项目名称:recap,代码行数:10,代码来源:ConfigGenerator.ts

示例8: promptForCrawl

function promptForCrawl(): Q.IPromise<boolean> {
    var dfd =Q.defer<boolean>();
    prompt.get(crawl, function(err, result){
        handleError(err);

        var crawl = (result.crawl === "y" || result.crawl === "yes");
        config.urls[Object.keys(config.urls)[0]].crawl = crawl;
        dfd.resolve(true);
    });
    return dfd.promise;
}
开发者ID:aintgoin2goa,项目名称:recap,代码行数:11,代码来源:ConfigGenerator.ts

示例9: libraryNameCreate

/**
 * Asks the user for the name of the library if it has been cloned into the
 * default directory, or if they want a different name to the one suggested
 */
function libraryNameCreate() {
  _prompt.get(_promptSchemaLibraryName, (err: any, res: any) => {
    if (err) {
      console.log(colors.red("Sorry, there was an error building the workspace :("))
      removeItems()
      process.exit(1)
      return
    }

    setupLibrary(res.library)
  })
}
开发者ID:robertrbairdii,项目名称:typescript-library-starter,代码行数:16,代码来源:init.ts

示例10: function

 function(callback) {
   var repo = repos.shift();
   console.log("Repository [%s]", repo.name);
   prompt.get(InstallSchema, function(err, result) {
     // don't break execution for an error at the prompt, assume no
     if(err) return console.error(err);
     if(result.install.charAt(0) === "y") {
       resultingRepos.push(repo);
     }
     callback(null);
   });
 },
开发者ID:my-koop,项目名称:installation,代码行数:12,代码来源:index-install.ts


注:本文中的prompt.get函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。