From 3e45d42e16c441b3831bed279c3198928ff5a508 Mon Sep 17 00:00:00 2001 From: Staffan Eketorp Date: Wed, 28 Dec 2016 00:12:58 +0100 Subject: [PATCH] Types 2.0 (#13294) * colors: added "colors/safe" module * colors: fix old lint error * colors: added enabled: boolean for "colors/safe" --- colors/index.d.ts | 49 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/colors/index.d.ts b/colors/index.d.ts index 50e960c416..87612a6f36 100644 --- a/colors/index.d.ts +++ b/colors/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Colors.js 0.6.0-1 +// Type definitions for Colors.js 1.1 // Project: https://github.com/Marak/colors.js -// Definitions by: Bart van der Schoor +// Definitions by: Bart van der Schoor , Staffan Eketorp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "colors" { @@ -48,7 +48,7 @@ declare module "colors" { } namespace e { - export function setTheme(theme:any): void; + export function setTheme(theme: any): void; export var enabled: boolean; @@ -135,3 +135,46 @@ interface String { random: string; zalgo: string; } + +declare module 'colors/safe' { + export var enabled: boolean; + + export function strip(str: string): string; + export function stripColors(str: string): string; + + export function black(str: string): string; + export function red(str: string): string; + export function green(str: string): string; + export function yellow(str: string): string; + export function blue(str: string): string; + export function magenta(str: string): string; + export function cyan(str: string): string; + export function white(str: string): string; + export function gray(str: string): string; + export function grey(str: string): string; + + export function bgBlack(str: string): string; + export function bgRed(str: string): string; + export function bgGreen(str: string): string; + export function bgYellow(str: string): string; + export function bgBlue(str: string): string; + export function bgMagenta(str: string): string; + export function bgCyan(str: string): string; + export function bgWhite(str: string): string; + + export function reset(str: string): string; + export function bold(str: string): string; + export function dim(str: string): string; + export function italic(str: string): string; + export function underline(str: string): string; + export function inverse(str: string): string; + export function hidden(str: string): string; + export function strikethrough(str: string): string; + + export function rainbow(str: string): string; + export function zebra(str: string): string; + export function america(str: string): string; + export function trap(str: string): string; + export function random(str: string): string; + export function zalgo(str: string): string; +}