UNPKG

@microsoft/teams.common

Version:

<p> <a href="https://www.npmjs.com/package/@microsoft/teams.common" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.common" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.common?activeTab=code"

121 lines (118 loc) 3.41 kB
'use strict'; var ansi = require('./ansi'); class String { _value; constructor(value = "") { this._value = value; } clear() { this._value = ""; return this; } append(...text) { this._value += text.join(""); return this; } reset() { this._value += ansi.ANSI.Reset; return this; } bold(text) { this._value += ansi.ANSI.Bold + text.toString() + ansi.ANSI.BoldReset; return this; } italic(text) { this._value += ansi.ANSI.Italic + text.toString() + ansi.ANSI.ItalicReset; return this; } underline(text) { this._value += ansi.ANSI.Underline + text.toString() + ansi.ANSI.UnderlineReset; return this; } strike(text) { this._value += ansi.ANSI.Strike + text.toString() + ansi.ANSI.StrikeReset; return this; } black(text) { this._value += ansi.ANSI.ForegroundBlack + text.toString() + ansi.ANSI.ForegroundReset; return this; } bgBlack(text) { this._value += ansi.ANSI.BackgroundBlack + text.toString() + ansi.ANSI.BackgroundReset; return this; } red(text) { this._value += ansi.ANSI.ForegroundRed + text.toString() + ansi.ANSI.ForegroundReset; return this; } bgRed(text) { this._value += ansi.ANSI.BackgroundRed + text.toString() + ansi.ANSI.BackgroundReset; return this; } green(text) { this._value += ansi.ANSI.ForegroundGreen + text.toString() + ansi.ANSI.ForegroundReset; return this; } bgGreen(text) { this._value += ansi.ANSI.BackgroundGreen + text.toString() + ansi.ANSI.BackgroundReset; return this; } yellow(text) { this._value += ansi.ANSI.ForegroundYellow + text.toString() + ansi.ANSI.ForegroundReset; return this; } bgYellow(text) { this._value += ansi.ANSI.BackgroundYellow + text.toString() + ansi.ANSI.BackgroundReset; return this; } blue(text) { this._value += ansi.ANSI.ForegroundBlue + text.toString() + ansi.ANSI.ForegroundReset; return this; } bgBlue(text) { this._value += ansi.ANSI.BackgroundBlue + text.toString() + ansi.ANSI.BackgroundReset; return this; } magenta(text) { this._value += ansi.ANSI.ForegroundMagenta + text.toString() + ansi.ANSI.ForegroundReset; return this; } bgMagenta(text) { this._value += ansi.ANSI.BackgroundMagenta + text.toString() + ansi.ANSI.BackgroundReset; return this; } cyan(text) { this._value += ansi.ANSI.ForegroundCyan + text.toString() + ansi.ANSI.ForegroundReset; return this; } bgCyan(text) { this._value += ansi.ANSI.BackgroundCyan + text.toString() + ansi.ANSI.BackgroundReset; return this; } white(text) { this._value += ansi.ANSI.ForegroundWhite + text.toString() + ansi.ANSI.ForegroundReset; return this; } bgWhite(text) { this._value += ansi.ANSI.BackgroundWhite + text.toString() + ansi.ANSI.BackgroundReset; return this; } gray(text) { this._value += ansi.ANSI.ForegroundGray + text.toString() + ansi.ANSI.ForegroundReset; return this; } default(text) { this._value += ansi.ANSI.ForegroundDefault + text.toString() + ansi.ANSI.ForegroundReset; return this; } bgDefault(text) { this._value += ansi.ANSI.BackgroundDefault + text.toString() + ansi.ANSI.BackgroundReset; return this; } toString() { return this._value; } } exports.String = String; //# sourceMappingURL=string.js.map //# sourceMappingURL=string.js.map