From 8672d44de79b80ec5533c4a8099d28aa12347ac4 Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Tue, 25 Nov 2014 15:11:36 +0200 Subject: [PATCH] Add color functions to the colors module and tests for them --- colors/colors-tests.ts | 13 +++++++++++++ colors/colors.d.ts | 11 +++++++++++ 2 files changed, 24 insertions(+) diff --git a/colors/colors-tests.ts b/colors/colors-tests.ts index bf83f60056..a7f595fdf1 100644 --- a/colors/colors-tests.ts +++ b/colors/colors-tests.ts @@ -1,5 +1,18 @@ /// +import colors = require("colors"); + var test:string = 'test'; var arr:string[] = ['color', 'odd'.italic.zebra, 'radical'.bold.rainbow, test.underline + 'super'.green]; + +colors.black("abc").trim(); +colors.red("abc").trim(); +colors.green("abc").trim(); +colors.yellow("abc").trim(); +colors.blue("abc").trim(); +colors.magenta("abc").trim(); +colors.cyan("abc").trim(); +colors.white("abc").trim(); +colors.gray("abc").trim(); +colors.grey("abc").trim(); diff --git a/colors/colors.d.ts b/colors/colors.d.ts index e6056b3540..8332ac5bb9 100644 --- a/colors/colors.d.ts +++ b/colors/colors.d.ts @@ -5,6 +5,17 @@ declare module "colors" { export function setTheme(theme:any):any; + + export function black(text: string): string; + export function red(text: string): string; + export function green(text: string): string; + export function yellow(text: string): string; + export function blue(text: string): string; + export function magenta(text: string): string; + export function cyan(text: string): string; + export function white(text: string): string; + export function gray(text: string): string; + export function grey(text: string): string; } interface String {