@orangecharts/wrun-chart-host 0.1.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 (198) hide show
  1. package/README.md +72 -0
  2. package/dist/constants/governed-exchanges.constants.d.ts +11 -0
  3. package/dist/constants/governed-exchanges.constants.js +11 -0
  4. package/dist/constants/indicator-sets.constants.d.ts +8 -0
  5. package/dist/constants/indicator-sets.constants.js +8 -0
  6. package/dist/constants/interval.constants.d.ts +34 -0
  7. package/dist/constants/interval.constants.js +121 -0
  8. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +28 -0
  9. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +65 -0
  10. package/dist/constants/tpo-color-schemes.constants.d.ts +30 -0
  11. package/dist/constants/tpo-color-schemes.constants.js +32 -0
  12. package/dist/host-env.d.ts +102 -0
  13. package/dist/host-env.js +26 -0
  14. package/dist/index.d.ts +93 -0
  15. package/dist/index.js +96 -0
  16. package/dist/indicators/controls/tpo-letter.util.d.ts +2 -0
  17. package/dist/indicators/controls/tpo-letter.util.js +13 -0
  18. package/dist/indicators/controls/tpo-session.util.d.ts +99 -0
  19. package/dist/indicators/controls/tpo-session.util.js +389 -0
  20. package/dist/interfaces/kscript-diagnostics.interface.d.ts +64 -0
  21. package/dist/interfaces/kscript-diagnostics.interface.js +1 -0
  22. package/dist/interfaces/om-panel-data.interface.d.ts +103 -0
  23. package/dist/interfaces/om-panel-data.interface.js +7 -0
  24. package/dist/interfaces/wrun-runtime.interface.d.ts +2659 -0
  25. package/dist/interfaces/wrun-runtime.interface.js +55 -0
  26. package/dist/utility/chart/calendar-interval.util.d.ts +24 -0
  27. package/dist/utility/chart/calendar-interval.util.js +81 -0
  28. package/dist/utility/chart/candle-bar-end.util.d.ts +15 -0
  29. package/dist/utility/chart/candle-bar-end.util.js +23 -0
  30. package/dist/utility/chart/cme-realtime.util.d.ts +24 -0
  31. package/dist/utility/chart/cme-realtime.util.js +53 -0
  32. package/dist/utility/chart/interval-ladder.util.d.ts +27 -0
  33. package/dist/utility/chart/interval-ladder.util.js +92 -0
  34. package/dist/utility/chart/kscript-drawing-prep.util.d.ts +40 -0
  35. package/dist/utility/chart/kscript-drawing-prep.util.js +184 -0
  36. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +95 -0
  37. package/dist/utility/chart/kscript-drawing-safe-area.util.js +805 -0
  38. package/dist/utility/chart/kscript-legend-entries.util.d.ts +166 -0
  39. package/dist/utility/chart/kscript-legend-entries.util.js +538 -0
  40. package/dist/utility/chart/kscript-output-role.util.d.ts +32 -0
  41. package/dist/utility/chart/kscript-output-role.util.js +215 -0
  42. package/dist/utility/chart/kscript-provenance-keys.util.d.ts +22 -0
  43. package/dist/utility/chart/kscript-provenance-keys.util.js +56 -0
  44. package/dist/utility/chart/kscript-run-result-normalize.util.d.ts +53 -0
  45. package/dist/utility/chart/kscript-run-result-normalize.util.js +476 -0
  46. package/dist/utility/chart/kscript-run-result-shape.util.d.ts +14 -0
  47. package/dist/utility/chart/kscript-run-result-shape.util.js +66 -0
  48. package/dist/utility/chart/kscript-titancharts-container.util.d.ts +29 -0
  49. package/dist/utility/chart/kscript-titancharts-container.util.js +151 -0
  50. package/dist/utility/chart/kscript-viewport-overlays.util.d.ts +83 -0
  51. package/dist/utility/chart/kscript-viewport-overlays.util.js +443 -0
  52. package/dist/utility/chart/om-panel-push-style.util.d.ts +78 -0
  53. package/dist/utility/chart/om-panel-push-style.util.js +301 -0
  54. package/dist/utility/chart/om-panel.util.d.ts +166 -0
  55. package/dist/utility/chart/om-panel.util.js +815 -0
  56. package/dist/utility/chart/om-series.util.d.ts +42 -0
  57. package/dist/utility/chart/om-series.util.js +330 -0
  58. package/dist/utility/chart/om-target.util.d.ts +11 -0
  59. package/dist/utility/chart/om-target.util.js +24 -0
  60. package/dist/utility/chart/om-widget.util.d.ts +148 -0
  61. package/dist/utility/chart/om-widget.util.js +413 -0
  62. package/dist/utility/chart/overlay-output-budget.util.d.ts +16 -0
  63. package/dist/utility/chart/overlay-output-budget.util.js +109 -0
  64. package/dist/utility/chart/overlay-paint-flags.util.d.ts +24 -0
  65. package/dist/utility/chart/overlay-paint-flags.util.js +55 -0
  66. package/dist/utility/chart/profile-row-height.util.d.ts +21 -0
  67. package/dist/utility/chart/profile-row-height.util.js +110 -0
  68. package/dist/utility/chart/session-interval.util.d.ts +1 -0
  69. package/dist/utility/chart/session-interval.util.js +35 -0
  70. package/dist/utility/chart/technical-script-legend-value.util.d.ts +18 -0
  71. package/dist/utility/chart/technical-script-legend-value.util.js +53 -0
  72. package/dist/utility/chart/trading-day.util.d.ts +70 -0
  73. package/dist/utility/chart/trading-day.util.js +238 -0
  74. package/dist/utility/chart/wrun-legend-name.util.d.ts +25 -0
  75. package/dist/utility/chart/wrun-legend-name.util.js +87 -0
  76. package/dist/utility/chart/wrun-run-result.util.d.ts +977 -0
  77. package/dist/utility/chart/wrun-run-result.util.js +5179 -0
  78. package/dist/utility/chart/wrun-visibility-chart.util.d.ts +25 -0
  79. package/dist/utility/chart/wrun-visibility-chart.util.js +22 -0
  80. package/dist/utility/indicators/heatmap-sensitivity.util.d.ts +62 -0
  81. package/dist/utility/indicators/heatmap-sensitivity.util.js +82 -0
  82. package/dist/utility/number-format.util.d.ts +68 -0
  83. package/dist/utility/number-format.util.js +188 -0
  84. package/dist/utility/v2/opra-governed.util.d.ts +1 -0
  85. package/dist/utility/v2/opra-governed.util.js +13 -0
  86. package/dist/utility/wrun/wrun-auto-row.util.d.ts +54 -0
  87. package/dist/utility/wrun/wrun-auto-row.util.js +96 -0
  88. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +341 -0
  89. package/dist/utility/wrun/wrun-batched-marks.util.js +938 -0
  90. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +75 -0
  91. package/dist/utility/wrun/wrun-batched-readout.util.js +171 -0
  92. package/dist/utility/wrun/wrun-box-segment.util.d.ts +185 -0
  93. package/dist/utility/wrun/wrun-box-segment.util.js +570 -0
  94. package/dist/utility/wrun/wrun-build-memo.util.d.ts +133 -0
  95. package/dist/utility/wrun/wrun-build-memo.util.js +301 -0
  96. package/dist/utility/wrun/wrun-builtin-twin-ports.util.d.ts +25 -0
  97. package/dist/utility/wrun/wrun-builtin-twin-ports.util.js +75 -0
  98. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +9 -0
  99. package/dist/utility/wrun/wrun-builtin-twin.util.js +40 -0
  100. package/dist/utility/wrun/wrun-canvas-cache.util.d.ts +28 -0
  101. package/dist/utility/wrun/wrun-canvas-cache.util.js +56 -0
  102. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +69 -0
  103. package/dist/utility/wrun/wrun-canvas-readout.util.js +53 -0
  104. package/dist/utility/wrun/wrun-canvases.util.d.ts +295 -0
  105. package/dist/utility/wrun/wrun-canvases.util.js +1432 -0
  106. package/dist/utility/wrun/wrun-cap-notice.util.d.ts +77 -0
  107. package/dist/utility/wrun/wrun-cap-notice.util.js +296 -0
  108. package/dist/utility/wrun/wrun-card-style.util.d.ts +154 -0
  109. package/dist/utility/wrun/wrun-card-style.util.js +539 -0
  110. package/dist/utility/wrun/wrun-chart-context.util.d.ts +89 -0
  111. package/dist/utility/wrun/wrun-chart-context.util.js +213 -0
  112. package/dist/utility/wrun/wrun-chart-names.util.d.ts +23 -0
  113. package/dist/utility/wrun/wrun-chart-names.util.js +33 -0
  114. package/dist/utility/wrun/wrun-chart-time.util.d.ts +12 -0
  115. package/dist/utility/wrun/wrun-chart-time.util.js +23 -0
  116. package/dist/utility/wrun/wrun-child-overlay-id.util.d.ts +13 -0
  117. package/dist/utility/wrun/wrun-child-overlay-id.util.js +44 -0
  118. package/dist/utility/wrun/wrun-color-facts.util.d.ts +40 -0
  119. package/dist/utility/wrun/wrun-color-facts.util.js +88 -0
  120. package/dist/utility/wrun/wrun-color-settings.lazy.d.ts +26 -0
  121. package/dist/utility/wrun/wrun-color-settings.lazy.js +9 -0
  122. package/dist/utility/wrun/wrun-color-settings.util.d.ts +351 -0
  123. package/dist/utility/wrun/wrun-color-settings.util.js +1363 -0
  124. package/dist/utility/wrun/wrun-footprint-modes.util.d.ts +23 -0
  125. package/dist/utility/wrun/wrun-footprint-modes.util.js +24 -0
  126. package/dist/utility/wrun/wrun-frames.d.ts +217 -0
  127. package/dist/utility/wrun/wrun-frames.js +1021 -0
  128. package/dist/utility/wrun/wrun-handles.util.d.ts +792 -0
  129. package/dist/utility/wrun/wrun-handles.util.js +2050 -0
  130. package/dist/utility/wrun/wrun-heatmap-cell-budget.util.d.ts +156 -0
  131. package/dist/utility/wrun/wrun-heatmap-cell-budget.util.js +342 -0
  132. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +218 -0
  133. package/dist/utility/wrun/wrun-hosted-wire-caps.js +667 -0
  134. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +40 -0
  135. package/dist/utility/wrun/wrun-hosted-wire.util.js +27 -0
  136. package/dist/utility/wrun/wrun-hover.util.d.ts +182 -0
  137. package/dist/utility/wrun/wrun-hover.util.js +534 -0
  138. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +246 -0
  139. package/dist/utility/wrun/wrun-hud-looks.util.js +587 -0
  140. package/dist/utility/wrun/wrun-integration-budget.util.d.ts +47 -0
  141. package/dist/utility/wrun/wrun-integration-budget.util.js +122 -0
  142. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +19 -0
  143. package/dist/utility/wrun/wrun-latest-snapshot.js +7 -0
  144. package/dist/utility/wrun/wrun-levels-child.util.d.ts +131 -0
  145. package/dist/utility/wrun/wrun-levels-child.util.js +514 -0
  146. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +75 -0
  147. package/dist/utility/wrun/wrun-lifecycle.contract.js +9 -0
  148. package/dist/utility/wrun/wrun-market-facts.util.d.ts +116 -0
  149. package/dist/utility/wrun/wrun-market-facts.util.js +238 -0
  150. package/dist/utility/wrun/wrun-output-style.util.d.ts +344 -0
  151. package/dist/utility/wrun/wrun-output-style.util.js +1239 -0
  152. package/dist/utility/wrun/wrun-overlay-identity.util.d.ts +84 -0
  153. package/dist/utility/wrun/wrun-overlay-identity.util.js +142 -0
  154. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +120 -0
  155. package/dist/utility/wrun/wrun-overlay-result.util.js +219 -0
  156. package/dist/utility/wrun/wrun-pack.util.d.ts +70 -0
  157. package/dist/utility/wrun/wrun-pack.util.js +301 -0
  158. package/dist/utility/wrun/wrun-pane-format.util.d.ts +180 -0
  159. package/dist/utility/wrun/wrun-pane-format.util.js +299 -0
  160. package/dist/utility/wrun/wrun-panel-style.lazy.d.ts +25 -0
  161. package/dist/utility/wrun/wrun-panel-style.lazy.js +15 -0
  162. package/dist/utility/wrun/wrun-panel-style.util.d.ts +174 -0
  163. package/dist/utility/wrun/wrun-panel-style.util.js +726 -0
  164. package/dist/utility/wrun/wrun-param-values.util.d.ts +69 -0
  165. package/dist/utility/wrun/wrun-param-values.util.js +230 -0
  166. package/dist/utility/wrun/wrun-refusal.util.d.ts +263 -0
  167. package/dist/utility/wrun/wrun-refusal.util.js +1259 -0
  168. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +199 -0
  169. package/dist/utility/wrun/wrun-registry-errors.util.js +257 -0
  170. package/dist/utility/wrun/wrun-render-select.util.d.ts +336 -0
  171. package/dist/utility/wrun/wrun-render-select.util.js +1157 -0
  172. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +434 -0
  173. package/dist/utility/wrun/wrun-script-inputs.util.js +1971 -0
  174. package/dist/utility/wrun/wrun-setting-words.lazy.d.ts +20 -0
  175. package/dist/utility/wrun/wrun-setting-words.lazy.js +9 -0
  176. package/dist/utility/wrun/wrun-setting-words.util.d.ts +79 -0
  177. package/dist/utility/wrun/wrun-setting-words.util.js +176 -0
  178. package/dist/utility/wrun/wrun-socket-row-store.d.ts +98 -0
  179. package/dist/utility/wrun/wrun-socket-row-store.js +417 -0
  180. package/dist/utility/wrun/wrun-style-flags.util.d.ts +18 -0
  181. package/dist/utility/wrun/wrun-style-flags.util.js +21 -0
  182. package/dist/utility/wrun/wrun-style-words.util.d.ts +148 -0
  183. package/dist/utility/wrun/wrun-style-words.util.js +439 -0
  184. package/dist/utility/wrun/wrun-table-look.util.d.ts +125 -0
  185. package/dist/utility/wrun/wrun-table-look.util.js +225 -0
  186. package/dist/utility/wrun/wrun-text-look.util.d.ts +51 -0
  187. package/dist/utility/wrun/wrun-text-look.util.js +227 -0
  188. package/dist/utility/wrun/wrun-text-params.util.d.ts +106 -0
  189. package/dist/utility/wrun/wrun-text-params.util.js +171 -0
  190. package/dist/utility/wrun/wrun-tpo-rows.util.d.ts +71 -0
  191. package/dist/utility/wrun/wrun-tpo-rows.util.js +438 -0
  192. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +14 -0
  193. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +58 -0
  194. package/dist/utility/wrun/wrun-visibility-table.d.ts +437 -0
  195. package/dist/utility/wrun/wrun-visibility-table.js +237 -0
  196. package/dist/utility/wrun/wrun-volume-profile.util.d.ts +37 -0
  197. package/dist/utility/wrun/wrun-volume-profile.util.js +278 -0
  198. package/package.json +38 -0
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The footprint canvas facts two places read and must agree on: the modes
3
+ * whose cells are a grid that paints the volume colour, the defaults the
4
+ * mount door applies, and the metrics drawn in that colour. The Style row
5
+ * builder (wrun-script-inputs.util: a footprint whose cells paint the volume
6
+ * colour gets no buy / sell row) and the canvas mount door
7
+ * (wrun-canvases.util: footprintChild) both read these, so neither can drift
8
+ * from the other. A leaf: no imports.
9
+ */
10
+ /** Display modes whose cells form a grid (titan `isClusterGridProfileDisplayMode`). */
11
+ export declare const WRUN_FOOTPRINT_GRID_MODES: ReadonlySet<string>;
12
+ /** The mode a footprint declaration without `mode` draws (the mount door's default). */
13
+ export declare const WRUN_FOOTPRINT_MODE_DEFAULT = "split_bar";
14
+ /** The cell metric a grid-mode footprint without `cell_metric` draws (the mount door's default). */
15
+ export declare const WRUN_FOOTPRINT_CELL_METRIC_DEFAULT = "delta";
16
+ /** Cell metrics a grid paints in the volume colour (titan: `volumeColor || buyColor`), never the buy / sell pair. */
17
+ export declare const WRUN_FOOTPRINT_VOLUME_METRICS: ReadonlySet<string>;
18
+ /** True when the footprint's cells paint the volume colour: a grid mode with a
19
+ * volume or trades metric. Its buy / sell pair is then never read. */
20
+ export declare function footprintPaintsVolumeColor(profile: {
21
+ mode?: unknown;
22
+ cell_metric?: unknown;
23
+ }): boolean;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The footprint canvas facts two places read and must agree on: the modes
3
+ * whose cells are a grid that paints the volume colour, the defaults the
4
+ * mount door applies, and the metrics drawn in that colour. The Style row
5
+ * builder (wrun-script-inputs.util: a footprint whose cells paint the volume
6
+ * colour gets no buy / sell row) and the canvas mount door
7
+ * (wrun-canvases.util: footprintChild) both read these, so neither can drift
8
+ * from the other. A leaf: no imports.
9
+ */
10
+ /** Display modes whose cells form a grid (titan `isClusterGridProfileDisplayMode`). */
11
+ export const WRUN_FOOTPRINT_GRID_MODES = new Set(['cluster', 'ladder', 'imbalance_only']);
12
+ /** The mode a footprint declaration without `mode` draws (the mount door's default). */
13
+ export const WRUN_FOOTPRINT_MODE_DEFAULT = 'split_bar';
14
+ /** The cell metric a grid-mode footprint without `cell_metric` draws (the mount door's default). */
15
+ export const WRUN_FOOTPRINT_CELL_METRIC_DEFAULT = 'delta';
16
+ /** Cell metrics a grid paints in the volume colour (titan: `volumeColor || buyColor`), never the buy / sell pair. */
17
+ export const WRUN_FOOTPRINT_VOLUME_METRICS = new Set(['volume', 'trades']);
18
+ /** True when the footprint's cells paint the volume colour: a grid mode with a
19
+ * volume or trades metric. Its buy / sell pair is then never read. */
20
+ export function footprintPaintsVolumeColor(profile) {
21
+ const mode = typeof profile.mode === 'string' ? profile.mode : WRUN_FOOTPRINT_MODE_DEFAULT;
22
+ const metric = typeof profile.cell_metric === 'string' ? profile.cell_metric : WRUN_FOOTPRINT_CELL_METRIC_DEFAULT;
23
+ return WRUN_FOOTPRINT_GRID_MODES.has(mode) && WRUN_FOOTPRINT_VOLUME_METRICS.has(metric);
24
+ }
@@ -0,0 +1,217 @@
1
+ /**
2
+ * The frame host: every run-level frame a wrun module writes (a levels
3
+ * ladder, a panel, a ladder or feed widget, a price matrix) is JSON the
4
+ * module owns, decoded and validated here before the selection reads it.
5
+ * One parser per frame kind restates the kit's frame grammar (the om
6
+ * `WrunLevelsFrameSchema`, `validatePanelFrame`, `WrunLadderFrameSchema`,
7
+ * `WrunFeedFrameSchema`, `WrunMatrixFrameSchema` and the runtime's
8
+ * declaration cross-checks) with its caps and refusal messages, so a frame
9
+ * refuses alike on every host (WRUN-STYLE X22: the app never imports the kit
10
+ * bundle on this path; the spec mirrors the om corpus cases).
11
+ *
12
+ * A refusal reads `wrun_frame_invalid: slot '<slot>': <message>`; a message
13
+ * the kit raises at a path inside the frame prints the way the om runtime
14
+ * prints it, `<path>: <message>` (`cells.1: cells rows must all hold 2
15
+ * columns`). The frame payload types live here beside their parsers (X24);
16
+ * the sheet declaration types stay in wrun-runtime.interface.ts.
17
+ *
18
+ * Guard G2 (the no-disguises rule) runs on every string a frame carries,
19
+ * after the JSON decode, before the grammar.
20
+ */
21
+ import type { WrunFontWeight, WrunLevels, WrunMatrix, WrunPanel, WrunPanelGuide, WrunPanelHighlight, WrunPanelBadge, WrunPanelMarker, WrunPanelQuadrants } from '../../interfaces/wrun-runtime.interface.js';
22
+ import { type ParsedPanel } from '../chart/om-panel.util.js';
23
+ import type { FeedLine, LadderProps, LadderRow } from '../chart/om-widget.util.js';
24
+ import type { WrunMiniChartsFrame } from '@orangecharts/indicator-kit/host';
25
+ export declare const WRUN_FRAME_DEFAULT_MAX_BYTES = 98304;
26
+ export declare const WRUN_FRAME_MAX_SLOTS = 8;
27
+ /** Rows per levels frame on the pane dock, and per span (g2, g6). */
28
+ export declare const WRUN_MAX_LEVEL_ROWS = 512;
29
+ /** Stacked segments per row (DL-stacked). */
30
+ export declare const WRUN_MAX_LEVEL_SERIES = 8;
31
+ /** A frame row's own text (DL-row-text) and the POC tag (DL-poc). */
32
+ export declare const WRUN_MAX_LEVEL_LABEL_CHARS = 24;
33
+ /** A frame row's tooltip (DL-hover). */
34
+ export declare const WRUN_MAX_LEVEL_TOOLTIP_CHARS = 64;
35
+ /** Spans per levels frame under span "time", and rows across them (DL-time-anchored). */
36
+ export declare const WRUN_MAX_LEVEL_SPANS = 64;
37
+ export declare const WRUN_MAX_LEVEL_SPAN_ROWS = 4096;
38
+ /** Ladder frame rows (DW38, was 64) and feed lines. */
39
+ export declare const WRUN_MAX_LADDER_ROWS = 256;
40
+ export declare const WRUN_MAX_FEED_LINES = 50;
41
+ export declare const WRUN_MAX_FEED_LINE_CHARS = 80;
42
+ export declare const WRUN_MAX_LADDER_DIVIDER_CHARS = 24;
43
+ /** A ladder or feed frame title (DW15). */
44
+ export declare const WRUN_MAX_WIDGET_TITLE_CHARS = 40;
45
+ /** A matrix frame: prices x columns, the cell cap, a label or text's length (MX-price-matrix). */
46
+ export declare const WRUN_MAX_MATRIX_ROWS = 128;
47
+ export declare const WRUN_MAX_MATRIX_COLS = 12;
48
+ export declare const WRUN_MAX_MATRIX_TEXT = 16;
49
+ export declare const WRUN_MAX_MATRIX_CELLS = 1536;
50
+ export declare const WRUN_MAX_CANVAS_LABEL_CHARS = 40;
51
+ /** Panel frame chrome (SC17 and the kind fields of SC04 SC06 SC18 SC20 SC34 SC39). */
52
+ export declare const WRUN_PANEL_MAX_MARKERS = 8;
53
+ export declare const WRUN_PANEL_MAX_GUIDES = 8;
54
+ export declare const WRUN_PANEL_MAX_SUMMARY_ROWS = 5;
55
+ export declare const WRUN_PANEL_MAX_SUMMARY_VALUES = 2000;
56
+ export declare const WRUN_PANEL_MAX_TITLE_CHARS = 40;
57
+ export declare const WRUN_PANEL_MAX_CAPTION_CHARS = 64;
58
+ export declare const WRUN_PANEL_MAX_LABEL_CHARS = 24;
59
+ export declare const WRUN_PANEL_MAX_KEY_CHARS = 64;
60
+ export declare const WRUN_PANEL_MIN_MARKER_WIDTH = 0.5;
61
+ export declare const WRUN_PANEL_MAX_MARKER_WIDTH = 4;
62
+ /** The kit's colour-word refusal (wrun-style-words.ts `WRUN_COLOR_WORD_MESSAGE`). */
63
+ export declare const WRUN_COLOR_WORD_MESSAGE = "a colour must be #rrggbb, #rrggbbaa or one of theme.up, theme.down, theme.text, theme.muted, theme.bg, theme.grid, theme.accent";
64
+ /** The pane dock frame (span "pane", the default): today's three keys plus
65
+ * the g2 fields. `colors[i]` keeps its string type (any colour form is
66
+ * honoured or falls back to the level colour, never refused). */
67
+ export interface WrunLevelsFrame {
68
+ prices: number[];
69
+ values: (number | null)[];
70
+ colors?: string[];
71
+ /** DL-row-text: a string is the row's text, "" no label, null the formatted value. */
72
+ labels_text?: (string | null)[];
73
+ /** DL-stacked: one array per declared series, each the length of prices. */
74
+ series?: (number | null)[][];
75
+ /** DL-even-grid: a row's own price band, both or neither. */
76
+ lows?: (number | null)[];
77
+ highs?: (number | null)[];
78
+ /** DL-hover: a hover card per row. */
79
+ tooltips?: (string | null)[];
80
+ /** DL-value-area: [low, high]. */
81
+ value_area?: [number, number];
82
+ /** DL-poc: the marked price and the tag text. */
83
+ poc_price?: number;
84
+ poc_label_text?: string;
85
+ /** DL-scale: the per-run denominator (scale "fixed" only). */
86
+ scale_max?: number;
87
+ }
88
+ /** One time span of a span "time" frame (DL-time-anchored): its bounds in
89
+ * epoch seconds and its own rows; colours are colour words. */
90
+ export interface WrunLevelsSpan {
91
+ start: number;
92
+ end: number;
93
+ prices: number[];
94
+ values: (number | null)[];
95
+ colors?: string[];
96
+ }
97
+ /** The span "time" frame: 1..64 spans holding at most 4096 rows in all. */
98
+ export interface WrunLevelsSpansFrame {
99
+ spans: WrunLevelsSpan[];
100
+ }
101
+ /** True for the spans shape of a parsed levels frame. */
102
+ export declare function isWrunLevelsSpansFrame(frame: WrunLevelsFrame | WrunLevelsSpansFrame): frame is WrunLevelsSpansFrame;
103
+ /** A ladder frame: 1..256 rows of [price, size, fraction, colour word?], an
104
+ * optional divider and an optional per-run title (DW15, DW38). */
105
+ export interface WrunLadderFrame {
106
+ rows: LadderRow[];
107
+ divider?: LadderProps['divider'];
108
+ title?: string;
109
+ }
110
+ /** A feed frame: 1..50 lines of [time ms, text, colour word?] and an
111
+ * optional per-run title (DW15). */
112
+ export interface WrunFeedFrame {
113
+ lines: FeedLine[];
114
+ title?: string;
115
+ }
116
+ /** A heatmap summary row (SC18, frame only): values follow the columns in
117
+ * first-seen order. */
118
+ export interface WrunPanelSummaryRow {
119
+ label: string;
120
+ values: (number | null)[];
121
+ }
122
+ /** The keys a panel frame may carry beside `rows` (SC17): a frame field
123
+ * overrides the declared word of the same name for that run, `markers`
124
+ * replaces the declared list. Which kinds take which key is
125
+ * {@link WRUN_PANEL_FRAME_WORD_KINDS}. */
126
+ export interface WrunPanelFrameChrome {
127
+ title?: string;
128
+ caption?: string;
129
+ /** C2: the title-row chip (line, bars, histogram, scatter). */
130
+ badge?: WrunPanelBadge;
131
+ markers?: WrunPanelMarker[];
132
+ x_min?: number;
133
+ x_max?: number;
134
+ y_min?: number;
135
+ y_max?: number;
136
+ guides?: WrunPanelGuide[];
137
+ quadrants?: WrunPanelQuadrants;
138
+ min?: number;
139
+ max?: number;
140
+ highlight?: WrunPanelHighlight;
141
+ summary?: WrunPanelSummaryRow[];
142
+ hole_text?: string;
143
+ hole_caption?: string;
144
+ }
145
+ export type WrunPanelFrameWord = keyof WrunPanelFrameChrome;
146
+ /** A styled matrix cell: at least one field. */
147
+ export interface WrunMatrixCellStyle {
148
+ value?: number;
149
+ text?: string;
150
+ color?: string;
151
+ text_color?: string;
152
+ font_weight?: WrunFontWeight;
153
+ }
154
+ /** A matrix cell: empty, a number, a text, or a styled object. */
155
+ export type WrunMatrixCell = null | number | string | WrunMatrixCellStyle;
156
+ /** A written `plot.matrix` frame (MX-price-matrix): prices (one row each,
157
+ * strictly monotonic), cells (one row per price, one width), optional
158
+ * column labels, title, highlight and value range. */
159
+ export interface WrunMatrixFrame {
160
+ prices: number[];
161
+ cells: WrunMatrixCell[][];
162
+ cols?: string[];
163
+ title?: string;
164
+ highlight?: {
165
+ price?: number;
166
+ col?: number;
167
+ };
168
+ range?: {
169
+ min?: number;
170
+ max?: number;
171
+ };
172
+ }
173
+ export declare function invalidWrunFrame(slot: string, reason: string): never;
174
+ /** Parses a levels frame: the pane shape (`prices`, `values`, ...) or the
175
+ * spans shape (`spans`), told apart by the `spans` key; shape rules only
176
+ * (the kit's `WrunLevelsFrameSchema`). With a declaration, the shape must
177
+ * match its `span` (the kit's `validateWrunLevelsFrame` message); the
178
+ * series and scale cross-checks are the selection's (`checkWrunLevelsFrame`). */
179
+ export declare function parseWrunLevelsFrame(raw: string, slot: string, declaration?: Partial<Pick<WrunLevels, 'name' | 'span'>>): WrunLevelsFrame | WrunLevelsSpansFrame;
180
+ type PanelKind = WrunPanel['kind'];
181
+ /** Which kinds take each frame key; x_min / x_max also need x "index" or
182
+ * "number" on a line, like the declared words. */
183
+ export declare const WRUN_PANEL_FRAME_WORD_KINDS: Readonly<Record<WrunPanelFrameWord, ReadonlyArray<PanelKind>>>;
184
+ /** The frame keys this panel's kind accepts beside `rows`. */
185
+ export declare function wrunPanelFrameWords(kind: PanelKind): WrunPanelFrameWord[];
186
+ /** The per-run chrome a decoded panel frame carries beside `rows` (SC17):
187
+ * any key outside the kind's words refuses by name, each value goes
188
+ * through its declared word's ranges, then the cross rules against the
189
+ * declaration. Returns the parsed chrome (empty when the frame carries
190
+ * only rows). */
191
+ export declare function parseWrunPanelChrome(frame: Record<string, unknown>, declaration: WrunPanel, slot: string): WrunPanelFrameChrome;
192
+ /** Parses a panel frame: `rows` through the receive-lane validator (one row
193
+ * grammar on both lanes; the wrun lane carries the declaration's style
194
+ * words) plus the kind's chrome keys through {@link parseWrunPanelChrome},
195
+ * returned as `ParsedPanel.chrome` when the frame carries any. */
196
+ export declare function parseWrunPanelFrame(raw: string, slot: string, declaration: WrunPanel): ParsedPanel;
197
+ export declare function parseWrunLadderFrame(raw: string, slot: string): WrunLadderFrame;
198
+ export declare function parseWrunFeedFrame(raw: string, slot: string): WrunFeedFrame;
199
+ /** Parses a matrix frame through the kit's grammar (`WrunMatrixFrameSchema`:
200
+ * prices 1..128 strictly monotonic, cells one row per price of one width
201
+ * 1..12, at most 1536 cells, cols one label per column, highlight.col
202
+ * inside the width, texts 0..16, range.min below range.max), then the
203
+ * runtime's declaration check: a declared `columns` list must be as wide
204
+ * as the cells. */
205
+ export declare function parseWrunMatrixFrame(raw: string, slot: string, declaration?: Pick<WrunMatrix, 'columns'>): WrunMatrixFrame;
206
+ /**
207
+ * A minicharts frame (`draw.minicharts`) by om's WrunMiniChartsFrameSchema,
208
+ * rule for rule: `{ title?, panels }` and nothing else; the title a string,
209
+ * trimmed, at most 40 characters (empty = no title); 1..12 panels of exactly
210
+ * `{ label, bars }`, the label trimmed to 1..24 characters, at most 100 bars
211
+ * of `[time, open, high, low, close, volume?]` with time a safe integer (the
212
+ * candle's open in epoch ms), the prices finite and the volume finite, null
213
+ * or absent. The parsed frame carries the trimmed texts (zod's output), the
214
+ * shape the shared host's wrunMiniChartGridPayload maps.
215
+ */
216
+ export declare function parseWrunMiniChartsFrame(raw: string, slot: string): WrunMiniChartsFrame;
217
+ export {};