@johnoscott/isometric-engine 0.0.0-stage → 0.9.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.
Files changed (310) hide show
  1. package/EDITOR-GUIDE.md +317 -0
  2. package/LICENSE +21 -0
  3. package/LICENSES/ajv.txt +22 -0
  4. package/LICENSES/lucide-static.txt +43 -0
  5. package/LICENSES/yaml.txt +13 -0
  6. package/README.md +62 -2
  7. package/assets/app.css +265 -0
  8. package/assets/default-theme.yaml +99 -0
  9. package/assets/icons.svg +1 -0
  10. package/assets/marks.css +35 -0
  11. package/assets/skin.css +181 -0
  12. package/iso-editor.d.ts +4 -0
  13. package/iso-editor.js +550 -0
  14. package/iso-render.d.ts +3 -0
  15. package/iso-render.js +388 -0
  16. package/iso-systems.d.ts +4 -0
  17. package/iso-systems.js +389 -0
  18. package/js/iso-core/compile-schema.js +22 -0
  19. package/js/iso-core/depth.js +55 -0
  20. package/js/iso-core/errors.js +65 -0
  21. package/js/iso-core/glyphs.js +100 -0
  22. package/js/iso-core/index.js +55 -0
  23. package/js/iso-core/kernel.js +158 -0
  24. package/js/iso-core/metrics.json +1 -0
  25. package/js/iso-core/package.json +6 -0
  26. package/js/iso-core/parse.js +79 -0
  27. package/js/iso-core/schema-errors.js +170 -0
  28. package/js/iso-core/shims/crypto.js +125 -0
  29. package/js/iso-core/shims/path.js +49 -0
  30. package/js/iso-core/svg-dom.js +144 -0
  31. package/js/iso-core/theme.js +48 -0
  32. package/js/iso-core/vdom.js +48 -0
  33. package/js/iso-editor/adapter.js +0 -0
  34. package/js/iso-editor/clipboard.js +152 -0
  35. package/js/iso-editor/commands.js +173 -0
  36. package/js/iso-editor/complete.js +55 -0
  37. package/js/iso-editor/doc.js +182 -0
  38. package/js/iso-editor/index.js +105 -0
  39. package/js/iso-editor/model.js +210 -0
  40. package/js/iso-editor/outline.js +111 -0
  41. package/js/iso-editor/package.json +6 -0
  42. package/js/iso-editor/path.js +19 -0
  43. package/js/iso-editor/providers.js +96 -0
  44. package/js/iso-editor/schema-nav.js +117 -0
  45. package/js/iso-editor/splice.js +441 -0
  46. package/js/iso-editor/storage-keys.js +6 -0
  47. package/js/iso-editor/ui/actions.js +116 -0
  48. package/js/iso-editor/ui/canvas-layer.js +0 -0
  49. package/js/iso-editor/ui/canvas.js +1205 -0
  50. package/js/iso-editor/ui/clip.js +133 -0
  51. package/js/iso-editor/ui/dialog.js +26 -0
  52. package/js/iso-editor/ui/flat-canvas.js +54 -0
  53. package/js/iso-editor/ui/icons.js +15 -0
  54. package/js/iso-editor/ui/keys.js +26 -0
  55. package/js/iso-editor/ui/later.js +28 -0
  56. package/js/iso-editor/ui/layer.js +11 -0
  57. package/js/iso-editor/ui/menu.js +105 -0
  58. package/js/iso-editor/ui/monaco-entry.js +2 -0
  59. package/js/iso-editor/ui/mount-kit.js +0 -0
  60. package/js/iso-editor/ui/mount.js +767 -0
  61. package/js/iso-editor/ui/pane.js +0 -0
  62. package/js/iso-editor/ui/part.js +0 -0
  63. package/js/iso-editor/ui/plain-icons.js +34 -0
  64. package/js/iso-editor/ui/props.js +314 -0
  65. package/js/iso-editor/ui/scope-css.js +81 -0
  66. package/js/iso-editor/ui/setup.js +145 -0
  67. package/js/iso-editor/ui/text.js +323 -0
  68. package/js/iso-editor/ui/tree.js +728 -0
  69. package/js/iso-editor/validate.js +33 -0
  70. package/js/iso-editor/window/protocol.js +8 -0
  71. package/js/iso-objects/assemble.js +43 -0
  72. package/js/iso-objects/assets.js +88 -0
  73. package/js/iso-objects/board.js +162 -0
  74. package/js/iso-objects/compile.js +60 -0
  75. package/js/iso-objects/css.js +154 -0
  76. package/js/iso-objects/flat.js +696 -0
  77. package/js/iso-objects/focus.js +16 -0
  78. package/js/iso-objects/geometry.js +76 -0
  79. package/js/iso-objects/index.js +93 -0
  80. package/js/iso-objects/kinds.js +12 -0
  81. package/js/iso-objects/labels.js +325 -0
  82. package/js/iso-objects/package.json +6 -0
  83. package/js/iso-objects/place.js +347 -0
  84. package/js/iso-objects/route.js +461 -0
  85. package/js/iso-objects/scene.js +350 -0
  86. package/js/iso-objects/steps.js +246 -0
  87. package/js/iso-objects/types.js +0 -0
  88. package/js/iso-systems/catalog.js +42 -0
  89. package/js/iso-systems/compile.js +34 -0
  90. package/js/iso-systems/css.js +8 -0
  91. package/js/iso-systems/index.js +16 -0
  92. package/js/iso-systems/nodes.js +124 -0
  93. package/js/iso-systems/package.json +6 -0
  94. package/js/iso-systems/schema.json +311 -0
  95. package/js/iso-systems/validate.js +35 -0
  96. package/js/iso-viewer/bundle.js +20 -0
  97. package/js/iso-viewer/card-motion.js +228 -0
  98. package/js/iso-viewer/dom.js +14 -0
  99. package/js/iso-viewer/dual-view.js +212 -0
  100. package/js/iso-viewer/flat-view.js +124 -0
  101. package/js/iso-viewer/history.js +990 -0
  102. package/js/iso-viewer/index.js +98 -0
  103. package/js/iso-viewer/morph.js +192 -0
  104. package/js/iso-viewer/overlay.js +199 -0
  105. package/js/iso-viewer/package.json +6 -0
  106. package/js/iso-viewer/page.js +138 -0
  107. package/js/iso-viewer/player.js +409 -0
  108. package/js/iso-viewer/still.js +81 -0
  109. package/js/iso-viewer/timeline-contract.js +14 -0
  110. package/js/iso-viewer/timeline-engine.js +475 -0
  111. package/js/iso-viewer/timeline-export.js +36 -0
  112. package/js/iso-viewer/timeline-scale.js +116 -0
  113. package/js/iso-viewer/timeline-scope.js +58 -0
  114. package/js/iso-viewer/timeline-search.js +216 -0
  115. package/js/iso-viewer/timeline-time.js +55 -0
  116. package/js/iso-viewer/view-css.js +68 -0
  117. package/js/iso-viewer/viewport.js +177 -0
  118. package/package.json +502 -4
  119. package/src/iso-core/compile-schema.ts +23 -0
  120. package/src/iso-core/depth.ts +56 -0
  121. package/src/iso-core/errors.ts +73 -0
  122. package/src/iso-core/glyphs.ts +108 -0
  123. package/src/iso-core/index.ts +27 -0
  124. package/src/iso-core/kernel.ts +163 -0
  125. package/src/iso-core/metrics.json +1 -0
  126. package/src/iso-core/package.json +6 -0
  127. package/src/iso-core/parse.ts +91 -0
  128. package/src/iso-core/schema-errors.ts +163 -0
  129. package/src/iso-core/shims/crypto.ts +37 -0
  130. package/src/iso-core/shims/path.ts +24 -0
  131. package/src/iso-core/svg-dom.ts +103 -0
  132. package/src/iso-core/theme.ts +64 -0
  133. package/src/iso-core/vdom.ts +41 -0
  134. package/src/iso-editor/adapter.ts +128 -0
  135. package/src/iso-editor/clipboard.ts +163 -0
  136. package/src/iso-editor/commands.ts +191 -0
  137. package/src/iso-editor/complete.ts +73 -0
  138. package/src/iso-editor/doc.ts +207 -0
  139. package/src/iso-editor/index.ts +67 -0
  140. package/src/iso-editor/model.ts +234 -0
  141. package/src/iso-editor/outline.ts +126 -0
  142. package/src/iso-editor/package.json +6 -0
  143. package/src/iso-editor/path.ts +18 -0
  144. package/src/iso-editor/providers.ts +113 -0
  145. package/src/iso-editor/schema-nav.ts +129 -0
  146. package/src/iso-editor/splice.ts +472 -0
  147. package/src/iso-editor/storage-keys.ts +6 -0
  148. package/src/iso-editor/ui/actions.ts +119 -0
  149. package/src/iso-editor/ui/app.css +230 -0
  150. package/src/iso-editor/ui/canvas-layer.ts +56 -0
  151. package/src/iso-editor/ui/canvas.ts +1071 -0
  152. package/src/iso-editor/ui/clip.ts +97 -0
  153. package/src/iso-editor/ui/dialog.ts +25 -0
  154. package/src/iso-editor/ui/flat-canvas.ts +51 -0
  155. package/src/iso-editor/ui/icons.ts +21 -0
  156. package/src/iso-editor/ui/keys.ts +30 -0
  157. package/src/iso-editor/ui/later.ts +22 -0
  158. package/src/iso-editor/ui/layer.ts +7 -0
  159. package/src/iso-editor/ui/marks.css +35 -0
  160. package/src/iso-editor/ui/menu.ts +67 -0
  161. package/src/iso-editor/ui/monaco-entry.ts +6 -0
  162. package/src/iso-editor/ui/mount-kit.ts +35 -0
  163. package/src/iso-editor/ui/mount.ts +684 -0
  164. package/src/iso-editor/ui/pane.ts +45 -0
  165. package/src/iso-editor/ui/part.ts +45 -0
  166. package/src/iso-editor/ui/plain-icons.ts +83 -0
  167. package/src/iso-editor/ui/props.ts +347 -0
  168. package/src/iso-editor/ui/scope-css.ts +65 -0
  169. package/src/iso-editor/ui/setup.ts +144 -0
  170. package/src/iso-editor/ui/skin.css +181 -0
  171. package/src/iso-editor/ui/text.ts +262 -0
  172. package/src/iso-editor/ui/tree.ts +657 -0
  173. package/src/iso-editor/validate.ts +62 -0
  174. package/src/iso-editor/window/protocol.ts +33 -0
  175. package/src/iso-objects/assemble.ts +57 -0
  176. package/src/iso-objects/assets.ts +122 -0
  177. package/src/iso-objects/board.ts +169 -0
  178. package/src/iso-objects/compile.ts +76 -0
  179. package/src/iso-objects/css.ts +163 -0
  180. package/src/iso-objects/flat.ts +653 -0
  181. package/src/iso-objects/focus.ts +14 -0
  182. package/src/iso-objects/geometry.ts +86 -0
  183. package/src/iso-objects/index.ts +33 -0
  184. package/src/iso-objects/kinds.ts +56 -0
  185. package/src/iso-objects/labels.ts +310 -0
  186. package/src/iso-objects/package.json +6 -0
  187. package/src/iso-objects/place.ts +318 -0
  188. package/src/iso-objects/route.ts +444 -0
  189. package/src/iso-objects/scene.ts +376 -0
  190. package/src/iso-objects/steps.ts +234 -0
  191. package/src/iso-objects/types.ts +68 -0
  192. package/src/iso-systems/catalog.ts +31 -0
  193. package/src/iso-systems/compile.ts +39 -0
  194. package/src/iso-systems/css.ts +9 -0
  195. package/src/iso-systems/index.ts +12 -0
  196. package/src/iso-systems/nodes.ts +126 -0
  197. package/src/iso-systems/package.json +6 -0
  198. package/src/iso-systems/schema.json +311 -0
  199. package/src/iso-systems/validate.ts +34 -0
  200. package/src/iso-viewer/bundle.ts +15 -0
  201. package/src/iso-viewer/card-motion.ts +237 -0
  202. package/src/iso-viewer/dom.ts +13 -0
  203. package/src/iso-viewer/dual-view.ts +212 -0
  204. package/src/iso-viewer/flat-view.ts +127 -0
  205. package/src/iso-viewer/history.ts +781 -0
  206. package/src/iso-viewer/index.ts +40 -0
  207. package/src/iso-viewer/morph.ts +191 -0
  208. package/src/iso-viewer/overlay.ts +212 -0
  209. package/src/iso-viewer/package.json +6 -0
  210. package/src/iso-viewer/page.ts +150 -0
  211. package/src/iso-viewer/player.ts +321 -0
  212. package/src/iso-viewer/still.ts +74 -0
  213. package/src/iso-viewer/timeline-contract.ts +342 -0
  214. package/src/iso-viewer/timeline-engine.ts +420 -0
  215. package/src/iso-viewer/timeline-export.ts +31 -0
  216. package/src/iso-viewer/timeline-scale.ts +129 -0
  217. package/src/iso-viewer/timeline-scope.ts +56 -0
  218. package/src/iso-viewer/timeline-search.ts +198 -0
  219. package/src/iso-viewer/timeline-time.ts +54 -0
  220. package/src/iso-viewer/view-css.ts +59 -0
  221. package/src/iso-viewer/viewport.ts +142 -0
  222. package/types/iso-core/compile-schema.d.ts +11 -0
  223. package/types/iso-core/depth.d.ts +6 -0
  224. package/types/iso-core/errors.d.ts +24 -0
  225. package/types/iso-core/glyphs.d.ts +19 -0
  226. package/types/iso-core/index.d.ts +17 -0
  227. package/types/iso-core/kernel.d.ts +130 -0
  228. package/types/iso-core/metrics.json +1 -0
  229. package/types/iso-core/parse.d.ts +18 -0
  230. package/types/iso-core/schema-errors.d.ts +14 -0
  231. package/types/iso-core/shims/crypto.d.ts +9 -0
  232. package/types/iso-core/svg-dom.d.ts +15 -0
  233. package/types/iso-core/theme.d.ts +38 -0
  234. package/types/iso-core/vdom.d.ts +26 -0
  235. package/types/iso-editor/adapter.d.ts +145 -0
  236. package/types/iso-editor/clipboard.d.ts +23 -0
  237. package/types/iso-editor/commands.d.ts +32 -0
  238. package/types/iso-editor/complete.d.ts +25 -0
  239. package/types/iso-editor/doc.d.ts +50 -0
  240. package/types/iso-editor/index.d.ts +57 -0
  241. package/types/iso-editor/model.d.ts +96 -0
  242. package/types/iso-editor/outline.d.ts +28 -0
  243. package/types/iso-editor/path.d.ts +7 -0
  244. package/types/iso-editor/providers.d.ts +43 -0
  245. package/types/iso-editor/schema-nav.d.ts +34 -0
  246. package/types/iso-editor/splice.d.ts +53 -0
  247. package/types/iso-editor/storage-keys.d.ts +5 -0
  248. package/types/iso-editor/ui/actions.d.ts +23 -0
  249. package/types/iso-editor/ui/canvas-layer.d.ts +65 -0
  250. package/types/iso-editor/ui/canvas.d.ts +279 -0
  251. package/types/iso-editor/ui/clip.d.ts +14 -0
  252. package/types/iso-editor/ui/dialog.d.ts +7 -0
  253. package/types/iso-editor/ui/flat-canvas.d.ts +2 -0
  254. package/types/iso-editor/ui/icons.d.ts +5 -0
  255. package/types/iso-editor/ui/keys.d.ts +7 -0
  256. package/types/iso-editor/ui/later.d.ts +12 -0
  257. package/types/iso-editor/ui/layer.d.ts +2 -0
  258. package/types/iso-editor/ui/menu.d.ts +21 -0
  259. package/types/iso-editor/ui/mount-kit.d.ts +31 -0
  260. package/types/iso-editor/ui/mount.d.ts +146 -0
  261. package/types/iso-editor/ui/pane.d.ts +60 -0
  262. package/types/iso-editor/ui/part.d.ts +40 -0
  263. package/types/iso-editor/ui/plain-icons.d.ts +10 -0
  264. package/types/iso-editor/ui/props.d.ts +57 -0
  265. package/types/iso-editor/ui/scope-css.d.ts +5 -0
  266. package/types/iso-editor/ui/setup.d.ts +40 -0
  267. package/types/iso-editor/ui/text.d.ts +19 -0
  268. package/types/iso-editor/ui/tree.d.ts +100 -0
  269. package/types/iso-editor/validate.d.ts +36 -0
  270. package/types/iso-editor/window/protocol.d.ts +60 -0
  271. package/types/iso-objects/assemble.d.ts +35 -0
  272. package/types/iso-objects/assets.d.ts +49 -0
  273. package/types/iso-objects/board.d.ts +36 -0
  274. package/types/iso-objects/compile.d.ts +35 -0
  275. package/types/iso-objects/css.d.ts +16 -0
  276. package/types/iso-objects/flat.d.ts +130 -0
  277. package/types/iso-objects/focus.d.ts +1 -0
  278. package/types/iso-objects/geometry.d.ts +59 -0
  279. package/types/iso-objects/index.d.ts +26 -0
  280. package/types/iso-objects/kinds.d.ts +53 -0
  281. package/types/iso-objects/labels.d.ts +92 -0
  282. package/types/iso-objects/place.d.ts +25 -0
  283. package/types/iso-objects/route.d.ts +67 -0
  284. package/types/iso-objects/scene.d.ts +63 -0
  285. package/types/iso-objects/steps.d.ts +90 -0
  286. package/types/iso-objects/types.d.ts +140 -0
  287. package/types/iso-systems/catalog.d.ts +4 -0
  288. package/types/iso-systems/compile.d.ts +6 -0
  289. package/types/iso-systems/css.d.ts +3 -0
  290. package/types/iso-systems/index.d.ts +5 -0
  291. package/types/iso-systems/nodes.d.ts +3 -0
  292. package/types/iso-viewer/card-motion.d.ts +56 -0
  293. package/types/iso-viewer/dom.d.ts +1 -0
  294. package/types/iso-viewer/dual-view.d.ts +44 -0
  295. package/types/iso-viewer/flat-view.d.ts +25 -0
  296. package/types/iso-viewer/history.d.ts +91 -0
  297. package/types/iso-viewer/index.d.ts +31 -0
  298. package/types/iso-viewer/morph.d.ts +28 -0
  299. package/types/iso-viewer/overlay.d.ts +135 -0
  300. package/types/iso-viewer/page.d.ts +13 -0
  301. package/types/iso-viewer/still.d.ts +26 -0
  302. package/types/iso-viewer/timeline-contract.d.ts +345 -0
  303. package/types/iso-viewer/timeline-engine.d.ts +20 -0
  304. package/types/iso-viewer/timeline-export.d.ts +5 -0
  305. package/types/iso-viewer/timeline-scale.d.ts +44 -0
  306. package/types/iso-viewer/timeline-scope.d.ts +33 -0
  307. package/types/iso-viewer/timeline-search.d.ts +52 -0
  308. package/types/iso-viewer/timeline-time.d.ts +8 -0
  309. package/types/iso-viewer/view-css.d.ts +7 -0
  310. package/types/iso-viewer/viewport.d.ts +50 -0
