@oxog/pigment 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,245 @@
1
+ import { P as PigmentKernel, a as PigmentOptions, b as Pigment, C as ColorSupport, S as Styler, c as Platform } from './index-BE-MUtRO.js';
2
+ export { B as BoxBorder, o as BoxChars, k as BoxPluginOptions, E as EventHandler, G as GradientPluginOptions, K as Kernel, p as KernelOptions, e as PigmentContext, f as PigmentEvents, l as PigmentPluginOptions, d as Plugin, m as SemanticPluginOptions, g as Style, h as StyleFunction, j as ThemePluginOptions, T as ThemePreset, n as ThemePresetColors, i as plugins } from './index-BE-MUtRO.js';
3
+ export { createKernel } from '@oxog/plugin';
4
+ export { MaybePromise, Unsubscribe } from '@oxog/types';
5
+
6
+ /**
7
+ * Builder-pattern Pigment for explicit composition.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const builder = new BuilderPigment(kernel);
12
+ * const styled = builder.bold().red().paint('Error!');
13
+ * ```
14
+ */
15
+ declare class BuilderPigment {
16
+ private styles;
17
+ constructor(_kernel: PigmentKernel);
18
+ bold(): this;
19
+ dim(): this;
20
+ italic(): this;
21
+ underline(): this;
22
+ strikethrough(): this;
23
+ inverse(): this;
24
+ hidden(): this;
25
+ reset(): this;
26
+ black(): this;
27
+ red(): this;
28
+ green(): this;
29
+ yellow(): this;
30
+ blue(): this;
31
+ magenta(): this;
32
+ cyan(): this;
33
+ white(): this;
34
+ blackBright(): this;
35
+ redBright(): this;
36
+ greenBright(): this;
37
+ yellowBright(): this;
38
+ blueBright(): this;
39
+ magentaBright(): this;
40
+ cyanBright(): this;
41
+ whiteBright(): this;
42
+ gray(): this;
43
+ grey(): this;
44
+ bgBlack(): this;
45
+ bgRed(): this;
46
+ bgGreen(): this;
47
+ bgYellow(): this;
48
+ bgBlue(): this;
49
+ bgMagenta(): this;
50
+ bgCyan(): this;
51
+ bgWhite(): this;
52
+ bgBlackBright(): this;
53
+ bgRedBright(): this;
54
+ bgGreenBright(): this;
55
+ bgYellowBright(): this;
56
+ bgBlueBright(): this;
57
+ bgMagentaBright(): this;
58
+ bgCyanBright(): this;
59
+ bgWhiteBright(): this;
60
+ bgGray(): this;
61
+ bgGrey(): this;
62
+ ansi256(code: number): this;
63
+ bgAnsi256(code: number): this;
64
+ rgb(r: number, g: number, b: number): this;
65
+ bgRgb(r: number, g: number, b: number): this;
66
+ hex(color: string): this;
67
+ bgHex(color: string): this;
68
+ hsl(h: number, s: number, l: number): this;
69
+ bgHsl(h: number, s: number, l: number): this;
70
+ paint(text: string): string;
71
+ }
72
+
73
+ /**
74
+ * Creates a new Pigment instance using @oxog/plugin micro-kernel.
75
+ *
76
+ * @param options - Configuration options
77
+ * @returns Pigment instance with chainable API
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * // Simple usage (all core plugins auto-loaded)
82
+ * const pigment = createPigment();
83
+ * console.log(pigment.red.bold('Error!'));
84
+ *
85
+ * // With configuration
86
+ * const pigment = createPigment({
87
+ * level: 3, // Color level (0-3)
88
+ * forceColor: true, // Force colors
89
+ * });
90
+ *
91
+ * // With optional plugins
92
+ * import { gradientPlugin, themePlugin } from '@oxog/pigment/plugins';
93
+ *
94
+ * const pigment = createPigment({
95
+ * plugins: [
96
+ * gradientPlugin(),
97
+ * themePlugin({ preset: 'monokai' })
98
+ * ]
99
+ * });
100
+ * ```
101
+ */
102
+ declare function createPigment(options?: PigmentOptions): Pigment & {
103
+ builder: BuilderPigment;
104
+ level: number;
105
+ supportsColor: ColorSupport;
106
+ };
107
+
108
+ declare class Chalk {
109
+ level: 0 | 1 | 2 | 3;
110
+ supportsColor: ColorSupport;
111
+ private pigment;
112
+ constructor(options?: {
113
+ level?: 0 | 1 | 2 | 3;
114
+ });
115
+ red(text: string): string;
116
+ green(text: string): string;
117
+ yellow(text: string): string;
118
+ blue(text: string): string;
119
+ magenta(text: string): string;
120
+ cyan(text: string): string;
121
+ white(text: string): string;
122
+ black(text: string): string;
123
+ redBright(text: string): string;
124
+ greenBright(text: string): string;
125
+ yellowBright(text: string): string;
126
+ blueBright(text: string): string;
127
+ magentaBright(text: string): string;
128
+ cyanBright(text: string): string;
129
+ whiteBright(text: string): string;
130
+ gray(text: string): string;
131
+ grey(text: string): string;
132
+ bgRed(text: string): string;
133
+ bgGreen(text: string): string;
134
+ bgYellow(text: string): string;
135
+ bgBlue(text: string): string;
136
+ bgMagenta(text: string): string;
137
+ bgCyan(text: string): string;
138
+ bgWhite(text: string): string;
139
+ bgBlack(text: string): string;
140
+ bgRedBright(text: string): string;
141
+ bgGreenBright(text: string): string;
142
+ bgYellowBright(text: string): string;
143
+ bgBlueBright(text: string): string;
144
+ bgMagentaBright(text: string): string;
145
+ bgCyanBright(text: string): string;
146
+ bgWhiteBright(text: string): string;
147
+ bgGray(text: string): string;
148
+ bgGrey(text: string): string;
149
+ bold(text: string): string;
150
+ dim(text: string): string;
151
+ italic(text: string): string;
152
+ underline(text: string): string;
153
+ strikethrough(text: string): string;
154
+ inverse(text: string): string;
155
+ hidden(text: string): string;
156
+ reset(text: string): string;
157
+ visible(text: string): string;
158
+ rgb(r: number, g: number, b: number): (text: string) => string;
159
+ bgRgb(r: number, g: number, b: number): (text: string) => string;
160
+ hex(color: string): (text: string) => string;
161
+ bgHex(color: string): (text: string) => string;
162
+ ansi256(code: number): (text: string) => string;
163
+ bgAnsi256(code: number): (text: string) => string;
164
+ }
165
+
166
+ declare const chalk: Chalk;
167
+
168
+ declare const bold: Styler;
169
+ declare const dim: Styler;
170
+ declare const italic: Styler;
171
+ declare const underline: Styler;
172
+ declare const strikethrough: Styler;
173
+ declare const inverse: Styler;
174
+ declare const hidden: Styler;
175
+ declare const reset: Styler;
176
+ declare const black: Styler;
177
+ declare const red: Styler;
178
+ declare const green: Styler;
179
+ declare const yellow: Styler;
180
+ declare const blue: Styler;
181
+ declare const magenta: Styler;
182
+ declare const cyan: Styler;
183
+ declare const white: Styler;
184
+ declare const blackBright: Styler;
185
+ declare const redBright: Styler;
186
+ declare const greenBright: Styler;
187
+ declare const yellowBright: Styler;
188
+ declare const blueBright: Styler;
189
+ declare const magentaBright: Styler;
190
+ declare const cyanBright: Styler;
191
+ declare const whiteBright: Styler;
192
+ declare const gray: Styler;
193
+ declare const grey: Styler;
194
+ declare const bgBlack: Styler;
195
+ declare const bgRed: Styler;
196
+ declare const bgGreen: Styler;
197
+ declare const bgYellow: Styler;
198
+ declare const bgBlue: Styler;
199
+ declare const bgMagenta: Styler;
200
+ declare const bgCyan: Styler;
201
+ declare const bgWhite: Styler;
202
+ declare const bgBlackBright: Styler;
203
+ declare const bgRedBright: Styler;
204
+ declare const bgGreenBright: Styler;
205
+ declare const bgYellowBright: Styler;
206
+ declare const bgBlueBright: Styler;
207
+ declare const bgMagentaBright: Styler;
208
+ declare const bgCyanBright: Styler;
209
+ declare const bgWhiteBright: Styler;
210
+ declare const bgGray: Styler;
211
+ declare const bgGrey: Styler;
212
+ declare function compose(...stylers: Styler[]): Styler;
213
+
214
+ declare function detectColorSupport(overrideLevel?: 0 | 1 | 2 | 3): ColorSupport;
215
+ declare function supportsColor(): ColorSupport;
216
+
217
+ declare function detectPlatform(): Platform;
218
+ declare function isNode(): boolean;
219
+ declare function isBrowser(): boolean;
220
+ declare function isWindows(): boolean;
221
+ declare function isCI(): boolean;
222
+ declare function hasTTY(): boolean;
223
+
224
+ declare function hexToRgb(hex: string): {
225
+ r: number;
226
+ g: number;
227
+ b: number;
228
+ };
229
+ declare function validateHex(hex: string): boolean;
230
+
231
+ declare function hslToRgb(h: number, s: number, l: number): {
232
+ r: number;
233
+ g: number;
234
+ b: number;
235
+ };
236
+
237
+ declare function rgbToAnsi256(r: number, g: number, b: number): number;
238
+
239
+ declare const pigment: Pigment & {
240
+ builder: BuilderPigment;
241
+ level: number;
242
+ supportsColor: ColorSupport;
243
+ };
244
+
245
+ export { BuilderPigment, ColorSupport, Pigment, PigmentKernel, PigmentOptions, Platform, Styler, bgBlack, bgBlackBright, bgBlue, bgBlueBright, bgCyan, bgCyanBright, bgGray, bgGreen, bgGreenBright, bgGrey, bgMagenta, bgMagentaBright, bgRed, bgRedBright, bgWhite, bgWhiteBright, bgYellow, bgYellowBright, black, blackBright, blue, blueBright, bold, compose, createPigment, cyan, cyanBright, chalk as default, detectColorSupport, detectPlatform, dim, gray, green, greenBright, grey, hasTTY, hexToRgb, hidden, hslToRgb, inverse, isBrowser, isCI, isNode, isWindows, italic, magenta, magentaBright, pigment, red, redBright, reset, rgbToAnsi256, strikethrough, supportsColor, underline, validateHex, white, whiteBright, yellow, yellowBright };