Add colors strip and stripColors methods (#11160)

This commit is contained in:
Bastien Caudan
2016-09-14 13:40:39 +02:00
committed by Masahiro Wakame
parent 874a60bc68
commit b154604078
2 changed files with 11 additions and 0 deletions

View File

@@ -8,9 +8,11 @@ colors.enabled = true;
console.log(colors.black.underline('test'));
console.log(colors.rainbow.black.blue.gray('test'));
console.log(colors.random.reset.bgWhite.dim('test'));
console.log(colors.random.reset.bgWhite.strip('test'));
console.log('test'.black.underline);
console.log('test'.rainbow.black.blue.gray);
console.log('test'.random.reset.bgWhite.dim);
console.log('test'.random.reset.bgWhite.dim.stripColors);
colors.enabled = false;

9
colors/colors.d.ts vendored
View File

@@ -7,6 +7,9 @@ declare module "colors" {
interface Color {
(text: string): string;
strip: Color;
stripColors: Color;
black: Color;
red: Color;
green: Color;
@@ -49,6 +52,9 @@ declare module "colors" {
export var enabled: boolean;
export var strip: Color;
export var stripColors: Color;
export var black: Color;
export var red: Color;
export var green: Color;
@@ -90,6 +96,9 @@ declare module "colors" {
}
interface String {
strip: string;
stripColors: string;
black: string;
red: string;
green: string;