37 lines
3.1 KiB
JavaScript
37 lines
3.1 KiB
JavaScript
|
"use strict";
|
||
|
/// <reference path="./typings/main.d.ts" />
|
||
|
var plugins = require("./beautylog.plugins");
|
||
|
var log = require("./beautylog.log");
|
||
|
var Ora = (function () {
|
||
|
function Ora(textArg, colorArg) {
|
||
|
this._oraObject = plugins.ora({
|
||
|
spinner: "dots",
|
||
|
text: textArg,
|
||
|
color: colorArg
|
||
|
});
|
||
|
this._oraObject.start();
|
||
|
}
|
||
|
Ora.prototype.text = function (textArg) {
|
||
|
this._oraObject.text = textArg;
|
||
|
};
|
||
|
;
|
||
|
Ora.prototype.end = function () {
|
||
|
this._oraObject.stop();
|
||
|
this._oraObject.clear();
|
||
|
};
|
||
|
Ora.prototype.endOk = function (textArg) {
|
||
|
this.end();
|
||
|
log.ok(textArg);
|
||
|
};
|
||
|
;
|
||
|
Ora.prototype.endError = function (textArg) {
|
||
|
this.end();
|
||
|
log.error(textArg);
|
||
|
};
|
||
|
;
|
||
|
return Ora;
|
||
|
}());
|
||
|
exports.Ora = Ora;
|
||
|
|
||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5jbGFzc2VzLm9yYS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQVksT0FBTyxXQUFNLHFCQUFxQixDQUFDLENBQUE7QUFDL0MsSUFBWSxHQUFHLFdBQU0saUJBQWlCLENBQUMsQ0FBQTtBQUV2QztJQUdJLGFBQVksT0FBYyxFQUFDLFFBQWU7UUFDdEMsSUFBSSxDQUFDLFVBQVUsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDO1lBQzFCLE9BQU8sRUFBQyxNQUFNO1lBQ2QsSUFBSSxFQUFDLE9BQU87WUFDWixLQUFLLEVBQUMsUUFBUTtTQUNqQixDQUFDLENBQUM7UUFDSCxJQUFJLENBQUMsVUFBVSxDQUF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