@orkestrel/console 0.0.5 → 0.0.6
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/src/browser/index.d.ts +17 -9
- package/dist/src/browser/index.js +52 -10
- package/dist/src/browser/index.js.map +1 -1
- package/dist/src/core/index.cjs +325 -326
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +3 -48
- package/dist/src/core/index.d.ts +3 -48
- package/dist/src/core/index.js +326 -326
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.d.cts +2 -2
- package/dist/src/server/index.d.ts +2 -2
- package/package.json +6 -4
|
@@ -409,7 +409,7 @@ export declare interface CaptureOptions {
|
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
/**
|
|
412
|
-
* The structured outcome of {@link import('./
|
|
412
|
+
* The structured outcome of {@link import('./helpers.js').withCapture} — the wrapped function's
|
|
413
413
|
* own return `value` plus the {@link CapturedMessage}s intercepted while it ran.
|
|
414
414
|
*
|
|
415
415
|
* @remarks
|
|
@@ -450,7 +450,7 @@ export declare type Color = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'mag
|
|
|
450
450
|
* chainable accessors. The source of truth for the color axis; the styler drives its
|
|
451
451
|
* accessors from this array so the literals live in one place.
|
|
452
452
|
*/
|
|
453
|
-
export declare const COLORS:
|
|
453
|
+
export declare const COLORS: ReadonlyArray<Exclude<Color, 'default'>>;
|
|
454
454
|
|
|
455
455
|
/**
|
|
456
456
|
* One column of a {@link TableOptions} — its header label and how its cells align.
|
|
@@ -2102,51 +2102,6 @@ export declare interface Style {
|
|
|
2102
2102
|
readonly attributes: readonly Attribute[];
|
|
2103
2103
|
}
|
|
2104
2104
|
|
|
2105
|
-
/**
|
|
2106
|
-
* The fluent, composable styler — the consumer-facing API over the style engine. It
|
|
2107
|
-
* builds a {@link Style} (style as DATA) and renders it through an injected
|
|
2108
|
-
* {@link RendererInterface} (the ANSI default, or a browser `%c` renderer at C-f). Each
|
|
2109
|
-
* color / attribute accessor is immutable copy-on-write: it returns a NEW styler's
|
|
2110
|
-
* surface with the token added, so `styler.red.bold('hi')` composes without mutating,
|
|
2111
|
-
* and a base styler is freely reusable.
|
|
2112
|
-
*
|
|
2113
|
-
* @remarks
|
|
2114
|
-
* - **Callable surface.** A `Styler` is not itself callable; its {@link surface} getter
|
|
2115
|
-
* returns the {@link StylerInterface} — a render FUNCTION carrying the chainable
|
|
2116
|
-
* accessors. The accessors are installed as LAZY getters (`Object.defineProperties`),
|
|
2117
|
-
* so a chain materializes only the stylers it actually walks — never the full tree —
|
|
2118
|
-
* and the recursion terminates. The factory returns that surface; this class is the
|
|
2119
|
-
* engine behind it.
|
|
2120
|
-
* - **Immutable.** `#foreground` and `#attribute` return a fresh `Styler` (the style is
|
|
2121
|
-
* rebuilt, never mutated). A later color of the same channel WINS (last write); a
|
|
2122
|
-
* repeated attribute is idempotent (de-duplicated, order preserved).
|
|
2123
|
-
* - **`enabled` switch.** When `false`, the render function returns text VERBATIM — no
|
|
2124
|
-
* renderer call, no escape codes (for a non-TTY / `NO_COLOR` / piped output).
|
|
2125
|
-
* - **Event-free** — a pure styling primitive (AGENTS §13), like `Scheduler`.
|
|
2126
|
-
*/
|
|
2127
|
-
export declare class Styler {
|
|
2128
|
-
#private;
|
|
2129
|
-
constructor(renderer: RendererInterface, enabled: boolean, style: Style);
|
|
2130
|
-
/** The accumulated style DATA — the empty style on a base styler. */
|
|
2131
|
-
get style(): Style;
|
|
2132
|
-
/** Whether styling is applied; when `false`, the surface returns text unchanged. */
|
|
2133
|
-
get enabled(): boolean;
|
|
2134
|
-
/**
|
|
2135
|
-
* The fluent {@link StylerInterface} value — a render function (`text => string`) with
|
|
2136
|
-
* `style`, `enabled`, and every {@link Color} / {@link Attribute} as a LAZY accessor
|
|
2137
|
-
* (each computes the next styler's surface only when read). This is what consumers
|
|
2138
|
-
* hold and call.
|
|
2139
|
-
*
|
|
2140
|
-
* @remarks
|
|
2141
|
-
* The accessors are defined as getters (not eagerly-merged values), so accessing one
|
|
2142
|
-
* builds exactly one child styler — the tree is never fully materialized and the
|
|
2143
|
-
* construction terminates. The assembled function is then narrowed to
|
|
2144
|
-
* {@link StylerInterface} through {@link #isSurface} (a real structural check), so no
|
|
2145
|
-
* type assertion is used (AGENTS §1 / §14 — narrow, never assert).
|
|
2146
|
-
*/
|
|
2147
|
-
get surface(): StylerInterface;
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
2105
|
/**
|
|
2151
2106
|
* The fluent, composable styling surface — the consumer-facing API. It is BOTH a
|
|
2152
2107
|
* function (call it with text to render the accumulated style) AND a record of
|
|
@@ -2226,7 +2181,7 @@ export declare interface StylerOptions {
|
|
|
2226
2181
|
*/
|
|
2227
2182
|
export declare interface TableOptions {
|
|
2228
2183
|
readonly columns: readonly ColumnSpec[];
|
|
2229
|
-
readonly rows: readonly
|
|
2184
|
+
readonly rows: ReadonlyArray<readonly string[]>;
|
|
2230
2185
|
readonly border?: BorderStyle;
|
|
2231
2186
|
readonly styler?: StylerInterface;
|
|
2232
2187
|
}
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -409,7 +409,7 @@ export declare interface CaptureOptions {
|
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
/**
|
|
412
|
-
* The structured outcome of {@link import('./
|
|
412
|
+
* The structured outcome of {@link import('./helpers.js').withCapture} — the wrapped function's
|
|
413
413
|
* own return `value` plus the {@link CapturedMessage}s intercepted while it ran.
|
|
414
414
|
*
|
|
415
415
|
* @remarks
|
|
@@ -450,7 +450,7 @@ export declare type Color = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'mag
|
|
|
450
450
|
* chainable accessors. The source of truth for the color axis; the styler drives its
|
|
451
451
|
* accessors from this array so the literals live in one place.
|
|
452
452
|
*/
|
|
453
|
-
export declare const COLORS:
|
|
453
|
+
export declare const COLORS: ReadonlyArray<Exclude<Color, 'default'>>;
|
|
454
454
|
|
|
455
455
|
/**
|
|
456
456
|
* One column of a {@link TableOptions} — its header label and how its cells align.
|
|
@@ -2102,51 +2102,6 @@ export declare interface Style {
|
|
|
2102
2102
|
readonly attributes: readonly Attribute[];
|
|
2103
2103
|
}
|
|
2104
2104
|
|
|
2105
|
-
/**
|
|
2106
|
-
* The fluent, composable styler — the consumer-facing API over the style engine. It
|
|
2107
|
-
* builds a {@link Style} (style as DATA) and renders it through an injected
|
|
2108
|
-
* {@link RendererInterface} (the ANSI default, or a browser `%c` renderer at C-f). Each
|
|
2109
|
-
* color / attribute accessor is immutable copy-on-write: it returns a NEW styler's
|
|
2110
|
-
* surface with the token added, so `styler.red.bold('hi')` composes without mutating,
|
|
2111
|
-
* and a base styler is freely reusable.
|
|
2112
|
-
*
|
|
2113
|
-
* @remarks
|
|
2114
|
-
* - **Callable surface.** A `Styler` is not itself callable; its {@link surface} getter
|
|
2115
|
-
* returns the {@link StylerInterface} — a render FUNCTION carrying the chainable
|
|
2116
|
-
* accessors. The accessors are installed as LAZY getters (`Object.defineProperties`),
|
|
2117
|
-
* so a chain materializes only the stylers it actually walks — never the full tree —
|
|
2118
|
-
* and the recursion terminates. The factory returns that surface; this class is the
|
|
2119
|
-
* engine behind it.
|
|
2120
|
-
* - **Immutable.** `#foreground` and `#attribute` return a fresh `Styler` (the style is
|
|
2121
|
-
* rebuilt, never mutated). A later color of the same channel WINS (last write); a
|
|
2122
|
-
* repeated attribute is idempotent (de-duplicated, order preserved).
|
|
2123
|
-
* - **`enabled` switch.** When `false`, the render function returns text VERBATIM — no
|
|
2124
|
-
* renderer call, no escape codes (for a non-TTY / `NO_COLOR` / piped output).
|
|
2125
|
-
* - **Event-free** — a pure styling primitive (AGENTS §13), like `Scheduler`.
|
|
2126
|
-
*/
|
|
2127
|
-
export declare class Styler {
|
|
2128
|
-
#private;
|
|
2129
|
-
constructor(renderer: RendererInterface, enabled: boolean, style: Style);
|
|
2130
|
-
/** The accumulated style DATA — the empty style on a base styler. */
|
|
2131
|
-
get style(): Style;
|
|
2132
|
-
/** Whether styling is applied; when `false`, the surface returns text unchanged. */
|
|
2133
|
-
get enabled(): boolean;
|
|
2134
|
-
/**
|
|
2135
|
-
* The fluent {@link StylerInterface} value — a render function (`text => string`) with
|
|
2136
|
-
* `style`, `enabled`, and every {@link Color} / {@link Attribute} as a LAZY accessor
|
|
2137
|
-
* (each computes the next styler's surface only when read). This is what consumers
|
|
2138
|
-
* hold and call.
|
|
2139
|
-
*
|
|
2140
|
-
* @remarks
|
|
2141
|
-
* The accessors are defined as getters (not eagerly-merged values), so accessing one
|
|
2142
|
-
* builds exactly one child styler — the tree is never fully materialized and the
|
|
2143
|
-
* construction terminates. The assembled function is then narrowed to
|
|
2144
|
-
* {@link StylerInterface} through {@link #isSurface} (a real structural check), so no
|
|
2145
|
-
* type assertion is used (AGENTS §1 / §14 — narrow, never assert).
|
|
2146
|
-
*/
|
|
2147
|
-
get surface(): StylerInterface;
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
2105
|
/**
|
|
2151
2106
|
* The fluent, composable styling surface — the consumer-facing API. It is BOTH a
|
|
2152
2107
|
* function (call it with text to render the accumulated style) AND a record of
|
|
@@ -2226,7 +2181,7 @@ export declare interface StylerOptions {
|
|
|
2226
2181
|
*/
|
|
2227
2182
|
export declare interface TableOptions {
|
|
2228
2183
|
readonly columns: readonly ColumnSpec[];
|
|
2229
|
-
readonly rows: readonly
|
|
2184
|
+
readonly rows: ReadonlyArray<readonly string[]>;
|
|
2230
2185
|
readonly border?: BorderStyle;
|
|
2231
2186
|
readonly styler?: StylerInterface;
|
|
2232
2187
|
}
|