本文整理汇总了TypeScript中clui.Spinner类的典型用法代码示例。如果您正苦于以下问题:TypeScript Spinner类的具体用法?TypeScript Spinner怎么用?TypeScript Spinner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Spinner类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: return
return (() => {
let [platform, version] = platformParam.split("@");
this.validatePlatform(platform);
let platformPath = path.join(this.$projectData.platformsDir, platform);
if (this.$fs.exists(platformPath).wait()) {
this.$errors.failWithoutHelp("Platform %s already added", platform);
}
let platformData = this.$platformsData.getPlatformData(platform);
// Copy platform specific files in platforms dir
let platformProjectService = platformData.platformProjectService;
platformProjectService.validate().wait();
// Log the values for project
this.$logger.trace("Creating NativeScript project for the %s platform", platform);
this.$logger.trace("Path: %s", platformData.projectRoot);
this.$logger.trace("Package: %s", this.$projectData.projectId);
this.$logger.trace("Name: %s", this.$projectData.projectName);
this.$logger.out("Copying template files...");
let packageToInstall = "";
let npmOptions: IStringDictionary = {
pathToSave: path.join(this.$projectData.platformsDir, platform)
};
if (this.$options.frameworkPath) {
packageToInstall = this.$options.frameworkPath;
} else {
packageToInstall = platformData.frameworkPackageName;
npmOptions["version"] = version;
}
let spinner = new clui.Spinner("Installing " + packageToInstall);
try {
spinner.start();
let downloadedPackagePath = this.$npmInstallationManager.install(packageToInstall, npmOptions).wait();
let frameworkDir = path.join(downloadedPackagePath, constants.PROJECT_FRAMEWORK_FOLDER_NAME);
frameworkDir = path.resolve(frameworkDir);
this.addPlatformCore(platformData, frameworkDir).wait();
} catch (err) {
this.$fs.deleteDirectory(platformPath).wait();
throw err;
} finally {
spinner.stop();
}
this.$logger.out("Project successfully created.");
}).future<void>()();
开发者ID:Emat12,项目名称:nativescript-cli,代码行数:55,代码来源:platform-service.ts
示例2: Progress
// Sparkline
const reqsPerSec = [10, 12, 3, 7, 12, 9, 23, 10, 9, 19, 16, 18, 12, 12];
console.log(Sparkline(reqsPerSec, 'reqs/sec'));
// Progress
const thisProgressBar = new Progress(20);
console.log(thisProgressBar.update(10, 30));
// or
const thisPercentBar = new Progress(20);
console.log(thisPercentBar.update(0.4));
// Spinner
const countdown = new Spinner('Exiting in 10 seconds... ', ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷']);
countdown.start();
let n = 10;
const interval = setInterval(() => {
n--;
countdown.message(`Exiting in ${n} seconds...`);
if (n === 0) {
console.log('\n');
countdown.stop();
clearInterval(interval);
}
}, 1000);
开发者ID:ChaosinaCan,项目名称:DefinitelyTyped,代码行数:29,代码来源:clui-tests.ts
示例3: setInterval
const interval = setInterval(() => {
n--;
countdown.message(`Exiting in ${n} seconds...`);
if (n === 0) {
console.log('\n');
countdown.stop();
clearInterval(interval);
}
}, 1000);
开发者ID:ChaosinaCan,项目名称:DefinitelyTyped,代码行数:9,代码来源:clui-tests.ts
注:本文中的clui.Spinner类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论