@forgecharts/sdk 1.1.27 → 1.1.29

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 (356) hide show
  1. package/dist/__tests__/backwardCompatibility.test.d.ts +14 -0
  2. package/dist/__tests__/backwardCompatibility.test.d.ts.map +1 -0
  3. package/dist/__tests__/candleInvariant.test.d.ts +20 -0
  4. package/dist/__tests__/candleInvariant.test.d.ts.map +1 -0
  5. package/dist/__tests__/public-api-surface.d.ts +13 -0
  6. package/dist/__tests__/public-api-surface.d.ts.map +1 -0
  7. package/dist/__tests__/timeframeBoundary.test.d.ts +17 -0
  8. package/dist/__tests__/timeframeBoundary.test.d.ts.map +1 -0
  9. package/dist/api/DrawingManager.d.ts +20 -0
  10. package/dist/api/DrawingManager.d.ts.map +1 -0
  11. package/dist/api/EventBus.d.ts +19 -0
  12. package/dist/api/EventBus.d.ts.map +1 -0
  13. package/dist/api/IndicatorDAG.d.ts +85 -0
  14. package/dist/api/IndicatorDAG.d.ts.map +1 -0
  15. package/dist/api/IndicatorRegistry.d.ts +22 -0
  16. package/dist/api/IndicatorRegistry.d.ts.map +1 -0
  17. package/dist/api/LayoutManager.d.ts +30 -0
  18. package/dist/api/LayoutManager.d.ts.map +1 -0
  19. package/dist/api/PaneManager.d.ts +42 -0
  20. package/dist/api/PaneManager.d.ts.map +1 -0
  21. package/dist/api/ReferenceAPI.d.ts +78 -0
  22. package/dist/api/ReferenceAPI.d.ts.map +1 -0
  23. package/dist/api/TChart.d.ts +345 -0
  24. package/dist/api/TChart.d.ts.map +1 -0
  25. package/{src/api/createChart.ts → dist/api/createChart.d.ts} +2 -7
  26. package/dist/api/createChart.d.ts.map +1 -0
  27. package/dist/api/drawing tools/fib gann menu/fibRetracement.d.ts +4 -0
  28. package/dist/api/drawing tools/fib gann menu/fibRetracement.d.ts.map +1 -0
  29. package/dist/api/drawing tools/lines menu/crossLine.d.ts +4 -0
  30. package/dist/api/drawing tools/lines menu/crossLine.d.ts.map +1 -0
  31. package/dist/api/drawing tools/lines menu/disjointChannel.d.ts +17 -0
  32. package/dist/api/drawing tools/lines menu/disjointChannel.d.ts.map +1 -0
  33. package/dist/api/drawing tools/lines menu/extendedLine.d.ts +4 -0
  34. package/dist/api/drawing tools/lines menu/extendedLine.d.ts.map +1 -0
  35. package/dist/api/drawing tools/lines menu/flatTopBottom.d.ts +4 -0
  36. package/dist/api/drawing tools/lines menu/flatTopBottom.d.ts.map +1 -0
  37. package/dist/api/drawing tools/lines menu/horizontal.d.ts +4 -0
  38. package/dist/api/drawing tools/lines menu/horizontal.d.ts.map +1 -0
  39. package/dist/api/drawing tools/lines menu/horizontalRay.d.ts +4 -0
  40. package/dist/api/drawing tools/lines menu/horizontalRay.d.ts.map +1 -0
  41. package/dist/api/drawing tools/lines menu/infoLine.d.ts +4 -0
  42. package/dist/api/drawing tools/lines menu/infoLine.d.ts.map +1 -0
  43. package/dist/api/drawing tools/lines menu/insidePitchfork.d.ts +4 -0
  44. package/dist/api/drawing tools/lines menu/insidePitchfork.d.ts.map +1 -0
  45. package/dist/api/drawing tools/lines menu/modifiedSchiffPitchfork.d.ts +4 -0
  46. package/dist/api/drawing tools/lines menu/modifiedSchiffPitchfork.d.ts.map +1 -0
  47. package/dist/api/drawing tools/lines menu/parallelChannel.d.ts +4 -0
  48. package/dist/api/drawing tools/lines menu/parallelChannel.d.ts.map +1 -0
  49. package/dist/api/drawing tools/lines menu/pitchfork.d.ts +4 -0
  50. package/dist/api/drawing tools/lines menu/pitchfork.d.ts.map +1 -0
  51. package/dist/api/drawing tools/lines menu/ray.d.ts +4 -0
  52. package/dist/api/drawing tools/lines menu/ray.d.ts.map +1 -0
  53. package/dist/api/drawing tools/lines menu/regressionTrend.d.ts +4 -0
  54. package/dist/api/drawing tools/lines menu/regressionTrend.d.ts.map +1 -0
  55. package/dist/api/drawing tools/lines menu/schiffPitchfork.d.ts +4 -0
  56. package/dist/api/drawing tools/lines menu/schiffPitchfork.d.ts.map +1 -0
  57. package/dist/api/drawing tools/lines menu/trendAngle.d.ts +4 -0
  58. package/dist/api/drawing tools/lines menu/trendAngle.d.ts.map +1 -0
  59. package/dist/api/drawing tools/lines menu/trendline.d.ts +4 -0
  60. package/dist/api/drawing tools/lines menu/trendline.d.ts.map +1 -0
  61. package/dist/api/drawing tools/lines menu/vertical.d.ts +4 -0
  62. package/dist/api/drawing tools/lines menu/vertical.d.ts.map +1 -0
  63. package/{src/api/drawing tools/pointers menu/crosshair.ts → dist/api/drawing tools/pointers menu/crosshair.d.ts } +8 -9
  64. package/dist/api/drawing tools/pointers menu/crosshair.d.ts.map +1 -0
  65. package/dist/api/drawing tools/pointers menu/cursor.d.ts +15 -0
  66. package/dist/api/drawing tools/pointers menu/cursor.d.ts.map +1 -0
  67. package/{src/api/drawing tools/pointers menu/demonstration.ts → dist/api/drawing tools/pointers menu/demonstration.d.ts } +12 -17
  68. package/dist/api/drawing tools/pointers menu/demonstration.d.ts.map +1 -0
  69. package/{src/api/drawing tools/pointers menu/dot.ts → dist/api/drawing tools/pointers menu/dot.d.ts } +10 -13
  70. package/dist/api/drawing tools/pointers menu/dot.d.ts.map +1 -0
  71. package/dist/api/drawing tools/shapes menu/rectangle.d.ts +4 -0
  72. package/dist/api/drawing tools/shapes menu/rectangle.d.ts.map +1 -0
  73. package/dist/api/drawing tools/shapes menu/text.d.ts +4 -0
  74. package/dist/api/drawing tools/shapes menu/text.d.ts.map +1 -0
  75. package/dist/api/drawingUtils.d.ts +22 -0
  76. package/dist/api/drawingUtils.d.ts.map +1 -0
  77. package/dist/core/CanvasLayer.d.ts +26 -0
  78. package/dist/core/CanvasLayer.d.ts.map +1 -0
  79. package/dist/core/Chart.d.ts +164 -0
  80. package/dist/core/Chart.d.ts.map +1 -0
  81. package/dist/core/CoordTransform.d.ts +168 -0
  82. package/dist/core/CoordTransform.d.ts.map +1 -0
  83. package/dist/core/Crosshair.d.ts +30 -0
  84. package/dist/core/Crosshair.d.ts.map +1 -0
  85. package/dist/core/IndicatorEngine.d.ts +51 -0
  86. package/dist/core/IndicatorEngine.d.ts.map +1 -0
  87. package/dist/core/InteractionManager.d.ts +197 -0
  88. package/dist/core/InteractionManager.d.ts.map +1 -0
  89. package/dist/core/PriceScale.d.ts +27 -0
  90. package/dist/core/PriceScale.d.ts.map +1 -0
  91. package/dist/core/Series.d.ts +40 -0
  92. package/dist/core/Series.d.ts.map +1 -0
  93. package/dist/core/TimeScale.d.ts +43 -0
  94. package/dist/core/TimeScale.d.ts.map +1 -0
  95. package/dist/datafeed/DatafeedConnector.d.ts +89 -0
  96. package/dist/datafeed/DatafeedConnector.d.ts.map +1 -0
  97. package/dist/engine/CandleEngine.d.ts +207 -0
  98. package/dist/engine/CandleEngine.d.ts.map +1 -0
  99. package/dist/engine/__tests__/CandleEngine.test.d.ts +2 -0
  100. package/dist/engine/__tests__/CandleEngine.test.d.ts.map +1 -0
  101. package/dist/engine/candleInvariants.d.ts +66 -0
  102. package/dist/engine/candleInvariants.d.ts.map +1 -0
  103. package/{src/engine/mergeUtils.ts → dist/engine/mergeUtils.d.ts} +15 -52
  104. package/dist/engine/mergeUtils.d.ts.map +1 -0
  105. package/dist/engine/timeframeUtils.d.ts +80 -0
  106. package/dist/engine/timeframeUtils.d.ts.map +1 -0
  107. package/dist/index.d.ts +40 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +8101 -0
  110. package/dist/index.js.map +1 -0
  111. package/{src/internal.ts → dist/internal.d.ts} +1 -13
  112. package/dist/internal.d.ts.map +1 -0
  113. package/dist/internal.js +8852 -0
  114. package/dist/internal.js.map +1 -0
  115. package/dist/licensing/ChartRuntimeResolver.d.ts +233 -0
  116. package/dist/licensing/ChartRuntimeResolver.d.ts.map +1 -0
  117. package/dist/licensing/LicenseManager.d.ts +55 -0
  118. package/dist/licensing/LicenseManager.d.ts.map +1 -0
  119. package/dist/licensing/__tests__/ChartRuntimeResolver.test.d.ts +13 -0
  120. package/dist/licensing/__tests__/ChartRuntimeResolver.test.d.ts.map +1 -0
  121. package/dist/licensing/__tests__/LicenseManager.test.d.ts +12 -0
  122. package/dist/licensing/__tests__/LicenseManager.test.d.ts.map +1 -0
  123. package/dist/licensing/licenseTypes.d.ts +18 -0
  124. package/dist/licensing/licenseTypes.d.ts.map +1 -0
  125. package/dist/pine/PineCompiler.d.ts +35 -0
  126. package/dist/pine/PineCompiler.d.ts.map +1 -0
  127. package/dist/pine/diagnostics.d.ts +20 -0
  128. package/dist/pine/diagnostics.d.ts.map +1 -0
  129. package/{src/pine/index.ts → dist/pine/index.d.ts} +4 -3
  130. package/dist/pine/index.d.ts.map +1 -0
  131. package/dist/pine/pine-ast.d.ts +142 -0
  132. package/dist/pine/pine-ast.d.ts.map +1 -0
  133. package/dist/pine/pine-lexer.d.ts +41 -0
  134. package/dist/pine/pine-lexer.d.ts.map +1 -0
  135. package/dist/pine/pine-parser.d.ts +51 -0
  136. package/dist/pine/pine-parser.d.ts.map +1 -0
  137. package/dist/pine/pine-transpiler.d.ts +33 -0
  138. package/dist/pine/pine-transpiler.d.ts.map +1 -0
  139. package/dist/pixi/LayerName.d.ts +18 -0
  140. package/dist/pixi/LayerName.d.ts.map +1 -0
  141. package/dist/pixi/PixiCandlestickRenderer.d.ts +23 -0
  142. package/dist/pixi/PixiCandlestickRenderer.d.ts.map +1 -0
  143. package/dist/pixi/PixiChart.d.ts +72 -0
  144. package/dist/pixi/PixiChart.d.ts.map +1 -0
  145. package/dist/pixi/PixiCrosshairRenderer.d.ts +29 -0
  146. package/dist/pixi/PixiCrosshairRenderer.d.ts.map +1 -0
  147. package/dist/pixi/PixiDrawingRenderer.d.ts +17 -0
  148. package/dist/pixi/PixiDrawingRenderer.d.ts.map +1 -0
  149. package/dist/pixi/PixiGridRenderer.d.ts +22 -0
  150. package/dist/pixi/PixiGridRenderer.d.ts.map +1 -0
  151. package/dist/pixi/PixiLayerManager.d.ts +56 -0
  152. package/dist/pixi/PixiLayerManager.d.ts.map +1 -0
  153. package/dist/react/canvas/ChartCanvas.d.ts +85 -0
  154. package/dist/react/canvas/ChartCanvas.d.ts.map +1 -0
  155. package/dist/react/canvas/ChartContextMenu.d.ts +18 -0
  156. package/dist/react/canvas/ChartContextMenu.d.ts.map +1 -0
  157. package/dist/react/canvas/ChartSettingsDialog.d.ts +25 -0
  158. package/dist/react/canvas/ChartSettingsDialog.d.ts.map +1 -0
  159. package/dist/react/canvas/IndicatorLabel.d.ts +21 -0
  160. package/dist/react/canvas/IndicatorLabel.d.ts.map +1 -0
  161. package/dist/react/canvas/IndicatorPane.d.ts +32 -0
  162. package/dist/react/canvas/IndicatorPane.d.ts.map +1 -0
  163. package/dist/react/canvas/PointerOverlay.d.ts +23 -0
  164. package/dist/react/canvas/PointerOverlay.d.ts.map +1 -0
  165. package/dist/react/canvas/toolbars/LeftToolbar.d.ts +19 -0
  166. package/dist/react/canvas/toolbars/LeftToolbar.d.ts.map +1 -0
  167. package/dist/react/hooks/useChartCapabilities.d.ts +21 -0
  168. package/dist/react/hooks/useChartCapabilities.d.ts.map +1 -0
  169. package/{src/react/index.ts → dist/react/index.d.ts} +2 -23
  170. package/dist/react/index.d.ts.map +1 -0
  171. package/dist/react/index.js +11559 -0
  172. package/dist/react/index.js.map +1 -0
  173. package/{src/react/internal.ts → dist/react/internal.d.ts} +2 -26
  174. package/dist/react/internal.d.ts.map +1 -0
  175. package/dist/react/internal.js +12148 -0
  176. package/dist/react/internal.js.map +1 -0
  177. package/dist/react/shell/ManagedAppShell.d.ts +91 -0
  178. package/dist/react/shell/ManagedAppShell.d.ts.map +1 -0
  179. package/dist/react/trading/TradingBridge.d.ts +86 -0
  180. package/dist/react/trading/TradingBridge.d.ts.map +1 -0
  181. package/dist/react/workspace/ChartWorkspace.d.ts +73 -0
  182. package/dist/react/workspace/ChartWorkspace.d.ts.map +1 -0
  183. package/dist/react/workspace/FloatingPanel.d.ts +18 -0
  184. package/dist/react/workspace/FloatingPanel.d.ts.map +1 -0
  185. package/dist/react/workspace/IndicatorsDialog.d.ts +8 -0
  186. package/dist/react/workspace/IndicatorsDialog.d.ts.map +1 -0
  187. package/dist/react/workspace/LayoutMenu.d.ts +33 -0
  188. package/dist/react/workspace/LayoutMenu.d.ts.map +1 -0
  189. package/dist/react/workspace/SymbolSearchDialog.d.ts +10 -0
  190. package/dist/react/workspace/SymbolSearchDialog.d.ts.map +1 -0
  191. package/dist/react/workspace/TabBar.d.ts +17 -0
  192. package/dist/react/workspace/TabBar.d.ts.map +1 -0
  193. package/dist/react/workspace/toolbars/BottomToolbar.d.ts +19 -0
  194. package/dist/react/workspace/toolbars/BottomToolbar.d.ts.map +1 -0
  195. package/dist/react/workspace/toolbars/RightToolbar.d.ts +8 -0
  196. package/dist/react/workspace/toolbars/RightToolbar.d.ts.map +1 -0
  197. package/dist/react/workspace/toolbars/TopToolbar.d.ts +41 -0
  198. package/dist/react/workspace/toolbars/TopToolbar.d.ts.map +1 -0
  199. package/dist/renderers/CandlestickRenderer.d.ts +13 -0
  200. package/dist/renderers/CandlestickRenderer.d.ts.map +1 -0
  201. package/dist/renderers/HistogramRenderer.d.ts +11 -0
  202. package/dist/renderers/HistogramRenderer.d.ts.map +1 -0
  203. package/dist/renderers/LineRenderer.d.ts +12 -0
  204. package/dist/renderers/LineRenderer.d.ts.map +1 -0
  205. package/dist/theme/colors.d.ts +4 -0
  206. package/dist/theme/colors.d.ts.map +1 -0
  207. package/dist/tools/barDivergenceCheck.d.ts +120 -0
  208. package/dist/tools/barDivergenceCheck.d.ts.map +1 -0
  209. package/dist/trading/TradingOverlayStore.d.ts +86 -0
  210. package/dist/trading/TradingOverlayStore.d.ts.map +1 -0
  211. package/dist/trading/UnmanagedIngestion.d.ts +91 -0
  212. package/dist/trading/UnmanagedIngestion.d.ts.map +1 -0
  213. package/dist/trading/__tests__/ManagedTradingController.test.d.ts +18 -0
  214. package/dist/trading/__tests__/ManagedTradingController.test.d.ts.map +1 -0
  215. package/dist/trading/__tests__/TradingOverlayStore.test.d.ts +16 -0
  216. package/dist/trading/__tests__/TradingOverlayStore.test.d.ts.map +1 -0
  217. package/dist/trading/__tests__/UnmanagedIngestion.test.d.ts +16 -0
  218. package/dist/trading/__tests__/UnmanagedIngestion.test.d.ts.map +1 -0
  219. package/dist/trading/managed/ManagedTradingController.d.ts +110 -0
  220. package/dist/trading/managed/ManagedTradingController.d.ts.map +1 -0
  221. package/dist/trading/managed/managedCapabilities.d.ts +45 -0
  222. package/dist/trading/managed/managedCapabilities.d.ts.map +1 -0
  223. package/dist/trading/managed/managedTypes.d.ts +122 -0
  224. package/dist/trading/managed/managedTypes.d.ts.map +1 -0
  225. package/dist/trading/tradingTypes.d.ts +89 -0
  226. package/dist/trading/tradingTypes.d.ts.map +1 -0
  227. package/dist/tscript/TScriptIndicator.d.ts +41 -0
  228. package/dist/tscript/TScriptIndicator.d.ts.map +1 -0
  229. package/dist/tscript/ast.d.ts +89 -0
  230. package/dist/tscript/ast.d.ts.map +1 -0
  231. package/dist/tscript/lexer.d.ts +36 -0
  232. package/dist/tscript/lexer.d.ts.map +1 -0
  233. package/dist/tscript/parser.d.ts +50 -0
  234. package/dist/tscript/parser.d.ts.map +1 -0
  235. package/dist/tscript/runtime.d.ts +123 -0
  236. package/dist/tscript/runtime.d.ts.map +1 -0
  237. package/dist/tscript/series.d.ts +49 -0
  238. package/dist/tscript/series.d.ts.map +1 -0
  239. package/dist/types/IChart.d.ts +48 -0
  240. package/dist/types/IChart.d.ts.map +1 -0
  241. package/{src/types/IRenderer.ts → dist/types/IRenderer.d.ts} +2 -8
  242. package/dist/types/IRenderer.d.ts.map +1 -0
  243. package/dist/types/ISeries.d.ts +26 -0
  244. package/dist/types/ISeries.d.ts.map +1 -0
  245. package/package.json +5 -1
  246. package/src/__tests__/backwardCompatibility.test.ts +0 -191
  247. package/src/__tests__/candleInvariant.test.ts +0 -500
  248. package/src/__tests__/public-api-surface.ts +0 -76
  249. package/src/__tests__/timeframeBoundary.test.ts +0 -583
  250. package/src/api/DrawingManager.ts +0 -188
  251. package/src/api/EventBus.ts +0 -53
  252. package/src/api/IndicatorDAG.ts +0 -389
  253. package/src/api/IndicatorRegistry.ts +0 -47
  254. package/src/api/LayoutManager.ts +0 -72
  255. package/src/api/PaneManager.ts +0 -129
  256. package/src/api/ReferenceAPI.ts +0 -195
  257. package/src/api/TChart.ts +0 -881
  258. package/src/api/drawing tools/fib gann menu/fibRetracement.ts +0 -27
  259. package/src/api/drawing tools/lines menu/crossLine.ts +0 -21
  260. package/src/api/drawing tools/lines menu/disjointChannel.ts +0 -74
  261. package/src/api/drawing tools/lines menu/extendedLine.ts +0 -22
  262. package/src/api/drawing tools/lines menu/flatTopBottom.ts +0 -45
  263. package/src/api/drawing tools/lines menu/horizontal.ts +0 -24
  264. package/src/api/drawing tools/lines menu/horizontalRay.ts +0 -25
  265. package/src/api/drawing tools/lines menu/infoLine.ts +0 -127
  266. package/src/api/drawing tools/lines menu/insidePitchfork.ts +0 -21
  267. package/src/api/drawing tools/lines menu/modifiedSchiffPitchfork.ts +0 -18
  268. package/src/api/drawing tools/lines menu/parallelChannel.ts +0 -47
  269. package/src/api/drawing tools/lines menu/pitchfork.ts +0 -15
  270. package/src/api/drawing tools/lines menu/ray.ts +0 -28
  271. package/src/api/drawing tools/lines menu/regressionTrend.ts +0 -157
  272. package/src/api/drawing tools/lines menu/schiffPitchfork.ts +0 -18
  273. package/src/api/drawing tools/lines menu/trendAngle.ts +0 -64
  274. package/src/api/drawing tools/lines menu/trendline.ts +0 -16
  275. package/src/api/drawing tools/lines menu/vertical.ts +0 -16
  276. package/src/api/drawing tools/pointers menu/cursor.ts +0 -16
  277. package/src/api/drawing tools/shapes menu/rectangle.ts +0 -24
  278. package/src/api/drawing tools/shapes menu/text.ts +0 -30
  279. package/src/api/drawingUtils.ts +0 -82
  280. package/src/core/CanvasLayer.ts +0 -77
  281. package/src/core/Chart.ts +0 -917
  282. package/src/core/CoordTransform.ts +0 -282
  283. package/src/core/Crosshair.ts +0 -207
  284. package/src/core/IndicatorEngine.ts +0 -216
  285. package/src/core/InteractionManager.ts +0 -899
  286. package/src/core/PriceScale.ts +0 -133
  287. package/src/core/Series.ts +0 -132
  288. package/src/core/TimeScale.ts +0 -175
  289. package/src/datafeed/DatafeedConnector.ts +0 -300
  290. package/src/engine/CandleEngine.ts +0 -458
  291. package/src/engine/__tests__/CandleEngine.test.ts +0 -402
  292. package/src/engine/candleInvariants.ts +0 -172
  293. package/src/engine/timeframeUtils.ts +0 -118
  294. package/src/index.ts +0 -190
  295. package/src/licensing/ChartRuntimeResolver.ts +0 -380
  296. package/src/licensing/LicenseManager.ts +0 -131
  297. package/src/licensing/__tests__/ChartRuntimeResolver.test.ts +0 -207
  298. package/src/licensing/__tests__/LicenseManager.test.ts +0 -180
  299. package/src/licensing/licenseTypes.ts +0 -19
  300. package/src/pine/PineCompiler.ts +0 -68
  301. package/src/pine/diagnostics.ts +0 -30
  302. package/src/pine/pine-ast.ts +0 -163
  303. package/src/pine/pine-lexer.ts +0 -265
  304. package/src/pine/pine-parser.ts +0 -439
  305. package/src/pine/pine-transpiler.ts +0 -301
  306. package/src/pixi/LayerName.ts +0 -35
  307. package/src/pixi/PixiCandlestickRenderer.ts +0 -125
  308. package/src/pixi/PixiChart.ts +0 -425
  309. package/src/pixi/PixiCrosshairRenderer.ts +0 -134
  310. package/src/pixi/PixiDrawingRenderer.ts +0 -121
  311. package/src/pixi/PixiGridRenderer.ts +0 -136
  312. package/src/pixi/PixiLayerManager.ts +0 -102
  313. package/src/react/canvas/ChartCanvas.tsx +0 -984
  314. package/src/react/canvas/ChartContextMenu.tsx +0 -60
  315. package/src/react/canvas/ChartSettingsDialog.tsx +0 -133
  316. package/src/react/canvas/IndicatorLabel.tsx +0 -347
  317. package/src/react/canvas/IndicatorPane.tsx +0 -503
  318. package/src/react/canvas/PointerOverlay.tsx +0 -126
  319. package/src/react/canvas/toolbars/LeftToolbar.tsx +0 -1096
  320. package/src/react/hooks/useChartCapabilities.ts +0 -76
  321. package/src/react/shell/ManagedAppShell.tsx +0 -699
  322. package/src/react/trading/TradingBridge.ts +0 -156
  323. package/src/react/workspace/ChartWorkspace.tsx +0 -228
  324. package/src/react/workspace/FloatingPanel.tsx +0 -131
  325. package/src/react/workspace/IndicatorsDialog.tsx +0 -246
  326. package/src/react/workspace/LayoutMenu.tsx +0 -345
  327. package/src/react/workspace/SymbolSearchDialog.tsx +0 -377
  328. package/src/react/workspace/TabBar.tsx +0 -87
  329. package/src/react/workspace/toolbars/BottomToolbar.tsx +0 -372
  330. package/src/react/workspace/toolbars/RightToolbar.tsx +0 -46
  331. package/src/react/workspace/toolbars/TopToolbar.tsx +0 -431
  332. package/src/renderers/CandlestickRenderer.ts +0 -130
  333. package/src/renderers/HistogramRenderer.ts +0 -63
  334. package/src/renderers/LineRenderer.ts +0 -77
  335. package/src/theme/colors.ts +0 -21
  336. package/src/tools/barDivergenceCheck.ts +0 -305
  337. package/src/trading/TradingOverlayStore.ts +0 -161
  338. package/src/trading/UnmanagedIngestion.ts +0 -156
  339. package/src/trading/__tests__/ManagedTradingController.test.ts +0 -338
  340. package/src/trading/__tests__/TradingOverlayStore.test.ts +0 -323
  341. package/src/trading/__tests__/UnmanagedIngestion.test.ts +0 -205
  342. package/src/trading/managed/ManagedTradingController.ts +0 -292
  343. package/src/trading/managed/managedCapabilities.ts +0 -98
  344. package/src/trading/managed/managedTypes.ts +0 -151
  345. package/src/trading/tradingTypes.ts +0 -135
  346. package/src/tscript/TScriptIndicator.ts +0 -54
  347. package/src/tscript/ast.ts +0 -105
  348. package/src/tscript/lexer.ts +0 -190
  349. package/src/tscript/parser.ts +0 -334
  350. package/src/tscript/runtime.ts +0 -525
  351. package/src/tscript/series.ts +0 -84
  352. package/src/types/IChart.ts +0 -56
  353. package/src/types/ISeries.ts +0 -30
  354. package/tsconfig.json +0 -23
  355. package/tsup.config.ts +0 -16
  356. package/vitest.config.ts +0 -25
