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"

119 lines (117 loc) 3.16 kB
import { ANSI } from './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.Reset; return this; } bold(text) { this._value += ANSI.Bold + text.toString() + ANSI.BoldReset; return this; } italic(text) { this._value += ANSI.Italic + text.toString() + ANSI.ItalicReset; return this; } underline(text) { this._value += ANSI.Underline + text.toString() + ANSI.UnderlineReset; return this; } strike(text) { this._value += ANSI.Strike + text.toString() + ANSI.StrikeReset; return this; } black(text) { this._value += ANSI.ForegroundBlack + text.toString() + ANSI.ForegroundReset; return this; } bgBlack(text) { this._value += ANSI.BackgroundBlack + text.toString() + ANSI.BackgroundReset; return this; } red(text) { this._value += ANSI.ForegroundRed + text.toString() + ANSI.ForegroundReset; return this; } bgRed(text) { this._value += ANSI.BackgroundRed + text.toString() + ANSI.BackgroundReset; return this; } green(text) { this._value += ANSI.ForegroundGreen + text.toString() + ANSI.ForegroundReset; return this; } bgGreen(text) { this._value += ANSI.BackgroundGreen + text.toString() + ANSI.BackgroundReset; return this; } yellow(text) { this._value += ANSI.ForegroundYellow + text.toString() + ANSI.ForegroundReset; return this; } bgYellow(text) { this._value += ANSI.BackgroundYellow + text.toString() + ANSI.BackgroundReset; return this; } blue(text) { this._value += ANSI.ForegroundBlue + text.toString() + ANSI.ForegroundReset; return this; } bgBlue(text) { this._value += ANSI.BackgroundBlue + text.toString() + ANSI.BackgroundReset; return this; } magenta(text) { this._value += ANSI.ForegroundMagenta + text.toString() + ANSI.ForegroundReset; return this; } bgMagenta(text) { this._value += ANSI.BackgroundMagenta + text.toString() + ANSI.BackgroundReset; return this; } cyan(text) { this._value += ANSI.ForegroundCyan + text.toString() + ANSI.ForegroundReset; return this; } bgCyan(text) { this._value += ANSI.BackgroundCyan + text.toString() + ANSI.BackgroundReset; return this; } white(text) { this._value += ANSI.ForegroundWhite + text.toString() + ANSI.ForegroundReset; return this; } bgWhite(text) { this._value += ANSI.BackgroundWhite + text.toString() + ANSI.BackgroundReset; return this; } gray(text) { this._value += ANSI.ForegroundGray + text.toString() + ANSI.ForegroundReset; return this; } default(text) { this._value += ANSI.ForegroundDefault + text.toString() + ANSI.ForegroundReset; return this; } bgDefault(text) { this._value += ANSI.BackgroundDefault + text.toString() + ANSI.BackgroundReset; return this; } toString() { return this._value; } } export { String }; //# sourceMappingURL=string.mjs.map //# sourceMappingURL=string.mjs.map