@oxog/pigment 1.0.2 → 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.
@@ -23,6 +23,8 @@ type Style = {
23
23
  background?: boolean;
24
24
  };
25
25
  type Pigment = {
26
+ /** Returns the (styled) text when colors are supported, otherwise an empty string */
27
+ visible: (text: string) => string;
26
28
  bold: Pigment;
27
29
  dim: Pigment;
28
30
  italic: Pigment;
@@ -102,6 +104,12 @@ interface PigmentContext {
102
104
  colorSupport: ColorSupport;
103
105
  /** Registered styles map */
104
106
  styles?: Map<string, StyleFunction>;
107
+ environment?: {
108
+ isCI: boolean;
109
+ noColor: boolean;
110
+ forceColor: boolean;
111
+ term: string;
112
+ };
105
113
  /** Colors map */
106
114
  colors?: {
107
115
  foreground: Record<string, number>;
@@ -23,6 +23,8 @@ type Style = {
23
23
  background?: boolean;
24
24
  };
25
25
  type Pigment = {
26
+ /** Returns the (styled) text when colors are supported, otherwise an empty string */
27
+ visible: (text: string) => string;
26
28
  bold: Pigment;
27
29
  dim: Pigment;
28
30
  italic: Pigment;
@@ -102,6 +104,12 @@ interface PigmentContext {
102
104
  colorSupport: ColorSupport;
103
105
  /** Registered styles map */
104
106
  styles?: Map<string, StyleFunction>;
107
+ environment?: {
108
+ isCI: boolean;
109
+ noColor: boolean;
110
+ forceColor: boolean;
111
+ term: string;
112
+ };
105
113
  /** Colors map */
106
114
  colors?: {
107
115
  foreground: Record<string, number>;