-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.d.ts
149 lines (149 loc) · 4.38 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
138
139
140
141
142
143
144
145
146
147
148
149
/**
* Create a map of nestable functions, allowing color to be applied a-lá-chalk.
* @param {Object} palette A map of name/color definitions.
* @return {function} The resultant name/function map.
*/
export function chalkish(palette: any): Function;
/**
* Create a map of trucolor instances from a map of name/color values.
* @param {Object} options Options to pass to trucolor creation.
* @param {Object} palette A map of name/color definitions.
* @return {Object} The resultant name/trucolor map.
*/
export function palette(options: any, palette: any): any;
declare function parser(color: any): Processor[];
export function render(processor: any, { colorFlags, format, force, }: {
colorFlags?: {};
format: any;
force: any;
}): any;
/**
* Create a simple, sharable palette
* @param {Object} options Options to pass to trucolor creation.
* @return {Object} The resultant name/trucolor map.
* @example
* {
* white: '#BBB',
* black: '#111',
* red: '#B00',
* green: '#0B0',
* blue: '#44B',
* cyan: '#0BB',
* yellow: '#BB0',
* magenta: '#B0B',
* brightWhite: '#FFF',
* brightRed: '#F33',
* brightGreen: '#3F3',
* brightBlue: '#44F',
* brightCyan: '#3FF',
* brightYellow: '#FF3',
* brightMagenta: '#F3F',
* dim: 'dim',
* bold: 'bold',
* italic: 'italic',
* invert: 'invert',
* example: '#CC99FF',
* command: '#31A0FF',
* argument: '#7DC3FF',
* option: '#C1BA89',
* operator: '#FFFFFF',
* grey: '#808080',
* title: 'bold #80C480',
* normal: 'normal',
* reset: 'reset'
* }
*/
export function simple(options: any): any;
/**
* Color retreival API. Will return different values if called with a cli or sgr context.
* @name Trucolor
* @typedef {Trucolor}
* @property {string} name - Human readable color name.
* @property {string} in - Opening SGR code
* @property {string} out - Closing SGR code
* @property {string} hex - #RRGGBB Hexadecimal color value (or SGR reset name)
* @property {string} rgb - 'rgb(red, green, blue)' CSS format (or SGR reset name)
* @property {function} toString - Returns a Hex code, SGR in code or CLI
* arguments with formatting flags, depending on
* format.
* @property {function} toSwatch - Returns a graphic swatch of the color.
*/
/**
* Create an SGR-aware color from a loose text definition.
* @param {string} color A color definition.
* @param {Object} options Options.
* @property {string} options.format Output collection format. [ default | sgr | cli ]
* @property {string} options.force Force a colour depth [ (4|color}, (8|256), (24|16m) ]
* @return {Trucolor} A Trucolor instance.
*/
export function trucolor(color: string, options?: any): any;
/**
* Color retreival API. Will return different values if called with a cli or sgr context.
*/
export type trucolor = any;
declare class Processor {
constructor(colorname: any);
baseName: any;
lockedName: boolean;
attributes: {
background: boolean;
bold: boolean;
dim: boolean;
italic: boolean;
invert: boolean;
underline: boolean;
blink: boolean;
};
haveAttrs: boolean;
haveSource: boolean;
queue: any[];
haveQueue: boolean;
namePrefix: string;
nameSuffix: string;
render(): any;
set source(arg: any);
get source(): any;
interpreter: any;
get hasSource(): boolean;
get name(): string | true;
get rgb(): any;
lock(lockedName: any): void;
get locked(): boolean;
get input(): any;
get human(): any;
get hasAttrs(): boolean;
set attrs(arg: {
background: boolean;
bold: boolean;
dim: boolean;
italic: boolean;
invert: boolean;
underline: boolean;
blink: boolean;
});
get attrs(): {
background: boolean;
bold: boolean;
dim: boolean;
italic: boolean;
invert: boolean;
underline: boolean;
blink: boolean;
};
addStep(step: any): void;
background(): void;
bold(): void;
dim(): void;
italic(): void;
invert(): void;
underline(): void;
blink(): void;
saturate(args: any): void;
desaturate(args: any): void;
darken(args: any): void;
lighten(args: any): void;
spin(args: any): void;
mono(): void;
mix(args: any): void;
}
export { parser as parse };