Add color functions to the colors module and tests for them

This commit is contained in:
Panu Horsmalahti 2014-11-25 15:11:36 +02:00
parent 266324c29c
commit 8672d44de7
2 changed files with 24 additions and 0 deletions

View File

@ -1,5 +1,18 @@
///<reference path="colors.d.ts" />
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();

11
colors/colors.d.ts vendored
View File

@ -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 {