@oxog/pigment 1.0.1 → 1.1.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/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PigmentKernel, a as PigmentOptions, b as Pigment, C as ColorSupport, S as Styler, c as Platform } from './index-BE-MUtRO.cjs';
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.cjs';
1
+ import { P as PigmentKernel, a as PigmentOptions, b as Pigment, C as ColorSupport, S as Styler, c as Platform } from './index-CLqJXFfX.cjs';
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-CLqJXFfX.cjs';
3
3
  export { createKernel } from '@oxog/plugin';
4
4
  export { MaybePromise, Unsubscribe } from '@oxog/types';
5
5
 
@@ -154,6 +154,7 @@ declare class Chalk {
154
154
  inverse(text: string): string;
155
155
  hidden(text: string): string;
156
156
  reset(text: string): string;
157
+ /** Like chalk: returns the text only when colors are supported, otherwise ''. */
157
158
  visible(text: string): string;
158
159
  rgb(r: number, g: number, b: number): (text: string) => string;
159
160
  bgRgb(r: number, g: number, b: number): (text: string) => string;
@@ -213,6 +214,11 @@ declare function compose(...stylers: Styler[]): Styler;
213
214
 
214
215
  declare function detectColorSupport(overrideLevel?: 0 | 1 | 2 | 3): ColorSupport;
215
216
  declare function supportsColor(): ColorSupport;
217
+ /**
218
+ * Reset the cached color support detection.
219
+ * Useful for testing when environment variables change.
220
+ */
221
+ declare function resetColorSupportCache(): void;
216
222
 
217
223
  declare function detectPlatform(): Platform;
218
224
  declare function isNode(): boolean;
@@ -242,4 +248,4 @@ declare const pigment: Pigment & {
242
248
  supportsColor: ColorSupport;
243
249
  };
244
250
 
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 };
251
+ 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, resetColorSupportCache, rgbToAnsi256, strikethrough, supportsColor, underline, validateHex, white, whiteBright, yellow, yellowBright };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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';
1
+ import { P as PigmentKernel, a as PigmentOptions, b as Pigment, C as ColorSupport, S as Styler, c as Platform } from './index-CLqJXFfX.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-CLqJXFfX.js';
3
3
  export { createKernel } from '@oxog/plugin';
4
4
  export { MaybePromise, Unsubscribe } from '@oxog/types';
5
5
 
@@ -154,6 +154,7 @@ declare class Chalk {
154
154
  inverse(text: string): string;
155
155
  hidden(text: string): string;
156
156
  reset(text: string): string;
157
+ /** Like chalk: returns the text only when colors are supported, otherwise ''. */
157
158
  visible(text: string): string;
158
159
  rgb(r: number, g: number, b: number): (text: string) => string;
159
160
  bgRgb(r: number, g: number, b: number): (text: string) => string;
@@ -213,6 +214,11 @@ declare function compose(...stylers: Styler[]): Styler;
213
214
 
214
215
  declare function detectColorSupport(overrideLevel?: 0 | 1 | 2 | 3): ColorSupport;
215
216
  declare function supportsColor(): ColorSupport;
217
+ /**
218
+ * Reset the cached color support detection.
219
+ * Useful for testing when environment variables change.
220
+ */
221
+ declare function resetColorSupportCache(): void;
216
222
 
217
223
  declare function detectPlatform(): Platform;
218
224
  declare function isNode(): boolean;
@@ -242,4 +248,4 @@ declare const pigment: Pigment & {
242
248
  supportsColor: ColorSupport;
243
249
  };
244
250
 
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 };
251
+ 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, resetColorSupportCache, rgbToAnsi256, strikethrough, supportsColor, underline, validateHex, white, whiteBright, yellow, yellowBright };