@promptctl/rich-js 0.24.1 → 0.25.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 +7 -0
- package/dist/core/anchor.d.ts +5 -0
- package/dist/core/anchor.js +11 -4
- package/dist/core/animation.d.ts +175 -10
- package/dist/core/animation.js +283 -15
- package/dist/core/ansi.js +2 -2
- package/dist/core/box.d.ts +7 -7
- package/dist/core/cells.d.ts +23 -13
- package/dist/core/cells.js +58 -48
- package/dist/core/clock.d.ts +2 -2
- package/dist/core/clock.js +6 -4
- package/dist/core/color.d.ts +27 -10
- package/dist/core/color.js +21 -29
- package/dist/core/console.d.ts +28 -17
- package/dist/core/console.js +44 -39
- package/dist/core/easing.d.ts +30 -0
- package/dist/core/easing.js +65 -20
- package/dist/core/emoji.d.ts +1 -1
- package/dist/core/emoji.js +1 -2
- package/dist/core/export-html.js +2 -1
- package/dist/core/export-lines.js +3 -3
- package/dist/core/highlighter.d.ts +9 -8
- package/dist/core/highlighter.js +3 -2
- package/dist/core/json.js +2 -2
- package/dist/core/markup.js +16 -12
- package/dist/core/measure.js +2 -2
- package/dist/core/memo.d.ts +11 -2
- package/dist/core/memo.js +16 -0
- package/dist/core/oklch.js +17 -6
- package/dist/core/osc8.d.ts +1 -1
- package/dist/core/osc8.js +4 -5
- package/dist/core/paint.d.ts +2 -1
- package/dist/core/paint.js +4 -3
- package/dist/core/pattern.d.ts +21 -0
- package/dist/core/pattern.js +21 -0
- package/dist/core/pretty.js +9 -10
- package/dist/core/protocol.d.ts +100 -39
- package/dist/core/protocol.js +167 -21
- package/dist/core/render.d.ts +15 -2
- package/dist/core/render.js +25 -5
- package/dist/core/segment.d.ts +13 -5
- package/dist/core/segment.js +23 -9
- package/dist/core/spinnerData.d.ts +1 -1
- package/dist/core/state.d.ts +53 -0
- package/dist/core/state.js +82 -0
- package/dist/core/strip.d.ts +13 -16
- package/dist/core/strip.js +119 -110
- package/dist/core/style.d.ts +47 -14
- package/dist/core/style.js +57 -28
- package/dist/core/text.d.ts +5 -8
- package/dist/core/text.js +116 -124
- package/dist/core/timeline.d.ts +30 -5
- package/dist/core/timeline.js +43 -7
- package/dist/core/tween.d.ts +1 -1
- package/dist/core/tween.js +5 -3
- package/dist/core/view.d.ts +92 -0
- package/dist/core/view.js +83 -0
- package/dist/host/app.d.ts +49 -21
- package/dist/host/app.js +71 -37
- package/dist/host/input.js +3 -4
- package/dist/index.d.ts +24 -12
- package/dist/index.js +9 -4
- package/dist/node/traceback.js +4 -3
- package/dist/renderables/align.d.ts +2 -3
- package/dist/renderables/align.js +0 -3
- package/dist/renderables/change.d.ts +42 -0
- package/dist/renderables/change.js +112 -0
- package/dist/renderables/columns.d.ts +3 -4
- package/dist/renderables/columns.js +2 -7
- package/dist/renderables/constrain.d.ts +2 -3
- package/dist/renderables/constrain.js +0 -3
- package/dist/renderables/effect.d.ts +132 -54
- package/dist/renderables/effect.js +188 -115
- package/dist/renderables/effects.d.ts +122 -11
- package/dist/renderables/effects.js +238 -94
- package/dist/renderables/embed.d.ts +1 -1
- package/dist/renderables/embed.js +16 -8
- package/dist/renderables/flexStrip.d.ts +2 -3
- package/dist/renderables/flexStrip.js +0 -4
- package/dist/renderables/frames.d.ts +35 -54
- package/dist/renderables/frames.js +43 -58
- package/dist/renderables/glyph-effect.d.ts +158 -0
- package/dist/renderables/glyph-effect.js +237 -0
- package/dist/renderables/glyph-effects.d.ts +147 -0
- package/dist/renderables/glyph-effects.js +283 -0
- package/dist/renderables/group.d.ts +3 -4
- package/dist/renderables/group.js +0 -3
- package/dist/renderables/layout.d.ts +12 -12
- package/dist/renderables/layout.js +40 -46
- package/dist/renderables/lifecycle.d.ts +77 -0
- package/dist/renderables/lifecycle.js +132 -0
- package/dist/renderables/list-view.d.ts +4 -5
- package/dist/renderables/list-view.js +9 -13
- package/dist/renderables/live.d.ts +36 -21
- package/dist/renderables/live.js +88 -41
- package/dist/renderables/markdown-parse.d.ts +4 -4
- package/dist/renderables/markdown-parse.js +52 -46
- package/dist/renderables/markdown-url.js +11 -11
- package/dist/renderables/padding.d.ts +4 -5
- package/dist/renderables/padding.js +0 -3
- package/dist/renderables/panel.d.ts +14 -16
- package/dist/renderables/panel.js +6 -14
- package/dist/renderables/progress.d.ts +83 -34
- package/dist/renderables/progress.js +182 -95
- package/dist/renderables/progressBar.d.ts +22 -12
- package/dist/renderables/progressBar.js +32 -9
- package/dist/renderables/prompt.js +3 -2
- package/dist/renderables/python-space.js +2 -1
- package/dist/renderables/scroll.d.ts +50 -0
- package/dist/renderables/scroll.js +106 -0
- package/dist/renderables/spinner.d.ts +35 -14
- package/dist/renderables/spinner.js +65 -25
- package/dist/renderables/status.js +1 -1
- package/dist/renderables/syntax.d.ts +10 -9
- package/dist/renderables/syntax.js +3 -2
- package/dist/renderables/table.d.ts +34 -40
- package/dist/renderables/table.js +41 -63
- package/dist/renderables/traceback.d.ts +2 -2
- package/dist/renderables/traceback.js +6 -5
- package/dist/renderables/tree.d.ts +27 -25
- package/dist/renderables/tree.js +104 -58
- package/dist/renderables/viewport.d.ts +75 -44
- package/dist/renderables/viewport.js +145 -82
- package/dist/template-bindings/animation-funcs.d.ts +78 -9
- package/dist/template-bindings/animation-funcs.js +132 -14
- package/dist/template-bindings/index.d.ts +5 -5
- package/dist/template-bindings/index.js +5 -5
- package/dist/themes/ramp.d.ts +46 -3
- package/dist/themes/ramp.js +61 -4
- package/dist/themes/registry.js +5 -7
- package/dist/widgets/button.js +3 -2
- package/dist/widgets/checkbox.js +4 -3
- package/dist/widgets/dropdown.d.ts +3 -1
- package/dist/widgets/dropdown.js +20 -15
- package/dist/widgets/event-router.js +4 -2
- package/dist/widgets/focus-manager.d.ts +2 -0
- package/dist/widgets/focus-manager.js +6 -4
- package/dist/widgets/hit.d.ts +6 -0
- package/dist/widgets/hit.js +8 -1
- package/dist/widgets/observable.d.ts +23 -0
- package/dist/widgets/observable.js +43 -0
- package/dist/widgets/slider.d.ts +1 -1
- package/dist/widgets/slider.js +12 -3
- package/dist/widgets/static-item.d.ts +2 -3
- package/dist/widgets/static-item.js +0 -3
- package/dist/widgets/text-input.d.ts +28 -32
- package/dist/widgets/text-input.js +360 -346
- package/dist/widgets/themed-widget.js +2 -1
- package/dist/widgets/toggle.js +4 -3
- package/dist/widgets/types.d.ts +10 -4
- package/dist/widgets/types.js +8 -2
- package/dist/widgets/widget-app.d.ts +14 -4
- package/dist/widgets/widget-app.js +36 -7
- package/dist/widgets/widget-base.d.ts +2 -2
- package/dist/widgets/widget-base.js +29 -18
- package/package.json +8 -1
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Effected — a renderable whose finished cells' colours
|
|
3
|
-
* effect at a moment `t`.
|
|
2
|
+
* Effected — a renderable whose finished cells' looks — colours and text
|
|
3
|
+
* attributes — pass through an effect at a moment `t`.
|
|
4
4
|
*
|
|
5
5
|
* An effect is, for what an element draws in a frame, an `Animation`
|
|
6
6
|
* (`core/animation.ts`) of what is done to its cells: its value at `t` is a
|
|
7
|
-
* function from a cell's
|
|
8
|
-
*
|
|
7
|
+
* function from a cell's look and where the cell is to the cell's new look
|
|
8
|
+
* (`EffectFrame`), and it says when that next changes as every
|
|
9
9
|
* animation does. Whatever holds for the whole frame is worked out once, in
|
|
10
10
|
* the effect and its `at(t)`, and every cell of the frame is handed to the
|
|
11
11
|
* function `at(t)` returns, but for those a wrapper keeps back: `confined`
|
|
12
12
|
* hands over only the cells its owners drew, so an effect never counts on
|
|
13
|
-
* seeing them all. Shimmer, pulse, fade
|
|
14
|
-
* differing by what the function does with its
|
|
15
|
-
* [LAW:one-type-per-behavior]; two effects stack by nesting one
|
|
16
|
-
* another, which is the same as calling one after the other but
|
|
17
|
-
* outer one measures: the inner one's output.
|
|
13
|
+
* seeing them all. Shimmer, pulse, fade, dissolve and a blinking attribute
|
|
14
|
+
* are all this one shape, differing by what the function does with its
|
|
15
|
+
* inputs [LAW:one-type-per-behavior]; two effects stack by nesting one
|
|
16
|
+
* wrapper in another, which is the same as calling one after the other but
|
|
17
|
+
* for what the outer one measures: the inner one's output.
|
|
18
|
+
*
|
|
19
|
+
* A cell's look is one value, its colours and its attributes together
|
|
20
|
+
* (`CellLook`), rather than an attribute stage beside the colour one, so
|
|
21
|
+
* everything that takes an `Effect` — `confined`, `onBeat`,
|
|
22
|
+
* `Animation.all`, nesting over a glyph effect — takes one that moves
|
|
23
|
+
* attributes with no second copy of itself. `reverse` is the one attribute
|
|
24
|
+
* a look leaves out (`CellAttributes`): it decides which of a style's slots
|
|
25
|
+
* a colour on screen is in, and a swap of the two is already a colour move.
|
|
18
26
|
*
|
|
19
27
|
* What the element draws (`Drawn`) — the cells the effect will be handed,
|
|
20
28
|
* and the colours of its words — is measured here, in the render, off the
|
|
@@ -23,10 +31,12 @@
|
|
|
23
31
|
* against (`onColors`, `./effects.ts`), so no caller derives it a second time
|
|
24
32
|
* from a render of its own.
|
|
25
33
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the
|
|
29
|
-
*
|
|
34
|
+
* An `Effected` is the element under its effect over time: an
|
|
35
|
+
* `Animation<Renderable>`, placed wherever a renderable goes and drawn at
|
|
36
|
+
* the time of the frame it is drawn in. Its value at `t` is the element
|
|
37
|
+
* through the effect at `t` (`Recolored`). [LAW:no-ambient-temporal-coupling]
|
|
38
|
+
* The time is the frame's, never a clock read, so the same time always draws
|
|
39
|
+
* the same bytes, at 30 frames a second or one every two seconds.
|
|
30
40
|
*
|
|
31
41
|
* What an effect may not do is the contract this module holds:
|
|
32
42
|
*
|
|
@@ -36,26 +46,30 @@
|
|
|
36
46
|
* segment's link and meta and carries its anchor shifted to the run's first
|
|
37
47
|
* cell (`Style.shiftedBy`), so hit testing still finds the owner.
|
|
38
48
|
* - A cell whose colours come back unchanged keeps its original `ColorSpec`,
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* the
|
|
49
|
+
* one whose attributes come back as its style set them keeps them, and a
|
|
50
|
+
* segment whose every cell is unchanged is yielded with its look as
|
|
51
|
+
* it was, so the identity effect is byte-identical; what an `Effected` gains is when
|
|
52
|
+
* the frame next changes (`Style.hold`), which writes no byte.
|
|
42
53
|
* Neighbouring cells the output depth
|
|
43
54
|
* writes alike stay one segment: a segment is cut only where the written
|
|
44
|
-
* colours change, so two colours that land on one index
|
|
55
|
+
* colours or the attributes change, so two colours that land on one index
|
|
56
|
+
* are one run.
|
|
45
57
|
* - New colours are built with `ColorSpec.fromRgba`, never parsed from a
|
|
46
58
|
* string, so no frame adds an entry to a parse cache.
|
|
47
|
-
* - With no colour output (`colorSystem: null`)
|
|
48
|
-
*
|
|
59
|
+
* - With no colour output (`colorSystem: null`) no style is written at all,
|
|
60
|
+
* attributes included, so there is nothing for an effect to change, and
|
|
61
|
+
* the child's segments pass through untouched.
|
|
49
62
|
*
|
|
50
63
|
* Positions are the child's own: row and column count from the top-left of
|
|
51
64
|
* what the child drew, so a sweep crosses the element, not the screen.
|
|
52
65
|
*/
|
|
53
66
|
import { type Anchor } from "../core/anchor.js";
|
|
54
67
|
import { Animation } from "../core/animation.js";
|
|
68
|
+
import type { Hold } from "../core/style.js";
|
|
55
69
|
import { ColorDepth, type ColorRgba, type TerminalTheme } from "../core/color.js";
|
|
56
|
-
import type {
|
|
57
|
-
import type { Composite, Measurable, Renderable, RenderOptions } from "../core/protocol.js";
|
|
70
|
+
import type { Measurable, Renderable, RenderOptions } from "../core/protocol.js";
|
|
58
71
|
import { Segment } from "../core/segment.js";
|
|
72
|
+
import { type Attributes } from "../core/style.js";
|
|
59
73
|
/**
|
|
60
74
|
* A cell's foreground and background as they appear on screen — the glyph's
|
|
61
75
|
* colour and the colour behind it — which are the colours an effect moves.
|
|
@@ -65,6 +79,16 @@ export interface CellColors {
|
|
|
65
79
|
readonly fg: ColorRgba;
|
|
66
80
|
readonly bg: ColorRgba;
|
|
67
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* The text attributes an effect moves: every one a style sets but
|
|
84
|
+
* `reverse`, each on, off or unset as the cell's style has it. An unset
|
|
85
|
+
* one lets a style laid beneath show through, as it does undrawn.
|
|
86
|
+
*/
|
|
87
|
+
export type CellAttributes = Omit<Attributes, "reverse">;
|
|
88
|
+
/** What an effect moves in a cell: its colours as the screen shows them, and its attributes. */
|
|
89
|
+
export interface CellLook extends CellColors {
|
|
90
|
+
readonly attributes: CellAttributes;
|
|
91
|
+
}
|
|
68
92
|
/**
|
|
69
93
|
* Where a cell is in the output of the renderable an effect wraps, its seed:
|
|
70
94
|
* a number in [0, 1) that is the same for that cell on every frame, for an
|
|
@@ -141,8 +165,8 @@ export interface Drawn {
|
|
|
141
165
|
/** The terminal the frame is drawn on. */
|
|
142
166
|
readonly theme: TerminalTheme;
|
|
143
167
|
}
|
|
144
|
-
/** What an effect does to the cells of one frame: each cell's
|
|
145
|
-
export type EffectFrame = (
|
|
168
|
+
/** What an effect does to the cells of one frame: each cell's look and where it is in, its look out. Return `look` to leave a cell be. */
|
|
169
|
+
export type EffectFrame = (look: CellLook, cell: EffectCell) => CellLook;
|
|
146
170
|
/**
|
|
147
171
|
* For an element drawing `drawn`, the animation of what is done to its cells.
|
|
148
172
|
* [LAW:types-are-the-program] Per-frame work is `at(t)`, so it runs once a
|
|
@@ -159,8 +183,6 @@ export type EffectFrame = (colors: CellColors, cell: EffectCell) => CellColors;
|
|
|
159
183
|
*/
|
|
160
184
|
export type Effect = (drawn: Drawn) => Animation<EffectFrame>;
|
|
161
185
|
export interface EffectedOptions {
|
|
162
|
-
/** The moment to draw, in seconds. */
|
|
163
|
-
readonly t: number;
|
|
164
186
|
/**
|
|
165
187
|
* Names the element for its seeds, so two elements showing the same text do
|
|
166
188
|
* not twinkle in lockstep. The same key gives the same seeds on every frame.
|
|
@@ -173,21 +195,71 @@ export interface EffectedOptions {
|
|
|
173
195
|
*/
|
|
174
196
|
readonly theme: TerminalTheme;
|
|
175
197
|
}
|
|
176
|
-
|
|
198
|
+
/** A frame an effect drew at a moment, and the hold the effect says it is in there. */
|
|
199
|
+
export interface Moved {
|
|
200
|
+
readonly segments: Iterable<Segment>;
|
|
201
|
+
readonly hold: Hold;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* An `Effected` at `t`, or an element through an effect at a time an
|
|
205
|
+
* animation's `at` was handed — a lifecycle's time since it entered: `renderable`
|
|
206
|
+
* with its cells' looks passed through `effect` at `t`, saying nothing of
|
|
207
|
+
* when that changes, since whatever placed the animation stamps its hold.
|
|
208
|
+
* [LAW:one-type-per-behavior]
|
|
209
|
+
*/
|
|
210
|
+
export declare class Recolored implements Renderable, Measurable {
|
|
177
211
|
readonly renderable: Renderable;
|
|
178
212
|
readonly effect: Effect;
|
|
179
213
|
readonly t: number;
|
|
180
214
|
readonly key: string;
|
|
181
215
|
readonly theme: TerminalTheme;
|
|
182
|
-
constructor(renderable: Renderable, effect: Effect, options: EffectedOptions
|
|
216
|
+
constructor(renderable: Renderable, effect: Effect, options: EffectedOptions & {
|
|
217
|
+
readonly t: number;
|
|
218
|
+
});
|
|
183
219
|
render(options: RenderOptions): Iterable<Segment>;
|
|
184
|
-
|
|
185
|
-
|
|
220
|
+
/** The frame the effect draws at `t`, and the hold it says that is in. */
|
|
221
|
+
moved(options: RenderOptions): Moved;
|
|
186
222
|
private _recolored;
|
|
187
223
|
measure(options: RenderOptions): {
|
|
188
224
|
minimum: number;
|
|
189
225
|
maximum: number;
|
|
190
226
|
};
|
|
227
|
+
/**
|
|
228
|
+
* The specs that draw a cell's slot colours `to` where the segment drew
|
|
229
|
+
* `from` with `wire`: each moved slot in the spec `movedSpecs` writes it
|
|
230
|
+
* in, the rest as `wire` wrote them.
|
|
231
|
+
*/
|
|
232
|
+
private respec;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* `renderable` under `effect` over time: an `Animation<Renderable>` whose
|
|
236
|
+
* value at `t` is the element through the effect at `t`, placed wherever a
|
|
237
|
+
* renderable goes. Its own answer to when it changes is `t`, at every time:
|
|
238
|
+
* an `Effect` is made from what the element draws, so with nothing drawn
|
|
239
|
+
* nothing can say more — early, never false. Placed, it says exactly: its
|
|
240
|
+
* cells carry the effect's own hold at the frame's time and the output's
|
|
241
|
+
* depth (`stampFrame`), under whatever the element already said, so at a
|
|
242
|
+
* depth that shows no motion a loop says it never changes there and the
|
|
243
|
+
* host sleeps.
|
|
244
|
+
*/
|
|
245
|
+
export declare class Effected implements Animation<Renderable> {
|
|
246
|
+
readonly renderable: Renderable;
|
|
247
|
+
readonly effect: Effect;
|
|
248
|
+
readonly key: string;
|
|
249
|
+
readonly theme: TerminalTheme;
|
|
250
|
+
constructor(renderable: Renderable, effect: Effect, options: EffectedOptions);
|
|
251
|
+
/** The element through the effect at `t`, unstamped. */
|
|
252
|
+
at(t: number): Recolored;
|
|
253
|
+
nextChange(t: number): number;
|
|
254
|
+
lastChange(t: number): number;
|
|
255
|
+
/** The element under the effect with its motion taken out. */
|
|
256
|
+
reduced(): Effected;
|
|
257
|
+
/** Drawn at the frame's time, its cells stamped with the effect's exact hold there. */
|
|
258
|
+
render(options: RenderOptions): Iterable<Segment>;
|
|
259
|
+
measure(options: RenderOptions): {
|
|
260
|
+
minimum: number;
|
|
261
|
+
maximum: number;
|
|
262
|
+
};
|
|
191
263
|
/**
|
|
192
264
|
* The colours the screen shows for `pair` once it is drawn moved to `to`,
|
|
193
265
|
* both as the screen shows them, at `depth` on `theme`: what an effect
|
|
@@ -196,34 +268,34 @@ export declare class Effected implements Renderable, Measurable, Composite {
|
|
|
196
268
|
* moved slot is written with.
|
|
197
269
|
*/
|
|
198
270
|
static shows(pair: Pair, to: CellColors, depth: ColorDepth, theme: TerminalTheme): CellColors;
|
|
199
|
-
/**
|
|
200
|
-
* The specs that draw a cell's slot colours `to` where the segment drew
|
|
201
|
-
* `from` with `wire`: each moved slot in the spec `movedSpecs` writes it
|
|
202
|
-
* in, the rest as `wire` wrote them.
|
|
203
|
-
*/
|
|
204
|
-
private respec;
|
|
205
|
-
/** A cell's seed: FNV-1a of the key and the position, scaled into [0, 1). */
|
|
206
|
-
private seed;
|
|
207
271
|
}
|
|
208
272
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
273
|
+
* A cell's seed: FNV-1a of the element's key and the cell's position, scaled
|
|
274
|
+
* into [0, 1). [LAW:one-source-of-truth] One rule for a colour effect's seeds
|
|
275
|
+
* and a glyph effect's, so one element under both twinkles from one seed.
|
|
276
|
+
*/
|
|
277
|
+
export declare function cellSeed(key: string, row: number, col: number): number;
|
|
278
|
+
/** A glyph of a segment, placed where its cell is drawn — or none for a newline, which is no cell. */
|
|
279
|
+
export interface WalkedGlyph {
|
|
280
|
+
readonly glyph: string;
|
|
281
|
+
readonly cell: Placed | undefined;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Each glyph of each of `segments`, where its cell sits: rows and columns
|
|
285
|
+
* from the top-left of the output, a wide glyph one cell at its first
|
|
286
|
+
* column, and its anchor shifted to that column as `Style.shiftedBy` shifts
|
|
287
|
+
* a run's. A control segment draws nothing and has none.
|
|
288
|
+
* [LAW:one-source-of-truth] The one walk: what `Drawn.cells` lists, what the
|
|
289
|
+
* render hands a colour effect, and what a glyph effect (`./glyph-effect.ts`)
|
|
290
|
+
* is handed are all read off it.
|
|
291
|
+
*/
|
|
292
|
+
export declare function walkGlyphs(segments: readonly Segment[]): (readonly WalkedGlyph[])[];
|
|
293
|
+
/**
|
|
294
|
+
* Whether `text` draws ink: anything but blanks. [LAW:one-source-of-truth]
|
|
295
|
+
* The one test, so the words a colour effect lights are the words a glyph
|
|
296
|
+
* effect (`./glyph-effects.ts`) scrambles and its particles pass behind.
|
|
225
297
|
*/
|
|
226
|
-
export declare function
|
|
298
|
+
export declare function inked(text: string): boolean;
|
|
227
299
|
/**
|
|
228
300
|
* `effect` on the colours any of `owners` drew, itself or through an owner
|
|
229
301
|
* nested in its output, and every other colour left as it is: one item of a
|
|
@@ -242,3 +314,9 @@ export declare function confined(effect: Effect, ...owners: readonly object[]):
|
|
|
242
314
|
* output under an effect to read the contrast its words are left at.
|
|
243
315
|
*/
|
|
244
316
|
export declare function drawnOf(segments: Iterable<Segment>, depth: ColorDepth, theme: TerminalTheme): Drawn;
|
|
317
|
+
/**
|
|
318
|
+
* The attributes a look carries, read off anything that sets them — a
|
|
319
|
+
* `Style`, or a look a frame returned with more on it than `CellAttributes`
|
|
320
|
+
* names. [LAW:one-source-of-truth] The one place `reverse` is left out.
|
|
321
|
+
*/
|
|
322
|
+
export declare function cellAttributes(of: CellAttributes): CellAttributes;
|