@promptctl/rich-js 0.27.0 → 0.29.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.
Files changed (185) hide show
  1. package/README.md +7 -6
  2. package/THIRD-PARTY-NOTICES +42 -0
  3. package/dist/core/animation.d.ts +65 -46
  4. package/dist/core/animation.js +91 -67
  5. package/dist/core/ansi.d.ts +19 -12
  6. package/dist/core/ansi.js +114 -36
  7. package/dist/core/bidi-data.d.ts +14 -0
  8. package/dist/core/bidi-data.js +385 -0
  9. package/dist/core/bidi.d.ts +89 -0
  10. package/dist/core/bidi.js +615 -0
  11. package/dist/core/box.d.ts +9 -1
  12. package/dist/core/box.js +11 -0
  13. package/dist/core/cell-widths.d.ts +3 -2
  14. package/dist/core/cell-widths.js +93 -93
  15. package/dist/core/cells.d.ts +20 -0
  16. package/dist/core/cells.js +94 -6
  17. package/dist/core/clock.d.ts +1 -1
  18. package/dist/core/color.d.ts +56 -57
  19. package/dist/core/color.js +79 -81
  20. package/dist/core/console.d.ts +24 -7
  21. package/dist/core/console.js +27 -8
  22. package/dist/core/control-codes.d.ts +61 -0
  23. package/dist/core/control-codes.js +157 -0
  24. package/dist/core/easing.d.ts +40 -40
  25. package/dist/core/easing.js +40 -40
  26. package/dist/core/env.d.ts +6 -0
  27. package/dist/core/env.js +9 -1
  28. package/dist/core/export-html.js +5 -4
  29. package/dist/core/export-lines.d.ts +13 -11
  30. package/dist/core/export-lines.js +19 -15
  31. package/dist/core/export-svg.d.ts +3 -3
  32. package/dist/core/export-svg.js +10 -9
  33. package/dist/core/json.js +9 -2
  34. package/dist/core/markup.js +5 -4
  35. package/dist/core/memo.d.ts +1 -1
  36. package/dist/core/memo.js +1 -1
  37. package/dist/core/oklch.d.ts +14 -14
  38. package/dist/core/oklch.js +10 -10
  39. package/dist/core/orient.d.ts +68 -0
  40. package/dist/core/orient.js +224 -0
  41. package/dist/core/osc8.d.ts +12 -5
  42. package/dist/core/osc8.js +14 -7
  43. package/dist/core/paint.d.ts +9 -9
  44. package/dist/core/paint.js +3 -3
  45. package/dist/core/pretty.d.ts +1 -1
  46. package/dist/core/pretty.js +23 -19
  47. package/dist/core/protocol.d.ts +47 -26
  48. package/dist/core/protocol.js +31 -23
  49. package/dist/core/render.d.ts +19 -14
  50. package/dist/core/render.js +30 -17
  51. package/dist/core/seal.d.ts +26 -0
  52. package/dist/core/seal.js +75 -0
  53. package/dist/core/segment.d.ts +12 -4
  54. package/dist/core/segment.js +16 -6
  55. package/dist/core/strip.d.ts +83 -83
  56. package/dist/core/strip.js +70 -70
  57. package/dist/core/style.d.ts +46 -18
  58. package/dist/core/style.js +92 -56
  59. package/dist/core/text-order.d.ts +51 -0
  60. package/dist/core/text-order.js +50 -0
  61. package/dist/core/text.d.ts +12 -2
  62. package/dist/core/text.js +136 -90
  63. package/dist/core/timeline.d.ts +5 -5
  64. package/dist/core/timeline.js +11 -11
  65. package/dist/core/tween.d.ts +6 -6
  66. package/dist/core/tween.js +10 -10
  67. package/dist/core/view.d.ts +5 -5
  68. package/dist/core/view.js +15 -14
  69. package/dist/core/wrap.d.ts +24 -6
  70. package/dist/core/wrap.js +82 -16
  71. package/dist/host/app.d.ts +50 -9
  72. package/dist/host/app.js +120 -15
  73. package/dist/host/host-environment.d.ts +2 -2
  74. package/dist/host/host-environment.js +2 -2
  75. package/dist/host/index.d.ts +3 -2
  76. package/dist/host/index.js +1 -0
  77. package/dist/host/input.d.ts +42 -9
  78. package/dist/host/input.js +91 -7
  79. package/dist/host/terminal-colors.d.ts +18 -0
  80. package/dist/host/terminal-colors.js +46 -0
  81. package/dist/host/terminal-host.d.ts +4 -3
  82. package/dist/host/terminal-host.js +1 -1
  83. package/dist/index.d.ts +17 -16
  84. package/dist/index.js +11 -11
  85. package/dist/node/prompt.d.ts +1 -1
  86. package/dist/node/prompt.js +1 -1
  87. package/dist/node/terminal-host.d.ts +1 -1
  88. package/dist/node/traceback.js +2 -2
  89. package/dist/renderables/change.d.ts +1 -3
  90. package/dist/renderables/change.js +6 -8
  91. package/dist/renderables/effect.d.ts +88 -87
  92. package/dist/renderables/effect.js +124 -114
  93. package/dist/renderables/effects.d.ts +105 -76
  94. package/dist/renderables/effects.js +309 -176
  95. package/dist/renderables/embed.d.ts +1 -1
  96. package/dist/renderables/embed.js +2 -2
  97. package/dist/renderables/flexStrip.d.ts +7 -7
  98. package/dist/renderables/flexStrip.js +15 -15
  99. package/dist/renderables/frames.d.ts +7 -16
  100. package/dist/renderables/frames.js +12 -27
  101. package/dist/renderables/glyph-effect.d.ts +22 -23
  102. package/dist/renderables/glyph-effect.js +43 -41
  103. package/dist/renderables/glyph-effects.d.ts +33 -14
  104. package/dist/renderables/glyph-effects.js +90 -22
  105. package/dist/renderables/html-entities.d.ts +1 -1
  106. package/dist/renderables/html-entities.js +1 -1
  107. package/dist/renderables/lifecycle.d.ts +8 -10
  108. package/dist/renderables/lifecycle.js +17 -18
  109. package/dist/renderables/live.d.ts +2 -2
  110. package/dist/renderables/live.js +7 -7
  111. package/dist/renderables/markdown-parse.js +3 -3
  112. package/dist/renderables/markdown.js +4 -2
  113. package/dist/renderables/panel.js +7 -5
  114. package/dist/renderables/progress.d.ts +1 -1
  115. package/dist/renderables/progress.js +1 -1
  116. package/dist/renderables/progressBar.d.ts +3 -3
  117. package/dist/renderables/progressBar.js +21 -18
  118. package/dist/renderables/prompt.d.ts +1 -1
  119. package/dist/renderables/scroll.d.ts +1 -1
  120. package/dist/renderables/scroll.js +3 -3
  121. package/dist/renderables/spinner.d.ts +4 -4
  122. package/dist/renderables/spinner.js +10 -10
  123. package/dist/renderables/syntax.d.ts +2 -2
  124. package/dist/renderables/syntax.js +9 -4
  125. package/dist/renderables/table.js +5 -4
  126. package/dist/renderables/traceback.d.ts +1 -1
  127. package/dist/renderables/traceback.js +1 -1
  128. package/dist/renderables/tree.js +3 -3
  129. package/dist/template-bindings/animation-funcs.d.ts +60 -29
  130. package/dist/template-bindings/animation-funcs.js +126 -43
  131. package/dist/template-bindings/color-funcs.d.ts +14 -14
  132. package/dist/template-bindings/color-funcs.js +25 -25
  133. package/dist/template-bindings/index.d.ts +16 -14
  134. package/dist/template-bindings/index.js +17 -14
  135. package/dist/template-bindings/palette-funcs.d.ts +2 -2
  136. package/dist/template-bindings/palette-funcs.js +4 -4
  137. package/dist/template-bindings/style-funcs.d.ts +5 -5
  138. package/dist/template-bindings/style-funcs.js +16 -16
  139. package/dist/themes/{transpose.d.ts → adjust.d.ts} +23 -23
  140. package/dist/themes/{transpose.js → adjust.js} +28 -28
  141. package/dist/themes/buildPalette.d.ts +6 -5
  142. package/dist/themes/buildPalette.js +22 -22
  143. package/dist/themes/colorMath.d.ts +16 -16
  144. package/dist/themes/colorMath.js +32 -32
  145. package/dist/themes/data/ansi-tables.d.ts +2 -2
  146. package/dist/themes/data/ansi-tables.js +2 -2
  147. package/dist/themes/data/index.js +1 -4
  148. package/dist/themes/data/textual-ansi.js +0 -143
  149. package/dist/themes/data/types.d.ts +4 -4
  150. package/dist/themes/data/types.js +2 -2
  151. package/dist/themes/palette.d.ts +12 -12
  152. package/dist/themes/palette.js +16 -16
  153. package/dist/themes/ramp.d.ts +17 -17
  154. package/dist/themes/ramp.js +12 -12
  155. package/dist/themes/registry.d.ts +6 -8
  156. package/dist/themes/registry.js +6 -8
  157. package/dist/themes/terminalThemes.d.ts +4 -11
  158. package/dist/themes/terminalThemes.js +31 -47
  159. package/dist/widgets/button.d.ts +3 -3
  160. package/dist/widgets/button.js +8 -8
  161. package/dist/widgets/checkbox.d.ts +2 -2
  162. package/dist/widgets/checkbox.js +4 -4
  163. package/dist/widgets/dropdown.d.ts +3 -3
  164. package/dist/widgets/dropdown.js +7 -5
  165. package/dist/widgets/event-router.d.ts +6 -6
  166. package/dist/widgets/event-router.js +2 -2
  167. package/dist/widgets/focus-manager.d.ts +3 -3
  168. package/dist/widgets/focus-manager.js +3 -3
  169. package/dist/widgets/index.d.ts +2 -2
  170. package/dist/widgets/index.js +1 -1
  171. package/dist/widgets/ink.d.ts +3 -3
  172. package/dist/widgets/ink.js +4 -4
  173. package/dist/widgets/slider.d.ts +2 -2
  174. package/dist/widgets/static-item.d.ts +2 -2
  175. package/dist/widgets/text-input.d.ts +2 -2
  176. package/dist/widgets/text-input.js +5 -5
  177. package/dist/widgets/themed-widget.js +4 -4
  178. package/dist/widgets/toggle.d.ts +4 -4
  179. package/dist/widgets/toggle.js +6 -6
  180. package/dist/widgets/types.d.ts +6 -6
  181. package/dist/widgets/types.js +2 -2
  182. package/dist/widgets/widget-app.d.ts +10 -10
  183. package/dist/widgets/widget-app.js +8 -8
  184. package/dist/widgets/widget-base.d.ts +2 -2
  185. package/package.json +5 -4
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Terminal color representation, parsing, downgrading, and ANSI code generation.
3
3
  */
