@oxog/pigment 1.1.1 → 1.2.0
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.
- package/README.md +5 -12
- package/dist/index-DsggPsSl.d.cts +1482 -0
- package/dist/index-DsggPsSl.d.ts +1482 -0
- package/dist/index.cjs +64 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +64 -43
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.cjs +62 -41
- package/dist/plugins/index.cjs.map +1 -1
- package/dist/plugins/index.d.cts +1 -3
- package/dist/plugins/index.d.ts +1 -3
- package/dist/plugins/index.js +62 -41
- package/dist/plugins/index.js.map +1 -1
- package/package.json +21 -11
- package/dist/index-C_LwyWae.d.cts +0 -564
- package/dist/index-C_LwyWae.d.ts +0 -564
package/dist/index-C_LwyWae.d.ts
DELETED
|
@@ -1,564 +0,0 @@
|
|
|
1
|
-
import { Plugin as Plugin$1, Kernel as Kernel$1 } from '@oxog/types';
|
|
2
|
-
import { KernelInstance } from '@oxog/plugin';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Builder-pattern Pigment for explicit composition.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* const builder = new BuilderPigment(kernel);
|
|
10
|
-
* const styled = builder.bold().red().paint('Error!');
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
declare class BuilderPigment {
|
|
14
|
-
private styles;
|
|
15
|
-
private readonly kernel;
|
|
16
|
-
constructor(kernel?: PigmentKernel);
|
|
17
|
-
/** The instance's color level (true color when there is no kernel). */
|
|
18
|
-
private get level();
|
|
19
|
-
bold(): this;
|
|
20
|
-
dim(): this;
|
|
21
|
-
italic(): this;
|
|
22
|
-
underline(): this;
|
|
23
|
-
strikethrough(): this;
|
|
24
|
-
inverse(): this;
|
|
25
|
-
hidden(): this;
|
|
26
|
-
reset(): this;
|
|
27
|
-
black(): this;
|
|
28
|
-
red(): this;
|
|
29
|
-
green(): this;
|
|
30
|
-
yellow(): this;
|
|
31
|
-
blue(): this;
|
|
32
|
-
magenta(): this;
|
|
33
|
-
cyan(): this;
|
|
34
|
-
white(): this;
|
|
35
|
-
blackBright(): this;
|
|
36
|
-
redBright(): this;
|
|
37
|
-
greenBright(): this;
|
|
38
|
-
yellowBright(): this;
|
|
39
|
-
blueBright(): this;
|
|
40
|
-
magentaBright(): this;
|
|
41
|
-
cyanBright(): this;
|
|
42
|
-
whiteBright(): this;
|
|
43
|
-
gray(): this;
|
|
44
|
-
grey(): this;
|
|
45
|
-
bgBlack(): this;
|
|
46
|
-
bgRed(): this;
|
|
47
|
-
bgGreen(): this;
|
|
48
|
-
bgYellow(): this;
|
|
49
|
-
bgBlue(): this;
|
|
50
|
-
bgMagenta(): this;
|
|
51
|
-
bgCyan(): this;
|
|
52
|
-
bgWhite(): this;
|
|
53
|
-
bgBlackBright(): this;
|
|
54
|
-
bgRedBright(): this;
|
|
55
|
-
bgGreenBright(): this;
|
|
56
|
-
bgYellowBright(): this;
|
|
57
|
-
bgBlueBright(): this;
|
|
58
|
-
bgMagentaBright(): this;
|
|
59
|
-
bgCyanBright(): this;
|
|
60
|
-
bgWhiteBright(): this;
|
|
61
|
-
bgGray(): this;
|
|
62
|
-
bgGrey(): this;
|
|
63
|
-
ansi256(code: number): this;
|
|
64
|
-
bgAnsi256(code: number): this;
|
|
65
|
-
rgb(r: number, g: number, b: number): this;
|
|
66
|
-
bgRgb(r: number, g: number, b: number): this;
|
|
67
|
-
hex(color: string): this;
|
|
68
|
-
bgHex(color: string): this;
|
|
69
|
-
hsl(h: number, s: number, l: number): this;
|
|
70
|
-
bgHsl(h: number, s: number, l: number): this;
|
|
71
|
-
paint(text: string): string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
type PigmentOptions = {
|
|
75
|
-
level?: 0 | 1 | 2 | 3;
|
|
76
|
-
forceColor?: boolean;
|
|
77
|
-
noColor?: boolean;
|
|
78
|
-
plugins?: Plugin<PigmentContext>[];
|
|
79
|
-
};
|
|
80
|
-
type ColorSupport = {
|
|
81
|
-
level: 0 | 1 | 2 | 3;
|
|
82
|
-
hasBasic: boolean;
|
|
83
|
-
has256: boolean;
|
|
84
|
-
has16m: boolean;
|
|
85
|
-
};
|
|
86
|
-
type Styler = (text: string) => string;
|
|
87
|
-
type Style = {
|
|
88
|
-
name: string;
|
|
89
|
-
code: number;
|
|
90
|
-
open: string;
|
|
91
|
-
close: string;
|
|
92
|
-
type: 'modifier' | 'color';
|
|
93
|
-
background?: boolean;
|
|
94
|
-
};
|
|
95
|
-
type Pigment = {
|
|
96
|
-
/** Returns the (styled) text when colors are supported, otherwise an empty string */
|
|
97
|
-
visible: (text: string) => string;
|
|
98
|
-
bold: Pigment;
|
|
99
|
-
dim: Pigment;
|
|
100
|
-
italic: Pigment;
|
|
101
|
-
underline: Pigment;
|
|
102
|
-
strikethrough: Pigment;
|
|
103
|
-
inverse: Pigment;
|
|
104
|
-
hidden: Pigment;
|
|
105
|
-
reset: Pigment;
|
|
106
|
-
black: Pigment;
|
|
107
|
-
red: Pigment;
|
|
108
|
-
green: Pigment;
|
|
109
|
-
yellow: Pigment;
|
|
110
|
-
blue: Pigment;
|
|
111
|
-
magenta: Pigment;
|
|
112
|
-
cyan: Pigment;
|
|
113
|
-
white: Pigment;
|
|
114
|
-
blackBright: Pigment;
|
|
115
|
-
redBright: Pigment;
|
|
116
|
-
greenBright: Pigment;
|
|
117
|
-
yellowBright: Pigment;
|
|
118
|
-
blueBright: Pigment;
|
|
119
|
-
magentaBright: Pigment;
|
|
120
|
-
cyanBright: Pigment;
|
|
121
|
-
whiteBright: Pigment;
|
|
122
|
-
gray: Pigment;
|
|
123
|
-
grey: Pigment;
|
|
124
|
-
bgBlack: Pigment;
|
|
125
|
-
bgRed: Pigment;
|
|
126
|
-
bgGreen: Pigment;
|
|
127
|
-
bgYellow: Pigment;
|
|
128
|
-
bgBlue: Pigment;
|
|
129
|
-
bgMagenta: Pigment;
|
|
130
|
-
bgCyan: Pigment;
|
|
131
|
-
bgWhite: Pigment;
|
|
132
|
-
bgBlackBright: Pigment;
|
|
133
|
-
bgRedBright: Pigment;
|
|
134
|
-
bgGreenBright: Pigment;
|
|
135
|
-
bgYellowBright: Pigment;
|
|
136
|
-
bgBlueBright: Pigment;
|
|
137
|
-
bgMagentaBright: Pigment;
|
|
138
|
-
bgCyanBright: Pigment;
|
|
139
|
-
bgWhiteBright: Pigment;
|
|
140
|
-
bgGray: Pigment;
|
|
141
|
-
bgGrey: Pigment;
|
|
142
|
-
ansi256(code: number): Pigment;
|
|
143
|
-
bgAnsi256(code: number): Pigment;
|
|
144
|
-
rgb(r: number, g: number, b: number): Pigment;
|
|
145
|
-
bgRgb(r: number, g: number, b: number): Pigment;
|
|
146
|
-
hex(color: string): Pigment;
|
|
147
|
-
bgHex(color: string): Pigment;
|
|
148
|
-
hsl(h: number, s: number, l: number): Pigment;
|
|
149
|
-
bgHsl(h: number, s: number, l: number): Pigment;
|
|
150
|
-
(text: string): string;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* A color accepted by plugin methods: `'#rrggbb'` / `'#rgb'`, `'rgb(r, g, b)'`
|
|
154
|
-
* or `[r, g, b]`.
|
|
155
|
-
*/
|
|
156
|
-
type ColorInput = string | readonly [number, number, number];
|
|
157
|
-
/** Theme color roles used by `themePlugin`. */
|
|
158
|
-
type ThemeColorType = 'keyword' | 'string' | 'number' | 'comment' | 'error' | 'success' | 'warning' | 'info';
|
|
159
|
-
/** Options for `pigment.box()` (`boxPlugin`). */
|
|
160
|
-
type BoxOptions = {
|
|
161
|
-
border?: BoxBorder;
|
|
162
|
-
padding?: number;
|
|
163
|
-
/** Background color for the whole box. */
|
|
164
|
-
bgColor?: string;
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* Methods added to an instance by the optional plugins. Each one throws a
|
|
168
|
-
* `PluginError` naming the plugin to install when it is missing.
|
|
169
|
-
*/
|
|
170
|
-
type PigmentPluginApi = {
|
|
171
|
-
/** gradientPlugin: color each character along a gradient. */
|
|
172
|
-
gradient(start: ColorInput, end: ColorInput): (text: string) => string;
|
|
173
|
-
/** gradientPlugin: rainbow-colored text. */
|
|
174
|
-
rainbow(text: string): string;
|
|
175
|
-
/** themePlugin: style text with a theme role color. */
|
|
176
|
-
theme: Record<ThemeColorType, (text: string) => string>;
|
|
177
|
-
/** semanticPlugin */
|
|
178
|
-
success(text: string): string;
|
|
179
|
-
/** semanticPlugin */
|
|
180
|
-
error(text: string): string;
|
|
181
|
-
/** semanticPlugin */
|
|
182
|
-
warning(text: string): string;
|
|
183
|
-
/** semanticPlugin */
|
|
184
|
-
info(text: string): string;
|
|
185
|
-
/** semanticPlugin */
|
|
186
|
-
debug(text: string): string;
|
|
187
|
-
/** boxPlugin: draw a box around text. */
|
|
188
|
-
box(text: string, options?: BoxOptions): string;
|
|
189
|
-
/** templatePlugin: tagged template with `{style.chain text}` blocks. */
|
|
190
|
-
template(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
191
|
-
};
|
|
192
|
-
/**
|
|
193
|
-
* What `createPigment()` returns (and the `pigment` export): the chainable
|
|
194
|
-
* styler plus instance members.
|
|
195
|
-
*/
|
|
196
|
-
type PigmentInstance = Pigment & PigmentPluginApi & {
|
|
197
|
-
/** A new builder on every access. */
|
|
198
|
-
readonly builder: BuilderPigment;
|
|
199
|
-
readonly level: number;
|
|
200
|
-
readonly supportsColor: ColorSupport;
|
|
201
|
-
/** Install a plugin on this instance; returns the instance. */
|
|
202
|
-
use(plugin: Plugin<PigmentContext>): PigmentInstance;
|
|
203
|
-
};
|
|
204
|
-
/**
|
|
205
|
-
* Plugin interface - re-exported from @oxog/types.
|
|
206
|
-
* Use this for creating Pigment-compatible plugins.
|
|
207
|
-
*/
|
|
208
|
-
type Plugin<TContext = unknown> = Plugin$1<TContext>;
|
|
209
|
-
/**
|
|
210
|
-
* Kernel interface - re-exported from @oxog/types.
|
|
211
|
-
*/
|
|
212
|
-
type Kernel<TContext = unknown> = Kernel$1<TContext>;
|
|
213
|
-
/**
|
|
214
|
-
* Pigment kernel type - extended KernelInstance from @oxog/plugin.
|
|
215
|
-
*/
|
|
216
|
-
type PigmentKernel<TContext = PigmentContext> = KernelInstance<TContext, PigmentEvents>;
|
|
217
|
-
/**
|
|
218
|
-
* Pigment context shared between plugins.
|
|
219
|
-
*/
|
|
220
|
-
interface PigmentContext {
|
|
221
|
-
/** Current color level */
|
|
222
|
-
level: 0 | 1 | 2 | 3;
|
|
223
|
-
/** Whether colors are enabled */
|
|
224
|
-
enabled: boolean;
|
|
225
|
-
/** Color support information */
|
|
226
|
-
colorSupport: ColorSupport;
|
|
227
|
-
/** Registered styles map */
|
|
228
|
-
styles?: Map<string, StyleFunction>;
|
|
229
|
-
environment?: {
|
|
230
|
-
isCI: boolean;
|
|
231
|
-
noColor: boolean;
|
|
232
|
-
forceColor: boolean;
|
|
233
|
-
term: string;
|
|
234
|
-
};
|
|
235
|
-
/** Colors map */
|
|
236
|
-
colors?: {
|
|
237
|
-
foreground: Record<string, number>;
|
|
238
|
-
background: Record<string, number>;
|
|
239
|
-
all: Record<string, number>;
|
|
240
|
-
};
|
|
241
|
-
/** Utility functions */
|
|
242
|
-
utils?: {
|
|
243
|
-
hexToRgb: (hex: string) => {
|
|
244
|
-
r: number;
|
|
245
|
-
g: number;
|
|
246
|
-
b: number;
|
|
247
|
-
};
|
|
248
|
-
hslToRgb: (h: number, s: number, l: number) => {
|
|
249
|
-
r: number;
|
|
250
|
-
g: number;
|
|
251
|
-
b: number;
|
|
252
|
-
};
|
|
253
|
-
rgbToAnsi256: (r: number, g: number, b: number) => number;
|
|
254
|
-
detectColorSupport: (level?: 0 | 1 | 2 | 3) => ColorSupport;
|
|
255
|
-
supportsColor: (level?: 0 | 1 | 2 | 3) => ColorSupport;
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Pigment event map for type-safe events.
|
|
260
|
-
*/
|
|
261
|
-
interface PigmentEvents {
|
|
262
|
-
'plugin:register': {
|
|
263
|
-
plugin: Plugin<PigmentContext>;
|
|
264
|
-
};
|
|
265
|
-
'plugin:unregister': {
|
|
266
|
-
plugin: Plugin<PigmentContext>;
|
|
267
|
-
};
|
|
268
|
-
'plugin:init': {
|
|
269
|
-
plugin: Plugin<PigmentContext>;
|
|
270
|
-
};
|
|
271
|
-
'plugin:destroy': {
|
|
272
|
-
plugin: Plugin<PigmentContext>;
|
|
273
|
-
};
|
|
274
|
-
'context:change': PigmentContext;
|
|
275
|
-
'style:apply': {
|
|
276
|
-
name: string;
|
|
277
|
-
text: string;
|
|
278
|
-
};
|
|
279
|
-
'error': Error;
|
|
280
|
-
[key: string]: unknown;
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Style function type.
|
|
284
|
-
*/
|
|
285
|
-
type StyleFunction = {
|
|
286
|
-
(text: string): string;
|
|
287
|
-
open: string;
|
|
288
|
-
close: string;
|
|
289
|
-
};
|
|
290
|
-
type ThemePreset = 'monokai' | 'dracula' | 'nord' | 'github' | 'vscode' | 'tokyo-night' | 'catppuccin' | 'one-dark' | 'solarized';
|
|
291
|
-
type BoxBorder = 'single' | 'double' | 'rounded' | 'bold' | 'classic';
|
|
292
|
-
type GradientPluginOptions = {
|
|
293
|
-
steps?: number;
|
|
294
|
-
};
|
|
295
|
-
type ThemePluginOptions = {
|
|
296
|
-
preset?: ThemePreset;
|
|
297
|
-
custom?: Record<string, string>;
|
|
298
|
-
};
|
|
299
|
-
type BoxPluginOptions = {
|
|
300
|
-
border?: BoxBorder;
|
|
301
|
-
padding?: number;
|
|
302
|
-
};
|
|
303
|
-
type PigmentPluginOptions = {
|
|
304
|
-
theme?: ThemePreset;
|
|
305
|
-
level?: 0 | 1 | 2 | 3;
|
|
306
|
-
};
|
|
307
|
-
type Platform = {
|
|
308
|
-
isNode: boolean;
|
|
309
|
-
isBrowser: boolean;
|
|
310
|
-
isWindows: boolean;
|
|
311
|
-
isCI: boolean;
|
|
312
|
-
hasTTY: boolean;
|
|
313
|
-
};
|
|
314
|
-
type ThemePresetColors = {
|
|
315
|
-
keyword: string;
|
|
316
|
-
string: string;
|
|
317
|
-
number: string;
|
|
318
|
-
comment: string;
|
|
319
|
-
error: string;
|
|
320
|
-
success: string;
|
|
321
|
-
warning: string;
|
|
322
|
-
info: string;
|
|
323
|
-
};
|
|
324
|
-
type SemanticPluginOptions = {
|
|
325
|
-
success?: string;
|
|
326
|
-
error?: string;
|
|
327
|
-
warning?: string;
|
|
328
|
-
info?: string;
|
|
329
|
-
debug?: string;
|
|
330
|
-
};
|
|
331
|
-
type BoxChars = {
|
|
332
|
-
tl: string;
|
|
333
|
-
tr: string;
|
|
334
|
-
bl: string;
|
|
335
|
-
br: string;
|
|
336
|
-
h: string;
|
|
337
|
-
v: string;
|
|
338
|
-
};
|
|
339
|
-
type KernelOptions<TContext> = {
|
|
340
|
-
context?: TContext;
|
|
341
|
-
};
|
|
342
|
-
/**
|
|
343
|
-
* Event handler type.
|
|
344
|
-
*/
|
|
345
|
-
type EventHandler = (data?: unknown) => void;
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Core plugin that provides 16 base ANSI colors + bright variants.
|
|
349
|
-
*
|
|
350
|
-
* @example
|
|
351
|
-
* ```typescript
|
|
352
|
-
* const pigment = createPigment();
|
|
353
|
-
* pigment.red('Error!');
|
|
354
|
-
* pigment.greenBright('Success!');
|
|
355
|
-
* ```
|
|
356
|
-
*/
|
|
357
|
-
declare function baseColorsPlugin(): Plugin<PigmentContext>;
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Core plugin that provides text modifiers (bold, dim, italic, etc.).
|
|
361
|
-
*
|
|
362
|
-
* @example
|
|
363
|
-
* ```typescript
|
|
364
|
-
* const pigment = createPigment();
|
|
365
|
-
* pigment.bold('Bold text');
|
|
366
|
-
* pigment.italic.underline('Styled text');
|
|
367
|
-
* ```
|
|
368
|
-
*/
|
|
369
|
-
declare function modifiersPlugin(): Plugin<PigmentContext>;
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Core plugin that provides 256-color palette support.
|
|
373
|
-
*
|
|
374
|
-
* @example
|
|
375
|
-
* ```typescript
|
|
376
|
-
* const pigment = createPigment();
|
|
377
|
-
* pigment.ansi256(196)('Bright red');
|
|
378
|
-
* pigment.bgAnsi256(21)('Blue background');
|
|
379
|
-
* ```
|
|
380
|
-
*/
|
|
381
|
-
declare function ansi256Plugin(): Plugin<PigmentContext>;
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* Core plugin that provides RGB, HEX, and HSL color support.
|
|
385
|
-
*
|
|
386
|
-
* @example
|
|
387
|
-
* ```typescript
|
|
388
|
-
* const pigment = createPigment();
|
|
389
|
-
* pigment.rgb(255, 136, 0)('Orange text');
|
|
390
|
-
* pigment.hex('#FF8800')('Orange text');
|
|
391
|
-
* pigment.hsl(30, 100, 50)('Orange text');
|
|
392
|
-
* ```
|
|
393
|
-
*/
|
|
394
|
-
declare function trueColorPlugin(): Plugin<PigmentContext>;
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* Core plugin that enables nested/composed style support.
|
|
398
|
-
*
|
|
399
|
-
* Nesting is handled directly in applyStyles() by replacing inner reset codes
|
|
400
|
-
* with outer style reopeners. This plugin just sets the enabled flag for
|
|
401
|
-
* compatibility and to indicate nesting support is active.
|
|
402
|
-
*
|
|
403
|
-
* @example
|
|
404
|
-
* ```typescript
|
|
405
|
-
* const pigment = createPigment();
|
|
406
|
-
* // Nested styles work automatically:
|
|
407
|
-
* pigment.red(`Error: ${pigment.blue('details')} here`);
|
|
408
|
-
* // Output: "Error: " (red), "details" (blue), " here" (red again)
|
|
409
|
-
* ```
|
|
410
|
-
*/
|
|
411
|
-
declare function nestingPlugin(): Plugin<PigmentContext>;
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Core plugin that handles environment detection (NO_COLOR, FORCE_COLOR, TTY).
|
|
415
|
-
*
|
|
416
|
-
* Respects environment variables:
|
|
417
|
-
* - NO_COLOR - disables all colors
|
|
418
|
-
* - FORCE_COLOR - forces color level (0, 1, 2, 3)
|
|
419
|
-
* - TERM - terminal type detection
|
|
420
|
-
* - CI - CI environment detection
|
|
421
|
-
*
|
|
422
|
-
* @example
|
|
423
|
-
* ```typescript
|
|
424
|
-
* const pigment = createPigment();
|
|
425
|
-
* // Automatically detects environment
|
|
426
|
-
* ```
|
|
427
|
-
*/
|
|
428
|
-
declare function environmentPlugin(): Plugin<PigmentContext>;
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* Optional plugin that provides smooth color gradients between two colors.
|
|
432
|
-
*
|
|
433
|
-
* @example
|
|
434
|
-
* ```typescript
|
|
435
|
-
* import { createPigment } from '@oxog/pigment';
|
|
436
|
-
* import { gradientPlugin } from '@oxog/pigment/plugins';
|
|
437
|
-
*
|
|
438
|
-
* const pigment = createPigment({
|
|
439
|
-
* plugins: [gradientPlugin()]
|
|
440
|
-
* });
|
|
441
|
-
*
|
|
442
|
-
* pigment.gradient('red', 'blue')('Gradient text');
|
|
443
|
-
* pigment.rainbow('Rainbow text');
|
|
444
|
-
* ```
|
|
445
|
-
*/
|
|
446
|
-
declare function gradientPlugin(options?: GradientPluginOptions): Plugin<PigmentContext>;
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Optional plugin that provides predefined color themes.
|
|
450
|
-
*
|
|
451
|
-
* @example
|
|
452
|
-
* ```typescript
|
|
453
|
-
* import { createPigment } from '@oxog/pigment';
|
|
454
|
-
* import { themePlugin } from '@oxog/pigment/plugins';
|
|
455
|
-
*
|
|
456
|
-
* const pigment = createPigment({
|
|
457
|
-
* plugins: [themePlugin({ preset: 'monokai' })]
|
|
458
|
-
* });
|
|
459
|
-
*
|
|
460
|
-
* pigment.theme.keyword('const');
|
|
461
|
-
* pigment.theme.string('"hello"');
|
|
462
|
-
* pigment.theme.error('Error!');
|
|
463
|
-
* ```
|
|
464
|
-
*
|
|
465
|
-
* Available presets: monokai, dracula, nord, github, vscode, tokyo-night, catppuccin, one-dark, solarized
|
|
466
|
-
*/
|
|
467
|
-
declare function themePlugin(options?: ThemePluginOptions): Plugin<PigmentContext>;
|
|
468
|
-
|
|
469
|
-
/**
|
|
470
|
-
* Optional plugin that provides semantic colors (success, error, warning, info, debug).
|
|
471
|
-
*
|
|
472
|
-
* @example
|
|
473
|
-
* ```typescript
|
|
474
|
-
* import { createPigment } from '@oxog/pigment';
|
|
475
|
-
* import { semanticPlugin } from '@oxog/pigment/plugins';
|
|
476
|
-
*
|
|
477
|
-
* const pigment = createPigment({
|
|
478
|
-
* plugins: [semanticPlugin()]
|
|
479
|
-
* });
|
|
480
|
-
*
|
|
481
|
-
* pigment.success('✓ Task completed');
|
|
482
|
-
* pigment.error('✗ Task failed');
|
|
483
|
-
* pigment.warning('⚠ Check this');
|
|
484
|
-
* pigment.info('ℹ Note');
|
|
485
|
-
* pigment.debug('[DEBUG] value');
|
|
486
|
-
* ```
|
|
487
|
-
*/
|
|
488
|
-
declare function semanticPlugin(options?: SemanticPluginOptions): Plugin<PigmentContext>;
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* Optional plugin that provides box drawing with borders.
|
|
492
|
-
*
|
|
493
|
-
* @example
|
|
494
|
-
* ```typescript
|
|
495
|
-
* import { createPigment } from '@oxog/pigment';
|
|
496
|
-
* import { boxPlugin } from '@oxog/pigment/plugins';
|
|
497
|
-
*
|
|
498
|
-
* const pigment = createPigment({
|
|
499
|
-
* plugins: [boxPlugin()]
|
|
500
|
-
* });
|
|
501
|
-
*
|
|
502
|
-
* pigment.box('Hello World');
|
|
503
|
-
* // ┌─────────────┐
|
|
504
|
-
* // │ Hello World │
|
|
505
|
-
* // └─────────────┘
|
|
506
|
-
*
|
|
507
|
-
* pigment.box('Error!', { border: 'double', padding: 2 });
|
|
508
|
-
* ```
|
|
509
|
-
*/
|
|
510
|
-
declare function boxPlugin(options?: BoxPluginOptions): Plugin<PigmentContext>;
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* Optional plugin that provides tagged template literal syntax.
|
|
514
|
-
*
|
|
515
|
-
* @example
|
|
516
|
-
* ```typescript
|
|
517
|
-
* import { createPigment } from '@oxog/pigment';
|
|
518
|
-
* import { templatePlugin } from '@oxog/pigment/plugins';
|
|
519
|
-
*
|
|
520
|
-
* const pigment = createPigment({
|
|
521
|
-
* plugins: [templatePlugin()]
|
|
522
|
-
* });
|
|
523
|
-
*
|
|
524
|
-
* console.log(pigment.template`{red Error:} {bold ${name}} has {yellow ${count}} issues`);
|
|
525
|
-
* console.log(pigment.template`{bold.red CRITICAL:} {dim system {underline failure}}`);
|
|
526
|
-
* ```
|
|
527
|
-
*/
|
|
528
|
-
declare function templatePlugin(): Plugin<PigmentContext>;
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* Plugin that adds Pigment color support to any @oxog kernel.
|
|
532
|
-
* Use this in @oxog/log, @oxog/cli, etc.
|
|
533
|
-
*
|
|
534
|
-
* @example
|
|
535
|
-
* ```typescript
|
|
536
|
-
* // In @oxog/log or @oxog/cli
|
|
537
|
-
* import { pigmentPlugin } from '@oxog/pigment/plugins';
|
|
538
|
-
*
|
|
539
|
-
* const log = createLogger();
|
|
540
|
-
* log.use(pigmentPlugin()); // Adds color support to logger
|
|
541
|
-
*
|
|
542
|
-
* // Now log has access to colors
|
|
543
|
-
* log.pigment.red('Error message');
|
|
544
|
-
* ```
|
|
545
|
-
*/
|
|
546
|
-
declare function pigmentPlugin<TContext = unknown>(options?: PigmentPluginOptions): Plugin<TContext>;
|
|
547
|
-
|
|
548
|
-
declare const index_ansi256Plugin: typeof ansi256Plugin;
|
|
549
|
-
declare const index_baseColorsPlugin: typeof baseColorsPlugin;
|
|
550
|
-
declare const index_boxPlugin: typeof boxPlugin;
|
|
551
|
-
declare const index_environmentPlugin: typeof environmentPlugin;
|
|
552
|
-
declare const index_gradientPlugin: typeof gradientPlugin;
|
|
553
|
-
declare const index_modifiersPlugin: typeof modifiersPlugin;
|
|
554
|
-
declare const index_nestingPlugin: typeof nestingPlugin;
|
|
555
|
-
declare const index_pigmentPlugin: typeof pigmentPlugin;
|
|
556
|
-
declare const index_semanticPlugin: typeof semanticPlugin;
|
|
557
|
-
declare const index_templatePlugin: typeof templatePlugin;
|
|
558
|
-
declare const index_themePlugin: typeof themePlugin;
|
|
559
|
-
declare const index_trueColorPlugin: typeof trueColorPlugin;
|
|
560
|
-
declare namespace index {
|
|
561
|
-
export { index_ansi256Plugin as ansi256Plugin, index_baseColorsPlugin as baseColorsPlugin, index_boxPlugin as boxPlugin, index_environmentPlugin as environmentPlugin, index_gradientPlugin as gradientPlugin, index_modifiersPlugin as modifiersPlugin, index_nestingPlugin as nestingPlugin, index_pigmentPlugin as pigmentPlugin, index_semanticPlugin as semanticPlugin, index_templatePlugin as templatePlugin, index_themePlugin as themePlugin, index_trueColorPlugin as trueColorPlugin };
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
export { nestingPlugin as A, BuilderPigment as B, type ColorSupport as C, environmentPlugin as D, type EventHandler as E, gradientPlugin as F, type GradientPluginOptions as G, themePlugin as H, semanticPlugin as I, boxPlugin as J, type Kernel as K, templatePlugin as L, pigmentPlugin as M, type PigmentOptions as P, type Styler as S, type ThemePreset as T, type PigmentInstance as a, type Pigment as b, type Platform as c, type Plugin as d, type PigmentKernel as e, type PigmentContext as f, type PigmentEvents as g, type Style as h, index as i, type StyleFunction as j, type BoxBorder as k, type ThemePluginOptions as l, type BoxPluginOptions as m, type PigmentPluginOptions as n, type SemanticPluginOptions as o, type ThemePresetColors as p, type BoxChars as q, type KernelOptions as r, type PigmentPluginApi as s, type ColorInput as t, type ThemeColorType as u, type BoxOptions as v, baseColorsPlugin as w, modifiersPlugin as x, ansi256Plugin as y, trueColorPlugin as z };
|