@orangecharts/wrun-chart-host 0.7.1 → 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 (210) hide show
  1. package/README.md +27 -4
  2. package/dist/constants/feature-flags.constants.d.ts +5 -0
  3. package/dist/constants/feature-flags.constants.js +32 -0
  4. package/dist/constants/marketCapabilities.constants.d.ts +14 -9
  5. package/dist/constants/marketCapabilities.constants.js +36 -13
  6. package/dist/constants/opra-compliance.constants.d.ts +14 -0
  7. package/dist/constants/opra-compliance.constants.js +14 -0
  8. package/dist/constants/option-venues.constants.d.ts +29 -6
  9. package/dist/constants/option-venues.constants.js +19 -2
  10. package/dist/constants/venue-presets.constants.d.ts +17 -3
  11. package/dist/constants/venue-presets.constants.js +17 -3
  12. package/dist/host-env.d.ts +34 -4
  13. package/dist/host-env.js +21 -0
  14. package/dist/host-ports.types.d.ts +51 -3
  15. package/dist/index.d.ts +17 -0
  16. package/dist/index.js +17 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +40 -11
  18. package/dist/indicators/controls/tpo-session.util.js +138 -14
  19. package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
  20. package/dist/interfaces/opra-realtime.interface.js +10 -10
  21. package/dist/interfaces/option-instrument.interface.d.ts +6 -0
  22. package/dist/interfaces/wrun-runtime.interface.d.ts +34 -13
  23. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +57 -10
  24. package/dist/kscript-data/controls/live-trades-merge.util.js +85 -16
  25. package/dist/market-data/billing.interface.d.ts +138 -17
  26. package/dist/market-data/billing.interface.js +25 -8
  27. package/dist/market-data/venues/index.d.ts +3 -3
  28. package/dist/market-data/venues/opra.contract.copy.json +5 -3
  29. package/dist/market-data/venues/opra.d.ts +3 -3
  30. package/dist/market-data/venues/opra.js +5 -4
  31. package/dist/replay/replayLadder.js +3 -1
  32. package/dist/settings-templates/footprint-rows.d.ts +25 -0
  33. package/dist/settings-templates/footprint-rows.js +127 -0
  34. package/dist/settings-templates/form-rows.d.ts +56 -0
  35. package/dist/settings-templates/form-rows.js +19 -0
  36. package/dist/settings-templates/frvp-fields.js +14 -0
  37. package/dist/settings-templates/index.d.ts +10 -1
  38. package/dist/settings-templates/index.js +11 -2
  39. package/dist/settings-templates/indicator-fields.js +78 -0
  40. package/dist/settings-templates/tool-rules.d.ts +35 -9
  41. package/dist/settings-templates/tool-rules.js +42 -8
  42. package/dist/settings-templates/tool-tables.generated.js +13 -2
  43. package/dist/utility/chart/candle-volume-unit.leaf.d.ts +16 -0
  44. package/dist/utility/chart/candle-volume-unit.leaf.js +61 -0
  45. package/dist/utility/chart/crypto-index.leaf.d.ts +2 -2
  46. package/dist/utility/chart/crypto-index.leaf.js +2 -2
  47. package/dist/utility/chart/footprint-columns.util.d.ts +74 -0
  48. package/dist/utility/chart/footprint-columns.util.js +106 -0
  49. package/dist/utility/chart/footprint-display-mode.util.d.ts +40 -0
  50. package/dist/utility/chart/footprint-display-mode.util.js +62 -0
  51. package/dist/utility/chart/footprint-sierra-look.util.d.ts +2 -0
  52. package/dist/utility/chart/footprint-sierra-look.util.js +37 -0
  53. package/dist/utility/chart/index-mode-admission.util.js +9 -1
  54. package/dist/utility/chart/index-mode.util.d.ts +5 -2
  55. package/dist/utility/chart/index-mode.util.js +23 -13
  56. package/dist/utility/chart/kscript-venue-policy.util.d.ts +28 -21
  57. package/dist/utility/chart/kscript-venue-policy.util.js +34 -26
  58. package/dist/utility/chart/marketKind.util.d.ts +12 -10
  59. package/dist/utility/chart/marketKind.util.js +17 -7
  60. package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
  61. package/dist/utility/chart/om-panel-push-style.util.js +17 -15
  62. package/dist/utility/chart/om-panel.util.d.ts +11 -0
  63. package/dist/utility/chart/om-panel.util.js +65 -6
  64. package/dist/utility/chart/profile-block-size.util.d.ts +16 -0
  65. package/dist/utility/chart/profile-block-size.util.js +7 -0
  66. package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
  67. package/dist/utility/chart/quote-perp.leaf.js +20 -0
  68. package/dist/utility/chart/window-geometry.leaf.d.ts +23 -1
  69. package/dist/utility/chart/window-geometry.leaf.js +78 -6
  70. package/dist/utility/chart/window-owner.leaf.d.ts +13 -0
  71. package/dist/utility/chart/window-owner.leaf.js +5 -0
  72. package/dist/utility/chart/wrun-run-result.util.d.ts +5 -0
  73. package/dist/utility/chart/wrun-run-result.util.js +4 -1
  74. package/dist/utility/common/transformations.util.d.ts +7 -0
  75. package/dist/utility/common/transformations.util.js +11 -0
  76. package/dist/utility/options/cme-options-root.util.d.ts +25 -0
  77. package/dist/utility/options/cme-options-root.util.js +40 -0
  78. package/dist/utility/options/option-book.util.d.ts +27 -0
  79. package/dist/utility/options/option-book.util.js +76 -0
  80. package/dist/utility/options/option-trade-date.util.d.ts +50 -0
  81. package/dist/utility/options/option-trade-date.util.js +120 -0
  82. package/dist/utility/options/option-venue.util.d.ts +3 -3
  83. package/dist/utility/options/option-venue.util.js +3 -3
  84. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +1 -1
  85. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +2 -2
  86. package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
  87. package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
  88. package/dist/utility/wrun/sources/host-grid-landing.d.ts +4 -2
  89. package/dist/utility/wrun/sources/host-grid-landing.js +8 -0
  90. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +40 -4
  91. package/dist/utility/wrun/sources/lanes/options_flow.js +115 -18
  92. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +12 -9
  93. package/dist/utility/wrun/sources/opra-option-lanes.util.js +10 -7
  94. package/dist/utility/wrun/sources/row-lane-registry.js +10 -5
  95. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  96. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +3 -2
  97. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +30 -5
  98. package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
  99. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +13 -5
  100. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +25 -1
  101. package/dist/utility/wrun/sources/row-lanes/option_prints.js +161 -30
  102. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.d.ts +4 -0
  103. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +65 -0
  104. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -1
  105. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +83 -2
  106. package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +17 -1
  107. package/dist/utility/wrun/sources/row-lanes/option_surface.js +33 -2
  108. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +7 -1
  109. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +51 -5
  110. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +136 -3
  111. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +42 -0
  112. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +146 -0
  113. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +25 -5
  114. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +111 -20
  115. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +291 -48
  116. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
  117. package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
  118. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
  119. package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
  120. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -0
  121. package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
  122. package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
  123. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +147 -9
  124. package/dist/utility/wrun/wrun-chart-market-facts.util.js +345 -11
  125. package/dist/utility/wrun/wrun-cloud-record.leaf.d.ts +27 -0
  126. package/dist/utility/wrun/wrun-cloud-record.leaf.js +71 -0
  127. package/dist/utility/wrun/wrun-cloud-record.util.d.ts +4 -21
  128. package/dist/utility/wrun/wrun-cloud-record.util.js +5 -65
  129. package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
  130. package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
  131. package/dist/utility/wrun/wrun-color-settings.util.d.ts +22 -9
  132. package/dist/utility/wrun/wrun-color-settings.util.js +57 -23
  133. package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
  134. package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
  135. package/dist/utility/wrun/wrun-download-meter.util.d.ts +92 -0
  136. package/dist/utility/wrun/wrun-download-meter.util.js +122 -0
  137. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +10 -3
  138. package/dist/utility/wrun/wrun-draft-overlay.util.js +63 -6
  139. package/dist/utility/wrun/wrun-frames.js +5 -5
  140. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
  141. package/dist/utility/wrun/wrun-hosted-wire-caps.js +11 -0
  142. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +33 -17
  143. package/dist/utility/wrun/wrun-hud-looks.util.js +30 -16
  144. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +29 -3
  145. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +33 -3
  146. package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
  147. package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
  148. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
  149. package/dist/utility/wrun/wrun-live-intake.util.d.ts +6 -2
  150. package/dist/utility/wrun/wrun-live-intake.util.js +136 -21
  151. package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -1
  152. package/dist/utility/wrun/wrun-live-tick.util.js +130 -44
  153. package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
  154. package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
  155. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +224 -0
  156. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +342 -0
  157. package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +88 -0
  158. package/dist/utility/wrun/wrun-market-size-defaults.util.js +471 -0
  159. package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +43 -8
  160. package/dist/utility/wrun/wrun-opra-flow.leaf.js +37 -6
  161. package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +51 -10
  162. package/dist/utility/wrun/wrun-option-contract-flow.util.js +85 -33
  163. package/dist/utility/wrun/wrun-option-prints.util.d.ts +172 -3
  164. package/dist/utility/wrun/wrun-option-prints.util.js +394 -17
  165. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +99 -0
  166. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +218 -0
  167. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +365 -0
  168. package/dist/utility/wrun/wrun-option-strike-flow.util.js +797 -0
  169. package/dist/utility/wrun/wrun-option-views.util.d.ts +231 -7
  170. package/dist/utility/wrun/wrun-option-views.util.js +643 -23
  171. package/dist/utility/wrun/wrun-options-chain.util.d.ts +6 -4
  172. package/dist/utility/wrun/wrun-options-chain.util.js +8 -5
  173. package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
  174. package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
  175. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +3 -0
  176. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
  177. package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
  178. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +9 -1
  179. package/dist/utility/wrun/wrun-overlay-recovery.util.js +32 -3
  180. package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
  181. package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
  182. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +34 -6
  183. package/dist/utility/wrun/wrun-overlay-run.util.js +527 -180
  184. package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +15 -0
  185. package/dist/utility/wrun/wrun-pack-widths.leaf.js +22 -0
  186. package/dist/utility/wrun/wrun-pack.util.d.ts +13 -8
  187. package/dist/utility/wrun/wrun-pack.util.js +38 -21
  188. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +4 -0
  189. package/dist/utility/wrun/wrun-panel-mount.util.js +62 -22
  190. package/dist/utility/wrun/wrun-panel-style.util.d.ts +41 -14
  191. package/dist/utility/wrun/wrun-panel-style.util.js +86 -26
  192. package/dist/utility/wrun/wrun-param-map.util.d.ts +7 -6
  193. package/dist/utility/wrun/wrun-param-map.util.js +8 -5
  194. package/dist/utility/wrun/wrun-param-values.util.d.ts +10 -2
  195. package/dist/utility/wrun/wrun-param-values.util.js +2 -0
  196. package/dist/utility/wrun/wrun-pin-spelling.util.js +19 -10
  197. package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
  198. package/dist/utility/wrun/wrun-refusal.util.js +17 -2
  199. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +20 -0
  200. package/dist/utility/wrun/wrun-script-inputs.util.js +43 -0
  201. package/dist/utility/wrun/wrun-source-rows.util.d.ts +4 -0
  202. package/dist/utility/wrun/wrun-source-rows.util.js +92 -40
  203. package/dist/utility/wrun/wrun-tape-source.util.d.ts +133 -48
  204. package/dist/utility/wrun/wrun-tape-source.util.js +205 -62
  205. package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
  206. package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
  207. package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
  208. package/dist/workers/utils/volume-profile.worker.util.js +5 -2
  209. package/dist/workers/wrun/wrun-abi-host.js +3 -2
  210. package/package.json +11 -11
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The row shape a host's settings form draws for a control the package describes (the footprint's Classic Presets and
3
+ * Columns: ./footprint-rows.ts). The field tables beside it (./indicator-fields.ts) name which keys each lane keeps and
4
+ * cannot say what a row shows or writes, so a described control rides this shape. It is renderer-agnostic and holds
5
+ * no words: a row names its words as locale keys, which the host translates with its own dictionary (web's i18n, the
6
+ * phone's word table), says what it shows for the model it was built for, and answers the model a click or a pick
7
+ * writes. The host's control applies that model, as a web slot row hands its dialog the model to apply and confirm.
8
+ *
9
+ * - `action`: a label and one button (`action` words). `apply(model)` answers the model the click writes.
10
+ * - `choice`: one value among `options`, drawn as a drop-down (`select`) or as chips (`chips`: each chip is a choice,
11
+ * never a switch). `value` is the option that is on for the model the row was built for, or null when none is (a
12
+ * layout of the user's own lights no preset). `pick(model, value)` answers the model the pick writes, and the model
13
+ * itself (the same object) when the pick writes nothing (a value no option names, or the lit chip): the host then
14
+ * applies nothing.
15
+ *
16
+ * A row is built for one model. After an apply the host builds the rows again from the model it now holds, since their
17
+ * values, and which rows show, follow the model. `apply` and `pick` take the host's current model, never a copy.
18
+ */
19
+ export {};
@@ -105,4 +105,18 @@ export const FRVP_FIELD_ROWS = [
105
105
  ['showVAL', PREFERENCE],
106
106
  ['valColor', PREFERENCE],
107
107
  ['showVALLabel', PREFERENCE],
108
+ // Sierra parity: naked lines, stepped shading, printed stats and the level-line look the FRVP tool now reads.
109
+ ['showPOCNaked', PREFERENCE],
110
+ ['showVAHNaked', PREFERENCE],
111
+ ['showVALNaked', PREFERENCE],
112
+ ['cellShading', PREFERENCE],
113
+ ['shadingSteps', PREFERENCE],
114
+ ['shadingThresholds', PREFERENCE],
115
+ ['shadingStepColors', PREFERENCE],
116
+ ['profileStats', PREFERENCE],
117
+ ['profileStatsPosition', PREFERENCE],
118
+ ['levelLineWidth', PREFERENCE],
119
+ ['levelLineStyle', PREFERENCE],
120
+ // Stamped on every mount in the reader's language: mirrored so the box prints it, never saved.
121
+ ['profileStatsLabels', { owner: 'profile', lanes: ['mirror'] }],
108
122
  ];
@@ -1,5 +1,7 @@
1
+ import { type ToolTextRole } from './tool-rules.js';
1
2
  import { TOOL_DEFAULT_STYLE, TOOL_TEMPLATE_KEYS } from './tool-tables.generated.js';
2
3
  export { TOOL_DEFAULT_STYLE, TOOL_TEMPLATE_KEYS };
4
+ export type { ToolTextRole };
3
5
  export type TemplateKind = 'indicator' | 'tool';
4
6
  export type FieldLane = 'row' | 'template' | 'default' | 'mirror';
5
7
  export type FieldOwner = 'settings' | 'meta' | 'box' | 'profile';
@@ -12,7 +14,7 @@ export interface FieldSpec {
12
14
  instance?: boolean;
13
15
  /** An absolute in the market's own units: written only onto the market the template was saved on. */
14
16
  marketBound?: boolean;
15
- /** A drawing's label (the tool rules' `label`): an empty one is neither captured nor written over the destination's. */
17
+ /** A drawing's label (a `label` text, by the tool rules' text rule): an empty one is neither captured nor written. */
16
18
  label?: boolean;
17
19
  /** The serialisable value a capture writes where the engine holds none ("all"), when the field declares one. */
18
20
  unset?: unknown;
@@ -69,6 +71,13 @@ export declare class TemplateSchemaVersionError extends Error {
69
71
  }
70
72
  /** Whether a drawing type keeps the "Show on" intervals it was drawn with, whatever a template holds. */
71
73
  export declare function isIntervalBoundTool(type: string): boolean;
74
+ /**
75
+ * What a drawing type's free text is, by the tool rules' text rule over the type's style in the shipped tables
76
+ * (textRoleOf): its `label` (a template carries it), its `content` (a template never does), a text its engine never
77
+ * draws (`ignored`), or undefined when the type holds none. A host's text box reads this, the same rule the template
78
+ * tables were generated with, so the box never offers a label that a template drops.
79
+ */
80
+ export declare function toolTextRole(type: string): ToolTextRole | undefined;
72
81
  /**
73
82
  * Every field a type declares, with what each lane keeps. For a technical script `ctx` adds its declared inputs and
74
83
  * viewer rows (a script's filing key, `TECHNICAL_SCRIPT:<identity>`, reads as its type). The specs are frozen.
@@ -46,7 +46,7 @@ import cloneDeep from 'lodash-es/cloneDeep.js';
46
46
  import { isWrunViewerRowKey } from '../utility/wrun/wrun-color-facts.util.js';
47
47
  import { FRVP_FIELD_ROWS, FRVP_TOOL_TYPE } from './frvp-fields.js';
48
48
  import { INDICATOR_COMMON_FIELDS, INDICATOR_TYPE_FIELDS, RESERVED_SCRIPT_INPUT_NAMES, SCRIPT_INDICATOR_TYPE, SCRIPT_INPUT_FIELD, VIEWER_ROW_FIELD, } from './indicator-fields.js';
49
- import { TOOL_TEMPLATE_RULES } from './tool-rules.js';
49
+ import { textRoleOf, TOOL_TEMPLATE_RULES } from './tool-rules.js';
50
50
  import { TOOL_DEFAULT_STYLE, TOOL_TEMPLATE_KEYS } from './tool-tables.generated.js';
51
51
  export { TOOL_DEFAULT_STYLE, TOOL_TEMPLATE_KEYS };
52
52
  /** The schema version a capture stamps on the template envelope (never inside the settings bag). */
@@ -73,7 +73,7 @@ const RESERVED_INPUT_NAMES = new Set(RESERVED_SCRIPT_INPUT_NAMES);
73
73
  /** Names an object prototype reserves: never a field, whatever a script declares (a write would reach the prototype). */
74
74
  const PROTOTYPE_NAMES = new Set(['__proto__', 'constructor', 'prototype']);
75
75
  const TOOL_INSTANCE_KEYS = TOOL_TEMPLATE_RULES.instanceKeys;
76
- const LABEL_KEY = TOOL_TEMPLATE_RULES.label.key;
76
+ const LABEL_KEY = TOOL_TEMPLATE_RULES.text.key;
77
77
  const INTERVAL_BOUND_TYPES = new Set(TOOL_TEMPLATE_RULES.intervalBoundTypes);
78
78
  const DEFAULT_EXCLUDED_KEYS = new Set(TOOL_TEMPLATE_RULES.defaultExcludedKeys);
79
79
  const DEFAULT_EXCLUDED_TYPES = new Set(TOOL_TEMPLATE_RULES.defaultExcludedTypes);
@@ -89,6 +89,15 @@ const isFrvpOwner = (owner) => owner === 'box' || owner === 'profile';
89
89
  export function isIntervalBoundTool(type) {
90
90
  return INTERVAL_BOUND_TYPES.has(type);
91
91
  }
92
+ /**
93
+ * What a drawing type's free text is, by the tool rules' text rule over the type's style in the shipped tables
94
+ * (textRoleOf): its `label` (a template carries it), its `content` (a template never does), a text its engine never
95
+ * draws (`ignored`), or undefined when the type holds none. A host's text box reads this, the same rule the template
96
+ * tables were generated with, so the box never offers a label that a template drops.
97
+ */
98
+ export function toolTextRole(type) {
99
+ return textRoleOf(type, ownRecord(TOOL_DEFAULT_STYLE, type));
100
+ }
92
101
  function specOf(key, field) {
93
102
  const spec = { key, owner: field.owner ?? 'settings', lanes: Object.freeze([...field.lanes]) };
94
103
  if (field.instance)
@@ -695,6 +695,72 @@ export const INDICATOR_COMMON_FIELDS = [
695
695
  // The volumetric size window is a volume in those same units.
696
696
  ['sizeCeil', META_MARKET_BOUND],
697
697
  ['venueChoice', META_VENUE_CHOICE],
698
+ // Sierra parity (2026-10-21): every key absent = today's look. Appended as one block so the row-keys golden names
699
+ // them as one later addition (LATER_SHARED_ROW_KEYS in its spec).
700
+ // TPO look, structure and period keys the settings dialog and the period menu write.
701
+ ['fontFamily', PREFERENCE],
702
+ ['fontWeight', PREFERENCE],
703
+ ['deltaColors', PREFERENCE],
704
+ ['tpoColorEachSession', PREFERENCE],
705
+ ['tpoSessionColors', PREFERENCE],
706
+ ['valueAreaMethod', PREFERENCE],
707
+ ['vaFromVolume', PREFERENCE],
708
+ ['levelLineExtend', PREFERENCE],
709
+ ['priorLevelsEverySession', PREFERENCE],
710
+ // Peaks and valleys (HVN/LVN): TPO and the volume profiles share these keys.
711
+ ['peaksValleys', PREFERENCE],
712
+ ['peaksValleysSensitivity', PREFERENCE],
713
+ ['hvnColor', PREFERENCE],
714
+ ['lvnColor', PREFERENCE],
715
+ ['showIBLines', PREFERENCE],
716
+ ['ibExtensionPercents', PREFERENCE],
717
+ ['ibLineColor', PREFERENCE],
718
+ ['ibExtensionColor', PREFERENCE],
719
+ ['openingRangeMinutes', PREFERENCE],
720
+ ['closingRangeMinutes', PREFERENCE],
721
+ ['showMidpoint', PREFERENCE],
722
+ ['midpointColor', PREFERENCE],
723
+ ['statsItems', PREFERENCE],
724
+ ['statsLastProfileOnly', PREFERENCE],
725
+ ['statsOnHover', PREFERENCE],
726
+ ['splitPeriodsMap', PREFERENCE],
727
+ ['periodLength', PREFERENCE],
728
+ ['ownColumnBesideStandard', PREFERENCE],
729
+ ['hideEveningExceptLatest', PREFERENCE],
730
+ // VRVP / Agg VRVP Last bars and Last days scopes: the bar and trading-day counts (stamped only on rows that use them).
731
+ ['compositeBars', PREFERENCE],
732
+ ['compositeDays', PREFERENCE],
733
+ // SVP / Agg SVP Custom session: the block length ({ count, unit }); `session` carries the derived ms.
734
+ ['customSessionLength', PREFERENCE],
735
+ // Volume profiles: the printed profile stats (profileStatsLabels is derived on every mount and never declared).
736
+ ['profileStats', PREFERENCE],
737
+ ['profileStatsPosition', PREFERENCE],
738
+ // Volume profile level extras (titan profileLevels.ts), the level-line look and the row number format.
739
+ ['showVWAP', PREFERENCE],
740
+ ['vwapColor', PREFERENCE],
741
+ ['showVWAPLabel', PREFERENCE],
742
+ ['levelLineWidth', PREFERENCE],
743
+ ['levelLineStyle', PREFERENCE],
744
+ ['rowText', PREFERENCE],
745
+ // Footprint live animation (the Animate Live Updates switch writes both); absent = titan's on.
746
+ ['liveFlash', PREFERENCE],
747
+ ['liveGrowth', PREFERENCE],
748
+ // Stepped shading: footprint cells and volume-profile bars (heat by % of the POC) share these keys.
749
+ ['cellShading', PREFERENCE],
750
+ ['shadingSteps', PREFERENCE],
751
+ ['shadingThresholds', PREFERENCE],
752
+ ['shadingStepColors', PREFERENCE],
753
+ // Footprint Sierra look and columns layout.
754
+ ['highlightExtremes', PREFERENCE],
755
+ ['highlightMaxColor', PREFERENCE],
756
+ ['highlightMinColor', PREFERENCE],
757
+ ['imbalanceMethod', PREFERENCE],
758
+ ['imbalanceMinVolume', PREFERENCE],
759
+ ['cellFontSize', PREFERENCE],
760
+ ['fullNumbers', PREFERENCE],
761
+ ['showValueAreaBand', PREFERENCE],
762
+ ['candleMarker', PREFERENCE],
763
+ ['footprintColumns', PREFERENCE],
698
764
  ];
699
765
  /**
700
766
  * FEED (live series, docs/features/indicators/feeds.md): the rest of the C4 record beside `address`, `scope` and
@@ -733,6 +799,11 @@ const METRIC_PROFILE_FIELDS = [
733
799
  * generic, and declared for every overlay it would start persisting other natives' engine keys.
734
800
  */
735
801
  const SYMBOL_COMPARISON_FIELDS = [['label', INSTANCE]];
802
+ /** The VRVP own-window scope rows (see INDICATOR_TYPE_FIELDS below). */
803
+ const VISIBLE_RANGE_PROFILE_FIELDS = [
804
+ ['profileWindow', PREFERENCE],
805
+ ['periodMarkers', PREFERENCE],
806
+ ];
736
807
  /**
737
808
  * The fields one indicator type declares beyond INDICATOR_COMMON_FIELDS: a row here adds a key, or replaces the shared
738
809
  * row of the same owner and key.
@@ -747,6 +818,13 @@ export const INDICATOR_TYPE_FIELDS = {
747
818
  * rows.
748
819
  */
749
820
  DELTA_PROFILE: [['profileWindow', PREFERENCE]],
821
+ /**
822
+ * VRVP and Agg VRVP own-window scopes (Recent, Last bars, Last days, Prior period): the window kind and the period
823
+ * markers the scope writes beside `scope`. Scoped like DELTA_PROFILE, because the Developing Session Profile stamps
824
+ * `profileWindow: 'data'` on every mount.
825
+ */
826
+ VISIBLE_RANGE_VOLUME_PROFILE: VISIBLE_RANGE_PROFILE_FIELDS,
827
+ AGGREGATED_VISIBLE_RANGE_VOLUME_PROFILE: VISIBLE_RANGE_PROFILE_FIELDS,
750
828
  OPEN_INTEREST_PROFILE: METRIC_PROFILE_FIELDS,
751
829
  LIQUIDATION_PROFILE: METRIC_PROFILE_FIELDS,
752
830
  SYMBOL_COMPARISON_SCALE: SYMBOL_COMPARISON_FIELDS,
@@ -4,8 +4,12 @@
4
4
  * on its own, so it imports nothing) and writes tool-tables.generated.ts from it and chart-schema TOOLS:
5
5
  *
6
6
  * - TOOL_DEFAULT_STYLE[type]: the registry defaultStyle, then the held extras below with their declared defaults;
7
- * - TOOL_TEMPLATE_KEYS[type]: those keys, then `visibleIntervalsMs` unless the type is interval-bound, never an
8
- * instance key or a cached compute key (`settingsKeysToStrip`).
7
+ * - TOOL_TEMPLATE_KEYS[type]: those keys, then the text of a type whose text is a label (the text rule, textRoleOf),
8
+ * then `visibleIntervalsMs` unless the type is interval-bound, never an instance key or a cached compute key
9
+ * (`settingsKeysToStrip`).
10
+ *
11
+ * The text rule is the hosts' too: a host's text box reads it through toolTextRole (settings-templates/index.ts), so
12
+ * the box and the template tables give every type one answer.
9
13
  *
10
14
  * A rule changes here, then the generator runs (the package build does), and both commit together:
11
15
  * tests/packages/wrun-chart-host/settings-templates/tool-tables.generated.spec.ts regenerates the tables and fails
@@ -15,18 +19,32 @@ export declare const TOOL_TEMPLATE_RULES: {
15
19
  /**
16
20
  * Per-drawing state a template never carries and never writes: lock, hide, layer and name are the drawing's own
17
21
  * (the rule Save as default already followed), and `text` is the drawing's content (TEMPLATES-PLAN decision 6), but
18
- * on a label type a template carries it (`label`).
22
+ * a type whose text is a label (the text rule, `text`) carries it in its template.
19
23
  */
20
24
  readonly instanceKeys: readonly ["isLocked", "isHidden", "zPriority", "name", "text"];
21
25
  /**
22
- * A label a template carries: `key` on every type whose registry style places a label on the drawing (holds
23
- * `placedBy`: the line family and the Rectangle). TradingView parity: a "CALL WALL" template draws its label
24
- * (decision 6 revised 2026-10-21, ticket #248). It is never style: no seed and no Save as default keeps it, and a
25
- * template that holds no label leaves the drawing's own. A text tool's text (Text, Note, Callout) stays its content.
26
+ * The text rule: which drawing types hold a free text (`key`), and what that text is. It is the one rule for every
27
+ * surface: the template tables (the generator) and the settings panel's text box (web
28
+ * src/components/objects/tool-prop-sections.ts supportsLabelText, through toolTextRole) both read it through
29
+ * textRoleOf. Until 2026-10-21 each read a rule of its own (the tables a label position, `textVerticalPosition`; the
30
+ * panel a font size), so a Price Note's or a Signpost's template kept the colour and dropped the text.
31
+ *
32
+ * A type holds a text when its style holds `heldBy` (its engine draws the text at that size) or a list below names
33
+ * it:
34
+ * - `content`: the text IS the drawing (a text tool's words, a note's or a comment's body): the panel shows the box,
35
+ * and a template never carries it (TEMPLATES-PLAN decision 6).
36
+ * - `ignored`: the engine never draws the text (a Price Label paints only its anchored price,
37
+ * PriceLabelTool.renderLabel): no box and no template.
38
+ * - Every other type's text is its label (the line family, the Rectangle, the Price Note, the Signpost): the panel
39
+ * shows the box and a template carries it, as TradingView's do: a "CALL WALL" template draws its label (decision 6
40
+ * revised 2026-10-21, ticket #248). A label is never style: no seed and no Save as default keeps it, and a template
41
+ * that holds no label leaves the drawing's own.
26
42
  */
27
- readonly label: {
43
+ readonly text: {
28
44
  readonly key: "text";
29
- readonly placedBy: "textVerticalPosition";
45
+ readonly heldBy: "fontSize";
46
+ readonly content: readonly ["Text", "AnchoredText", "Note", "AnchoredNote", "Callout", "Comment"];
47
+ readonly ignored: readonly ["PriceLabel"];
30
48
  };
31
49
  /**
32
50
  * Drawings whose legs or captured bars read wrong on another interval (a GhostFeed's legs, a Bar Pattern's bars, a
@@ -67,3 +85,11 @@ export declare const TOOL_TEMPLATE_RULES: {
67
85
  */
68
86
  readonly defaultExcludedTypes: readonly ["Image"];
69
87
  };
88
+ /** What a drawing type's free text is, by the text rule: its label, its content, or a text its engine never draws. */
89
+ export type ToolTextRole = 'label' | 'content' | 'ignored';
90
+ /**
91
+ * The text rule over one drawing type: what its free text is, or undefined when the type holds none. `style` is the
92
+ * type's style as the tables hold it (TOOL_DEFAULT_STYLE[type]: the registry style and the held extras); the generator
93
+ * passes the same style, and a host reads toolTextRole (settings-templates/index.ts), which passes the shipped table.
94
+ */
95
+ export declare function textRoleOf(type: string, style: Readonly<Record<string, unknown>> | undefined): ToolTextRole | undefined;
@@ -4,8 +4,12 @@
4
4
  * on its own, so it imports nothing) and writes tool-tables.generated.ts from it and chart-schema TOOLS:
5
5
  *
6
6
  * - TOOL_DEFAULT_STYLE[type]: the registry defaultStyle, then the held extras below with their declared defaults;
7
- * - TOOL_TEMPLATE_KEYS[type]: those keys, then `visibleIntervalsMs` unless the type is interval-bound, never an
8
- * instance key or a cached compute key (`settingsKeysToStrip`).
7
+ * - TOOL_TEMPLATE_KEYS[type]: those keys, then the text of a type whose text is a label (the text rule, textRoleOf),
8
+ * then `visibleIntervalsMs` unless the type is interval-bound, never an instance key or a cached compute key
9
+ * (`settingsKeysToStrip`).
10
+ *
11
+ * The text rule is the hosts' too: a host's text box reads it through toolTextRole (settings-templates/index.ts), so
12
+ * the box and the template tables give every type one answer.
9
13
  *
10
14
  * A rule changes here, then the generator runs (the package build does), and both commit together:
11
15
  * tests/packages/wrun-chart-host/settings-templates/tool-tables.generated.spec.ts regenerates the tables and fails
@@ -15,16 +19,33 @@ export const TOOL_TEMPLATE_RULES = {
15
19
  /**
16
20
  * Per-drawing state a template never carries and never writes: lock, hide, layer and name are the drawing's own
17
21
  * (the rule Save as default already followed), and `text` is the drawing's content (TEMPLATES-PLAN decision 6), but
18
- * on a label type a template carries it (`label`).
22
+ * a type whose text is a label (the text rule, `text`) carries it in its template.
19
23
  */
20
24
  instanceKeys: ['isLocked', 'isHidden', 'zPriority', 'name', 'text'],
21
25
  /**
22
- * A label a template carries: `key` on every type whose registry style places a label on the drawing (holds
23
- * `placedBy`: the line family and the Rectangle). TradingView parity: a "CALL WALL" template draws its label
24
- * (decision 6 revised 2026-10-21, ticket #248). It is never style: no seed and no Save as default keeps it, and a
25
- * template that holds no label leaves the drawing's own. A text tool's text (Text, Note, Callout) stays its content.
26
+ * The text rule: which drawing types hold a free text (`key`), and what that text is. It is the one rule for every
27
+ * surface: the template tables (the generator) and the settings panel's text box (web
28
+ * src/components/objects/tool-prop-sections.ts supportsLabelText, through toolTextRole) both read it through
29
+ * textRoleOf. Until 2026-10-21 each read a rule of its own (the tables a label position, `textVerticalPosition`; the
30
+ * panel a font size), so a Price Note's or a Signpost's template kept the colour and dropped the text.
31
+ *
32
+ * A type holds a text when its style holds `heldBy` (its engine draws the text at that size) or a list below names
33
+ * it:
34
+ * - `content`: the text IS the drawing (a text tool's words, a note's or a comment's body): the panel shows the box,
35
+ * and a template never carries it (TEMPLATES-PLAN decision 6).
36
+ * - `ignored`: the engine never draws the text (a Price Label paints only its anchored price,
37
+ * PriceLabelTool.renderLabel): no box and no template.
38
+ * - Every other type's text is its label (the line family, the Rectangle, the Price Note, the Signpost): the panel
39
+ * shows the box and a template carries it, as TradingView's do: a "CALL WALL" template draws its label (decision 6
40
+ * revised 2026-10-21, ticket #248). A label is never style: no seed and no Save as default keeps it, and a template
41
+ * that holds no label leaves the drawing's own.
26
42
  */
27
- label: { key: 'text', placedBy: 'textVerticalPosition' },
43
+ text: {
44
+ key: 'text',
45
+ heldBy: 'fontSize',
46
+ content: ['Text', 'AnchoredText', 'Note', 'AnchoredNote', 'Callout', 'Comment'],
47
+ ignored: ['PriceLabel'],
48
+ },
28
49
  /**
29
50
  * Drawings whose legs or captured bars read wrong on another interval (a GhostFeed's legs, a Bar Pattern's bars, a
30
51
  * fixed Gann Square's per-bar price): each keeps the "Show on" intervals it was drawn with, so a template neither
@@ -54,3 +75,16 @@ export const TOOL_TEMPLATE_RULES = {
54
75
  */
55
76
  defaultExcludedTypes: ['Image'],
56
77
  };
78
+ /**
79
+ * The text rule over one drawing type: what its free text is, or undefined when the type holds none. `style` is the
80
+ * type's style as the tables hold it (TOOL_DEFAULT_STYLE[type]: the registry style and the held extras); the generator
81
+ * passes the same style, and a host reads toolTextRole (settings-templates/index.ts), which passes the shipped table.
82
+ */
83
+ export function textRoleOf(type, style) {
84
+ const rule = TOOL_TEMPLATE_RULES.text;
85
+ if (rule.ignored.includes(type))
86
+ return 'ignored';
87
+ if (rule.content.includes(type))
88
+ return 'content';
89
+ return style && Object.hasOwn(style, rule.heldBy) ? 'label' : undefined;
90
+ }
@@ -1264,6 +1264,17 @@ export const TOOL_TEMPLATE_KEYS = {
1264
1264
  'showVAL',
1265
1265
  'valColor',
1266
1266
  'showVALLabel',
1267
+ 'showPOCNaked',
1268
+ 'showVAHNaked',
1269
+ 'showVALNaked',
1270
+ 'cellShading',
1271
+ 'shadingSteps',
1272
+ 'shadingThresholds',
1273
+ 'shadingStepColors',
1274
+ 'profileStats',
1275
+ 'profileStatsPosition',
1276
+ 'levelLineWidth',
1277
+ 'levelLineStyle',
1267
1278
  ],
1268
1279
  FlagMark: ['color', 'visibleIntervalsMs'],
1269
1280
  FlatTopBottom: ['color', 'lineWidth', 'lineStyle', 'fillBackground', 'backgroundOpacity', 'visibleIntervalsMs'],
@@ -1482,7 +1493,7 @@ export const TOOL_TEMPLATE_KEYS = {
1482
1493
  ],
1483
1494
  PositionForecast: ['color', 'lineWidth', 'lineStyle', 'profitColor', 'stopColor', 'visibleIntervalsMs'],
1484
1495
  PriceLabel: ['color', 'fontColor', 'fontSize', 'visibleIntervalsMs'],
1485
- PriceNote: ['color', 'fontColor', 'fontSize', 'visibleIntervalsMs'],
1496
+ PriceNote: ['color', 'fontColor', 'fontSize', 'text', 'visibleIntervalsMs'],
1486
1497
  PriceRange: ['bullishColor', 'bearishColor', 'visibleIntervalsMs'],
1487
1498
  Ray: [
1488
1499
  'color',
@@ -1572,7 +1583,7 @@ export const TOOL_TEMPLATE_KEYS = {
1572
1583
  'lineStyle',
1573
1584
  'visibleIntervalsMs',
1574
1585
  ],
1575
- Signpost: ['color', 'fontColor', 'fontSize', 'visibleIntervalsMs'],
1586
+ Signpost: ['color', 'fontColor', 'fontSize', 'text', 'visibleIntervalsMs'],
1576
1587
  SineLine: ['color', 'lineWidth', 'lineStyle', 'visibleIntervalsMs'],
1577
1588
  Subtle: ['color', 'highlight', 'lineWidth', 'visibleIntervalsMs'],
1578
1589
  Text: [
@@ -0,0 +1,16 @@
1
+ export type SidedCandleUnitProfile = {
2
+ serve: true;
3
+ inverse: false;
4
+ multiplier: 1;
5
+ } | {
6
+ serve: false;
7
+ reason: 'venue' | 'inverse';
8
+ };
9
+ /**
10
+ * The unit profile of the TRANSPORT venue: a UI identity can alias another
11
+ * venue (`BINANCE_FUTURES|BTCUSD_PERP` rides BINANCE_DELIVERY), so the label
12
+ * on the token is resolved the way the request itself is.
13
+ */
14
+ export declare function resolveSidedCandleUnitProfile(exchange: string | null | undefined, symbol: string | null | undefined): SidedCandleUnitProfile;
15
+ /** Whether a market's candle volume is base coins (`resolveSidedCandleUnitProfile` serves it). */
16
+ export declare function candleVolumeIsBaseCoins(exchange: string | null | undefined, symbol: string | null | undefined): boolean;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Which venues' candle volume is base coins: the ONE list, split out of the sided candle lane
3
+ * (src/utility/chart/sided-candles.util.ts re-exports it) so the package reads it too. The sided split converts
4
+ * exactly only on these venues, and the market-scaled size defaults (wrun-market-size-defaults.leaf) read a market's
5
+ * daily base volume off its candles only on them: on any other venue a candle's volume is contracts, and a share of
6
+ * it would be no size in coins.
7
+ */
8
+ import { getExchangeFromSymbol } from '../../helpers/data.helpers.js';
9
+ /**
10
+ * Venues whose raw TRADE_SIDE_AGNOSTIC_AGG `volume` is base coins with an
11
+ * implicit contract multiplier of 1 and linear (non-inverse) settlement, so
12
+ * the returned split is in the same unit the CVD coins lane requests
13
+ * (`coins_value(amount, 1, price, false) = amount`). Contract-denominated
14
+ * venues (OKEX_SWAP, DERIBIT, BITMEX, GATE_IO_FUTURES, the governed CME
15
+ * plane) and inverse settlement (BINANCE_DELIVERY, Bybit inverse symbols)
16
+ * stay on the wire: their conversion needs per-instrument registry fields
17
+ * the frontend does not carry.
18
+ */
19
+ const SIDED_CANDLE_LINEAR_BASE_VENUES = new Set([
20
+ 'BINANCE',
21
+ 'BINANCE_FUTURES',
22
+ 'BINANCE_US',
23
+ 'BYBIT',
24
+ 'BYBIT_SPOT',
25
+ 'COINBASE',
26
+ 'COINBASE_INTERNATIONAL',
27
+ 'COINBASE_PRO',
28
+ 'KRAKEN',
29
+ 'HYPERLIQUID',
30
+ 'HYPERLIQUID_FUTURES',
31
+ 'OKEX',
32
+ 'GATE_IO',
33
+ ]);
34
+ /** Inverse-settled venues: their split is in contracts, converted per instrument by the gateway. */
35
+ const SIDED_CANDLE_INVERSE_VENUES = new Set(['BINANCE_DELIVERY']);
36
+ /** Bybit lists inverse contracts beside linear ones under one venue: only the stable-quoted symbols are linear. */
37
+ function isBybitLinearSymbol(symbol) {
38
+ const upper = symbol.toUpperCase();
39
+ return upper.endsWith('USDT') || upper.endsWith('USDC') || upper.endsWith('PERP');
40
+ }
41
+ /**
42
+ * The unit profile of the TRANSPORT venue: a UI identity can alias another
43
+ * venue (`BINANCE_FUTURES|BTCUSD_PERP` rides BINANCE_DELIVERY), so the label
44
+ * on the token is resolved the way the request itself is.
45
+ */
46
+ export function resolveSidedCandleUnitProfile(exchange, symbol) {
47
+ const label = String(exchange ?? '').toUpperCase();
48
+ const sym = String(symbol ?? '');
49
+ const venue = getExchangeFromSymbol(label, sym).toUpperCase();
50
+ if (SIDED_CANDLE_INVERSE_VENUES.has(venue))
51
+ return { serve: false, reason: 'inverse' };
52
+ if (!SIDED_CANDLE_LINEAR_BASE_VENUES.has(venue))
53
+ return { serve: false, reason: 'venue' };
54
+ if (venue === 'BYBIT' && !isBybitLinearSymbol(sym))
55
+ return { serve: false, reason: 'inverse' };
56
+ return { serve: true, inverse: false, multiplier: 1 };
57
+ }
58
+ /** Whether a market's candle volume is base coins (`resolveSidedCandleUnitProfile` serves it). */
59
+ export function candleVolumeIsBaseCoins(exchange, symbol) {
60
+ return resolveSidedCandleUnitProfile(exchange, symbol).serve;
61
+ }
@@ -3,8 +3,8 @@
3
3
  * docs/features/data/cryptocap-indices.md). The backend prints each series as raw CRYPTO_DOMINANCE points and serves
4
4
  * its candles as CRYPTO_DOMINANCE_AGG on tsdb-gateway v2: value candles with no volume, trades or book behind them.
5
5
  *
6
- * A leaf on purpose, with no imports: the market-kind table (`marketKind.util`) and the ticker hub and the sub-minute
7
- * block (`index-mode.util`) both read this list, and neither may call into the other at module load. Web code asks
6
+ * A leaf on purpose, with no imports: the market-kind table (`marketKind.util`), the ticker hub (`index-mode.util`) and
7
+ * the replay ladder all read it, and none may call into the others at module load. Web code asks
8
8
  * `checkIsCryptoIndex` here, never through `index-mode.util` or `marketKind.util`: over a hundred specs mock those two
9
9
  * with partial factories, and a predicate read through such a mock throws.
10
10
  */
@@ -3,8 +3,8 @@
3
3
  * docs/features/data/cryptocap-indices.md). The backend prints each series as raw CRYPTO_DOMINANCE points and serves
4
4
  * its candles as CRYPTO_DOMINANCE_AGG on tsdb-gateway v2: value candles with no volume, trades or book behind them.
5
5
  *
6
- * A leaf on purpose, with no imports: the market-kind table (`marketKind.util`) and the ticker hub and the sub-minute
7
- * block (`index-mode.util`) both read this list, and neither may call into the other at module load. Web code asks
6
+ * A leaf on purpose, with no imports: the market-kind table (`marketKind.util`), the ticker hub (`index-mode.util`) and
7
+ * the replay ladder all read it, and none may call into the others at module load. Web code asks
8
8
  * `checkIsCryptoIndex` here, never through `index-mode.util` or `marketKind.util`: over a hundred specs mock those two
9
9
  * with partial factories, and a predicate read through such a mock throws.
10
10
  */
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The footprint columns layout (titan P2, `displayMode: 'columns'`): Sierra Chart's Numbers Bars columns, BackQuant's
3
+ * "your own columns". Every bar's cell span splits into 2 to 4 equal columns, drawn left to right in
4
+ * `footprintColumns` order, one kind each:
5
+ *
6
+ * | kind | the column shows |
7
+ * | ------------------ | ---------------------------------------------------------------- |
8
+ * | 'bidAsk' | bid and ask in its two halves, on the cluster cell metric's heat |
9
+ * | 'delta' | delta on a cell in the sign's colour |
10
+ * | 'deltaColored' | delta in the up / down colour, no cell |
11
+ * | 'diagonalDelta' | the ask minus the bid one row below, on a cell |
12
+ * | 'deltaPct' | delta as a share of the row's volume, on a cell |
13
+ * | 'volume' | volume on a cell in the volume colour |
14
+ * | 'buy' / 'sell' | one side's volume on a cell in its colour |
15
+ * | 'volumeBar' | a volume bar and its number |
16
+ * | 'deltaBar' | a delta bar and its number |
17
+ * | 'volumeBarLeading' | a volume bar in the leading side's colour, no number |
18
+ * | 'splitBar' | the sell bar left of the column's centre, the buy bar right |
19
+ *
20
+ * Titan reads the list as written: invalid entries drop, the first four valid ones draw, and fewer than two valid
21
+ * ones draw its default (bid x ask, then delta). Outside the columns display mode titan ignores the list, so a
22
+ * footprint switched to another mode keeps its columns for the next switch back.
23
+ *
24
+ * Moved from web (src/utility/chart/footprint-columns.util.ts, now its shim), content unchanged: web's dialogs and the
25
+ * phone's settings form read the kinds, the presets and the writes from here (settings-templates/footprint-rows.ts).
26
+ */
27
+ export declare const FOOTPRINT_COLUMN_KINDS: readonly ["bidAsk", "delta", "deltaColored", "diagonalDelta", "deltaPct", "volume", "buy", "sell", "volumeBar", "deltaBar", "volumeBarLeading", "splitBar"];
28
+ export type FootprintColumnKind = (typeof FOOTPRINT_COLUMN_KINDS)[number];
29
+ /** A column's pick in the dialog: a kind, or 'off' (columns 3 and 4 only). */
30
+ export type FootprintColumnPick = FootprintColumnKind | 'off';
31
+ /** The display mode that draws the columns. */
32
+ export declare const FOOTPRINT_COLUMNS_DISPLAY_MODE = "columns";
33
+ export declare const FOOTPRINT_COLUMNS_MIN = 2;
34
+ export declare const FOOTPRINT_COLUMNS_MAX = 4;
35
+ /** One-click layouts: a preset writes `footprintColumns` and nothing else, so every column stays editable. */
36
+ export declare const FOOTPRINT_COLUMN_PRESETS: readonly [{
37
+ readonly id: "bidAskDelta";
38
+ readonly columns: readonly ["bidAsk", "delta"];
39
+ }, {
40
+ readonly id: "deltaVolumeBar";
41
+ readonly columns: readonly ["deltaColored", "volume", "volumeBar"];
42
+ }, {
43
+ readonly id: "volumeDeltaBars";
44
+ readonly columns: readonly ["volumeBar", "deltaBar"];
45
+ }, {
46
+ readonly id: "profileBars";
47
+ readonly columns: readonly ["splitBar", "volume"];
48
+ }];
49
+ export type FootprintColumnPresetId = (typeof FOOTPRINT_COLUMN_PRESETS)[number]['id'];
50
+ type ColumnsModel = {
51
+ displayMode?: unknown;
52
+ footprintColumns?: unknown;
53
+ };
54
+ /** Whether the footprint draws the columns layout. */
55
+ export declare function isFootprintColumnsMode(model: unknown): boolean;
56
+ /**
57
+ * A saved `footprintColumns` as titan reads it: its valid kinds in order, the first four. Undefined when fewer than
58
+ * two are valid (titan then draws its default), so only a list titan draws as written is carried and saved.
59
+ */
60
+ export declare function footprintColumnsOf(value: unknown): FootprintColumnKind[] | undefined;
61
+ /** The columns the footprint draws in the columns layout: its own list, else titan's default. */
62
+ export declare function footprintColumnsShown(model: ColumnsModel): FootprintColumnKind[];
63
+ /**
64
+ * The model with column `index` (0 = the left one) set to `pick`. A kind replaces that column, or adds one when the
65
+ * index is past the last column; 'off' removes it and the columns after it move left. A pick that names no kind, or
66
+ * that would leave fewer than two columns, returns the model unchanged: the dialog never saves a list titan would
67
+ * not draw as written.
68
+ */
69
+ export declare function withFootprintColumn<T extends ColumnsModel>(model: T, index: number, pick: FootprintColumnPick): T;
70
+ /** The model with a preset's columns. */
71
+ export declare function withFootprintColumnsPreset<T extends ColumnsModel>(model: T, id: FootprintColumnPresetId): T;
72
+ /** The preset the footprint's columns are (no list of its own reads as titan's default), or null for its own. */
73
+ export declare function footprintColumnsPresetOf(model: ColumnsModel): FootprintColumnPresetId | null;
74
+ export {};