4
- import type { Env } from "./env.js";
4
+ import { type Env } from "./env.js";
5
+ import { type TextOrder } from "./text-order.js";
5
6
  import type { Palette } from "../themes/palette.js";
6
7
  /**
7
8
  * Immutable RGBA color value. Alpha defaults to 1 (fully opaque).
@@ -34,12 +35,12 @@ export declare class ColorRgba {
34
35
  compositeOver(bg: ColorRgba): ColorRgba;
35
36
  }
36
37
  /**
37
- * The surface a terminal draws a translucent colour over. A terminal cannot
38
+ * The surface a terminal draws a translucent color over. A terminal cannot
38
39
  * know what lies under its cells, so the SGR writer (`Style.toSgrCodes`), the
39
40
  * exports that picture its output (`resolveLook`), the strip's seam test and
40
41
  * the contrast choosers (`themes/colorMath`) all composite over this one
41
- * colour. [LAW:one-source-of-truth] One constant, so
42
- * the colour text is chosen against is the colour the writer draws.
42
+ * color. [LAW:one-source-of-truth] One constant, so
43
+ * the color text is chosen against is the color the writer draws.
43
44
  */
44
45
  export declare const SURFACE_BLACK: ColorRgba;
45
46
  /**
@@ -63,7 +64,7 @@ export declare function rgbDistance(a: ColorRgba, b: ColorRgba): number;
63
64
  /**
64
65
  * An indexed palette: entry `i` of `colors` is terminal index `firstIndex + i`.
65
66
  * `firstIndex` lets a table hold only the part of a palette a downgrade may
66
- * choose (the 256-colour cube and grey ramp start at 16) while every index it
67
+ * choose (the 256-color cube and grey ramp start at 16) while every index it
67
68
  * reports is the terminal's own.
68
69
  */
