mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
Add colors strip and stripColors methods (#11160)
This commit is contained in:
committed by
Masahiro Wakame
parent
874a60bc68
commit
b154604078
@@ -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
9
colors/colors.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user