@@ -1,163 +0,0 @@
1
- /**
2
- * Pine Script AST types — subset understood by the ForgeCharts Pine compat layer.
3
- *
4
- * Supported Pine v5 constructs:
5
- * indicator(title, overlay?, ...)
6
- * input(defval, title?, ...) / input.int() / input.float() / input.bool() / input.source()
7
- * ta.sma() ta.ema() ta.wma() ta.rma() ta.rsi() ta.macd()
8
- * ta.stdev() ta.highest() ta.lowest() ta.change() ta.mom() ta.atr()
9
- * ta.crossover() ta.crossunder() ta.barssince()
10
- * math.abs() math.max() math.min() math.round() math.floor() math.ceil()
11
- * math.sqrt() math.log() math.pow() math.sign()
12
- * plot() plotshape()
13
- * nz() na()
14
- * if / else blocks
15
- * var declarations
16
- * ternary a ? b : c
17
- */
18
-
19
- // ─── Locations ────────────────────────────────────────────────────────────────
20
-
21
- export type Loc = { line: number; col: number };
22
-
23
- // ─── Literals ─────────────────────────────────────────────────────────────────
24
-
25
- export type PineNumberLit = { kind: 'PineNumberLit'; value: number; loc: Loc };
26
- export type PineStringLit = { kind: 'PineStringLit'; value: string; loc: Loc };
27
- export type PineBoolLit = { kind: 'PineBoolLit'; value: boolean; loc: Loc };
28
- export type PineColorLit = { kind: 'PineColorLit'; value: string; loc: Loc }; // e.g. color.red
29
- export type PineNa = { kind: 'PineNa'; loc: Loc };
30
-
31
- // ─── Expressions ──────────────────────────────────────────────────────────────
32
-
33
- export type PineIdent = {
34
- kind: 'PineIdent';
35
- name: string;
36
- loc: Loc;
37
- };
38
-
39
- /** Namespaced call: ta.sma(src, len) or math.abs(x) */
40
- export type PineNsCall = {
41
- kind: 'PineNsCall';
42
- namespace: string; // 'ta' | 'math' | 'input' | 'color' | etc.
43
- fn: string;
44
- args: PineExpr[];
45
- namedArgs: Map<string, PineExpr>;
46
- loc: Loc;
47
- };
48
-
49
- /** Plain function call: sma(src, len), indicator(...), plot(...) */
50
- export type PineCall = {
51
- kind: 'PineCall';
52
- fn: string;
53
- args: PineExpr[];
54
- namedArgs: Map<string, PineExpr>;
55
- loc: Loc;
56
- };
57
-
58
- export type PineIndex = {
59
- kind: 'PineIndex';
60
- series: PineExpr;
61
- index: PineExpr;
62
- loc: Loc;
63
- };
64
-
65
- export type PineBinary = {
66
- kind: 'PineBinary';
67
- op: '+' | '-' | '*' | '/' | '%' | '<' | '>' | '<=' | '>=' | '==' | '!=' | 'and' | 'or';
68
- left: PineExpr;
69
- right: PineExpr;
70
- loc: Loc;
71
- };
72
-
73
- export type PineUnary = {
74
- kind: 'PineUnary';
75
- op: '-' | 'not';
76
- operand: PineExpr;
77
- loc: Loc;
78
- };
79
-
80
- export type PineTernary = {
81
- kind: 'PineTernary';
82
- condition: PineExpr;
83
- consequent: PineExpr;
84
- alternate: PineExpr;
85
- loc: Loc;
86
- };
87
-
88
- /** Member access: color.red, bar_index, etc. — resolved at transpile time */
89
- export type PineMember = {
90
- kind: 'PineMember';
91
- object: string;
92
- prop: string;
93
- loc: Loc;
94
- };
95
-
96
- export type PineExpr =
97
- | PineNumberLit
98
- | PineStringLit
99
- | PineBoolLit
100
- | PineColorLit
101
- | PineNa
102
- | PineIdent
103
- | PineNsCall
104
- | PineCall
105
- | PineIndex
106
- | PineBinary
107
- | PineUnary
108
- | PineTernary
109
- | PineMember;
110
-
111
- // ─── Statements ───────────────────────────────────────────────────────────────
112
-
113
- export type PineIndicatorDecl = {
114
- kind: 'PineIndicatorDecl';
115
- args: PineExpr[];
116
- namedArgs: Map<string, PineExpr>;
117
- loc: Loc;
118
- };
119
-
120
- /** var / varip declaration */
121
- export type PineVarDecl = {
122
- kind: 'PineVarDecl';
123
- modifier: 'var' | 'varip';
124
- name: string;
125
- typeHint?: string;
126
- value: PineExpr;
127
- loc: Loc;
128
- };
129
-
130
- export type PineAssign = {
131
- kind: 'PineAssign';
132
- name: string;
133
- op: '=' | ':=';
134
- value: PineExpr;
135
- loc: Loc;
136
- };
137
-
138
- export type PineExprStmt = {
139
- kind: 'PineExprStmt';
140
- expr: PineExpr;
141
- loc: Loc;
142
- };
143
-
144
- export type PineIf = {
145
- kind: 'PineIf';
146
- condition: PineExpr;
147
- then: PineStmt[];
148
- else_: PineStmt[];
149
- loc: Loc;
150
- };
151
-
152
- export type PineStmt =
153
- | PineIndicatorDecl
154
- | PineVarDecl
155
- | PineAssign
156
- | PineExprStmt
157
- | PineIf;
158
-
159
- export type PineProgram = {
160
- kind: 'PineProgram';
161
- version: number; // extracted from //@version=5
162
- stmts: PineStmt[];
163
- };
@@ -1,265 +0,0 @@
1
- /**
2
- * Pine Script Lexer — tokenises a Pine v5 source string.
3
- *
4
- * Differences vs TScript lexer:
5
- * - `//@version=N` comment is parsed for the version number
6
- * - `color.red`, `ta.sma`, `math.abs` — namespace.member chains
7
- * - `:=` reassignment operator
8
- * - Indentation-based block structure (INDENT / DEDENT tokens)
9
- * - `var` / `varip` keywords
10
- * - `=>` (function body arrow, for single-line user functions — recognised
11
- * but not fully transpiled; emits an diagnostic)
12
- */
13
-
14
- export type PineTok =
15
- | 'NUMBER' | 'STRING' | 'BOOL' | 'COLOR'
16
- | 'IDENT'
17
- | 'PLUS' | 'MINUS' | 'STAR' | 'SLASH' | 'PERCENT'
18
- | 'LT' | 'GT' | 'LTE' | 'GTE' | 'EQEQ' | 'NEQ'
19
- | 'QMARK' | 'COLON' | 'ARROW' // ?: =>
20
- | 'ASSIGN' | 'REASSIGN' // = :=
21
- | 'DOT'
22
- | 'LPAREN' | 'RPAREN' | 'LBRACKET' | 'RBRACKET'
23
- | 'COMMA'
24
- | 'INDENT' | 'DEDENT' | 'NEWLINE'
25
- | 'EOF';
26
-
27
- export type PineToken = {
28
- kind: PineTok;
29
- value: string;
30
- line: number;
31
- col: number;
32
- };
33
-
34
- export class PineLexer {
35
- private _src: string;
36
- private _pos: number = 0;
37
- private _line: number = 1;
38
- private _col: number = 1;
39
-
40
- /** Version extracted from `//@version=N` */
41
- version = 5;
42
-
43
- constructor(src: string) {
44
- this._src = src.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
45
- }
46
-
47
- tokenize(): PineToken[] {
48
- // First pass: raw tokens (with raw NEWLINEs and spaces preserved)
49
- const raw = this._rawTokenize();
50
- // Second pass: inject INDENT / DEDENT for indented blocks
51
- return this._injectIndents(raw);
52
- }
53
-
54
- // ─── Raw tokenisation ────────────────────────────────────────────────────────
55
-
56
- private _rawTokenize(): PineToken[] {
57
- const tokens: PineToken[] = [];
58
-
59
- while (this._pos < this._src.length) {
60
- const ch = this._src[this._pos]!;
61
-
62
- // Handle newline
63
- if (ch === '\n') {
64
- tokens.push(this._make('NEWLINE', '\n'));
65
- this._pos++; this._line++; this._col = 1;
66
- continue;
67
- }
68
-
69
- // Skip horizontal whitespace (not newlines — needed for indent tracking)
70
- if (ch === ' ' || ch === '\t') {
71
- this._pos++; this._col++;
72
- continue;
73
- }
74
-
75
- // Line comment
76
- if (ch === '/' && this._peek(1) === '/') {
77
- // Check for version annotation
78
- const commentStart = this._pos;
79
- while (this._pos < this._src.length && this._src[this._pos] !== '\n') {
80
- this._pos++; this._col++;
81
- }
82
- const comment = this._src.slice(commentStart, this._pos);
83
- const vMatch = comment.match(/\/\/@version\s*=\s*(\d+)/);
84
- if (vMatch) this.version = parseInt(vMatch[1]!, 10);
85
- continue;
86
- }
87
-
88
- // Numbers
89
- if ((ch >= '0' && ch <= '9') || (ch === '.' && this._isDigit(this._peek(1)))) {
90
- tokens.push(this._readNumber());
91
- continue;
92
- }
93
-
94
- // Strings
95
- if (ch === '"' || ch === "'") {
96
- tokens.push(this._readString(ch));
97
- continue;
98
- }
99
-
100
- // Identifiers / keywords
101
- if (this._isAlpha(ch)) {
102
- const tok = this._readIdent();
103
- tokens.push(tok);
104
- continue;
105
- }
106
-
107
- // Two-char operators
108
- const two = this._src.slice(this._pos, this._pos + 2);
109
- if (two === '<=') { tokens.push(this._make('LTE', two)); this._adv(2); continue; }
110
- if (two === '>=') { tokens.push(this._make('GTE', two)); this._adv(2); continue; }
111
- if (two === '==') { tokens.push(this._make('EQEQ', two)); this._adv(2); continue; }
112
- if (two === '!=') { tokens.push(this._make('NEQ', two)); this._adv(2); continue; }
113
- if (two === ':=') { tokens.push(this._make('REASSIGN', two)); this._adv(2); continue; }
114
- if (two === '=>') { tokens.push(this._make('ARROW', two)); this._adv(2); continue; }
115
-
116
- // Single-char operators
117
- const singleOps: Record<string, PineTok> = {
118
- '+': 'PLUS', '-': 'MINUS', '*': 'STAR', '/': 'SLASH', '%': 'PERCENT',
119
- '<': 'LT', '>': 'GT',
120
- '?': 'QMARK', ':': 'COLON',
121
- '(': 'LPAREN', ')': 'RPAREN', '[': 'LBRACKET', ']': 'RBRACKET',
122
- ',': 'COMMA', '.': 'DOT',
123
- '=': 'ASSIGN',
124
- };
125
- if (ch in singleOps) {
126
- tokens.push(this._make(singleOps[ch]!, ch));
127
- this._pos++; this._col++;
128
- continue;
129
- }
130
-
131
- throw new SyntaxError(`[Pine] Unexpected character '${ch}' at ${this._line}:${this._col}`);
132
- }
133
-
134
- tokens.push(this._make('EOF', ''));
135
- return tokens;
136
- }
137
-
138
- // ─── Indent/Dedent injection ─────────────────────────────────────────────────
139
-
140
- private _injectIndents(raw: PineToken[]): PineToken[] {
141
- const out: PineToken[] = [];
142
- const indentStack: number[] = [0];
143
- let i = 0;
144
-
145
- while (i < raw.length) {
146
- const tok = raw[i]!;
147
-
148
- if (tok.kind !== 'NEWLINE') {
149
- out.push(tok);
150
- i++;
151
- continue;
152
- }
153
-
154
- // After a NEWLINE, measure the indentation of the next non-empty line
155
- out.push(tok); // keep the NEWLINE token
156
- i++;
157
-
158
- // Count leading spaces of the next real line
159
- let spaces = 0;
160
- let j = i;
161
- while (j < raw.length && (raw[j]!.kind === 'NEWLINE')) {
162
- // blank line — skip
163
- out.push(raw[j]!);
164
- j++;
165
- }
166
- i = j;
167
-
168
- if (i >= raw.length || raw[i]!.kind === 'EOF') break;
169
-
170
- // Compute indent width from the column of the next token
171
- const nextTok = raw[i]!;
172
- spaces = nextTok.col - 1; // col is 1-based
173
-
174
- const currentIndent = indentStack[indentStack.length - 1]!;
175
-
176
- if (spaces > currentIndent) {
177
- indentStack.push(spaces);
178
- out.push({ kind: 'INDENT', value: '', line: nextTok.line, col: 1 });
179
- } else {
180
- while (spaces < indentStack[indentStack.length - 1]!) {
181
- indentStack.pop();
182
- out.push({ kind: 'DEDENT', value: '', line: nextTok.line, col: 1 });
183
- }
184
- }
185
- }
186
-
187
- // Close any remaining open indents
188
- while (indentStack.length > 1) {
189
- indentStack.pop();
190
- out.push({ kind: 'DEDENT', value: '', line: 0, col: 0 });
191
- }
192
-
193
- out.push({ kind: 'EOF', value: '', line: this._line, col: this._col });
194
- return out;
195
- }
196
-
197
- // ─── Helpers ─────────────────────────────────────────────────────────────────
198
-
199
- private _make(kind: PineTok, value: string): PineToken {
200
- return { kind, value, line: this._line, col: this._col };
201
- }
202
-
203
- private _peek(offset: number): string {
204
- return this._src[this._pos + offset] ?? '';
205
- }
206
-
207
- private _adv(n = 1): void {
208
- this._pos += n;
209
- this._col += n;
210
- }
211
-
212
- private _isDigit(ch: string): boolean {
213
- return ch >= '0' && ch <= '9';
214
- }
215
-
216
- private _isAlpha(ch: string): boolean {
217
- return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch === '_';
218
- }
219
-
220
- private _isAlphaNum(ch: string): boolean {
221
- return this._isAlpha(ch) || this._isDigit(ch);
222
- }
223
-
224
- private _readNumber(): PineToken {
225
- const start = this._pos;
226
- const startCol = this._col;
227
- while (this._pos < this._src.length) {
228
- const c = this._src[this._pos]!;
229
- if (this._isDigit(c) || c === '.') { this._pos++; this._col++; }
230
- else break;
231
- }
232
- return { kind: 'NUMBER', value: this._src.slice(start, this._pos), line: this._line, col: startCol };
233
- }
234
-
235
- private _readString(quote: string): PineToken {
236
- const startCol = this._col;
237
- this._pos++; this._col++;
238
- let result = '';
239
- while (this._pos < this._src.length && this._src[this._pos] !== quote) {
240
- if (this._src[this._pos] === '\\') {
241
- this._pos++; this._col++;
242
- const esc = this._src[this._pos] ?? '';
243
- result += esc === 'n' ? '\n' : esc === 't' ? '\t' : esc;
244
- } else {
245
- result += this._src[this._pos];
246
- }
247
- this._pos++; this._col++;
248
- }
249
- this._pos++; this._col++;
250
- return { kind: 'STRING', value: result, line: this._line, col: startCol };
251
- }
252
-
253
- private _readIdent(): PineToken {
254
- const start = this._pos;
255
- const startCol = this._col;
256
- while (this._pos < this._src.length && this._isAlphaNum(this._src[this._pos]!)) {
257
- this._pos++; this._col++;
258
- }
259
- const name = this._src.slice(start, this._pos);
260
- if (name === 'true' || name === 'false') {
261
- return { kind: 'BOOL', value: name, line: this._line, col: startCol };
262
- }
263
- return { kind: 'IDENT', value: name, line: this._line, col: startCol };
264
- }
265
- }