69
70
  export declare class ColorTable {
@@ -97,7 +98,7 @@ export declare class ColorTable {
97
98
  private nearestReadable;
98
99
  /**
99
100
  * The nearest entry to `value` (the distance `match` uses) among those
100
- * `accept` takes, given each entry's colour and terminal index; `undefined`
101
+ * `accept` takes, given each entry's color and terminal index; `undefined`
101
102
  * when it takes none. Entries are offered nearest-first (ties to the lower
102
103
  * index) and the first taken wins, so an expensive predicate runs only as
103
104
  * far out as the answer. Uncached: the predicate is the caller's, and a
@@ -125,8 +126,8 @@ declare const COLOR_SYSTEM_DEPTHS: {
125
126
  readonly none: null;
126
127
  };
127
128
  /**
128
- * A colour system by name: `"auto"` detects it from the environment, and each
129
- * other name is a fixed depth — `"none"` no colour. `ColorDepth.WINDOWS` has
129
+ * A color system by name: `"auto"` detects it from the environment, and each
130
+ * other name is a fixed depth — `"none"` no color. `ColorDepth.WINDOWS` has
130
131
  * no name; pass the enum value where a `ColorDepth` is accepted.
131
132
  */
132
133
  export type ColorSystemName = "auto" | keyof typeof COLOR_SYSTEM_DEPTHS;
@@ -142,22 +143,16 @@ export type ColorSystemName = "auto" | keyof typeof COLOR_SYSTEM_DEPTHS;
142
143
  * in the env values, not in which checks execute.
143
144
  */
144
145
  export declare function detectColorSystem(options?: DetectColorOptions): ColorDepth | null;
145
- /**
146
- * A terminal that says it cannot be drawn on: `TERM` is `dumb` or `unknown`,
147
- * as Emacs' shell mode sets it. It takes no colour and nothing that moves the
148
- * cursor.
149
- */
150
- export declare function isDumbTerminal(env: Env): boolean;
151
146
  /**
152
147
  * Where segments are written, as everything the serializer (`segmentsToString`)
153
- * needs to know about it: the colour depth SGR is drawn at, whether OSC 8
148
+ * needs to know about it: the color depth SGR is drawn at, whether OSC 8
154
149
  * hyperlinks are emitted, and whether the reader there asked for reduced
155
150
  * motion — under which the terminal's own blink is not asked for
156
151
  * (`shownOn`, `./render.ts`). The serializer takes this value whole, so a
157
152
  * fact the encoding comes to need joins it here rather than the serializer's
158
153
  * signature.
159
154
  */
160
- export interface Destination {
155
+ export interface OutputTarget {
161
156
  readonly colorSystem: ColorDepth | null;
162
157
  readonly hyperlinks: boolean;
163
158
  /**
@@ -166,29 +161,33 @@ export interface Destination {
166
161
  * drawn and how it is encoded take one preference.
167
162
  */
168
163
  readonly reducedMotion: boolean;
164
+ /** What the destination does with direction; `./text-order.ts` owns the three. */
165
+ readonly textOrder: TextOrder;
169
166
  }
170
167
  /**
171
- * What `resolveDestination` is told about where it writes beyond the colour
168
+ * What `resolveOutputTarget` is told about where it writes beyond the color
172
169
  * spec: what detection probes, and the reader's preference for motion, which
173
170
  * no spec or terminal reports, so the program hands it in. Absent, everything
174
171
  * moves.
175
172
  */
176
173
  export interface DestinationOptions extends DetectColorOptions {
177
174
  reducedMotion?: boolean;
175
+ /** The order the program knows its destination takes. Absent, `detectTextOrder` decides. */
176
+ textOrder?: TextOrder;
178
177
  }
179
178
  /**
180
- * Resolve a colour spec into a `Destination`.
179
+ * Resolve a color spec into an `OutputTarget`.
181
180
  *
182
181
  * [LAW:single-enforcer] The one place a spec becomes both facts. A hyperlink is
183
- * not a colour: an explicit depth — `"none"` and `null` included — states a
184
- * colour choice and keeps links, and under `"auto"` links follow what the
182
+ * not a color: an explicit depth — `"none"` and `null` included — states a
183
+ * color choice and keeps links, and under `"auto"` links follow what the
185
184
  * terminal can take (no TTY, TERM=dumb: none) while NO_COLOR and FORCE_COLOR=0,
186
- * colour preferences, leave them alone. A FORCE_COLOR that forces colour on
185
+ * color preferences, leave them alone. A FORCE_COLOR that forces color on
187
186
  * declares the destination takes escapes, so it keeps links on a pipe too.
188
187
  */
189
- export declare function resolveDestination(spec: ColorSystemName | ColorDepth | null, options?: DestinationOptions): Destination;
188
+ export declare function resolveOutputTarget(spec: ColorSystemName | ColorDepth | null, options?: DestinationOptions): OutputTarget;
190
189
  /**
191
- * Resolve a colour system name into a `ColorDepth` (or `null` for no color).
190
+ * Resolve a color system name into a `ColorDepth` (or `null` for no color).
192
191
  *
193
192
  * `"auto"` triggers env-based detection; every other name is a fixed depth.
194
193
  * A name outside the vocabulary — reachable only from untyped JavaScript —
@@ -209,12 +208,12 @@ export declare class ColorSpec {
209
208
  constructor(name: string, type: ColorDepth, number?: number, value?: ColorRgba);
210
209
  get isDefault(): boolean;
211
210
  /**
212
- * The colour every terminal draws this spec as, where that is fixed — before
211
+ * The color every terminal draws this spec as, where that is fixed — before
213
212
  * any alpha is flattened, so a translucent value is drawn composited over
214
213
  * its ground (`flattenAlpha`) and should be measured that way: a
215
- * truecolor value, or a 256-colour cube or grey-ramp entry (xterm fixes
214
+ * truecolor value, or a 256-color cube or grey-ramp entry (xterm fixes
216
215
  * indices 16–255, and `fromAnsi` types only those as EIGHT_BIT). ANSI 0–15,
217
- * the default colour and a blend reaching either are the terminal theme's
216
+ * the default color and a blend reaching either are the terminal theme's
218
217
  * own, so they have none.
219
218
  */
220
219
  get fixedValue(): ColorRgba | undefined;
@@ -251,48 +250,48 @@ export declare class ColorSpec {
251
250
  static fromRgba(value: ColorRgba): ColorSpec;
252
251
  static fromRgb(r: number, g: number, b: number): ColorSpec;
253
252
  /**
254
- * The colour `t` of the way from `from` to `to`: what `blend(from,to,t)`
255
- * parses to. Two fixed colours mix to a fixed colour. A mix reaching a
256
- * theme's own colour stays a mix until it is drawn, so whatever theme draws
253
+ * The color `t` of the way from `from` to `to`: what `blend(from,to,t)`
254
+ * parses to. Two fixed colors mix to a fixed color. A mix reaching a
255
+ * theme's own color stays a mix until it is drawn, so whatever theme draws
257
256
  * an end draws the mix from it: exported under a theme whose `blue` is
258
257
  * #61afef, a mix with `blue` starts from #61afef. A terminal is told its RGB
259
258
  * under the standard table, the only one a render has.
260
259
  *
261
- * Each end is one opaque colour: `default` is no colour to mix, and a
260
+ * Each end is one opaque color: `default` is no color to mix, and a
262
261
  * translucent end has no one shade until it is laid on a ground.
263
262
  */
264
263
  static blend(from: ColorSpec, to: ColorSpec, t: number): ColorSpec;
265
264
  /**
266
265
  * The spec that draws `value` nearest to it at `depth` on a terminal known
267
- * to show `theme`, as the colour of the glyph (`foreground`) or of the
266
+ * to show `theme`, as the color of the glyph (`foreground`) or of the
268
267
  * ground. Where `downgrade` knows no terminal, and so rounds only against
269
- * colours every terminal fixes (or, at sixteen colours, the stock
270
- * sixteen), this rounds against every colour the depth can write whose
271
- * look `theme` fixes: the default colour, the theme's sixteen, and at 256
272
- * colours the cube and grey ramp too. A colour read off any of those and
273
- * moved a little is drawn as the colour it came from — or, where the theme
274
- * gives two slots one colour, as the lower slot, which looks the same.
268
+ * colors every terminal fixes (or, at sixteen colors, the stock
269
+ * sixteen), this rounds against every color the depth can write whose
270
+ * look `theme` fixes: the default color, the theme's sixteen, and at 256
271
+ * colors the cube and grey ramp too. A color read off any of those and
272
+ * moved a little is drawn as the color it came from — or, where the theme
273
+ * gives two slots one color, as the lower slot, which looks the same.
275
274
  *
276
- * `value` is opaque: a translucent colour has no one look until it is laid
275
+ * `value` is opaque: a translucent color has no one look until it is laid
277
276
  * on a ground (`flattenAlpha`).
278
277
  */
279
278
  static matchOn(value: ColorRgba, depth: ColorDepth, theme: TerminalColors, foreground: boolean): ColorSpec;
280
279
  /**
281
- * Every colour `depth` writes by index, each with the colour a terminal
280
+ * Every color `depth` writes by index, each with the color a terminal
282
281
  * known to show `theme` draws it in, lowest index first: the theme's
283
- * sixteen, and at 256 colours the cube and grey ramp after them. Each is
284
- * drawn alike as glyph and as ground, which the default colour is not, so
285
- * it is not among them. Truecolor writes a colour itself and the default
286
- * depth only the default, so neither writes any by index. The colours
282
+ * sixteen, and at 256 colors the cube and grey ramp after them. Each is
283
+ * drawn alike as glyph and as ground, which the default color is not, so
284
+ * it is not among them. Truecolor writes a color itself and the default
285
+ * depth only the default, so neither writes any by index. The colors
287
286
  * `matchOn` rounds to, but for the default, read off the same two tables.
288
287
  */
289
288
  static indexed(depth: ColorDepth, theme: TerminalColors): readonly (readonly [ColorSpec, ColorRgba])[];
290
289
  /**
291
- * The spec a slot is written in once its colour moves from `was`, what its
290
+ * The spec a slot is written in once its color moves from `was`, what its
292
291
  * written spec draws on `theme`, to the opaque `now`: `matchOn`'s — or
293
292
  * none, where the written spec is as near `now` as that match. A move the
294
- * depth cannot show is no move, so below truecolor a colour moved a little
295
- * off any colour the depth can write — a theme slot, the default colour,
293
+ * depth cannot show is no move, so below truecolor a color moved a little
294
+ * off any color the depth can write — a theme slot, the default color,
296
295
  * the cube — keeps the spec it was written in.
297
296
  */
298
297
  static matchMove(was: ColorRgba, now: ColorRgba, depth: ColorDepth, theme: TerminalColors, foreground: boolean): ColorSpec | undefined;
@@ -303,7 +302,7 @@ export declare class ColorSpec {
303
302
  static parse(colorString: string): ColorSpec;
304
303
  private performDowngrade;
305
304
  }
306
- /** Six hex digits, no `#`, as an opaque colour. @throws {ColorParseError} on anything else. */
305
+ /** Six hex digits, no `#`, as an opaque color. @throws {ColorParseError} on anything else. */
307
306
  export declare function parseRgbHex(hex: string): ColorRgba;
308
307
  /** Eight hex digits, no `#`, the last pair alpha. @throws {ColorParseError} on anything else. */
309
308
  export declare function parseRgbaHex(hex: string): ColorRgba;
@@ -314,7 +313,7 @@ export declare function parseRgbaHex(hex: string): ColorRgba;
314
313
  export declare function parseHexColor(literal: string): ColorRgba;
315
314
  export declare function blendRgb(color1: ColorRgba, color2: ColorRgba, crossFade?: number): ColorRgba;
316
315
  /**
317
- * What a terminal draws with: the part of a `TerminalTheme` a colour resolves
316
+ * What a terminal draws with: the part of a `TerminalTheme` a color resolves
318
317
  * against.
319
318
  */
320
319
  export declare class TerminalColors {
@@ -325,12 +324,12 @@ export declare class TerminalColors {
325
324
  constructor(backgroundColor: ColorRgba, foregroundColor: ColorRgba, ansiColors: ColorTable);
326
325
  }
327
326
  /**
328
- * A terminal theme — surface/foreground baseline, the sixteen ANSI colours,
327
+ * A terminal theme — surface/foreground baseline, the sixteen ANSI colors,
329
328
  * and a semantic palette.
330
329
  *
331
- * **`ansiColors` is the theme's own sixteen colours**, the shades a terminal
330
+ * **`ansiColors` is the theme's own sixteen colors**, the shades a terminal
332
331
  * showing this theme draws `red`, `blue` and the rest in. `ColorSpec.parse("red")`
333
- * is ANSI colour 1 under every theme; which red that is, is the theme's to say,
332
+ * is ANSI color 1 under every theme; which red that is, is the theme's to say,
334
333
  * as it is in Rich, where each `TerminalTheme` carries its own table.
335
334
  */
336
335
  export declare class TerminalTheme extends TerminalColors {
@@ -340,15 +339,15 @@ export declare class TerminalTheme extends TerminalColors {
340
339
  export declare const STANDARD_TABLE: ColorTable;
341
340
  export declare const EIGHT_BIT_TABLE: ColorTable;
342
341
  /**
343
- * What a downgrade to 256 colours may choose: the cube and the grey ramp,
344
- * indices 16–255. Indices 0–15 are the terminal's own ANSI colours, which
342
+ * What a downgrade to 256 colors may choose: the cube and the grey ramp,
343
+ * indices 16–255. Indices 0–15 are the terminal's own ANSI colors, which
345
344
  * every theme redefines, so their RGB is unknown and a match against them is
346
345
  * a guess; Python Rich never picks them either.
347
346
  */
348
347
  export declare const EIGHT_BIT_DOWNGRADE_TABLE: ColorTable;
349
348
  export declare const WINDOWS_TABLE: ColorTable;
350
349
  /**
351
- * The terminal a colour at `depth` is drawn by: `theme`, or when a caller names
350
+ * The terminal a color at `depth` is drawn by: `theme`, or when a caller names
352
351
  * none, the one the depth assumes — the Windows console at WINDOWS, the VGA
353
352
  * sixteen otherwise — for `ColorSpec.getTruecolor` and the contrast measurement
354
353
  * that reads it. (Widgets fall back to `DEFAULT_TERMINAL_THEME`, which carries a
@@ -356,9 +355,9 @@ export declare const WINDOWS_TABLE: ColorTable;
356
355
  */
357
356
  export declare function resolveTerminal(theme: TerminalColors | undefined, depth: ColorDepth): TerminalColors;
358
357
  /**
359
- * The table a downgrade to `depth` rounds a fixed colour against.
360
- * [LAW:one-source-of-truth] `ColorSpec.downgrade` picks the index a colour is
361
- * written as from it, and colorMath hands back its entries as colours the
358
+ * The table a downgrade to `depth` rounds a fixed color against.
359
+ * [LAW:one-source-of-truth] `ColorSpec.downgrade` picks the index a color is
360
+ * written as from it, and colorMath hands back its entries as colors the
362
361
  * writer rounds to those same indices.
363
362
  */
364
363
  export declare function downgradeTable(depth: ColorDepth.EIGHT_BIT | ColorDepth.STANDARD | ColorDepth.WINDOWS): ColorTable;