-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
137 lines (137 loc) · 3.57 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/**
* A color to paint a string in.
*/
declare type Color = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'bold' | 'blink' | 'conceal';
/**
* An effect you can give to a string.
*/
declare type Effect = 'bold' | 'blink' | 'conceal';
/**
* A valid color or effect.
*/
declare type ColorOrEffect = Color | Effect;
/**
* An array of valid colors or effects.
*/
declare type ArrayOfColorsOrEffects = ColorOrEffect[];
/**
* Color `str` with color `color`.
*
* @param str The string to paint in color!
* @param color The color to paint the string in.
*/
export declare function coloring(str: string, color: ColorOrEffect): string;
/**
* Color `str` with colors `colors`.
*
* @param str The string to paint in color!
* @param colors The colors to paint the string in.
*/
export declare function coloring(str: string, colors: ArrayOfColorsOrEffects): string;
/**
* Colors `text` in a rainbow pattern.
*
* @param str The string to paint in color!
* @returns The colored string.
*/
export declare function rainbowify(str: string): string;
/**
* @class This is a colorizer class.
*/
export declare class Colorizer {
private __string;
constructor();
/**
* Paints `text` in black.
*
* @param text The text to paint in black.
* @returns `this` object for chaining.
*/
black(text: string): this;
/**
* Paints `text` in red.
*
* @param text The text to paint in red.
* @returns `this` object for chaining.
*/
red(text: string): this;
/**
* Paints `text` in green.
*
* @param text The text to paint in green.
* @returns `this` object for chaining.
*/
green(text: string): this;
/**
* Paints `text` in yellow.
*
* @param text The text to paint in yellow.
* @returns `this` object for chaining.
*/
yellow(text: string): this;
/**
* Paints `text` in blue.
*
* @param text The text to paint in blue.
* @returns `this` object for chaining.
*/
blue(text: string): this;
/**
* Paints `text` in magenta.
*
* @param text The text to paint in magenta.
* @returns `this` object for chaining.
*/
magenta(text: string): this;
/**
* Paints `text` in cyan.
*
* @param text The text to paint in cyan.
* @returns `this` object for chaining.
*/
cyan(text: string): this;
/**
* Paints `text` in white.
*
* @param text The text to paint in white.
* @returns `this` object for chaining.
*/
white(text: string): this;
/**
* Makes `text` **bold**.
*
* @param text The text to make **bold**.
* @returns `this` object for chaining.
*/
bold(text: string): this;
/**
* Makes `text` blink.
*
* @param text The text to make blink.
* @returns `this` object for chaining.
*/
blink(text: string): this;
/**
* Conceals `text`.
*
* @param text The text to conceal.
* @returns `this` object for chaining.
*/
conceal(text: string): this;
/**
* Turns this object into the final string.
*
* @returns The string with all colors in this object.
*/
toString(): string;
/**
* Resolves the object to the final string.
* @deprecated Use {@link Colorizer.prototype.toString} instead.
*/
resolve(): string;
}
/**
* @deprecated This is a deprecated alias for the `Colorizer` class. Use {@link Colorizer} instead.
*/
export declare const Coloring: typeof Colorizer;
export type { ArrayOfColorsOrEffects, ColorOrEffect, Color, Effect };