fixed small issue with optional params

This commit is contained in:
Philipp Kunz 2016-05-14 17:51:35 +02:00
parent 5f24ae865a
commit 542db5a2cf
3 changed files with 10 additions and 6 deletions

View File

@ -3,7 +3,7 @@ export declare class Ora {
state: string; state: string;
constructor(textArg: string, colorArg: string, startArg?: boolean); constructor(textArg: string, colorArg: string, startArg?: boolean);
text(textArg: any): void; text(textArg: any): void;
start(): void; start(textArg?: string, colorArg?: string): void;
end(): void; end(): void;
endOk(textArg: any): void; endOk(textArg: any): void;
endError(textArg: any): void; endError(textArg: any): void;

View File

@ -16,7 +16,11 @@ var Ora = (function () {
this._oraObject.text = textArg; this._oraObject.text = textArg;
}; };
; ;
Ora.prototype.start = function () { Ora.prototype.start = function (textArg, colorArg) {
if (textArg)
this._oraObject.text = textArg;
if (colorArg)
this._oraObject.color = colorArg;
this._oraObject.start(); this._oraObject.start();
}; };
; ;
@ -47,4 +51,4 @@ var Ora = (function () {
}()); }());
exports.Ora = Ora; exports.Ora = Ora;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5jbGFzc2VzLm9yYS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQVksT0FBTyxXQUFNLHFCQUFxQixDQUFDLENBQUE7QUFDL0MsSUFBWSxHQUFHLFdBQU0saUJBQWlCLENBQUMsQ0FBQTtBQUV2QztJQUdJLGFBQVksT0FBYyxFQUFDLFFBQWUsRUFBQyxRQUF3QjtRQUF4Qix3QkFBd0IsR0FBeEIsZ0JBQXdCO1FBQy9ELElBQUksQ0FBQyxVQUFVLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQztZQUMxQixPQUFPLEVBQUMsTUFBTTtZQUNkLElBQUksRUFBQyxPQUFPO1lBQ1osS0FBSyxFQUFDLFFBQVE7U0FDakIsQ0FBQyxDQUFDO1FBRUgsUUFBUSxHQUFHLElBQUksQ0FB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AgICAgICB0aGlzLnN0YXJ0KCk7XHJcbiAgICB9XHJcbn0iXX0=

View File

@ -18,9 +18,9 @@ export class Ora {
this._oraObject.text = textArg; this._oraObject.text = textArg;
}; };
start(textArg:string,colorArg:string){ start(textArg?:string,colorArg?:string){
this._oraObject.text = textArg; if(textArg) this._oraObject.text = textArg;
this._oraObject.color = colorArg; if(colorArg) this._oraObject.color = colorArg;
this._oraObject.start(); this._oraObject.start();
}; };
end(){ end(){