monowind 0.2.11 → 0.2.12

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/glyphs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BorderStyle } from "./types.ts";
1
+ import type { BorderStyle, CornerRole } from "./types.ts";
2
2
  /**
3
3
  * Border glyph sets (specs/theming.md): the rendering vocabulary
4
4
  * border STYLES resolve through — what the themed "hardware" can
@@ -39,6 +39,23 @@ export interface GlyphTable {
39
39
  qrFull?: string;
40
40
  qrUpper?: string;
41
41
  qrLower?: string;
42
+ /** Shadow shades from a box's shadow core outward (specs/box-shadow.md);
43
+ * `█ ▓ ▒ ░` by default. */
44
+ shadow?: string[];
45
+ /** Corner glyphs by border radius (specs/cell-model.md "Borders:
46
+ * glyph mapping"): a corner draws the registration nearest its
47
+ * radius, the plain corner counting at 0. Registering `rounded`
48
+ * (even empty) or a plain corner replaces the defaults' arcs. */
49
+ rounded?: CornerBand[];
50
+ }
51
+ /** Corner glyphs registered for a radius, in cells; every corner
52
+ * optional. */
53
+ export interface CornerBand {
54
+ radius: number;
55
+ tl?: string;
56
+ tr?: string;
57
+ bl?: string;
58
+ br?: string;
42
59
  }
43
60
  export type BorderGlyphSet = Partial<Record<BorderStyle, GlyphTable>>;
44
61
  /** Register (or last-wins replace, with a warning) a glyph set.
@@ -51,11 +68,21 @@ export declare function registerBorderGlyphs(name: string, set: BorderGlyphSet):
51
68
  export declare function glyphSetFor(name: string | null | undefined): BorderGlyphSet | undefined;
52
69
  /** Host subscription to registrations; returns the unsubscriber. */
53
70
  export declare function onGlyphRegistryChange(listener: () => void): () => void;
71
+ /** A corner's glyph for its radius: the registration nearest it,
72
+ * ties to the larger radius — `plain` at 0, and the set's `rounded`
73
+ * bands, or the defaults' for a style the set leaves untouched. */
74
+ export declare function cornerGlyph(style: BorderStyle, role: CornerRole, radius: number, plain: string, set?: BorderGlyphSet): string;
75
+ /** A table's glyph roles: every field but the corner bands and the
76
+ * shadow ramp. */
77
+ export type GlyphRole = Exclude<keyof GlyphTable, "rounded" | "shadow">;
54
78
  /** The role a junction bitmask (up 8 / down 4 / left 2 / right 1)
55
79
  * plays — stubs (≤1 arm per axis alone) read as plain lines. */
56
- export declare function junctionRole(mask: number): keyof GlyphTable | null;
80
+ export declare function junctionRole(mask: number): GlyphRole | null;
57
81
  export declare const LIGHT_JUNCTIONS: string[];
58
82
  export declare const DOUBLE_JUNCTIONS: string[];
83
+ /** The shade ramp of a box's shadows through the owner's set — a
84
+ * solid-table role, core outward (specs/box-shadow.md). */
85
+ export declare function shadowRamp(set: BorderGlyphSet | undefined): string[];
59
86
  /** Gutter ink through the owner's set — solid-table roles, defaults
60
87
  * `░` / `█` (specs/scrolling.md). */
61
88
  export declare function scrollGlyphs(set: BorderGlyphSet | undefined): {
@@ -1 +1 @@
1
- {"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../src/glyphs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AAEH;;2BAE2B;AAC3B,MAAM,WAAW,UAAU;IACzB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAA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