@@ -0,0 +1,135 @@
1
+ export type Box = {
2
+ x: number;
3
+ y: number;
4
+ w: number;
5
+ h: number;
6
+ };
7
+ export type Outline = {
8
+ kind: 'poly';
9
+ id: string;
10
+ points: [number, number][];
11
+ } | {
12
+ kind: 'route';
13
+ d: string;
14
+ };
15
+ /** a box in grid cells */
16
+ export type Box3 = {
17
+ x0: number;
18
+ x1: number;
19
+ y0: number;
20
+ y1: number;
21
+ z0: number;
22
+ z1: number;
23
+ };
24
+ /** a card's model: its middle, the tail's tip (z), the card's box and its stack's boxes */
25
+ export interface CardGeo {
26
+ cx: number;
27
+ cy: number;
28
+ tipZ: number;
29
+ card: Box3;
30
+ panes: Box3[];
31
+ }
32
+ /** a badge: a character, or an icon (by name), in a small circle; cls: its tone */
33
+ export type Glyph = {
34
+ g: string;
35
+ cls: string;
36
+ } | {
37
+ icon: string;
38
+ cls: string;
39
+ };
40
+ /** what is drawn over one object, in this order: its outline, its badge (or, with none, a hit area for its title),
41
+ * badges beside it, a dot at its bottom left and a tag at its bottom right */
42
+ export interface Mark {
43
+ /** what it is drawn over (the host's boxOf and outlinesFor know it) */
44
+ at: string;
45
+ title: string;
46
+ /** the class of its outline: an outline is drawn when it has one */
47
+ outline?: string;
48
+ badge?: Glyph;
49
+ /** no badge: a transparent rect over it, holding its title */
50
+ hit?: boolean;
51
+ /** badges beside the first, each a badge's width further right */
52
+ beside?: {
53
+ glyph: Glyph;
54
+ title: string;
55
+ }[];
56
+ dot?: {
57
+ glyph: Glyph;
58
+ title: string;
59
+ };
60
+ tag?: {
61
+ cls: string;
62
+ text: string;
63
+ };
64
+ }
65
+ /** a thing that isn't in the drawing, drawn as a ghost where the domain puts it */
66
+ export interface Ghost {
67
+ rect: {
68
+ x: number;
69
+ y: number;
70
+ w: number;
71
+ hgt: number;
72
+ k: number;
73
+ };
74
+ /** classes beside the ghost's own */
75
+ cls: string;
76
+ /** attributes on its group (data-*) */
77
+ data: [string, string][];
78
+ line1: string;
79
+ line2: string;
80
+ title: string;
81
+ }
82
+ /** a card standing over what it is about */
83
+ export interface Card {
84
+ /** the box (grid cells) it stands over */
85
+ over: {
86
+ x0: number;
87
+ y0: number;
88
+ x1: number;
89
+ y1: number;
90
+ z1: number;
91
+ };
92
+ /** classes beside the card's own */
93
+ cls: string;
94
+ /** attributes on its group (data-*) */
95
+ data: [string, string][];
96
+ /** the big mark on its face, who it is from, how old it is, and (shown near) one line of its text */
97
+ mark: string;
98
+ who: string;
99
+ age: string;
100
+ line?: string;
101
+ /** how many it stands for: more than one, a stack behind it (up to three) and the count on it */
102
+ count: number;
103
+ title: string;
104
+ }
105
+ export interface OverlayCtx {
106
+ /** pixels per unit of the drawing (badges keep their size on screen) */
107
+ k(): number;
108
+ /** an object's box on screen (the view measures its elements; a still render, its layout) */
109
+ boxOf(at: string): Box | undefined;
110
+ outlinesFor(at: string): Outline[];
111
+ /** an icon's reference (the view's sprite, or the still render's own symbols) */
112
+ iconHref(name: string): string;
113
+ /** a card drawn, with its geometry in grid cells (a view turns it in 3D) */
114
+ onCard?(card: Element, geo: CardGeo): void;
115
+ }
116
+ /** the card's size in grid cells (large: the first thing the eye finds), its height above what it stands over, the
117
+ * stack's fan (up and right per card) and the gap between its cards (back to front) */
118
+ export declare const CARD: {
119
+ half: number;
120
+ h: number;
121
+ t: number;
122
+ above: number;
123
+ lift: number;
124
+ fan: number;
125
+ gap: number;
126
+ };
127
+ export declare const P3: (x: number, y: number, z: number) => [number, number];
128
+ export declare const pts: (ps: [number, number][]) => string;
129
+ /** The painters. cards: the class prefix the domain's cards are drawn and styled with (PREFIX-card, PREFIX-face…). */
130
+ export declare function overlayPaint(ctx: OverlayCtx, cards: string): {
131
+ paintMarks: (d: Document, put: (n: Element) => void, marks: Mark[]) => void;
132
+ paintGhosts: (d: Document, put: (n: Element) => void, ghosts: Ghost[]) => void;
133
+ paintCards: (d: Document, put: (n: Element) => void, list: Card[]) => void;
134
+ };
135
+ export type OverlayPaint = ReturnType<typeof overlayPaint>;
@@ -0,0 +1,13 @@
1
+ import type { Compiled } from '../iso-objects/compile.js';
2
+ import type { CompiledScene } from '../iso-objects/compile.js';
3
+ /** A small Markdown subset for captions: `code`, **bold**, *em*, [text](url), paragraphs. */
4
+ export declare function md(s: string | undefined): string;
5
+ export interface PageOpts {
6
+ runtime?: string;
7
+ extraHead?: string;
8
+ extraBody?: string;
9
+ }
10
+ /** The data the player runs on, for every scene with steps. */
11
+ export declare function stepData(c: Compiled): string;
12
+ export declare function legend(c: Compiled, s: CompiledScene): string;
13
+ export declare function renderPage(c: Compiled, opts?: PageOpts): string;
@@ -0,0 +1,26 @@
1
+ import type { SvgNode } from '../iso-core/svg-dom.js';
2
+ import type { VNode } from '../iso-core/vdom.js';
3
+ import type { Box } from './overlay.js';
4
+ export type { Box };
5
+ export declare const n: (v: number) => string;
6
+ export declare const node: (name: string, attrs?: Record<string, string | number>, ...children: (VNode | string)[]) => VNode;
7
+ /** "var(--x)" → "var(--iso-x)" (the drawing's tokens, as the stylesheet names them); "#id" → the prefixed id */
8
+ export declare function rewrite(t: SvgNode | VNode | string, pfx: string): VNode | string;
9
+ /** keep a node? (for thumbs: no text, no titles, no small things, no badges) */
10
+ export declare function prune(t: VNode | string, drop: (n: VNode) => boolean): VNode | string | undefined;
11
+ export declare const cls: (t: VNode) => string[];
12
+ export declare const attr: (t: VNode, k: string) => string | undefined;
13
+ /** every point a tree draws (polygon points, rects, circles), for the overlay's extent */
14
+ export declare function extent(ts: (VNode | string)[]): Box | undefined;
15
+ export declare const unite: (a: Box, b?: Box) => Box;
16
+ /** The scale that fits the drawing and its overlay. The overlay's badges keep their size in px, so it is drawn at a
17
+ * scale, measured, and drawn again at the scale that holds both (twice: the scale it ends at is the one it is drawn at). */
18
+ export declare function fitWithOverlay(drawn: Box, size: {
19
+ width: number;
20
+ height: number;
21
+ pad: number;
22
+ }, paint: (k: number) => (VNode | string)[]): {
23
+ k: number;
24
+ box: Box;
25
+ live: (string | VNode)[];
26
+ };
@@ -0,0 +1,345 @@
1
+ export declare const TIMELINE_VERSION = 1;
2
+ /** what a domain fills in */
3
+ export interface TimelineTypes {
4
+ /** its scope kinds */
5
+ kind: string;
6
+ /** what a recorded frame holds */
7
+ state: unknown;
8
+ /** the boolean flags a scope's name (and its row) may carry */
9
+ flag: string;
10
+ /** the links an event may carry: each an id, never a text */
11
+ links: object;
12
+ }
13
+ /** any domain's (the generic code's own view) */
14
+ export interface AnyTimeline extends TimelineTypes {
15
+ kind: string;
16
+ state: unknown;
17
+ flag: never;
18
+ links: Record<string, string | undefined>;
19
+ }
20
+ /** a scope path: "kind:name" segments, outermost first, joined by "/"; the fleet is "" */
21
+ export type Scope = string;
22
+ /** a segment's name: no "/", ":", "%" or whitespace, except %-escaped (%2F, %3A, %25, %20) */
23
+ export declare const SEGMENT_NAME = "(?:[^/:%\\s]|%[0-9A-F]{2})+";
24
+ export declare const SEVERITIES: readonly ['debug', 'info', 'notice', 'warning', 'error'];
25
+ export type Severity = typeof SEVERITIES[number];
26
+ /** an attribute's value: a scalar, never an object; a string is one short line */
27
+ export type AttrValue = string | number | boolean | null;
28
+ /** One thing that happened, at t (or over [t, t + dur) for a span). */
29
+ export interface TimelineEvent<T extends TimelineTypes = AnyTimeline> {
30
+ /** unique within its source and stable: the same record, the same id (a later batch with this id replaces it) */
31
+ id: string;
32
+ /** when, in ms since 1970-01-01T00:00:00Z */
33
+ t: number;
34
+ /** a span's length in ms (so far, while open); absent for a mark */
35
+ dur?: number;
36
+ /** an ongoing span: it lasts to now (its dur, if any, is so far); a later batch gives its end */
37
+ open?: true;
38
+ scope: Scope;
39
+ /** one of the catalogue's sources */
40
+ source: string;
41
+ /** one of its source's kinds */
42
+ kind: string;
43
+ severity: Severity;
44
+ /** one line a person reads (at most 200 characters): never a message's text, a prompt, a secret, a real hostname, a
45
+ * folder, or a sensitive attr's value */
46
+ summary: string;
47
+ /** a flat map of scalars; the source's catalogue entry names the keys it may carry and which are sensitive */
48
+ attrs: Record<string, AttrValue>;
49
+ links: T['links'];
50
+ }
51
+ export declare const BINS: readonly ['1m', '1h', '1d'];
52
+ export type Bin = typeof BINS[number];
53
+ /** a bin's nominal width (a local day may be 23 or 25 hours long) */
54
+ export declare const BIN_MS: Record<Bin, number>;
55
+ /** one sample of a series, at t (a later batch with the same series, scope and t replaces it) */
56
+ export interface MetricPoint {
57
+ series: string;
58
+ scope: Scope;
59
+ t: number;
60
+ value: number;
61
+ }
62
+ /** a series over one bin [t, t + bin): what a coarser bin is made of (min of mins, max of maxes, sums of sums and counts) */
63
+ export interface MetricRollup {
64
+ series: string;
65
+ scope: Scope;
66
+ t: number;
67
+ bin: Bin;
68
+ min: number;
69
+ max: number;
70
+ sum: number;
71
+ count: number;
72
+ }
73
+ /** events over one bin, on one row: how the zoomed-out view draws count bars and heat strips */
74
+ export interface EventBin {
75
+ /** the row's scope */
76
+ scope: Scope;
77
+ t: number;
78
+ bin: Bin;
79
+ count: number;
80
+ /** count by severity (absent keys are 0) */
81
+ severity: Partial<Record<Severity, number>>;
82
+ /** count by kind, for the kinds present (a host may give only the top few, and say so with kindsTruncated: then the
83
+ * kind counts of a coarser bin can't be made from it) */
84
+ kinds?: Record<string, number>;
85
+ kindsTruncated?: boolean;
86
+ }
87
+ /** one test of an event */
88
+ export type Match<T extends TimelineTypes = AnyTimeline> = {
89
+ field: 'text';
90
+ value: string;
91
+ } | {
92
+ field: 'kind' | 'source';
93
+ value: string;
94
+ prefix?: true;
95
+ } | {
96
+ field: 'severity';
97
+ op: 'eq' | 'ge' | 'gt' | 'le' | 'lt';
98
+ value: Severity;
99
+ } | {
100
+ field: 'scope';
101
+ value: Scope;
102
+ from: 'top' | 'segments';
103
+ } | {
104
+ field: 'link';
105
+ link: keyof T['links'];
106
+ value: string;
107
+ } | {
108
+ field: 'attr';
109
+ key: string;
110
+ value: string;
111
+ };
112
+ /** a term: any of its matches (the same field twice ORs), or none of them when not */
113
+ export interface AstTerm<T extends TimelineTypes = AnyTimeline> {
114
+ not?: true;
115
+ any: Match<T>[];
116
+ }
117
+ /** every term (different fields AND); since: and before: aren't here: they narrow the query's from and to */
118
+ export interface SearchAst<T extends TimelineTypes = AnyTimeline> {
119
+ all: AstTerm<T>[];
120
+ }
121
+ /** days kept; null: kept until the user deletes it */
122
+ export type Days = number | null;
123
+ export interface Retention {
124
+ /** single events (and raw metric points) */
125
+ events: Days;
126
+ /** rollups, by bin */
127
+ rollups: Record<Bin, Days>;
128
+ }
129
+ export interface SeriesInfo<T extends TimelineTypes = AnyTimeline> {
130
+ name: string;
131
+ /** e.g. "count", "bytes", "ms", "%" */
132
+ unit: string;
133
+ /** counter: a count per sample, shown as sums only (its mean is meaningless); gauge: a level, shown as its min/max
134
+ * band and mean */
135
+ type: 'counter' | 'gauge';
136
+ /** the scope kind a series is recorded at */
137
+ at: T['kind'];
138
+ title: string;
139
+ }
140
+ export interface KindInfo {
141
+ name: string;
142
+ title: string;
143
+ /** a span (it has a dur, or is open) */
144
+ span?: boolean;
145
+ /** named, not yet recorded */
146
+ notYet?: boolean;
147
+ }
148
+ export interface SourceInfo<T extends TimelineTypes = AnyTimeline> {
149
+ name: string;
150
+ title: string;
151
+ /** kept: the host records it today; not-yet: named in the contract, not yet recorded (the UI lists it, greyed) */
152
+ status: 'kept' | 'not-yet';
153
+ /** the scope kinds its events and series are recorded at */
154
+ at: T['kind'][];
155
+ kinds: KindInfo[];
156
+ /** kinds taken verbatim from the host's own names: any kind matching this (the listed kinds are the known ones) */
157
+ kindPattern?: string;
158
+ series: SeriesInfo<T>[];
159
+ /** the attrs its events may carry */
160
+ attrs: string[];
161
+ /** attrs that can name something sensitive (a remote host, a folder, free text): hidden until asked for, never in free
162
+ * text search, a summary or a rollup */
163
+ sensitive?: string[];
164
+ /** attrs naming a person: the viewer's own name is written "you" */
165
+ people?: string[];
166
+ /** what the contract suggests; a host may choose otherwise */
167
+ defaultRetention: Retention;
168
+ }
169
+ /** The effective retention, per source, as the user set it: the UI says "kept 30 days" and greys out what's gone. */
170
+ export interface EffectiveRetention extends Retention {
171
+ source: string;
172
+ /** user: set by the user; default: the host's default */
173
+ setBy: 'user' | 'default';
174
+ /** the earliest t still kept, for single events and for each bin (absent: nothing kept yet) */
175
+ keptFrom: {
176
+ events?: number;
177
+ rollups: Partial<Record<Bin, number>>;
178
+ };
179
+ }
180
+ /** A scope's display: its label, the domain's flags, and the scopes it was known as before a rename (their history
181
+ * shows on its row). */
182
+ export type ScopeName<T extends TimelineTypes = AnyTimeline> = {
183
+ scope: Scope;
184
+ label: string;
185
+ aliases?: Scope[];
186
+ } & {
187
+ [F in T['flag']]?: boolean;
188
+ };
189
+ export interface Catalog<T extends TimelineTypes = AnyTimeline> {
190
+ timeline: 1;
191
+ type: 'catalog';
192
+ /** display names, chosen by the host per machine, %-escaped in a scope: never a real hostname */
193
+ hosts: string[];
194
+ sources: SourceInfo<T>[];
195
+ retention: EffectiveRetention[];
196
+ /** labels, flags and renames */
197
+ names?: ScopeName<T>[];
198
+ /** the host's now: the live edge */
199
+ now: number;
200
+ }
201
+ export interface Filters {
202
+ source?: string[];
203
+ kind?: string[];
204
+ severity?: Severity[];
205
+ /** scope prefixes (segment-wise: a prefix matches it and everything under it) */
206
+ scope?: Scope[];
207
+ }
208
+ export interface Query<T extends TimelineTypes = AnyTimeline> {
209
+ timeline: 1;
210
+ type: 'query';
211
+ scope: Scope;
212
+ /** rows: the scopes this many levels below scope (0: one row, the scope itself) */
213
+ depth: number;
214
+ /** [from, to), ms; since: and before: already applied */
215
+ from: number;
216
+ to: number;
217
+ /** binned: bins and rollups; absent: single events and points */
218
+ bin?: Bin;
219
+ /** the owner's time zone (IANA, e.g. "Australia/Sydney"): 1d bins start at its midnight, and 1h bins on its hour
220
+ * where its offset isn't whole hours; absent: UTC */
221
+ tz?: string;
222
+ /** the search, parsed by the component: what a host applies (ANDed with filters) */
223
+ where?: SearchAst<T>;
224
+ /** the search as typed: for display and saved views only; a host never needs to read it */
225
+ q?: string;
226
+ filters?: Filters;
227
+ /** series to return (absent: every series recorded at or under the rows; empty: none) */
228
+ series?: string[];
229
+ /** single events per page (default 2000, at most 10000) */
230
+ limit?: number;
231
+ /** from a result's next: the same query, the next page */
232
+ cursor?: string;
233
+ }
234
+ /** A row the component draws: one scope at the query's depth, with its name's flags. Events at a shallower scope than
235
+ * the rows go on their own scope's row, marked own. */
236
+ export type Row<T extends TimelineTypes = AnyTimeline> = {
237
+ scope: Scope;
238
+ /** the last segment's name, or the catalogue's label */
239
+ label: string;
240
+ kind: T['kind'] | 'fleet';
241
+ /** levels below the query's scope */
242
+ depth: number;
243
+ own?: boolean;
244
+ /** scopes one level below this row (the component offers to drill in when > 0) */
245
+ children: number;
246
+ /** events in the range, after search and filters */
247
+ count: number;
248
+ first?: number;
249
+ last?: number;
250
+ } & {
251
+ [F in T['flag']]?: boolean;
252
+ };
253
+ export interface Result<T extends TimelineTypes = AnyTimeline> {
254
+ timeline: 1;
255
+ type: 'result';
256
+ rows: Row<T>[];
257
+ /** unbinned: single events, by (t, id); spans overlapping the range are included */
258
+ events?: TimelineEvent<T>[];
259
+ /** binned: counts per row and bin, an event counted in the bin of its t */
260
+ bins?: EventBin[];
261
+ /** binned: the spans at least one bin long, so they still draw zoomed out */
262
+ spans?: TimelineEvent<T>[];
263
+ /** points unbinned, rollups binned (attributed to rows: sums and counts add, min of mins, max of maxes) */
264
+ metrics: (MetricPoint | MetricRollup)[];
265
+ /** all matching events in the range (or an estimate, said so) */
266
+ total: number;
267
+ totalEstimated?: boolean;
268
+ retention: EffectiveRetention[];
269
+ /** what of the search couldn't be read, and was searched as text (the component's parse says so; a host may add) */
270
+ warnings?: string[];
271
+ /** more single events: pass as cursor */
272
+ next?: string;
273
+ }
274
+ /** What subscribe() pushes: what's new or changed since the last batch, for a live query (to moves with the host's
275
+ * now). An event with an id already given replaces it (an open span's end, a late field); a point with a series, scope
276
+ * and t already given replaces it (a minute's counters grow after the minute). On the wire, one Batch per SSE event. */
277
+ export interface Batch<T extends TimelineTypes = AnyTimeline> {
278
+ timeline: 1;
279
+ type: 'batch';
280
+ events: TimelineEvent<T>[];
281
+ metrics: (MetricPoint | MetricRollup)[];
282
+ /** rows that appeared */
283
+ rows?: Row<T>[];
284
+ /** the host's now: everything up to here is in */
285
+ now: number;
286
+ retention?: EffectiveRetention[];
287
+ /** resume from here after a dropped connection (the SSE event's id) */
288
+ resume?: string;
289
+ }
290
+ /** A saved view: what the URL holds, with a name (the host stores it). */
291
+ export interface View {
292
+ timeline: 1;
293
+ type: 'view';
294
+ name: string;
295
+ scope: Scope;
296
+ depth: number;
297
+ /** a fixed range, or a quick one (15m, 1h, 1d, 1w, run) ending at now */
298
+ range: {
299
+ from: number;
300
+ to: number;
301
+ } | {
302
+ last: '15m' | '1h' | '1d' | '1w' | 'run';
303
+ };
304
+ q?: string;
305
+ filters?: Filters;
306
+ live?: boolean;
307
+ /** time breaks off (they are on unless this says false) */
308
+ collapseGaps?: boolean;
309
+ /** the rows with nothing in the range shown (they are hidden unless this says true) */
310
+ quietRows?: boolean;
311
+ }
312
+ /** A recorded history in one file: a fixture, or an export. */
313
+ export interface Recording<T extends TimelineTypes = AnyTimeline> {
314
+ timeline: 1;
315
+ type: 'recording';
316
+ catalog: Catalog<T>;
317
+ events: TimelineEvent<T>[];
318
+ metrics: (MetricPoint | MetricRollup)[];
319
+ }
320
+ /** What a host gives the timeline component. A fixture source reads a Recording; a simulation is one more source. */
321
+ export interface TimelineSource<T extends TimelineTypes = AnyTimeline> {
322
+ catalog(): Promise<Catalog<T>>;
323
+ query(q: Query<T>): Promise<Result<T>>;
324
+ /** live: batches for this query as they happen; returns unsubscribe (on the wire: SSE, §8) */
325
+ subscribe?(q: Query<T>, onBatch: (b: Batch<T>) => void): () => void;
326
+ /** the state recorded at t, where one was (a frame): a canvas follows the playhead */
327
+ stateAt?(scope: Scope, t: number): Promise<T['state'] | undefined>;
328
+ }
329
+ /** What the generic code needs to know of a domain's timeline. */
330
+ export interface TimelineCatalog {
331
+ /** its scope kinds, and what each may sit in ('' is the fleet) */
332
+ kinds: readonly string[];
333
+ parents: Readonly<Record<string, readonly string[]>>;
334
+ /** the flags a scope's name may carry, copied to its row; a flagged row is labelled by its first flag, not its kind */
335
+ flags: readonly string[];
336
+ /** the search's link fields (name:value), in the order the language lists them */
337
+ links: readonly string[];
338
+ /** a link the domain matches its own way as well (a link's value also found in an event's scope); undefined: only
339
+ * equal ids match */
340
+ linkMatch?(link: string, value: string, e: TimelineEvent): boolean | undefined;
341
+ /** a scope: search value starting with one of these kinds is anchored at the top (else it is segments anywhere) */
342
+ topKinds: readonly string[];
343
+ }
344
+ /** the pattern a scope path of this catalogue's kinds matches */
345
+ export declare const scopePattern: (cat: Pick<TimelineCatalog, 'kinds'>) => string;
@@ -0,0 +1,20 @@
1
+ import { type MetricPoint, type MetricRollup, type Recording, type Retention, type Scope, type TimelineEvent, type TimelineSource, type TimelineCatalog } from './timeline-contract.js';
2
+ export interface MemorySourceOptions {
3
+ /** the host's now (default: the recording's catalog.now) */
4
+ now?: number;
5
+ /** the state at t, where one was recorded (frames), as the timeline may show it */
6
+ stateAt?(scope: Scope, t: number): Promise<unknown>;
7
+ }
8
+ export interface MemorySource extends TimelineSource {
9
+ /** new or changed records, and the host's now: subscribers get them as a batch (an id, or a series, scope and t,
10
+ * given again replaces the first) */
11
+ append(events: TimelineEvent[], metrics?: (MetricPoint | MetricRollup)[], now?: number): void;
12
+ /** the user's retention for a source (what the host's settings would do) */
13
+ setRetention(source: string, r: Retention): void;
14
+ readonly now: number;
15
+ readonly size: {
16
+ events: number;
17
+ samples: number;
18
+ };
19
+ }
20
+ export declare function memorySource(rec: Recording, cat: TimelineCatalog, o?: MemorySourceOptions): MemorySource;
@@ -0,0 +1,5 @@
1
+ import type { TimelineEvent, TimelineTypes, AnyTimeline } from './timeline-contract.js';
2
+ /** sensitive: "source.attr" names to leave out */
3
+ export declare function toJSON<T extends TimelineTypes = AnyTimeline>(events: TimelineEvent<T>[], sensitive?: Iterable<string>): string;
4
+ /** CSV: the base columns, then attr.* and link.* columns for every key present (spreadsheet formulas defused) */
5
+ export declare function toCSV<T extends TimelineTypes = AnyTimeline>(events: TimelineEvent<T>[], sensitive?: Iterable<string>): string;
@@ -0,0 +1,44 @@
1
+ export interface Gap {
2
+ from: number;
3
+ to: number;
4
+ }
5
+ export interface Cut extends Gap {
6
+ x0: number;
7
+ x1: number;
8
+ weight: number;
9
+ }
10
+ /** The gaps of [t0, t1): activity intervals are [a, b) (a mark is [t, t]); a gap is a stretch between them (or between
11
+ * the range's edges and them) longer than minFrac of the range and than minMs. */
12
+ export declare function findGaps(activity: [number, number][], t0: number, t1: number, o?: {
13
+ minFrac?: number;
14
+ minMs?: number;
15
+ }): Gap[];
16
+ /** "14 h", "2 d 3 h", "45 min" */
17
+ export declare function gapLabel(ms: number): string;
18
+ export interface TimeScale {
19
+ t0: number;
20
+ t1: number;
21
+ width: number;
22
+ cuts: Cut[];
23
+ x(t: number): number;
24
+ /** the time at x; inside a cut, its nearer edge */
25
+ t(x: number): number;
26
+ /** the cut at x, if any */
27
+ cutAt(x: number): Cut | undefined;
28
+ /** visible ms per px outside the cuts */
29
+ msPerPx: number;
30
+ }
31
+ /** weights: how far each gap is expanded (0: a cut; 1: its own width in time), by gapKey */
32
+ export declare const gapKey: (g: Gap) => string;
33
+ export declare function timeScale(t0: number, t1: number, width: number, gaps?: Gap[], o?: {
34
+ cut?: number;
35
+ weights?: Map<string, number>;
36
+ }): TimeScale;
37
+ export interface Tick {
38
+ t: number;
39
+ x: number;
40
+ label: string;
41
+ major: boolean;
42
+ }
43
+ /** round times at least minPx apart, in the owner's zone (local hours and days), skipping the cuts */
44
+ export declare function ticks(s: TimeScale, tz?: string, minPx?: number): Tick[];
@@ -0,0 +1,33 @@
1
+ import { type Scope, type TimelineCatalog } from './timeline-contract.js';
2
+ export interface Segment {
3
+ kind: string;
4
+ name: string;
5
+ }
6
+ /** what a path of this catalogue may say: isScope, parseScope (its segments, names unescaped; throws on a path that
7
+ * isn't one), and wellNested (each segment may sit in its parent's kind) */
8
+ export declare function scopeRules(cat: Pick<TimelineCatalog, 'kinds' | 'parents'>): {
9
+ isScope: (s: string) => boolean;
10
+ parseScope: (s: Scope) => Segment[];
11
+ wellNested: (s: Scope) => boolean;
12
+ };
13
+ /** a name, escaped for a segment */
14
+ export declare const escapeName: (n: string) => string;
15
+ export declare const formatScope: (segs: Segment[]) => Scope;
16
+ export declare const join: (parent: Scope, kind: string, name: string) => Scope;
17
+ /** levels below the fleet */
18
+ export declare const levelOf: (s: Scope) => number;
19
+ /** the scope's prefix at a level (itself when it is shallower) */
20
+ export declare function prefixAt(s: Scope, level: number): Scope;
21
+ export declare const parentOf: (s: Scope) => Scope;
22
+ /** segment by segment: a prefix matches itself and everything under it */
23
+ export declare const within: (s: Scope, prefix: Scope) => boolean;
24
+ /** any segment equal to seg ("kind:name") */
25
+ export declare const hasSegment: (s: Scope, seg: string) => boolean;
26
+ export declare const kindOf: (s: Scope) => string;
27
+ export declare const nameOf: (s: Scope) => string;
28
+ /** breadcrumbs: the fleet, then each prefix */
29
+ export declare function crumbs(s: Scope): {
30
+ scope: Scope;
31
+ label: string;
32
+ kind: string;
33
+ }[];
@@ -0,0 +1,52 @@
1
+ import { type Severity, type TimelineEvent, type SearchAst, type TimelineCatalog } from './timeline-contract.js';
2
+ /** the fields every domain's search has; its link fields follow */
3
+ export declare const BASE_FIELDS: readonly ['kind', 'source', 'severity', 'scope', 'since', 'before'];
4
+ export type Field = string;
5
+ export type SearchDialect = Pick<TimelineCatalog, 'links' | 'linkMatch' | 'topKinds'>;
6
+ export interface Term {
7
+ neg: boolean;
8
+ /** absent: free text */
9
+ field?: Field;
10
+ /** severity only */
11
+ op?: '=' | '>=' | '>' | '<=' | '<';
12
+ value: string;
13
+ /** since and before: the time read (ms) */
14
+ time?: number;
15
+ }
16
+ export interface ParsedSearch {
17
+ terms: Term[];
18
+ warnings: string[];
19
+ }
20
+ /** a time: 15m, 2h, 3d, 1w back from now; or a date or date-time, local unless it has a zone */
21
+ export declare function readTime(v: string, now: number): number | undefined;
22
+ /** The search language of one domain: its fields (the base ones, then its links), and
23
+ * - parseSearch: the query, read;
24
+ * - toAst: the parse, as a query carries it;
25
+ * - compileSearch: what the component sends: the parse, the range narrowed by since: and before:, and what couldn't
26
+ * be read;
27
+ * - matchAst: the parsed search (as a query carries it) as a test of one event (sensitive: "source.attr" names free
28
+ * text never looks in);
29
+ * - matcher: the search as typed, as a test of one event. */
30
+ export declare function searchFor(d: SearchDialect): {
31
+ FIELDS: string[];
32
+ parseSearch: (q: string, now?: number) => ParsedSearch;
33
+ toAst: (p: ParsedSearch) => SearchAst;
34
+ compileSearch: (q: string, now: number, from: number, to: number) => {
35
+ where: SearchAst;
36
+ from: number;
37
+ to: number;
38
+ warnings: string[];
39
+ };
40
+ matchAst: (ast: SearchAst | undefined, sensitive?: Iterable<string>) => (e: TimelineEvent) => boolean;
41
+ matcher: (p: ParsedSearch, sensitive?: Iterable<string>) => (e: TimelineEvent) => boolean;
42
+ };
43
+ export type Search = ReturnType<typeof searchFor>;
44
+ /** the range since: and before: narrow [from, to) to (never wider) */
45
+ export declare function rangeOf(p: ParsedSearch, from: number, to: number): {
46
+ from: number;
47
+ to: number;
48
+ };
49
+ /** where the free text (positive terms) hits a line: [start, end) ranges, merged, in order */
50
+ export declare function highlights(p: ParsedSearch, line: string): [number, number][];
51
+ /** a severity filter as a set (for facets) */
52
+ export declare const severities: (min: Severity) => ("debug" | "error" | "info" | "notice" | "warning")[];