trebol 0.1.0 → 0.1.2

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 (160) hide show
  1. package/README.md +18 -3
  2. package/dist/cli.js +13790 -11417
  3. package/dist/fonts/OFL.txt +93 -0
  4. package/dist/fonts/inter-cyrillic-ext.woff2 +0 -0
  5. package/dist/fonts/inter-cyrillic.woff2 +0 -0
  6. package/dist/fonts/inter-greek-ext.woff2 +0 -0
  7. package/dist/fonts/inter-greek.woff2 +0 -0
  8. package/dist/fonts/inter-latin-ext.woff2 +0 -0
  9. package/dist/fonts/inter-latin.woff2 +0 -0
  10. package/dist/fonts/inter-vietnamese.woff2 +0 -0
  11. package/dist/lib/core/access.d.ts +10 -0
  12. package/dist/lib/core/access.js +210 -0
  13. package/dist/lib/core/base.d.ts +4 -0
  14. package/dist/lib/core/base.js +50 -0
  15. package/dist/lib/core/bitset.d.ts +9 -0
  16. package/dist/lib/core/bitset.js +75 -0
  17. package/dist/lib/core/boot.d.ts +18 -0
  18. package/dist/lib/core/boot.js +73 -0
  19. package/dist/lib/core/compare.d.ts +9 -0
  20. package/dist/lib/core/compare.js +156 -0
  21. package/dist/lib/core/ctx.d.ts +36 -0
  22. package/dist/lib/core/ctx.js +251 -0
  23. package/dist/lib/core/dec.d.ts +28 -0
  24. package/dist/lib/core/dec.js +158 -0
  25. package/dist/lib/core/errors.d.ts +15 -0
  26. package/dist/lib/core/errors.js +44 -0
  27. package/dist/lib/core/escapes.d.ts +14 -0
  28. package/dist/lib/core/escapes.js +80 -0
  29. package/dist/lib/core/eval.d.ts +220 -0
  30. package/dist/lib/core/eval.js +666 -0
  31. package/dist/lib/core/func.d.ts +68 -0
  32. package/dist/lib/core/func.js +129 -0
  33. package/dist/lib/core/hash.d.ts +5 -0
  34. package/dist/lib/core/hash.js +155 -0
  35. package/dist/lib/core/index.d.ts +18 -0
  36. package/dist/lib/core/index.js +20 -0
  37. package/dist/lib/core/int64.d.ts +22 -0
  38. package/dist/lib/core/int64.js +113 -0
  39. package/dist/lib/core/kinds.d.ts +67 -0
  40. package/dist/lib/core/kinds.js +134 -0
  41. package/dist/lib/core/lexer.d.ts +13 -0
  42. package/dist/lib/core/lexer.js +702 -0
  43. package/dist/lib/core/mezz.d.ts +1 -0
  44. package/dist/lib/core/mezz.js +360 -0
  45. package/dist/lib/core/mold.d.ts +20 -0
  46. package/dist/lib/core/mold.js +434 -0
  47. package/dist/lib/core/natives/control.d.ts +1 -0
  48. package/dist/lib/core/natives/control.js +374 -0
  49. package/dist/lib/core/natives/csv.d.ts +15 -0
  50. package/dist/lib/core/natives/csv.js +315 -0
  51. package/dist/lib/core/natives/data.d.ts +11 -0
  52. package/dist/lib/core/natives/data.js +367 -0
  53. package/dist/lib/core/natives/define.d.ts +17 -0
  54. package/dist/lib/core/natives/define.js +47 -0
  55. package/dist/lib/core/natives/encode.d.ts +3 -0
  56. package/dist/lib/core/natives/encode.js +187 -0
  57. package/dist/lib/core/natives/json.d.ts +5 -0
  58. package/dist/lib/core/natives/json.js +273 -0
  59. package/dist/lib/core/natives/math.d.ts +3 -0
  60. package/dist/lib/core/natives/math.js +500 -0
  61. package/dist/lib/core/natives/parse.d.ts +1 -0
  62. package/dist/lib/core/natives/parse.js +600 -0
  63. package/dist/lib/core/natives/series.d.ts +4 -0
  64. package/dist/lib/core/natives/series.js +519 -0
  65. package/dist/lib/core/natives/text.d.ts +1 -0
  66. package/dist/lib/core/natives/text.js +487 -0
  67. package/dist/lib/core/natives/xml.d.ts +9 -0
  68. package/dist/lib/core/natives/xml.js +242 -0
  69. package/dist/lib/core/series.d.ts +26 -0
  70. package/dist/lib/core/series.js +73 -0
  71. package/dist/lib/core/symbols.d.ts +9 -0
  72. package/dist/lib/core/symbols.js +44 -0
  73. package/dist/lib/core/values.d.ts +206 -0
  74. package/dist/lib/core/values.js +223 -0
  75. package/dist/lib/host/browser.d.ts +4 -0
  76. package/dist/lib/host/browser.js +4974 -0
  77. package/dist/lib/host/chart.d.ts +26 -0
  78. package/dist/lib/host/chart.js +158 -0
  79. package/dist/lib/host/compress.d.ts +1 -0
  80. package/dist/lib/host/compress.js +37 -0
  81. package/dist/lib/host/devlog.d.ts +11 -0
  82. package/dist/lib/host/devlog.js +13 -0
  83. package/dist/lib/host/devtools.d.ts +23 -0
  84. package/dist/lib/host/devtools.js +626 -0
  85. package/dist/lib/host/draw.d.ts +31 -0
  86. package/dist/lib/host/draw.js +348 -0
  87. package/dist/lib/host/fonts/OFL.txt +93 -0
  88. package/dist/lib/host/fonts/inter-cyrillic-ext.woff2 +0 -0
  89. package/dist/lib/host/fonts/inter-cyrillic.woff2 +0 -0
  90. package/dist/lib/host/fonts/inter-greek-ext.woff2 +0 -0
  91. package/dist/lib/host/fonts/inter-greek.woff2 +0 -0
  92. package/dist/lib/host/fonts/inter-latin-ext.woff2 +0 -0
  93. package/dist/lib/host/fonts/inter-latin.woff2 +0 -0
  94. package/dist/lib/host/fonts/inter-vietnamese.woff2 +0 -0
  95. package/dist/lib/host/fonts.d.ts +11 -0
  96. package/dist/lib/host/fonts.js +29 -0
  97. package/dist/lib/host/icons.d.ts +3 -0
  98. package/dist/lib/host/icons.js +97 -0
  99. package/dist/lib/host/index.d.ts +40 -0
  100. package/dist/lib/host/index.js +192 -0
  101. package/dist/lib/host/js.d.ts +5 -0
  102. package/dist/lib/host/js.js +130 -0
  103. package/dist/lib/host/locale.d.ts +40 -0
  104. package/dist/lib/host/locale.js +241 -0
  105. package/dist/lib/host/markdown.d.ts +30 -0
  106. package/dist/lib/host/markdown.js +161 -0
  107. package/dist/lib/host/modules.d.ts +14 -0
  108. package/dist/lib/host/modules.js +300 -0
  109. package/dist/lib/host/natives.d.ts +6 -0
  110. package/dist/lib/host/natives.js +98 -0
  111. package/dist/lib/host/net.d.ts +12 -0
  112. package/dist/lib/host/net.js +549 -0
  113. package/dist/lib/host/orbit.d.ts +121 -0
  114. package/dist/lib/host/orbit.js +374 -0
  115. package/dist/lib/host/page.d.ts +9 -0
  116. package/dist/lib/host/page.js +55 -0
  117. package/dist/lib/host/rows.d.ts +29 -0
  118. package/dist/lib/host/rows.js +109 -0
  119. package/dist/lib/host/scheduler.d.ts +51 -0
  120. package/dist/lib/host/scheduler.js +197 -0
  121. package/dist/lib/host/theme.d.ts +58 -0
  122. package/dist/lib/host/theme.js +1667 -0
  123. package/dist/lib/ui/i18n.trb +117 -0
  124. package/dist/lib/ui/test.trb +565 -0
  125. package/dist/lib/ui/ui.trb +1678 -0
  126. package/dist/trebol.js +1427 -138
  127. package/editors/vscode/README.md +15 -0
  128. package/editors/vscode/language-configuration.json +28 -0
  129. package/editors/vscode/package.json +42 -0
  130. package/editors/vscode/syntaxes/trebol.tmLanguage.json +237 -0
  131. package/package.json +23 -7
  132. package/src/core/boot.ts +1 -1
  133. package/src/core/func.ts +4 -0
  134. package/src/core/natives/control.ts +1 -1
  135. package/src/core/natives/series.ts +9 -1
  136. package/src/core/natives/text.ts +2 -0
  137. package/src/host/browser.ts +1235 -83
  138. package/src/host/devlog.ts +16 -0
  139. package/src/host/devtools.ts +641 -0
  140. package/src/host/fonts/OFL.txt +93 -0
  141. package/src/host/fonts/inter-cyrillic-ext.woff2 +0 -0
  142. package/src/host/fonts/inter-cyrillic.woff2 +0 -0
  143. package/src/host/fonts/inter-greek-ext.woff2 +0 -0
  144. package/src/host/fonts/inter-greek.woff2 +0 -0
  145. package/src/host/fonts/inter-latin-ext.woff2 +0 -0
  146. package/src/host/fonts/inter-latin.woff2 +0 -0
  147. package/src/host/fonts/inter-vietnamese.woff2 +0 -0
  148. package/src/host/fonts.ts +39 -0
  149. package/src/host/index.ts +5 -3
  150. package/src/host/js.ts +127 -0
  151. package/src/host/markdown.ts +9 -0
  152. package/src/host/modules.ts +41 -2
  153. package/src/host/net.ts +9 -1
  154. package/src/host/orbit.ts +432 -0
  155. package/src/host/rows.ts +30 -0
  156. package/src/host/scheduler.ts +62 -36
  157. package/src/host/theme.ts +270 -6
  158. package/src/ui/i18n.trb +10 -0
  159. package/src/ui/test.trb +565 -0
  160. package/src/ui/ui.trb +564 -90
