@brunosouzas/design-system 0.3.1 → 0.4.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 +29 -6
- package/dist/scripts/cover.d.ts +3 -2
- package/dist/scripts/cover.js +24 -12
- package/dist/src/pieces/cover.d.ts +54 -15
- package/dist/src/pieces/cover.js +327 -108
- package/dist/src/pieces/diagram.d.ts +137 -0
- package/dist/src/pieces/diagram.js +205 -0
- package/dist/src/pieces/index.d.ts +1 -1
- package/dist/src/pieces/index.js +1 -1
- package/dist/src/pieces/ink.d.ts +48 -0
- package/dist/src/pieces/ink.js +38 -0
- package/dist/src/pieces/library.d.ts +23 -0
- package/dist/src/pieces/library.js +4 -0
- package/dist/src/pieces/metro.d.ts +7 -9
- package/dist/src/pieces/metro.js +26 -39
- package/dist/src/pieces/node.d.ts +1 -1
- package/dist/src/pieces/node.js +1 -0
- package/dist/src/pieces/params.js +5 -2
- package/dist/src/pieces/render.js +2 -1
- package/dist/tokens/generated/tokens.d.ts +7 -0
- package/dist/tokens/generated/tokens.js +7 -0
- package/package.json +1 -1
- package/tokens/generated/tokens.css +5 -0
- package/tokens/generated/tokens.json +7 -0
- package/tokens/generated/tokens.ts +7 -0
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ The visual identity of [brunosouzas.com](https://brunosouzas.com): design tokens
|
|
|
25
25
|
|
|
26
26
|
## Status
|
|
27
27
|
|
|
28
|
-
Early. The first change of the [roadmap](docs/roadmap.md) is implemented: the token source and its CSS, TypeScript and JSON exports, the motion components, and the circuit-breaker state machine as the first catalogue scene (16:9 and 4:5, Portuguese and English), with commands to render its stills and videos. The first variety scene, `publish-subscribe`, is implemented with independent message copies, Publish acceptance, two ACKs and a local invoice NACK. Its owner stills/video approval is pending; implementation is not visual approval. The illustration pieces (roadmap item 3), the metro and diagram pieces (item 6)
|
|
28
|
+
Early. The first change of the [roadmap](docs/roadmap.md) is implemented: the token source and its CSS, TypeScript and JSON exports, the motion components, and the circuit-breaker state machine as the first catalogue scene (16:9 and 4:5, Portuguese and English), with commands to render its stills and videos. The first variety scene, `publish-subscribe`, is implemented with independent message copies, Publish acceptance, two ACKs and a local invoice NACK. Its owner stills/video approval is pending; implementation is not visual approval. The illustration pieces (roadmap item 3), the metro and diagram pieces (item 6) stackledger's map markers, zones and icons (AB#167, 0.3.0) and the body diagram pieces (AB#141, 0.3.2) are implemented: the static drawing library that covers, banners, diagrams and scenes share, with a command that builds a blog cover from a JSON spec. The published covers are not ported to it yet (item 5).
|
|
29
29
|
|
|
30
30
|
## What it is
|
|
31
31
|
|
|
@@ -90,7 +90,7 @@ npm run stills -- publish-subscribe # 24 phase/final PNGs (six per
|
|
|
90
90
|
npm run stills -- publish-subscribe --dry-run # print 24 commands, no effects
|
|
91
91
|
npm run render -- publish-subscribe --dry-run # print eight commands; real video waits for owner stills approval
|
|
92
92
|
npm run build # compile the package into dist/ (the package test needs it)
|
|
93
|
-
npm run cover -- cover.json --out card.svg # build a blog cover (or a banner) from its spec
|
|
93
|
+
npm run cover -- cover.json --out card.svg # build a blog cover (or a banner, diagram or icon) from its spec
|
|
94
94
|
npm run pieces:sheet -- --out out/pieces.svg # every piece once, labelled, for review
|
|
95
95
|
npm run studio # Remotion Studio, for frame-by-frame review
|
|
96
96
|
```
|
|
@@ -131,11 +131,11 @@ The components take every colour and size from the tokens, and what is visible a
|
|
|
131
131
|
- `toSvg(node)` writes a tree as SVG text; `toReact(node)` turns the same tree into React elements. Both describe the same elements, attributes and text, which the tests check.
|
|
132
132
|
- `pose(node, { x, y, tilt, squash, hop, scale, shake, opacity })` animates any piece around its base point; a scene recomputes the numbers every frame.
|
|
133
133
|
- Every colour parameter is a token path (`"color.healthy"`, `"illustration.accent"`), never a hex value, except the three data fills of the map pieces below. Each piece checks its parameters before drawing and names the first wrong one. Positions and points take any finite number, because a map has no edge; sizes stay within 10000. A drawing that would hold a non-finite number throws `<piece>: the drawing overflows`.
|
|
134
|
-
- The
|
|
134
|
+
- The 52 pieces, with their anchors, parameters and defaults, are listed in [design §4](openspec/changes/archive/2026-10-23-illustration-pieces/design.md) (the 26 cover pieces), in [design §3](openspec/changes/archive/2026-10-23-metro-and-diagram-pieces/design.md) of `metro-and-diagram-pieces` (the nine map and diagram pieces) and in [design §3, §5 and §6](openspec/changes/archive/2026-10-23-stackledger-map-and-link-pieces/design.md) of `stackledger-map-and-link-pieces` (the six markers, zones and icons) and in [design §3 to §5](openspec/changes/archive/2026-10-23-body-diagram-pieces/design.md) of `body-diagram-pieces` (the ten body diagram pieces), plus `stateStart` ([design §4](openspec/changes/archive/2026-10-24-designer-formats/design.md) of `designer-formats`); the rules are in [`openspec/specs/illustration-pieces/`](openspec/specs/illustration-pieces/spec.md). `npm run pieces:sheet -- --out <file.svg>` draws them all.
|
|
135
135
|
|
|
136
136
|
### Maps and diagrams
|
|
137
137
|
|
|
138
|
-
Thirteen pieces draw a metro map and its page diagrams, for [stackledger](https://github.com/brunosouzas/stackledger) and any other map in this style: `lineBadge`, `stationMarker` (stop, interchange as a capsule, deprecated), `pipe`, `countBadge`, `nodeBlock`, `pillNode`, `hexNode` (normal, focus, placeholder), `messageArrow` (curved or
|
|
138
|
+
Thirteen pieces draw a metro map and its page diagrams, for [stackledger](https://github.com/brunosouzas/stackledger) and any other map in this style: `lineBadge`, `stationMarker` (stop, interchange as a capsule, deprecated), `pipe`, `countBadge`, `nodeBlock`, `pillNode`, `hexNode` (normal, focus, placeholder), `messageArrow` (curved, straight or through two `controls` points, with a head and an optional label; `kind` `reply`, `failure` or `failFast` dashes it and paints it as ADR 0003 says), `ledgerMark` (stackledger's mark; `surface: "dark"` lines it with a light rim), `renewalRing` (orange bands round a station), `suggestedHalo` (a dashed muted circle), `licenceMark` (a 10-unit disc, green when held, white to buy) and `zone` (the outline the caller gives, widened by a round 32-unit stroke at the surface's zone opacity, with an optional title). They paint what the caller lays out: positions, hulls, text measurement and truncation stay with the map engine.
|
|
139
139
|
|
|
140
140
|
- A `placeholder` node may have a `subtitle` (drawn like a normal node's, all muted), and `lineBadge` may have no `text` (the pill alone, 30 wide by default).
|
|
141
141
|
- The licence's disc is small, so it has its own room rule: `size` at least three outlines (9 at ink scale 1).
|
|
@@ -153,6 +153,16 @@ const stop = stationMarker({ cx: 120, cy: 40, surface: "dark" });
|
|
|
153
153
|
const badge = lineBadge({ x: 250, y: 40, text: "SH", fill: "#7B3FE4", surface: "dark" });
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
+
### Body diagrams
|
|
157
|
+
|
|
158
|
+
Ten pieces draw what the blog's body diagrams need beyond the map pieces: `diagramBox` (a box or pill with a fill and centred lines), `decisionNode` (diamond), `storeNode` (cylinder), `queueNode` (box with two rails), `exchangeNode` (hexagon), `taggedContainer` (a frame with its name on a tab), `lifeline` (dashed, or sparse dots once nothing calls it), `phaseBand` (a pill across a sequence in its state's colour), `altFrame` (alt/else frame with a tag and condition per part) and `edgeLabel` (words next to an arrow, optionally on a backdrop). They take `surface` and, the stickers, `inkScale`, like the map pieces, and paint what the caller lays out.
|
|
159
|
+
|
|
160
|
+
- The shapes take one to three centred lines (`text`), an optional `subtitle` and `textSize`. Without `fill` the face is the surface's panel; with a fill, every word is ink.
|
|
161
|
+
- Backticks mark code: `` "adopts a `correlationId`" `` draws `correlationId` in the monospace stack, as a `tspan`. An odd number of backticks is drawn as is.
|
|
162
|
+
- Widths the piece estimates (`tagWidth`, `conditionWidth`, a label's `width`) can be passed by a caller that measures its text.
|
|
163
|
+
- A body diagram is 800 wide. Lay it out in 560 units and show it 800 wide: the pieces then come out at the sizes of the published diagrams (text about 18, outline about 4); only the hard shadow is shallower (5 instead of 8). The cover command does this for you with `"format": "diagram"` (below).
|
|
164
|
+
- `stateStart({ cx, cy, r, surface })` draws the filled start dot of a state machine (7.7 units, 11 at 800), in the surface's text colour, with no outline and no shadow.
|
|
165
|
+
|
|
156
166
|
### A cover
|
|
157
167
|
|
|
158
168
|
A cover is a JSON spec kept with its article, outside this repository: drafts are private, and only the pieces are public. `npm run cover -- <spec.json> --out <file.svg>` validates it, reports every problem with its JSON path, and writes an 800x420 SVG; the same spec always gives the same bytes. With `"format": "banner"` the same command writes a site banner instead (see below).
|
|
@@ -171,10 +181,10 @@ A cover is a JSON spec kept with its article, outside this repository: drafts ar
|
|
|
171
181
|
}
|
|
172
182
|
```
|
|
173
183
|
|
|
174
|
-
- `background` names one of the 21 pairs in `coverBackground` (a background and its ring colour, measured from the published covers).
|
|
184
|
+
- `background` names one of the 21 pairs in `coverBackground` (a background and its ring colour, measured from the published covers). Which covers may share a pair is the `designer` skill's rule, not the package's.
|
|
175
185
|
- `pieces` are drawn in order; their words go on top.
|
|
176
186
|
- The `rings` centre stays within ±10000 in a cover spec, and a piece that overflows is reported at its entry (`pieces[1]: the drawing overflows`).
|
|
177
|
-
- `custom` (optional) is the cover's one free-form object, a JSON node tree limited to drawing tags and a fixed list of attributes, with no external references. An object that repeats becomes a piece instead.
|
|
187
|
+
- `custom` (optional) is the cover's one free-form object, a JSON node tree limited to drawing tags and a fixed list of attributes, with no external references. An object that repeats becomes a piece instead. It is painted after every piece's shapes; `customAt: <i>` paints it before `pieces[i]` instead, so a pill can sit on top of it (words always stay on top).
|
|
178
188
|
- The three published covers that proved the pieces are the test fixtures in `test/fixtures/covers/`.
|
|
179
189
|
|
|
180
190
|
### Banners
|
|
@@ -186,6 +196,19 @@ A spec with `"format": "banner"` (the default is `"cover"`) builds a home banner
|
|
|
186
196
|
|
|
187
197
|
The banner is one image that scales down as a whole. Words in it become small on a phone (a 19px label is about 6px at 375px wide), so keep them few or none. `test/fixtures/covers/home-banner.json` is the brunosouzas.com home banner redrawn from the pieces.
|
|
188
198
|
|
|
199
|
+
### Body diagrams and icons from a spec
|
|
200
|
+
|
|
201
|
+
The same command draws the blog's body diagrams and icons, so a consumer needs no script and no local install:
|
|
202
|
+
|
|
203
|
+
```sh
|
|
204
|
+
npx --yes --package @brunosouzas/design-system@<version> brunosouzas-cover design/<topic>.json --lang pt --out images/<topic>-pt.svg
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
- `"format": "diagram"` takes a `height` in layout units (1 to 10000) and no `background`: the spec is laid out 560 wide and written 800 wide, on the `color.panel` panel with rounded corners (`bodyDiagram.radius`, 14 at 800) and rings in `color.ring` that show at step 28 and width 2, out to the farthest corner. Pieces get the map outline (3) and label size (13), which show at 4.3 and 18.6. `test/fixtures/covers/circuit-breaker-states.json` is the circuit breaker article's state diagram.
|
|
208
|
+
- `"format": "icon"` holds one `eipIcon`, `uiIcon` or `linkIcon` at 0,0 and writes it in a box of its own size (64x40 for an EIP icon). An EIP icon takes its title and description, with the CC BY 4.0 credit, from the icon's data, so its spec has neither; a UI or link icon spec needs both. No `background`, `rings` or `custom`.
|
|
209
|
+
- **Text tables.** `"text": { "pt": { "open": ["taxa de falha", "> limite"] }, "en": { ... } }` holds one table per language with the same keys; any string `"@open"` elsewhere in the spec (pieces, `title`, `description`, even `id`) is replaced by that key's value for the language passed with `--lang <code>`. Every language must define every key, and the ids in the output gain the language (`<id>-pt`). Without `text`, strings are drawn as written, so `"@home"` stays a label.
|
|
210
|
+
- Like a cover, a diagram or icon is a standalone image: `uiIcon` `colour: "currentColor"` is refused in every format.
|
|
211
|
+
|
|
189
212
|
### A new piece
|
|
190
213
|
|
|
191
214
|
Add it to `src/pieces/library.ts` (or `src/pieces/metro.ts` for a map or diagram piece) with `definePiece(name, schema, draw)`, take its colours and sizes from the tokens (a new colour goes to `tokens/source.json` first), register it in `PIECES`, and give it a sample in `scripts/pieces-sheet.ts`. The catalogue test then checks that it draws with only its required parameters and uses token colours only.
|
package/dist/scripts/cover.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export declare const COVER_USAGE = "usage: npm run cover -- <spec.json> --out <file.svg>";
|
|
2
|
+
export declare const COVER_USAGE = "usage: npm run cover -- <spec.json> --out <file.svg> [--lang <code>]";
|
|
3
3
|
export type CoverIo = {
|
|
4
4
|
cwd: string;
|
|
5
5
|
log: (line: string) => void;
|
|
@@ -10,12 +10,13 @@ export declare const parseCoverArgs: (args: string[], cwd: string) => {
|
|
|
10
10
|
ok: true;
|
|
11
11
|
spec: string;
|
|
12
12
|
out: string;
|
|
13
|
+
lang?: string;
|
|
13
14
|
} | {
|
|
14
15
|
ok: false;
|
|
15
16
|
problem: string;
|
|
16
17
|
};
|
|
17
18
|
/** Builds the cover text for a spec file's contents, or the problem lines. */
|
|
18
|
-
export declare const buildCover: (text: string, label: string) => {
|
|
19
|
+
export declare const buildCover: (text: string, label: string, lang?: string) => {
|
|
19
20
|
ok: true;
|
|
20
21
|
svg: string;
|
|
21
22
|
} | {
|
package/dist/scripts/cover.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// `npm run cover -- <spec.json> --out <file.svg
|
|
2
|
+
// `npm run cover -- <spec.json> --out <file.svg> [--lang <code>]`, installed as the bin
|
|
3
3
|
// `brunosouzas-cover` (spec cover-cli; design §6):
|
|
4
4
|
// builds one blog cover from a cover spec kept with its article in the vault.
|
|
5
5
|
//
|
|
@@ -14,23 +14,29 @@ import { closeSync, existsSync, openSync, readFileSync, realpathSync, renameSync
|
|
|
14
14
|
import { randomUUID } from "node:crypto";
|
|
15
15
|
import { dirname, resolve } from "node:path";
|
|
16
16
|
import { fileURLToPath } from "node:url";
|
|
17
|
-
import { coverTree, validateCoverSpec } from "../src/pieces/cover.js";
|
|
17
|
+
import { coverTree, LANGUAGE, validateCoverSpec } from "../src/pieces/cover.js";
|
|
18
18
|
import { toSvg } from "../src/pieces/render.js";
|
|
19
|
-
export const COVER_USAGE = "usage: npm run cover -- <spec.json> --out <file.svg>";
|
|
19
|
+
export const COVER_USAGE = "usage: npm run cover -- <spec.json> --out <file.svg> [--lang <code>]";
|
|
20
20
|
/** The first invocation problem, in the order of the spec, or the two paths. */
|
|
21
21
|
export const parseCoverArgs = (args, cwd) => {
|
|
22
22
|
const specs = [];
|
|
23
23
|
const outs = [];
|
|
24
|
+
const langs = [];
|
|
24
25
|
let unknown;
|
|
25
26
|
let outWithoutValue = false;
|
|
27
|
+
let langWithoutValue = false;
|
|
26
28
|
for (let i = 0; i < args.length; i++) {
|
|
27
29
|
const arg = args[i];
|
|
28
|
-
if (arg === "--out") {
|
|
30
|
+
if (arg === "--out" || arg === "--lang") {
|
|
29
31
|
const value = args[i + 1];
|
|
30
|
-
if (value === undefined || value.startsWith("--"))
|
|
31
|
-
|
|
32
|
+
if (value === undefined || value.startsWith("--")) {
|
|
33
|
+
if (arg === "--out")
|
|
34
|
+
outWithoutValue = true;
|
|
35
|
+
else
|
|
36
|
+
langWithoutValue = true;
|
|
37
|
+
}
|
|
32
38
|
else {
|
|
33
|
-
outs.push(value);
|
|
39
|
+
(arg === "--out" ? outs : langs).push(value);
|
|
34
40
|
i++;
|
|
35
41
|
}
|
|
36
42
|
}
|
|
@@ -56,11 +62,17 @@ export const parseCoverArgs = (args, cwd) => {
|
|
|
56
62
|
const target = resolve(cwd, out);
|
|
57
63
|
if (existsSync(target) && statSync(target).isDirectory())
|
|
58
64
|
return { ok: false, problem: `the output is a folder: ${out}` };
|
|
65
|
+
if (langWithoutValue)
|
|
66
|
+
return { ok: false, problem: "--lang needs a value: <code>" };
|
|
67
|
+
if (langs.length > 1)
|
|
68
|
+
return { ok: false, problem: "--lang given more than once" };
|
|
69
|
+
if (langs.length === 1 && !LANGUAGE.test(langs[0]))
|
|
70
|
+
return { ok: false, problem: `--lang expects a language code such as pt or en, found ${langs[0]}` };
|
|
59
71
|
if (specs.length === 0)
|
|
60
72
|
return { ok: false, problem: "missing the cover spec: <spec.json>" };
|
|
61
73
|
if (specs.length > 1)
|
|
62
74
|
return { ok: false, problem: `one cover spec at a time, found ${specs.length}` };
|
|
63
|
-
return { ok: true, spec: specs[0], out };
|
|
75
|
+
return { ok: true, spec: specs[0], out, ...(langs.length === 1 ? { lang: langs[0] } : {}) };
|
|
64
76
|
};
|
|
65
77
|
/** Parses the spec text; a syntax error names the line and column. */
|
|
66
78
|
const parseJson = (text, label) => {
|
|
@@ -82,14 +94,14 @@ const parseJson = (text, label) => {
|
|
|
82
94
|
}
|
|
83
95
|
};
|
|
84
96
|
/** Builds the cover text for a spec file's contents, or the problem lines. */
|
|
85
|
-
export const buildCover = (text, label) => {
|
|
97
|
+
export const buildCover = (text, label, lang) => {
|
|
86
98
|
const parsed = parseJson(text, label);
|
|
87
99
|
if ("problem" in parsed)
|
|
88
100
|
return { ok: false, lines: [parsed.problem] };
|
|
89
|
-
const problems = validateCoverSpec(parsed.value);
|
|
101
|
+
const problems = validateCoverSpec(parsed.value, { lang });
|
|
90
102
|
if (problems.length > 0)
|
|
91
103
|
return { ok: false, lines: problems.map((p) => `${p.path}: ${p.message}`) };
|
|
92
|
-
return { ok: true, svg: `${toSvg(coverTree(parsed.value))}\n` };
|
|
104
|
+
return { ok: true, svg: `${toSvg(coverTree(parsed.value, { lang }))}\n` };
|
|
93
105
|
};
|
|
94
106
|
export const runCover = (args, io) => {
|
|
95
107
|
const invocation = parseCoverArgs(args, io.cwd);
|
|
@@ -108,7 +120,7 @@ export const runCover = (args, io) => {
|
|
|
108
120
|
io.error(COVER_USAGE);
|
|
109
121
|
return 1;
|
|
110
122
|
}
|
|
111
|
-
const result = buildCover(text, invocation.spec);
|
|
123
|
+
const result = buildCover(text, invocation.spec, invocation.lang);
|
|
112
124
|
if (!result.ok) {
|
|
113
125
|
for (const line of result.lines)
|
|
114
126
|
io.error(line);
|
|
@@ -2,8 +2,9 @@ import { type PieceName } from "./library.ts";
|
|
|
2
2
|
import { type SvgNode } from "./node.ts";
|
|
3
3
|
import { type Problem } from "./params.ts";
|
|
4
4
|
export declare const SAFE_ID: RegExp;
|
|
5
|
-
/** Cover (800x420, the default)
|
|
6
|
-
|
|
5
|
+
/** Cover (800x420, the default), banner (1200x420, rounded corners), body diagram (560 laid out, 800 shown) or icon:
|
|
6
|
+
* spec cover-cli, "Banner output", "Diagram output", "Icon output". */
|
|
7
|
+
export declare const FORMATS: readonly ["cover", "banner", "diagram", "icon"];
|
|
7
8
|
export type CoverFormat = (typeof FORMATS)[number];
|
|
8
9
|
export type CoverPiece = {
|
|
9
10
|
piece: PieceName;
|
|
@@ -13,26 +14,64 @@ export type CustomNode = {
|
|
|
13
14
|
attrs?: Record<string, unknown>;
|
|
14
15
|
children?: (CustomNode | string)[];
|
|
15
16
|
};
|
|
16
|
-
export type
|
|
17
|
+
export type CoverRings = {
|
|
18
|
+
cx: number;
|
|
19
|
+
cy: number;
|
|
20
|
+
radius?: number;
|
|
21
|
+
};
|
|
22
|
+
type SpecCommon = {
|
|
17
23
|
id: string;
|
|
24
|
+
pieces: CoverPiece[];
|
|
25
|
+
/** One table per language; `"@key"` strings elsewhere are replaced for the language asked. */
|
|
26
|
+
text?: Record<string, Record<string, string | string[]>>;
|
|
27
|
+
};
|
|
28
|
+
type Framed = SpecCommon & {
|
|
18
29
|
title: string;
|
|
19
30
|
description: string;
|
|
20
|
-
|
|
21
|
-
background: string;
|
|
22
|
-
rings: {
|
|
23
|
-
cx: number;
|
|
24
|
-
cy: number;
|
|
25
|
-
radius?: number;
|
|
26
|
-
};
|
|
27
|
-
pieces: CoverPiece[];
|
|
31
|
+
rings: CoverRings;
|
|
28
32
|
custom?: CustomNode;
|
|
33
|
+
/** `custom` is drawn before `pieces[customAt]`; default after every piece. */
|
|
34
|
+
customAt?: number;
|
|
29
35
|
};
|
|
36
|
+
/** A cover spec, by format (spec cover-cli, "Cover spec format" and each format's keys). */
|
|
37
|
+
export type CoverSpec = (Framed & {
|
|
38
|
+
format?: "cover" | "banner";
|
|
39
|
+
background: string;
|
|
40
|
+
height?: never;
|
|
41
|
+
}) | (Framed & {
|
|
42
|
+
format: "diagram"; /** Layout units. */
|
|
43
|
+
height: number;
|
|
44
|
+
background?: never;
|
|
45
|
+
}) | (SpecCommon & {
|
|
46
|
+
format: "icon";
|
|
47
|
+
/** Not in an eipIcon spec: the icon's own title and description, with the credit, are drawn. */
|
|
48
|
+
title?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
background?: never;
|
|
51
|
+
rings?: never;
|
|
52
|
+
custom?: never;
|
|
53
|
+
customAt?: never;
|
|
54
|
+
height?: never;
|
|
55
|
+
});
|
|
30
56
|
export declare const backgroundNames: () => string[];
|
|
31
57
|
/** Compares JSON paths: segment by segment, array indexes as numbers, names by code point. */
|
|
32
58
|
export declare const comparePaths: (a: string, b: string) => number;
|
|
33
|
-
/**
|
|
34
|
-
export declare const
|
|
59
|
+
/** A language of a text table and of `--lang`: `pt`, `en`, `pt-br`. */
|
|
60
|
+
export declare const LANGUAGE: RegExp;
|
|
61
|
+
export type CoverOptions = {
|
|
62
|
+
lang?: string;
|
|
63
|
+
};
|
|
64
|
+
/** Every problem of a parsed spec, sorted by path; empty when the spec is valid. `lang` picks a text table. */
|
|
65
|
+
export declare const validateCoverSpec: (spec: unknown, options?: CoverOptions) => Problem[];
|
|
35
66
|
/** Rings a banner draws: out to the frame's farthest corner (spec cover-cli, "Banner rings reach the corners"). */
|
|
36
67
|
export declare const bannerRingCount: (cx: number, cy: number, radius?: number) => number;
|
|
37
|
-
/**
|
|
38
|
-
export declare const
|
|
68
|
+
/** Rings of a diagram (spec cover-cli, "Diagram rings at the shown scale"): the cover's step and width at the shown scale. */
|
|
69
|
+
export declare const diagramRings: (cx: number, cy: number, height: number, radius?: number) => {
|
|
70
|
+
count: number;
|
|
71
|
+
step: number;
|
|
72
|
+
width: number;
|
|
73
|
+
radius: number;
|
|
74
|
+
};
|
|
75
|
+
/** The cover's (banner's, diagram's, icon's) node tree. The spec must be valid for `lang` (validateCoverSpec returned no problem). */
|
|
76
|
+
export declare const coverTree: (input: CoverSpec, options?: CoverOptions) => SvgNode;
|
|
77
|
+
export {};
|