@theme-registry/refract 0.1.4 → 0.1.5

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.
@@ -9,7 +9,22 @@ export interface Choice<T> {
9
9
  readonly label: string;
10
10
  /** Trailing grey note — what this option means. */
11
11
  readonly hint?: string;
12
+ /**
13
+ * Hex colours to draw as blocks beside the label.
14
+ *
15
+ * This is a theme scaffolder: "triadic" and "split-complement" mean nothing as words, and the
16
+ * terminal can simply show the hues. Ignored when the terminal can't do 24-bit colour.
17
+ */
18
+ readonly swatches?: readonly string[];
12
19
  }
20
+ /**
21
+ * `#rrggbb` → a coloured block: exact in 24-bit terminals, approximated in 256-colour ones, and
22
+ * empty when there's no colour at all (a pipe, `NO_COLOR`) so redirected output stays clean.
23
+ *
24
+ * Approximating is right here — the swatch is a preview, and the exact value is written to the theme
25
+ * file regardless. An approximately-right hue beats a blank space.
26
+ */
27
+ export declare function swatch(hex: string, width?: number): string;
13
28
  /** The keys a list prompt understands, after decoding an stdin chunk. */
14
29
  export type ListKey = "up" | "down" | "space" | "submit" | "all" | "cancel" | "none";
15
30
  /** Decode a raw stdin chunk into a {@link ListKey}. Arrows arrive as escape sequences; j/k mirror vim. */