@@ -0,0 +1,26 @@
1
+ import { type El } from './draw.ts';
2
+ export type ChartKind = 'bar' | 'line' | 'area' | 'pie';
3
+ export interface Series {
4
+ name: string;
5
+ /** One per label; null where a row has no number. */
6
+ values: Array<number | null>;
7
+ color: string;
8
+ }
9
+ export interface ChartSpec {
10
+ kind: ChartKind;
11
+ labels: string[];
12
+ series: Series[];
13
+ stacked: boolean;
14
+ width: number;
15
+ height: number;
16
+ /** A number as it shows on screen: as the values it stands for (money, percent) in the active language. */
17
+ format: (n: number) => string;
18
+ }
19
+ /** The colors series take in turn: the theme's own two, then Red's color words. */
20
+ export declare const SERIES_COLORS: string[];
21
+ /** The elements of a chart, to go in an SVG of spec.width by spec.height. */
22
+ export declare function chartSvg(spec: ChartSpec): El[];
23
+ /** Round steps for an axis from lo to hi: 0, 250, 500...; whole numbers only, when the values are. */
24
+ export declare function ticks(lo: number, hi: number, whole?: boolean, most?: number): number[];
25
+ /** The color of slice i of a pie: each label its own. */
26
+ export declare function pieColor(i: number): string;
@@ -0,0 +1,158 @@
1
+ // Charts: bar, line, area and pie, drawn as SVG at the width they are given.
2
+ //
3
+ // chart bar income [month "Month" repairs "Repairs" parts "Parts"]
4
+ //
5
+ // The first column labels each point; the others are the series. The host
6
+ // reads the rows and the theme, and redraws when the width changes, so text
7
+ // stays the size of the rest of the page instead of scaling with the chart.
8
+ // Like draw.ts, this builds plain elements and knows nothing of the DOM.
9
+ import { svgEl } from "./draw.js";
10
+ /** The colors series take in turn: the theme's own two, then Red's color words. */
11
+ export const SERIES_COLORS = [
12
+ 'var(--tb-primary)', 'var(--tb-accent)', 'var(--tb-c-teal)', 'var(--tb-c-orange)',
13
+ 'var(--tb-c-purple)', 'var(--tb-c-green)', 'var(--tb-c-pink)', 'var(--tb-c-gold)',
14
+ ];
15
+ const FONT = 12;
16
+ const LABEL = { fill: 'var(--tb-muted)', 'font-size': FONT, 'font-family': 'var(--tb-font)' };
17
+ /** The elements of a chart, to go in an SVG of spec.width by spec.height. */
18
+ export function chartSvg(spec) {
19
+ if (spec.labels.length === 0 || spec.series.length === 0)
20
+ return [];
21
+ return spec.kind === 'pie' ? pie(spec) : axes(spec);
22
+ }
23
+ /** Round steps for an axis from lo to hi: 0, 250, 500...; whole numbers only, when the values are. */
24
+ export function ticks(lo, hi, whole = false, most = 5) {
25
+ if (hi === lo)
26
+ hi = lo + 1;
27
+ const raw = (hi - lo) / most;
28
+ const mag = 10 ** Math.floor(Math.log10(raw));
29
+ const step = Math.max(whole ? 1 : 0, [1, 2, 2.5, 5, 10].map(m => m * mag).find(s => s >= raw && (!whole || Number.isInteger(s))));
30
+ const out = [];
31
+ // each step from its count, cut to 12 digits, so 0.6 is not 0.6000000000000001
32
+ for (let k = Math.floor(lo / step); k * step <= hi + step * 1e-9; k++)
33
+ out.push(Number((k * step).toPrecision(12)));
34
+ if (out[out.length - 1] < hi)
35
+ out.push(out[out.length - 1] + step);
36
+ return out;
37
+ }
38
+ function axes(spec) {
39
+ const { labels, series, width, height, stacked, format } = spec;
40
+ const n = labels.length;
41
+ const stack = stacked && spec.kind !== 'line';
42
+ // the top of each point: its own value, or the sum below it when stacked
43
+ const tops = series.map(() => []);
44
+ const bases = series.map(() => []);
45
+ for (let i = 0; i < n; i++) {
46
+ let up = 0;
47
+ let down = 0;
48
+ series.forEach((s, k) => {
49
+ const v = s.values[i] ?? 0;
50
+ const base = stack ? (v >= 0 ? up : down) : 0;
51
+ bases[k][i] = base;
52
+ tops[k][i] = base + v;
53
+ if (stack)
54
+ v >= 0 ? (up += v) : (down += v);
55
+ });
56
+ }
57
+ const all = tops.flat().concat(bases.flat(), [0]);
58
+ const steps = ticks(Math.min(...all), Math.max(...all), all.every(Number.isInteger));
59
+ const lo = steps[0];
60
+ const hi = steps[steps.length - 1];
61
+ const left = Math.max(...steps.map(t => format(t).length)) * FONT * 0.6 + 8;
62
+ const right = 8;
63
+ const top = FONT;
64
+ const bottom = FONT * 2 + 4;
65
+ const plotW = Math.max(1, width - left - right);
66
+ const plotH = Math.max(1, height - top - bottom);
67
+ const y = (v) => top + plotH - ((v - lo) / (hi - lo)) * plotH;
68
+ const out = [];
69
+ for (const t of steps) {
70
+ out.push(svgEl('line', { x1: left, x2: left + plotW, y1: y(t), y2: y(t), stroke: 'var(--tb-border)', 'stroke-width': t === 0 ? 1.5 : 1 }));
71
+ out.push(svgEl('text', { ...LABEL, x: left - 6, y: y(t), 'text-anchor': 'end', 'dominant-baseline': 'middle' }, [], format(t)));
72
+ }
73
+ // each label gets a band; bars sit inside it, points in its middle
74
+ const band = plotW / n;
75
+ const x = (i) => left + band * (i + 0.5);
76
+ // as many labels as fit, evenly spread
77
+ const room = Math.max(1, Math.floor(plotW / (Math.max(...labels.map(l => l.length)) * FONT * 0.6 + 12)));
78
+ const every = Math.ceil(n / room);
79
+ labels.forEach((l, i) => {
80
+ if (i % every === 0)
81
+ out.push(svgEl('text', { ...LABEL, x: x(i), y: top + plotH + FONT + 4, 'text-anchor': 'middle', 'dominant-baseline': 'middle' }, [], l));
82
+ });
83
+ const tip = (i, s) => svgEl('title', {}, [], `${labels[i]}, ${s.name}: ${s.values[i] === null ? '' : format(s.values[i])}`);
84
+ if (spec.kind === 'bar') {
85
+ const groups = stack ? 1 : series.length;
86
+ const inner = band * 0.7;
87
+ const w = inner / groups;
88
+ series.forEach((s, k) => {
89
+ for (let i = 0; i < n; i++) {
90
+ if (s.values[i] === null)
91
+ continue;
92
+ const x0 = left + band * i + (band - inner) / 2 + (stack ? 0 : w * k);
93
+ const a = y(Math.max(bases[k][i], tops[k][i]));
94
+ const b = y(Math.min(bases[k][i], tops[k][i]));
95
+ out.push(svgEl('rect', { x: x0 + 1, y: a, width: Math.max(1, w - 2), height: Math.max(0, b - a), fill: s.color, rx: 2 }, [tip(i, s)]));
96
+ }
97
+ });
98
+ return out;
99
+ }
100
+ // line and area: the area first, so the lines go over every one of them
101
+ const marks = [];
102
+ series.forEach((s, k) => {
103
+ const pts = [];
104
+ for (let i = 0; i < n; i++)
105
+ if (s.values[i] !== null)
106
+ pts.push(`${x(i)},${y(tops[k][i])}`);
107
+ if (spec.kind === 'area') {
108
+ const under = [];
109
+ for (let i = n - 1; i >= 0; i--)
110
+ if (s.values[i] !== null)
111
+ under.push(`${x(i)},${y(bases[k][i])}`);
112
+ out.push(svgEl('polygon', { points: [...pts, ...under].join(' '), fill: s.color, 'fill-opacity': 0.18, stroke: 'none' }));
113
+ }
114
+ marks.push(svgEl('polyline', { points: pts.join(' '), fill: 'none', stroke: s.color, 'stroke-width': 2, 'stroke-linejoin': 'round', 'stroke-linecap': 'round' }));
115
+ for (let i = 0; i < n; i++) {
116
+ if (s.values[i] === null)
117
+ continue;
118
+ marks.push(svgEl('circle', { cx: x(i), cy: y(tops[k][i]), r: 3.5, fill: s.color, stroke: 'var(--tb-surface)', 'stroke-width': 1.5 }, [tip(i, s)]));
119
+ }
120
+ });
121
+ return out.concat(marks);
122
+ }
123
+ /** A pie of the first series: one slice per label, the ones with nothing to show left out. */
124
+ function pie(spec) {
125
+ const s = spec.series[0];
126
+ const vals = s.values.map(v => (v === null || v < 0 ? 0 : v));
127
+ const total = vals.reduce((a, b) => a + b, 0);
128
+ if (total === 0)
129
+ return [];
130
+ const r = Math.max(1, Math.min(spec.width, spec.height) / 2 - 4);
131
+ const cx = spec.width / 2;
132
+ const cy = spec.height / 2;
133
+ const out = [];
134
+ let at = -90;
135
+ vals.forEach((v, i) => {
136
+ if (v === 0)
137
+ return;
138
+ const sweep = (v / total) * 360;
139
+ const tip = svgEl('title', {}, [], `${spec.labels[i]}: ${spec.format(v)} (${Math.round((v / total) * 100)}%)`);
140
+ const paint = { fill: pieColor(i), stroke: 'var(--tb-surface)', 'stroke-width': 2 };
141
+ if (sweep >= 359.999) {
142
+ out.push(svgEl('circle', { cx, cy, r, ...paint }, [tip]));
143
+ }
144
+ else {
145
+ const p = (deg) => [cx + r * Math.cos((deg * Math.PI) / 180), cy + r * Math.sin((deg * Math.PI) / 180)];
146
+ const [x0, y0] = p(at);
147
+ const [x1, y1] = p(at + sweep);
148
+ const d = `M${cx},${cy} L${x0},${y0} A${r},${r} 0 ${sweep > 180 ? 1 : 0} 1 ${x1},${y1} Z`;
149
+ out.push(svgEl('path', { d, ...paint }, [tip]));
150
+ }
151
+ at += sweep;
152
+ });
153
+ return out;
154
+ }
155
+ /** The color of slice i of a pie: each label its own. */
156
+ export function pieColor(i) {
157
+ return SERIES_COLORS[i % SERIES_COLORS.length];
158
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ // compress and decompress, as in R3 and Red: gzip, zlib or raw deflate, done
2
+ // by the platform's CompressionStream (browsers and Node have it). It works
3
+ // on a stream, so both wait for the result as a fetch does.
4
+ import { K, native, value, binary, text, spell, canon, makeError, throwError, } from "../core/index.js";
5
+ const FORMATS = { gzip: 'gzip', zlib: 'deflate', deflate: 'deflate-raw' };
6
+ function format(method) {
7
+ return FORMATS[spell(canon(method.sym)).toLowerCase()] ?? null;
8
+ }
9
+ const bytesOf = (v) => v.t === K.Binary
10
+ ? new Uint8Array(v.s.data.slice(v.i))
11
+ : new TextEncoder().encode(text(v));
12
+ async function through(bytes, stream) {
13
+ const out = await new Response(new Blob([bytes]).stream().pipeThrough(stream)).arrayBuffer();
14
+ return binary([...new Uint8Array(out)]);
15
+ }
16
+ native('compress', '["Compresses bytes, or text as UTF-8, into a binary." data [binary! string!] method [word!] "gzip, zlib or deflate"]', (_t, f, v) => {
17
+ if (f.phase === 1)
18
+ return value(v);
19
+ const fmt = format(f.args[1]);
20
+ if (fmt === null)
21
+ return throwError('script', 'bad-method', 'compress takes gzip, zlib or deflate');
22
+ f.phase = 1;
23
+ return { k: 'await', p: through(bytesOf(f.args[0]), new CompressionStream(fmt)) };
24
+ });
25
+ native('decompress', '["The bytes that compress was given." data [binary!] method [word!] "gzip, zlib or deflate"]', (_t, f, v) => {
26
+ if (f.phase === 1)
27
+ return value(v);
28
+ const fmt = format(f.args[1]);
29
+ if (fmt === null)
30
+ return throwError('script', 'bad-method', 'decompress takes gzip, zlib or deflate');
31
+ f.phase = 1;
32
+ const name = spell(f.args[1].sym);
33
+ const p = through(bytesOf(f.args[0]), new DecompressionStream(fmt)).catch(() => {
34
+ throw makeError('script', 'bad-compression', `the data is not ${name} compressed`);
35
+ });
36
+ return { k: 'await', p };
37
+ });
@@ -0,0 +1,11 @@
1
+ import type { Cell, ObjectCell } from '../core/index.ts';
2
+ export declare const devLog: {
3
+ /** The host ran a UI event function (ui-click, ui-input...) on a face. */
4
+ event: (_fn: string, _face: ObjectCell, _args: Cell[]) => void;
5
+ /** A request ended: its status, or null and why it failed. */
6
+ request: (_verb: string, _url: string, _status: number | null, _ms: number, _problem: string | null) => void;
7
+ /** A toast, an error nobody caught or a warning (a cycle of reactions). */
8
+ note: (_kind: "toast" | "error" | "warning", _text: string) => void;
9
+ /** The faces on the page were repainted. */
10
+ repainted: () => void;
11
+ };
@@ -0,0 +1,13 @@
1
+ // What the app does, told to the dev tools of trebol dev (devtools.ts). Each
2
+ // hook does nothing until the dev tools start and set it, so the host calls
3
+ // them freely: in a built page, in tests and in Node they are never set.
4
+ export const devLog = {
5
+ /** The host ran a UI event function (ui-click, ui-input...) on a face. */
6
+ event: (_fn, _face, _args) => { },
7
+ /** A request ended: its status, or null and why it failed. */
8
+ request: (_verb, _url, _status, _ms, _problem) => { },
9
+ /** A toast, an error nobody caught or a warning (a cycle of reactions). */
10
+ note: (_kind, _text) => { },
11
+ /** The faces on the page were repainted. */
12
+ repainted: () => { },
13
+ };
@@ -0,0 +1,23 @@
1
+ import { type ObjectCell, type Runtime } from '../core/index.ts';
2
+ import { type Host } from './index.ts';
3
+ /** What the dev tools need from the browser host. */
4
+ export interface DevSide {
5
+ host: Host;
6
+ /** The folder trebol dev serves, to link a face to its file; null if unknown. */
7
+ root: string | null;
8
+ /** The face whose own node this is, if any. */
9
+ faceOf(e: Element): ObjectCell | null;
10
+ /** The face of a node or of the nearest node around it that is one. */
11
+ faceAt(e: Element): {
12
+ face: ObjectCell;
13
+ el: HTMLElement;
14
+ } | null;
15
+ /** The node of a face on the page, if it is on the page. */
16
+ nodeOf(face: ObjectCell): HTMLElement | null;
17
+ }
18
+ /** How a face is named in the tree, the log and errors: its style, name and text (`field email "Email"`). */
19
+ export declare function faceRef(face: ObjectCell, rt: Runtime): string;
20
+ /** Starts the dev tools on a page served by trebol dev; not in a frame (the documentation's examples). */
21
+ export declare function startDevtools(s: DevSide): void;
22
+ /** Keys typed in the panel are not the app's: its shortcuts and on-key leave them. */
23
+ export declare function inDevtools(target: EventTarget | null): boolean;