@vninvestcharts/widget 0.0.0-stage → 0.2.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 (676) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE.md +83 -0
  3. package/README.md +851 -3
  4. package/dist/AlertsModal-WKEUDTUZ.js +2 -0
  5. package/dist/ConnectedTradingPanel-KWJMIKTN.css +2 -0
  6. package/dist/ConnectedTradingPanel-XDKMOQY5.js +2 -0
  7. package/dist/PineEditorPanel-AUXB4FD3.js +2 -0
  8. package/dist/PineEditorPanel-V6YN2OTU.css +2 -0
  9. package/dist/RightSidebarDockHost-6FPZ6EKV.css +2 -0
  10. package/dist/RightSidebarDockHost-OBFXKSIY.js +2 -0
  11. package/dist/StrategyTesterPanel-6IUTS2P4.js +2 -0
  12. package/dist/StrategyTesterPanel-LEWEUMXP.css +2 -0
  13. package/dist/VolumeProfileWorker-UREKVPUE.js +189 -0
  14. package/dist/adapters/index.cjs +2532 -0
  15. package/dist/adapters/index.d.mts +673 -0
  16. package/dist/adapters/index.d.ts +673 -0
  17. package/dist/adapters/index.js +2521 -0
  18. package/dist/adapters/index.umd.js +2535 -0
  19. package/dist/chunk-5T6DGB3V.js +2 -0
  20. package/dist/chunk-66JBEGR3.js +4 -0
  21. package/dist/chunk-6D7DVBIK.js +2 -0
  22. package/dist/chunk-76E7CKUD.js +2 -0
  23. package/dist/chunk-AKWVXRQ6.js +2 -0
  24. package/dist/chunk-FHHSTO6Z.js +2 -0
  25. package/dist/chunk-HPL723JA.js +2 -0
  26. package/dist/chunk-NVGTF73S.js +2 -0
  27. package/dist/chunk-PNIB4OM3.js +2 -0
  28. package/dist/chunk-UKJ5AKQX.js +595 -0
  29. package/dist/chunk-UYJTX3SD.js +2 -0
  30. package/dist/combined.css +3068 -0
  31. package/dist/css-modules-manifest.json +297 -0
  32. package/dist/dist-Y6PZ2RN3.js +12 -0
  33. package/dist/drawing/index.cjs +53 -0
  34. package/dist/drawing/index.d.mts +2 -0
  35. package/dist/drawing/index.d.ts +2 -0
  36. package/dist/drawing/index.js +2 -0
  37. package/dist/drawing/index.umd.js +54 -0
  38. package/dist/dts/drawing-shim.d.ts +3 -0
  39. package/dist/dts/index.d.ts +31 -0
  40. package/dist/dts/lib/Chart.d.ts +31 -0
  41. package/dist/dts/lib/ChartContext.d.ts +10 -0
  42. package/dist/dts/lib/EventCapture.d.ts +3 -0
  43. package/dist/dts/lib/GenericChartComponent.d.ts +5 -0
  44. package/dist/dts/lib/GenericComponent.d.ts +124 -0
  45. package/dist/dts/lib/StockChartContext.d.ts +53 -0
  46. package/dist/dts/lib/adapters/BaseAdapter.d.ts +25 -0
  47. package/dist/dts/lib/adapters/BinanceAdapter.d.ts +51 -0
  48. package/dist/dts/lib/adapters/CSVAdapter.d.ts +17 -0
  49. package/dist/dts/lib/adapters/ContinuousContractAdapter.d.ts +63 -0
  50. package/dist/dts/lib/adapters/ContinuousContractTypes.d.ts +154 -0
  51. package/dist/dts/lib/adapters/DBAdapter.d.ts +16 -0
  52. package/dist/dts/lib/adapters/DataAdapter.d.ts +136 -0
  53. package/dist/dts/lib/adapters/DjangoVnstockAdapter.d.ts +15 -0
  54. package/dist/dts/lib/adapters/LocalCacheAdapter.d.ts +18 -0
  55. package/dist/dts/lib/adapters/MockAdapter.d.ts +22 -0
  56. package/dist/dts/lib/adapters/RESTAdapter.d.ts +16 -0
  57. package/dist/dts/lib/adapters/StockDataAdapter.d.ts +1 -0
  58. package/dist/dts/lib/adapters/UDFDataAdapter.d.ts +29 -0
  59. package/dist/dts/lib/adapters/VNStocksAdapter.d.ts +8 -0
  60. package/dist/dts/lib/adapters/WSAdapter.d.ts +30 -0
  61. package/dist/dts/lib/adapters/gapFixture.d.ts +71 -0
  62. package/dist/dts/lib/adapters/index.d.ts +15 -0
  63. package/dist/dts/lib/adapters/rollAlgorithms.d.ts +68 -0
  64. package/dist/dts/lib/advisory/AdvisoryPanel.d.ts +5 -0
  65. package/dist/dts/lib/alerts/AlertEvaluator.d.ts +5 -0
  66. package/dist/dts/lib/alerts/AlertManager.d.ts +123 -0
  67. package/dist/dts/lib/alerts/types.d.ts +58 -0
  68. package/dist/dts/lib/cache/cacheDebug.d.ts +3 -0
  69. package/dist/dts/lib/calendars/ExchangeCalendar.d.ts +23 -0
  70. package/dist/dts/lib/calendars/calendarRegistry.d.ts +10 -0
  71. package/dist/dts/lib/calendars/index.d.ts +3 -0
  72. package/dist/dts/lib/core/ChartPane.d.ts +8 -0
  73. package/dist/dts/lib/core/ChartSplitter.d.ts +70 -0
  74. package/dist/dts/lib/core/ChartTerminal.d.ts +12 -0
  75. package/dist/dts/lib/core/ErrorBoundary.d.ts +17 -0
  76. package/dist/dts/lib/core/IndicatorLegend.d.ts +47 -0
  77. package/dist/dts/lib/core/PaneHeader.d.ts +24 -0
  78. package/dist/dts/lib/core/PaneLabel.d.ts +8 -0
  79. package/dist/dts/lib/core/PaneSplitter.d.ts +9 -0
  80. package/dist/dts/lib/core/SeriesPicker.d.ts +10 -0
  81. package/dist/dts/lib/core/calculators/alignBarsByDate.d.ts +38 -0
  82. package/dist/dts/lib/core/calculators/buildIndicatorComputationPlan.d.ts +16 -0
  83. package/dist/dts/lib/core/calculators/calcCVDApprox.d.ts +6 -0
  84. package/dist/dts/lib/core/calculators/calcStrengthElder.d.ts +7 -0
  85. package/dist/dts/lib/core/calculators/calcWhaleApprox.d.ts +6 -0
  86. package/dist/dts/lib/core/calculators/computationHelpers.d.ts +12 -0
  87. package/dist/dts/lib/core/calculators/computeIndicatorComputationResult.d.ts +3 -0
  88. package/dist/dts/lib/core/calculators/computeMarketStructure.d.ts +8 -0
  89. package/dist/dts/lib/core/calculators/computeMomentum.d.ts +22 -0
  90. package/dist/dts/lib/core/calculators/computeMovingAverage.d.ts +15 -0
  91. package/dist/dts/lib/core/calculators/computeProfile.d.ts +9 -0
  92. package/dist/dts/lib/core/calculators/computeTrend.d.ts +10 -0
  93. package/dist/dts/lib/core/calculators/computeVolatility.d.ts +14 -0
  94. package/dist/dts/lib/core/calculators/computeVolumeFlow.d.ts +19 -0
  95. package/dist/dts/lib/core/calculators/enrichData.d.ts +7 -0
  96. package/dist/dts/lib/core/calculators/enrichDataWithCanonicalStore.d.ts +33 -0
  97. package/dist/dts/lib/core/calculators/exoticChartData.d.ts +140 -0
  98. package/dist/dts/lib/core/calculators/fixtures/mockData.d.ts +2 -0
  99. package/dist/dts/lib/core/calculators/indicatorComputation.d.ts +27 -0
  100. package/dist/dts/lib/core/calculators/indicatorComputationTypes.d.ts +249 -0
  101. package/dist/dts/lib/core/calculators/materializeIndicatorValues.d.ts +3 -0
  102. package/dist/dts/lib/core/calculators/normalizePrices.d.ts +36 -0
  103. package/dist/dts/lib/core/calculators/resolveCalculationOrder.d.ts +17 -0
  104. package/dist/dts/lib/core/calculators/types.d.ts +269 -0
  105. package/dist/dts/lib/core/canvas/ChartRenderContext.d.ts +14 -0
  106. package/dist/dts/lib/core/canvas/OverlayCanvas.d.ts +19 -0
  107. package/dist/dts/lib/core/context/ChartSyncContext.d.ts +21 -0
  108. package/dist/dts/lib/core/context/DataContext.d.ts +15 -0
  109. package/dist/dts/lib/core/context/PaneManagerContext.d.ts +10 -0
  110. package/dist/dts/lib/core/hooks/paneSizingHelpers.d.ts +13 -0
  111. package/dist/dts/lib/core/hooks/useCanvasResize.d.ts +8 -0
  112. package/dist/dts/lib/core/hooks/useChartTheme.d.ts +12 -0
  113. package/dist/dts/lib/core/hooks/useDynamicPanes.d.ts +155 -0
  114. package/dist/dts/lib/core/hooks/useIndicatorSets.d.ts +20 -0
  115. package/dist/dts/lib/core/hooks/usePaneManager.d.ts +39 -0
  116. package/dist/dts/lib/core/hooks/usePaneSizes.d.ts +52 -0
  117. package/dist/dts/lib/core/index.d.ts +41 -0
  118. package/dist/dts/lib/core/paneScaleSlotDomains.d.ts +3 -0
  119. package/dist/dts/lib/core/registry/SeriesRegistry.d.ts +22 -0
  120. package/dist/dts/lib/core/registry/filterPanesBySeriesTier.d.ts +43 -0
  121. package/dist/dts/lib/core/registry/marketStructure.d.ts +7 -0
  122. package/dist/dts/lib/core/registry/momentum.d.ts +20 -0
  123. package/dist/dts/lib/core/registry/movingAverage.d.ts +14 -0
  124. package/dist/dts/lib/core/registry/priceChartTypes.d.ts +16 -0
  125. package/dist/dts/lib/core/registry/profile.d.ts +8 -0
  126. package/dist/dts/lib/core/registry/registerAll.d.ts +1 -0
  127. package/dist/dts/lib/core/registry/registerPhaseOne.d.ts +3 -0
  128. package/dist/dts/lib/core/registry/registryCore.d.ts +77 -0
  129. package/dist/dts/lib/core/registry/trend.d.ts +11 -0
  130. package/dist/dts/lib/core/registry/volatility.d.ts +11 -0
  131. package/dist/dts/lib/core/registry/volumeFlow.d.ts +20 -0
  132. package/dist/dts/lib/core/replay/BarReplayController.d.ts +62 -0
  133. package/dist/dts/lib/core/replay/ReplayEventBus.d.ts +68 -0
  134. package/dist/dts/lib/core/replay/ReplayFillSimulator.d.ts +33 -0
  135. package/dist/dts/lib/core/replay/ReplayOrderBook.d.ts +24 -0
  136. package/dist/dts/lib/core/replay/ReplayPositionManager.d.ts +30 -0
  137. package/dist/dts/lib/core/replay/ReplaySessionAnalytics.d.ts +31 -0
  138. package/dist/dts/lib/core/replay/createReplayTradeMarkerPrimitives.d.ts +7 -0
  139. package/dist/dts/lib/core/replay/pnlUtils.d.ts +2 -0
  140. package/dist/dts/lib/core/replay/replayBrokerAdapters.d.ts +51 -0
  141. package/dist/dts/lib/core/replay/replayTradingTypes.d.ts +61 -0
  142. package/dist/dts/lib/core/scales/computeScales.d.ts +8 -0
  143. package/dist/dts/lib/core/seriesValueResolver.d.ts +27 -0
  144. package/dist/dts/lib/core/sets/builtins.d.ts +2 -0
  145. package/dist/dts/lib/core/sets/indicatorSetCodec.d.ts +15 -0
  146. package/dist/dts/lib/core/trading/AnalyticsEngine.d.ts +56 -0
  147. package/dist/dts/lib/core/trading/BrokerAPI.d.ts +40 -0
  148. package/dist/dts/lib/core/trading/ExecutionSimulator.d.ts +53 -0
  149. package/dist/dts/lib/core/trading/FillSettlement.d.ts +38 -0
  150. package/dist/dts/lib/core/trading/MarketDataPort.d.ts +41 -0
  151. package/dist/dts/lib/core/trading/MarketRules.d.ts +58 -0
  152. package/dist/dts/lib/core/trading/OrderManagementSystem.d.ts +57 -0
  153. package/dist/dts/lib/core/trading/PositionManager.d.ts +79 -0
  154. package/dist/dts/lib/core/trading/RiskEngine.d.ts +40 -0
  155. package/dist/dts/lib/core/trading/SettlementCalendar.d.ts +10 -0
  156. package/dist/dts/lib/core/trading/VirtualBrokerEngine.d.ts +92 -0
  157. package/dist/dts/lib/core/trading/orderMargin.d.ts +3 -0
  158. package/dist/dts/lib/core/trading/storage/InMemoryStorageAdapter.d.ts +10 -0
  159. package/dist/dts/lib/core/trading/storage/TradingStorage.d.ts +34 -0
  160. package/dist/dts/lib/core/trading/types.d.ts +99 -0
  161. package/dist/dts/lib/core/types/chart.d.ts +21 -0
  162. package/dist/dts/lib/core/types/indicator-catalog.d.ts +38 -0
  163. package/dist/dts/lib/core/types/indicator-set.d.ts +19 -0
  164. package/dist/dts/lib/core/types/pane-descriptor.d.ts +46 -0
  165. package/dist/dts/lib/core/types/seriesComponents.d.ts +15 -0
  166. package/dist/dts/lib/credentials/credentialStore.d.ts +93 -0
  167. package/dist/dts/lib/helper/SaveChartAsImage.d.ts +90 -0
  168. package/dist/dts/lib/indicator/defaultOptionsForAppearance.d.ts +105 -0
  169. package/dist/dts/lib/indicators/builtin/MTFWrapper.d.ts +3 -0
  170. package/dist/dts/lib/indicators/builtin/VolumeProfileWorker.d.ts +19 -0
  171. package/dist/dts/lib/indicators/builtin/ac.d.ts +4 -0
  172. package/dist/dts/lib/indicators/builtin/alligator.d.ts +5 -0
  173. package/dist/dts/lib/indicators/builtin/anchoredVwap.d.ts +5 -0
  174. package/dist/dts/lib/indicators/builtin/ao.d.ts +4 -0
  175. package/dist/dts/lib/indicators/builtin/bbi.d.ts +10 -0
  176. package/dist/dts/lib/indicators/builtin/bias.d.ts +4 -0
  177. package/dist/dts/lib/indicators/builtin/bollinger.d.ts +9 -0
  178. package/dist/dts/lib/indicators/builtin/brar.d.ts +4 -0
  179. package/dist/dts/lib/indicators/builtin/cci.d.ts +4 -0
  180. package/dist/dts/lib/indicators/builtin/chaikinOscillator.d.ts +14 -0
  181. package/dist/dts/lib/indicators/builtin/chaikinVol.d.ts +4 -0
  182. package/dist/dts/lib/indicators/builtin/ci.d.ts +4 -0
  183. package/dist/dts/lib/indicators/builtin/cmf.d.ts +4 -0
  184. package/dist/dts/lib/indicators/builtin/cr.d.ts +4 -0
  185. package/dist/dts/lib/indicators/builtin/cvd.d.ts +4 -0
  186. package/dist/dts/lib/indicators/builtin/deltaProfile.d.ts +5 -0
  187. package/dist/dts/lib/indicators/builtin/dema.d.ts +4 -0
  188. package/dist/dts/lib/indicators/builtin/dma.d.ts +4 -0
  189. package/dist/dts/lib/indicators/builtin/dmi.d.ts +4 -0
  190. package/dist/dts/lib/indicators/builtin/donchian.d.ts +5 -0
  191. package/dist/dts/lib/indicators/builtin/ema.d.ts +4 -0
  192. package/dist/dts/lib/indicators/builtin/emv.d.ts +4 -0
  193. package/dist/dts/lib/indicators/builtin/footprint.d.ts +5 -0
  194. package/dist/dts/lib/indicators/builtin/fractals.d.ts +5 -0
  195. package/dist/dts/lib/indicators/builtin/gator.d.ts +5 -0
  196. package/dist/dts/lib/indicators/builtin/hma.d.ts +4 -0
  197. package/dist/dts/lib/indicators/builtin/hv.d.ts +4 -0
  198. package/dist/dts/lib/indicators/builtin/ichimoku.d.ts +5 -0
  199. package/dist/dts/lib/indicators/builtin/kdj.d.ts +4 -0
  200. package/dist/dts/lib/indicators/builtin/keltner.d.ts +5 -0
  201. package/dist/dts/lib/indicators/builtin/ma.d.ts +10 -0
  202. package/dist/dts/lib/indicators/builtin/maRibbon.d.ts +5 -0
  203. package/dist/dts/lib/indicators/builtin/macd.d.ts +9 -0
  204. package/dist/dts/lib/indicators/builtin/marketProfile.d.ts +5 -0
  205. package/dist/dts/lib/indicators/builtin/mfi.d.ts +4 -0
  206. package/dist/dts/lib/indicators/builtin/mtm.d.ts +4 -0
  207. package/dist/dts/lib/indicators/builtin/obv.d.ts +10 -0
  208. package/dist/dts/lib/indicators/builtin/pivotHighLow.d.ts +5 -0
  209. package/dist/dts/lib/indicators/builtin/pivotStandard.d.ts +5 -0
  210. package/dist/dts/lib/indicators/builtin/psy.d.ts +4 -0
  211. package/dist/dts/lib/indicators/builtin/pvt.d.ts +4 -0
  212. package/dist/dts/lib/indicators/builtin/roc.d.ts +4 -0
  213. package/dist/dts/lib/indicators/builtin/rsi.d.ts +4 -0
  214. package/dist/dts/lib/indicators/builtin/sar.d.ts +10 -0
  215. package/dist/dts/lib/indicators/builtin/sma.d.ts +4 -0
  216. package/dist/dts/lib/indicators/builtin/smfi.d.ts +8 -0
  217. package/dist/dts/lib/indicators/builtin/stdDev.d.ts +4 -0
  218. package/dist/dts/lib/indicators/builtin/strengthRelative.d.ts +7 -0
  219. package/dist/dts/lib/indicators/builtin/supertrend.d.ts +5 -0
  220. package/dist/dts/lib/indicators/builtin/tema.d.ts +4 -0
  221. package/dist/dts/lib/indicators/builtin/trix.d.ts +4 -0
  222. package/dist/dts/lib/indicators/builtin/volOsc.d.ts +4 -0
  223. package/dist/dts/lib/indicators/builtin/volume.d.ts +4 -0
  224. package/dist/dts/lib/indicators/builtin/volumeProfile.d.ts +8 -0
  225. package/dist/dts/lib/indicators/builtin/vr.d.ts +10 -0
  226. package/dist/dts/lib/indicators/builtin/vwap.d.ts +5 -0
  227. package/dist/dts/lib/indicators/builtin/vwma.d.ts +4 -0
  228. package/dist/dts/lib/indicators/builtin/wma.d.ts +4 -0
  229. package/dist/dts/lib/indicators/builtin/wr.d.ts +10 -0
  230. package/dist/dts/lib/indicators/builtin/wyckoffWave.d.ts +15 -0
  231. package/dist/dts/lib/indicators/index.d.ts +63 -0
  232. package/dist/dts/lib/indicators/indicatorValueShapes.d.ts +15 -0
  233. package/dist/dts/lib/indicators/outputKeys.d.ts +50 -0
  234. package/dist/dts/lib/indicators/overlays/CVDIndicator.d.ts +26 -0
  235. package/dist/dts/lib/indicators/overlays/DarkFlowBadge.d.ts +19 -0
  236. package/dist/dts/lib/indicators/overlays/ExternalCVDOverlay.d.ts +15 -0
  237. package/dist/dts/lib/indicators/overlays/WhaleBubbleOverlay.d.ts +14 -0
  238. package/dist/dts/lib/indicators/overlays/WhaleMarketBubbleOverlay.d.ts +27 -0
  239. package/dist/dts/lib/indicators/overlays/whaleDetector.d.ts +66 -0
  240. package/dist/dts/lib/indicators/registry.d.ts +6 -0
  241. package/dist/dts/lib/indicators/types.d.ts +5 -0
  242. package/dist/dts/lib/indicators/utils.d.ts +259 -0
  243. package/dist/dts/lib/pinescript/PineCompiler.d.ts +34 -0
  244. package/dist/dts/lib/pinescript/ast.d.ts +73 -0
  245. package/dist/dts/lib/pinescript/compile.d.ts +40 -0
  246. package/dist/dts/lib/pinescript/grammar.d.ts +12 -0
  247. package/dist/dts/lib/pinescript/pine.worker.d.ts +1 -0
  248. package/dist/dts/lib/pinescript/pineBlocks.d.ts +54 -0
  249. package/dist/dts/lib/pinescript/pineBuiltins.d.ts +47 -0
  250. package/dist/dts/lib/pinescript/pineEnv.d.ts +46 -0
  251. package/dist/dts/lib/pinescript/pineMath.d.ts +13 -0
  252. package/dist/dts/lib/pinescript/pineParse.d.ts +25 -0
  253. package/dist/dts/lib/pinescript/pineStrings.d.ts +50 -0
  254. package/dist/dts/lib/pinescript/runtime.d.ts +5 -0
  255. package/dist/dts/lib/pinescript/scriptRegistry.d.ts +40 -0
  256. package/dist/dts/lib/pinescript/series-value.d.ts +64 -0
  257. package/dist/dts/lib/pinescript/vnscript-completion.d.ts +1 -0
  258. package/dist/dts/lib/pinescript/vnscript-grammar.d.ts +19 -0
  259. package/dist/dts/lib/scale/discontinuousTimeScaleProvider.d.ts +3 -0
  260. package/dist/dts/lib/scale/financeDiscontinuousScale.d.ts +15 -0
  261. package/dist/dts/lib/scale/index.d.ts +1 -0
  262. package/dist/dts/lib/scale/levels.d.ts +12 -0
  263. package/dist/dts/lib/series/AlternatingFillAreaSeries.d.ts +13 -0
  264. package/dist/dts/lib/series/AreaOnlySeries.d.ts +10 -0
  265. package/dist/dts/lib/series/AreaSeries.d.ts +30 -0
  266. package/dist/dts/lib/series/BarSeries.d.ts +40 -0
  267. package/dist/dts/lib/series/BollingerSeries.d.ts +11 -0
  268. package/dist/dts/lib/series/CandlestickSeries.d.ts +56 -0
  269. package/dist/dts/lib/series/CircleMarker.d.ts +28 -0
  270. package/dist/dts/lib/series/ElderRaySeries.d.ts +14 -0
  271. package/dist/dts/lib/series/FootprintSeries.d.ts +21 -0
  272. package/dist/dts/lib/series/GroupedBarSeries.d.ts +9 -0
  273. package/dist/dts/lib/series/HTFOverlaySeries.d.ts +32 -0
  274. package/dist/dts/lib/series/HistogramSeries.d.ts +51 -0
  275. package/dist/dts/lib/series/KagiSeries.d.ts +9 -0
  276. package/dist/dts/lib/series/LineBreakSeries.d.ts +28 -0
  277. package/dist/dts/lib/series/LineSeries.d.ts +54 -0
  278. package/dist/dts/lib/series/MACDSeries.d.ts +28 -0
  279. package/dist/dts/lib/series/MarketProfileSeries.d.ts +18 -0
  280. package/dist/dts/lib/series/OHLCSeries.d.ts +9 -0
  281. package/dist/dts/lib/series/OverlayBarSeries.d.ts +9 -0
  282. package/dist/dts/lib/series/PointAndFigureSeries.d.ts +45 -0
  283. package/dist/dts/lib/series/RSISeries.d.ts +38 -0
  284. package/dist/dts/lib/series/RenkoSeries.d.ts +9 -0
  285. package/dist/dts/lib/series/SARSeries.d.ts +10 -0
  286. package/dist/dts/lib/series/SVGComponent.d.ts +5 -0
  287. package/dist/dts/lib/series/ScatterSeries.d.ts +9 -0
  288. package/dist/dts/lib/series/SquareMarker.d.ts +28 -0
  289. package/dist/dts/lib/series/StackedBarSeries.d.ts +19 -0
  290. package/dist/dts/lib/series/StochasticSeries.d.ts +9 -0
  291. package/dist/dts/lib/series/StraightLine.d.ts +18 -0
  292. package/dist/dts/lib/series/TriangleMarker.d.ts +30 -0
  293. package/dist/dts/lib/series/VolumeProfileSeries.d.ts +9 -0
  294. package/dist/dts/lib/series/index.d.ts +28 -0
  295. package/dist/dts/lib/strategy/BrokerSimulator.d.ts +11 -0
  296. package/dist/dts/lib/strategy/types.d.ts +35 -0
  297. package/dist/dts/lib/tape/TapePanel.d.ts +5 -0
  298. package/dist/dts/lib/types/adapter.d.ts +1 -0
  299. package/dist/dts/lib/types/index.d.ts +5 -0
  300. package/dist/dts/lib/types/indicator.d.ts +11 -0
  301. package/dist/dts/lib/types/ohlcv.d.ts +1 -0
  302. package/dist/dts/lib/types/pane.d.ts +23 -0
  303. package/dist/dts/lib/types/runtime.d.ts +11 -0
  304. package/dist/dts/lib/types/vninvest.d.ts +320 -0
  305. package/dist/dts/lib/types.d.ts +45 -0
  306. package/dist/dts/lib/utils/ChartDataUtil.d.ts +26 -0
  307. package/dist/dts/lib/utils/PureComponent.d.ts +5 -0
  308. package/dist/dts/lib/utils/accumulatingWindow.d.ts +1 -0
  309. package/dist/dts/lib/utils/axisPriceFormat.d.ts +6 -0
  310. package/dist/dts/lib/utils/barWidth.d.ts +14 -0
  311. package/dist/dts/lib/utils/identity.d.ts +1 -0
  312. package/dist/dts/lib/utils/index.d.ts +70 -0
  313. package/dist/dts/lib/utils/logger.d.ts +28 -0
  314. package/dist/dts/lib/utils/mappedSlidingWindow.d.ts +1 -0
  315. package/dist/dts/lib/utils/merge.d.ts +6 -0
  316. package/dist/dts/lib/utils/noop.d.ts +1 -0
  317. package/dist/dts/lib/utils/rebind.d.ts +1 -0
  318. package/dist/dts/lib/utils/shallowEqual.d.ts +1 -0
  319. package/dist/dts/lib/utils/slidingWindow.d.ts +1 -0
  320. package/dist/dts/lib/utils/storage.d.ts +32 -0
  321. package/dist/dts/lib/utils/strokeDasharray.d.ts +3 -0
  322. package/dist/dts/lib/utils/timezoneFormatter.d.ts +14 -0
  323. package/dist/dts/lib/utils/zipper.d.ts +4 -0
  324. package/dist/dts/public-api.d.ts +31 -0
  325. package/dist/dts/widget/BackfillWorkerFlags.d.ts +12 -0
  326. package/dist/dts/widget/CanaryRollbackHelper.d.ts +95 -0
  327. package/dist/dts/widget/CanaryRolloutConfig.d.ts +100 -0
  328. package/dist/dts/widget/DrawingPriceLabelsOverlay.d.ts +20 -0
  329. package/dist/dts/widget/ForkDrawingsOverlay.d.ts +16 -0
  330. package/dist/dts/widget/MeasurementOverlay.d.ts +24 -0
  331. package/dist/dts/widget/VNInvestCharts.d.ts +5 -0
  332. package/dist/dts/widget/VNInvestChartsProps.d.ts +302 -0
  333. package/dist/dts/widget/VNInvestMultiCharts.d.ts +8 -0
  334. package/dist/dts/widget/VNInvestMultiCharts.types.d.ts +130 -0
  335. package/dist/dts/widget/WidgetEmptyState.d.ts +11 -0
  336. package/dist/dts/widget/WidgetErrorBoundary.d.ts +26 -0
  337. package/dist/dts/widget/adapters/ContinuousFuturesStockDataAdapter.d.ts +18 -0
  338. package/dist/dts/widget/adapters/DataProviderAdapterWrapper.d.ts +14 -0
  339. package/dist/dts/widget/adapters/MultiSourceDataAdapter.d.ts +24 -0
  340. package/dist/dts/widget/adapters/VNInvestClient.d.ts +161 -0
  341. package/dist/dts/widget/adapters/VNInvestDataAdapter.d.ts +77 -0
  342. package/dist/dts/widget/adapters/VNInvestWebSocketClient.d.ts +79 -0
  343. package/dist/dts/widget/adapters/barsPagingPolicy.d.ts +18 -0
  344. package/dist/dts/widget/adapters/corporateEvents.d.ts +13 -0
  345. package/dist/dts/widget/adapters/index.d.ts +20 -0
  346. package/dist/dts/widget/adapters/nativeShapes.d.ts +32 -0
  347. package/dist/dts/widget/adapters/watchlistRealtimeSync.d.ts +16 -0
  348. package/dist/dts/widget/alerts/DrawingAlertsHost.d.ts +18 -0
  349. package/dist/dts/widget/alerts/useDrawingAlerts.d.ts +37 -0
  350. package/dist/dts/widget/canaryBarFiltering.d.ts +35 -0
  351. package/dist/dts/widget/capabilities/CapabilityResolver.d.ts +71 -0
  352. package/dist/dts/widget/capabilities/capabilityProbe.d.ts +28 -0
  353. package/dist/dts/widget/capabilities/useTierGatedFeatures.d.ts +48 -0
  354. package/dist/dts/widget/components/BottomPanelHost.d.ts +80 -0
  355. package/dist/dts/widget/components/BottomPanelSplitter.d.ts +15 -0
  356. package/dist/dts/widget/components/CapabilityGate.d.ts +65 -0
  357. package/dist/dts/widget/components/ChartDiagOverlay.d.ts +31 -0
  358. package/dist/dts/widget/components/ConfirmDialog.d.ts +12 -0
  359. package/dist/dts/widget/components/DowngradeBanner.d.ts +9 -0
  360. package/dist/dts/widget/components/ForkPaneSeparators.d.ts +11 -0
  361. package/dist/dts/widget/components/ForkPaneTooltips.d.ts +23 -0
  362. package/dist/dts/widget/components/ForkXAxisOverlay.d.ts +11 -0
  363. package/dist/dts/widget/components/ForkYAxisCrosshairLabels.d.ts +9 -0
  364. package/dist/dts/widget/components/LayoutDesigner.d.ts +26 -0
  365. package/dist/dts/widget/components/PremiumFeatureGate.d.ts +10 -0
  366. package/dist/dts/widget/components/ShortcutHelpModal.d.ts +44 -0
  367. package/dist/dts/widget/components/SystemMenu.d.ts +66 -0
  368. package/dist/dts/widget/components/Toast.d.ts +20 -0
  369. package/dist/dts/widget/components/canvas/BarCountdownBadge.d.ts +8 -0
  370. package/dist/dts/widget/components/canvas/ChartA11ySummary.d.ts +40 -0
  371. package/dist/dts/widget/components/canvas/ChartStatusLine.d.ts +39 -0
  372. package/dist/dts/widget/components/canvas/PricePaneHeader.d.ts +24 -0
  373. package/dist/dts/widget/components/canvas/PriceScaleMenu.d.ts +27 -0
  374. package/dist/dts/widget/components/canvas/TimeAxisScrollbar.d.ts +18 -0
  375. package/dist/dts/widget/components/common/Icons.d.ts +67 -0
  376. package/dist/dts/widget/components/dock/DataWindow.d.ts +7 -0
  377. package/dist/dts/widget/components/dock/DockUpgradeNudge.d.ts +10 -0
  378. package/dist/dts/widget/components/dock/RightSidebarDockHost.d.ts +57 -0
  379. package/dist/dts/widget/components/dock/WatchlistPanel.d.ts +7 -0
  380. package/dist/dts/widget/components/dock/WorkspaceRightDockSlot.d.ts +46 -0
  381. package/dist/dts/widget/components/dock/dockAccess.d.ts +20 -0
  382. package/dist/dts/widget/components/dock/drawingDockContentBuilders.d.ts +29 -0
  383. package/dist/dts/widget/components/drawing/DrawingDock.d.ts +47 -0
  384. package/dist/dts/widget/components/drawing/DrawingInspector.d.ts +94 -0
  385. package/dist/dts/widget/components/drawing/DrawingListPanel.d.ts +62 -0
  386. package/dist/dts/widget/components/drawing/DrawingSemanticPointLegend.d.ts +14 -0
  387. package/dist/dts/widget/components/drawing/FloatingDrawingInspector.d.ts +18 -0
  388. package/dist/dts/widget/components/drawing/IconPickerPanel.d.ts +5 -0
  389. package/dist/dts/widget/components/drawing/InlineTextEditor.d.ts +20 -0
  390. package/dist/dts/widget/components/drawing/PatternScanPanel.d.ts +27 -0
  391. package/dist/dts/widget/components/drawing/TemplateManagerPanel.d.ts +18 -0
  392. package/dist/dts/widget/components/events/CorporateEventsOverlay.d.ts +23 -0
  393. package/dist/dts/widget/components/events/EventMarkerIcon.d.ts +6 -0
  394. package/dist/dts/widget/components/footer/ChartFooter.d.ts +26 -0
  395. package/dist/dts/widget/components/footer/MultiChartsFooter.d.ts +37 -0
  396. package/dist/dts/widget/components/footer/TimeframeFooter.d.ts +25 -0
  397. package/dist/dts/widget/components/footer/useBarCountdown.d.ts +5 -0
  398. package/dist/dts/widget/components/header/OHLCHeader.d.ts +72 -0
  399. package/dist/dts/widget/components/layout/DrawingConflictNotice.d.ts +4 -0
  400. package/dist/dts/widget/components/layout/GridContainer.d.ts +70 -0
  401. package/dist/dts/widget/components/layout/GridSlotErrorBoundary.d.ts +17 -0
  402. package/dist/dts/widget/components/layout/Splitter.d.ts +23 -0
  403. package/dist/dts/widget/components/layout/gridSplitterMath.d.ts +40 -0
  404. package/dist/dts/widget/components/layout/useGridSplitterDrag.d.ts +18 -0
  405. package/dist/dts/widget/components/mobile/MobileChartCarousel.d.ts +11 -0
  406. package/dist/dts/widget/components/mobile/MobileToolbar.d.ts +29 -0
  407. package/dist/dts/widget/components/overlays/AdvisoryPanel.d.ts +25 -0
  408. package/dist/dts/widget/components/overlays/TapePanel.d.ts +25 -0
  409. package/dist/dts/widget/components/overlays/WhalePanel.d.ts +5 -0
  410. package/dist/dts/widget/components/panels/AdvisoryPanel.d.ts +25 -0
  411. package/dist/dts/widget/components/panels/PineEditorPanel.d.ts +18 -0
  412. package/dist/dts/widget/components/panels/StrategyTesterPanel.d.ts +7 -0
  413. package/dist/dts/widget/components/panels/TapePanel.d.ts +17 -0
  414. package/dist/dts/widget/components/panels/index.d.ts +8 -0
  415. package/dist/dts/widget/components/replay/FloatingReplayToolbar.d.ts +24 -0
  416. package/dist/dts/widget/components/replay/ReplayCutOverlay.d.ts +8 -0
  417. package/dist/dts/widget/components/search/SymbolCompareModal.d.ts +24 -0
  418. package/dist/dts/widget/components/search/SymbolSearchModal.d.ts +12 -0
  419. package/dist/dts/widget/components/search/VNSymbolSearch.d.ts +83 -0
  420. package/dist/dts/widget/components/settings/AlertsModal.d.ts +74 -0
  421. package/dist/dts/widget/components/settings/SettingsContext.d.ts +58 -0
  422. package/dist/dts/widget/components/settings/SettingsModal.d.ts +78 -0
  423. package/dist/dts/widget/components/settings/SettingsRangeSlider.d.ts +17 -0
  424. package/dist/dts/widget/components/settings/SnapshotPreviewModal.d.ts +16 -0
  425. package/dist/dts/widget/components/settings/WorkspaceSettingsContext.d.ts +27 -0
  426. package/dist/dts/widget/components/settings/helpers/seriesFormatters.d.ts +11 -0
  427. package/dist/dts/widget/components/settings/model/appearancePayload.d.ts +31 -0
  428. package/dist/dts/widget/components/settings/model/chartSettingsSchema.d.ts +100 -0
  429. package/dist/dts/widget/components/settings/model/defaultSettings.d.ts +5 -0
  430. package/dist/dts/widget/components/settings/model/indicatorShare.d.ts +29 -0
  431. package/dist/dts/widget/components/settings/storageKeys.d.ts +29 -0
  432. package/dist/dts/widget/components/settings/tabs/AppearanceSettingsTab.d.ts +5 -0
  433. package/dist/dts/widget/components/settings/tabs/IndicatorParamsForm.d.ts +12 -0
  434. package/dist/dts/widget/components/settings/tabs/IndicatorsSettingsTab.d.ts +34 -0
  435. package/dist/dts/widget/components/settings/tabs/LicensingSettingsTab.d.ts +5 -0
  436. package/dist/dts/widget/components/settings/tabs/PanesLayoutSettingsTab.d.ts +11 -0
  437. package/dist/dts/widget/components/settings/tabs/ResetSettingsTab.d.ts +8 -0
  438. package/dist/dts/widget/components/settings/tabs/ScalesSettingsTab.d.ts +5 -0
  439. package/dist/dts/widget/components/settings/tabs/StatusLineSettingsTab.d.ts +5 -0
  440. package/dist/dts/widget/components/settings/tabs/SymbolSettingsTab.d.ts +5 -0
  441. package/dist/dts/widget/components/settings/tabs/ThemePaletteSettingsTab.d.ts +9 -0
  442. package/dist/dts/widget/components/settings/tabs/TradingEventsSettingsTab.d.ts +8 -0
  443. package/dist/dts/widget/components/toolbar/DrawingToolIcon.d.ts +10 -0
  444. package/dist/dts/widget/components/toolbar/DrawingToolbar.d.ts +33 -0
  445. package/dist/dts/widget/components/toolbar/FloatingChartBar.d.ts +20 -0
  446. package/dist/dts/widget/components/toolbar/FloatingFavoritesBar.d.ts +18 -0
  447. package/dist/dts/widget/components/toolbar/MultiChartTopbar.d.ts +47 -0
  448. package/dist/dts/widget/components/toolbar/UnifiedDrawingToolbar.d.ts +28 -0
  449. package/dist/dts/widget/components/trading/PaperTradePanel.d.ts +41 -0
  450. package/dist/dts/widget/components/workspace/WorkspaceToolbar.d.ts +25 -0
  451. package/dist/dts/widget/config/toolGroups.d.ts +11 -0
  452. package/dist/dts/widget/config/toolShortcuts.d.ts +27 -0
  453. package/dist/dts/widget/constants/comparison.d.ts +1 -0
  454. package/dist/dts/widget/constants/symbolSearch.d.ts +14 -0
  455. package/dist/dts/widget/constants/vn30.d.ts +7 -0
  456. package/dist/dts/widget/context/DataProviderContext.d.ts +7 -0
  457. package/dist/dts/widget/context/HoverEmitter.d.ts +50 -0
  458. package/dist/dts/widget/context/SyncContextShare.d.ts +11 -0
  459. package/dist/dts/widget/context/VNInvestChartsConfigContext.d.ts +24 -0
  460. package/dist/dts/widget/context/VNInvestChartsContext.d.ts +70 -0
  461. package/dist/dts/widget/context/VNInvestChartsStateContext.d.ts +50 -0
  462. package/dist/dts/widget/context/WidgetI18nContext.d.ts +25 -0
  463. package/dist/dts/widget/context/WorkspaceLiveTradingContext.d.ts +30 -0
  464. package/dist/dts/widget/context/WorkspacePaperVisibilityContext.d.ts +23 -0
  465. package/dist/dts/widget/context/WorkspaceReplayTradingContext.d.ts +36 -0
  466. package/dist/dts/widget/contexts/SaaSFeatureContext.d.ts +23 -0
  467. package/dist/dts/widget/data/DataEnvelope.d.ts +100 -0
  468. package/dist/dts/widget/drawingPriceLabelInputs.d.ts +3 -0
  469. package/dist/dts/widget/export/chartCsv.d.ts +59 -0
  470. package/dist/dts/widget/forkAnchorReconciliation.d.ts +6 -0
  471. package/dist/dts/widget/forkInteractionHelpers.d.ts +69 -0
  472. package/dist/dts/widget/grid/DeviceProfiles.d.ts +49 -0
  473. package/dist/dts/widget/grid/GridChartRegistry.d.ts +9 -0
  474. package/dist/dts/widget/grid/MemoryBudgetManager.d.ts +63 -0
  475. package/dist/dts/widget/grid/PerformanceMonitor.d.ts +70 -0
  476. package/dist/dts/widget/grid/customPresets.d.ts +42 -0
  477. package/dist/dts/widget/grid/presets.d.ts +18 -0
  478. package/dist/dts/widget/grid/types.d.ts +39 -0
  479. package/dist/dts/widget/history/BackfillDedupContext.d.ts +63 -0
  480. package/dist/dts/widget/history/RequestCoordinator.d.ts +59 -0
  481. package/dist/dts/widget/history/SharedBarStoreContext.d.ts +22 -0
  482. package/dist/dts/widget/history/cache/IndexedDBCacheMatrix.d.ts +16 -0
  483. package/dist/dts/widget/history/cache/LocalCacheMatrix.d.ts +86 -0
  484. package/dist/dts/widget/history/cache/index.d.ts +3 -0
  485. package/dist/dts/widget/history/chunkStore.d.ts +77 -0
  486. package/dist/dts/widget/history/externalBarsNormalization.d.ts +9 -0
  487. package/dist/dts/widget/history/externalBarsNormalization.worker.d.ts +1 -0
  488. package/dist/dts/widget/history/externalBarsNormalizationAsync.d.ts +25 -0
  489. package/dist/dts/widget/history/historyDataUtils.d.ts +82 -0
  490. package/dist/dts/widget/history/historyWindowPlanner.d.ts +89 -0
  491. package/dist/dts/widget/history/inflightController.d.ts +15 -0
  492. package/dist/dts/widget/history/requestCoalescing.d.ts +10 -0
  493. package/dist/dts/widget/history/sessionGuards.d.ts +3 -0
  494. package/dist/dts/widget/history/singleWriterLane.d.ts +4 -0
  495. package/dist/dts/widget/history/useExternalBarsNormalization.d.ts +5 -0
  496. package/dist/dts/widget/hooks/ShortcutManager.d.ts +65 -0
  497. package/dist/dts/widget/hooks/overlays/PaneHeaderWrapper.d.ts +11 -0
  498. package/dist/dts/widget/hooks/overlays/overlayHelpers.d.ts +60 -0
  499. package/dist/dts/widget/hooks/overlays/useDrawingDockNode.d.ts +15 -0
  500. package/dist/dts/widget/hooks/overlays/useLegendChrome.d.ts +36 -0
  501. package/dist/dts/widget/hooks/overlays/useMultiSelectActions.d.ts +22 -0
  502. package/dist/dts/widget/hooks/overlays/useSidebarResize.d.ts +13 -0
  503. package/dist/dts/widget/hooks/resolveEntitlement.d.ts +73 -0
  504. package/dist/dts/widget/hooks/useBottomPanelBehavior.d.ts +38 -0
  505. package/dist/dts/widget/hooks/useBottomPanelHeight.d.ts +39 -0
  506. package/dist/dts/widget/hooks/useCanvasTheme.d.ts +24 -0
  507. package/dist/dts/widget/hooks/useChartImperativeHandle.d.ts +57 -0
  508. package/dist/dts/widget/hooks/useClockAdapter.d.ts +11 -0
  509. package/dist/dts/widget/hooks/useComparisonState.d.ts +29 -0
  510. package/dist/dts/widget/hooks/useDialogFocus.d.ts +25 -0
  511. package/dist/dts/widget/hooks/useDrawingToolShortcuts.d.ts +16 -0
  512. package/dist/dts/widget/hooks/useFeatureGate.d.ts +28 -0
  513. package/dist/dts/widget/hooks/useFloatingChartBar.d.ts +33 -0
  514. package/dist/dts/widget/hooks/useForkRuntime.d.ts +155 -0
  515. package/dist/dts/widget/hooks/useIndicatorsShareApplier.d.ts +1 -0
  516. package/dist/dts/widget/hooks/useIntersectionObserver.d.ts +49 -0
  517. package/dist/dts/widget/hooks/useKeyboardAdapter.d.ts +9 -0
  518. package/dist/dts/widget/hooks/useLayoutHistory.d.ts +8 -0
  519. package/dist/dts/widget/hooks/useLicenseDiagnostics.d.ts +15 -0
  520. package/dist/dts/widget/hooks/useMultiChartReplaySync.d.ts +31 -0
  521. package/dist/dts/widget/hooks/useMultiWorkspacePersistence.d.ts +49 -0
  522. package/dist/dts/widget/hooks/usePaperTradeConfig.d.ts +27 -0
  523. package/dist/dts/widget/hooks/usePaperTradeInteraction.d.ts +27 -0
  524. package/dist/dts/widget/hooks/usePatTierAuthentication.d.ts +42 -0
  525. package/dist/dts/widget/hooks/usePineScriptRestore.d.ts +23 -0
  526. package/dist/dts/widget/hooks/usePortalAdapter.d.ts +8 -0
  527. package/dist/dts/widget/hooks/useRecentSymbols.d.ts +3 -0
  528. package/dist/dts/widget/hooks/useReplayState.d.ts +28 -0
  529. package/dist/dts/widget/hooks/useReplayTrading.d.ts +26 -0
  530. package/dist/dts/widget/hooks/useResizeAdapter.d.ts +13 -0
  531. package/dist/dts/widget/hooks/useScaleOverlays.d.ts +62 -0
  532. package/dist/dts/widget/hooks/useScriptPersistence.d.ts +72 -0
  533. package/dist/dts/widget/hooks/useSymbolSearch.d.ts +30 -0
  534. package/dist/dts/widget/hooks/useViewportBreakpoint.d.ts +15 -0
  535. package/dist/dts/widget/hooks/useWidgetCoordinateBridge.d.ts +70 -0
  536. package/dist/dts/widget/hooks/useWidgetData.d.ts +138 -0
  537. package/dist/dts/widget/hooks/useWidgetDataBackfill.d.ts +67 -0
  538. package/dist/dts/widget/hooks/useWidgetDataEnrichment.d.ts +32 -0
  539. package/dist/dts/widget/hooks/useWidgetDrawings.d.ts +38 -0
  540. package/dist/dts/widget/hooks/useWidgetForkInteraction.d.ts +68 -0
  541. package/dist/dts/widget/hooks/useWidgetInteractionActions.d.ts +36 -0
  542. package/dist/dts/widget/hooks/useWidgetOverlays.d.ts +190 -0
  543. package/dist/dts/widget/hooks/useWidgetRuntime.d.ts +20 -0
  544. package/dist/dts/widget/hooks/useWidgetSettings.d.ts +244 -0
  545. package/dist/dts/widget/hooks/useWidgetWorkspaceIO.d.ts +24 -0
  546. package/dist/dts/widget/hooks/useWorkspaceDockPanels.d.ts +11 -0
  547. package/dist/dts/widget/hooks/useWorkspaceLiveTrading.d.ts +28 -0
  548. package/dist/dts/widget/hooks/useWorkspaceReplayTrading.d.ts +22 -0
  549. package/dist/dts/widget/i18n/a11y.messages.en.d.ts +8 -0
  550. package/dist/dts/widget/i18n/a11y.messages.vi.d.ts +3 -0
  551. package/dist/dts/widget/i18n/capability.messages.en.d.ts +7 -0
  552. package/dist/dts/widget/i18n/capability.messages.vi.d.ts +3 -0
  553. package/dist/dts/widget/i18n/dock.messages.en.d.ts +2 -0
  554. package/dist/dts/widget/i18n/dock.messages.vi.d.ts +2 -0
  555. package/dist/dts/widget/i18n/messages.en.d.ts +2 -0
  556. package/dist/dts/widget/i18n/messages.licensing.d.ts +48 -0
  557. package/dist/dts/widget/i18n/messages.vi.d.ts +2 -0
  558. package/dist/dts/widget/i18n/trading.messages.en.d.ts +2 -0
  559. package/dist/dts/widget/i18n/trading.messages.vi.d.ts +2 -0
  560. package/dist/dts/widget/i18n/types.d.ts +3 -0
  561. package/dist/dts/widget/iframe/builtInAdapters.d.ts +63 -0
  562. package/dist/dts/widget/iframe/host-entry.d.ts +11 -0
  563. package/dist/dts/widget/iframe/hostSDK.d.ts +151 -0
  564. package/dist/dts/widget/iframe/iframeBridge.d.ts +165 -0
  565. package/dist/dts/widget/iframe/iframeEntry.d.ts +52 -0
  566. package/dist/dts/widget/iframe/iframeFrame.d.ts +15 -0
  567. package/dist/dts/widget/iframe/iframeQuotes.d.ts +20 -0
  568. package/dist/dts/widget/iframe/messageProtocol.d.ts +545 -0
  569. package/dist/dts/widget/iframe/quoteHub.d.ts +20 -0
  570. package/dist/dts/widget/iframe/useVNInvestChartsHost.d.ts +8 -0
  571. package/dist/dts/widget/iife-entry.d.ts +61 -0
  572. package/dist/dts/widget/iifeWidgetInstance.d.ts +60 -0
  573. package/dist/dts/widget/index.d.ts +56 -0
  574. package/dist/dts/widget/multiChartDefaults.d.ts +18 -0
  575. package/dist/dts/widget/paneInteractionUtils.d.ts +25 -0
  576. package/dist/dts/widget/patterns/autoPatternScan.d.ts +77 -0
  577. package/dist/dts/widget/patterns/patternDrawingFactory.d.ts +87 -0
  578. package/dist/dts/widget/plugin/ProPluginRegistry.d.ts +40 -0
  579. package/dist/dts/widget/runtime/ChartScaleAdapter.d.ts +73 -0
  580. package/dist/dts/widget/runtime/ChartSerializer.d.ts +12 -0
  581. package/dist/dts/widget/runtime/ForkRuntimeAdapter.d.ts +19 -0
  582. package/dist/dts/widget/runtime/IRuntimeEngine.d.ts +40 -0
  583. package/dist/dts/widget/runtime/WorkspaceSerializer.d.ts +31 -0
  584. package/dist/dts/widget/runtimePolicy.d.ts +36 -0
  585. package/dist/dts/widget/styles/injectStyles.d.ts +9 -0
  586. package/dist/dts/widget/theme/ThemeConfig.d.ts +21 -0
  587. package/dist/dts/widget/theme/applyTheme.d.ts +3 -0
  588. package/dist/dts/widget/trading/chart/DraggableOrderHandles.d.ts +15 -0
  589. package/dist/dts/widget/trading/chart/InteractivePositionOverlay.d.ts +19 -0
  590. package/dist/dts/widget/trading/chart/PendingOrderOverlay.d.ts +11 -0
  591. package/dist/dts/widget/trading/chart/QuickTradingHeader.d.ts +20 -0
  592. package/dist/dts/widget/trading/chart/TradingChartSurface.d.ts +8 -0
  593. package/dist/dts/widget/trading/chart/TradingOverlaysHost.d.ts +28 -0
  594. package/dist/dts/widget/trading/chart/priceTicks.d.ts +1 -0
  595. package/dist/dts/widget/trading/chart/useFloatingDrag.d.ts +40 -0
  596. package/dist/dts/widget/trading/chart/useTradingHotkeys.d.ts +21 -0
  597. package/dist/dts/widget/trading/config/paperRuntimeConfig.d.ts +53 -0
  598. package/dist/dts/widget/trading/context/PaperPanelRegistry.d.ts +45 -0
  599. package/dist/dts/widget/trading/context/TradingContext.d.ts +80 -0
  600. package/dist/dts/widget/trading/context/WorkspaceTradingSync.d.ts +24 -0
  601. package/dist/dts/widget/trading/hooks/usePaperRuntimeConfig.d.ts +36 -0
  602. package/dist/dts/widget/trading/index.d.ts +5 -0
  603. package/dist/dts/widget/trading/panel/AccountSummaryTab.d.ts +7 -0
  604. package/dist/dts/widget/trading/panel/ActiveChartPaperPanel.d.ts +26 -0
  605. package/dist/dts/widget/trading/panel/ConnectedTradingPanel.d.ts +3 -0
  606. package/dist/dts/widget/trading/panel/HistoryTab.d.ts +5 -0
  607. package/dist/dts/widget/trading/panel/MarketFallbackBanner.d.ts +4 -0
  608. package/dist/dts/widget/trading/panel/OrdersTab.d.ts +8 -0
  609. package/dist/dts/widget/trading/panel/PaperCapitalDialog.d.ts +8 -0
  610. package/dist/dts/widget/trading/panel/PaperSettingsModal.d.ts +17 -0
  611. package/dist/dts/widget/trading/panel/PositionsTab.d.ts +15 -0
  612. package/dist/dts/widget/trading/panel/TradeHistoryTab.d.ts +5 -0
  613. package/dist/dts/widget/trading/panel/TradingBottomPanel.d.ts +36 -0
  614. package/dist/dts/widget/trading/panel/TradingLogTab.d.ts +8 -0
  615. package/dist/dts/widget/trading/panel/TradingPanelHeader.d.ts +17 -0
  616. package/dist/dts/widget/trading/panel/csvExport.d.ts +18 -0
  617. package/dist/dts/widget/trading/ticket/ConnectedTradingDockPanel.d.ts +5 -0
  618. package/dist/dts/widget/trading/ticket/OrderTicketForm.d.ts +31 -0
  619. package/dist/dts/widget/trading/ticket/OrderTicketModal.d.ts +29 -0
  620. package/dist/dts/widget/trading/ticket/RegistryTradingDockPanel.d.ts +9 -0
  621. package/dist/dts/widget/trading/ticket/RiskCalculatorView.d.ts +9 -0
  622. package/dist/dts/widget/trading/ticket/TradingDockPanel.d.ts +36 -0
  623. package/dist/dts/widget/trading/ticket/orderTicketModel.d.ts +49 -0
  624. package/dist/dts/widget/trading/visibility/paperVisibility.d.ts +38 -0
  625. package/dist/dts/widget/types/dataProvider.d.ts +8 -0
  626. package/dist/dts/widget/types/fullChartHandle.d.ts +25 -0
  627. package/dist/dts/widget/types/saas.d.ts +83 -0
  628. package/dist/dts/widget/types/symbolSearch.d.ts +9 -0
  629. package/dist/dts/widget/types/watchlist.d.ts +26 -0
  630. package/dist/dts/widget/utils/axisHit.d.ts +16 -0
  631. package/dist/dts/widget/utils/chartRange.d.ts +12 -0
  632. package/dist/dts/widget/utils/chartTypeOptions.d.ts +38 -0
  633. package/dist/dts/widget/utils/clickOutside.d.ts +1 -0
  634. package/dist/dts/widget/utils/coordinateBridge.d.ts +31 -0
  635. package/dist/dts/widget/utils/crosshairSync.d.ts +50 -0
  636. package/dist/dts/widget/utils/drawingSync.d.ts +198 -0
  637. package/dist/dts/widget/utils/enrichedHash.d.ts +15 -0
  638. package/dist/dts/widget/utils/headerSync.d.ts +12 -0
  639. package/dist/dts/widget/utils/numberFormat.d.ts +13 -0
  640. package/dist/dts/widget/utils/paperTradeAdapters.d.ts +11 -0
  641. package/dist/dts/widget/utils/pineSeriesData.d.ts +71 -0
  642. package/dist/dts/widget/utils/rangeSync.d.ts +29 -0
  643. package/dist/dts/widget/utils/telemetry.d.ts +19 -0
  644. package/dist/dts/widget/utils/widgetEquality.d.ts +57 -0
  645. package/dist/dts/widget/utils/widgetErrors.d.ts +29 -0
  646. package/dist/dts/widget/utils/widgetHelpers.d.ts +395 -0
  647. package/dist/dts/widget/utils/xAxisTickFormatter.d.ts +33 -0
  648. package/dist/dts/widget/visibleRangeBridge.d.ts +28 -0
  649. package/dist/dts/widget/visibleRangeDiagnostics.d.ts +10 -0
  650. package/dist/dts/widget/visibleRangePolicies.d.ts +6 -0
  651. package/dist/dts/widget/workspace/WorkspaceManager.d.ts +23 -0
  652. package/dist/dts/widget/workspace/WorkspaceStore.d.ts +85 -0
  653. package/dist/dts/widget/workspace/types.d.ts +21 -0
  654. package/dist/externalBarsNormalization.worker.js +108 -0
  655. package/dist/iframe/index.html +63 -0
  656. package/dist/iframe/injected.css +6456 -0
  657. package/dist/iframe/vninvestchart.iframe.css +2 -0
  658. package/dist/iframe/vninvestchart.iframe.js +945 -0
  659. package/dist/iframe-host/host-entry.cjs +687 -0
  660. package/dist/iframe-host/host-entry.d.mts +818 -0
  661. package/dist/iframe-host/host-entry.d.ts +818 -0
  662. package/dist/iframe-host/host-entry.js +680 -0
  663. package/dist/index.cjs +7253 -0
  664. package/dist/index.css +3390 -0
  665. package/dist/index.d.ts +31 -0
  666. package/dist/index.js +6461 -0
  667. package/dist/injected.css +6456 -0
  668. package/dist/rollAlgorithms-2P2ZKKHO.js +2 -0
  669. package/dist/types/runtime.cjs +8 -0
  670. package/dist/types/runtime.d.mts +92 -0
  671. package/dist/types/runtime.d.ts +92 -0
  672. package/dist/types/runtime.js +5 -0
  673. package/dist/types/runtime.umd.js +14 -0
  674. package/dist/vninvestchart.iife.css +2 -0
  675. package/dist/vninvestchart.iife.js +945 -0
  676. package/package.json +225 -5
@@ -0,0 +1,673 @@
1
+ import { StockDataAdapter, SourceSemanticsDescriptor, Timeframe, CoverageFragment, OHLCVBar, Unsubscribe, Trade, OrderbookSnapshot, SymbolInfo } from '@vninvestcharts/engine-core';
2
+
3
+ /**
4
+ * Shared VNInvest domain type definitions.
5
+ *
6
+ * This module is the canonical home for cross-layer types used by
7
+ * widget/core/lib modules. Demo should consume these types, not own them.
8
+ */
9
+ interface TechnicalIndicators {
10
+ bias?: number;
11
+ rsi14?: number;
12
+ sma20?: number;
13
+ sma50?: number;
14
+ sma200?: number;
15
+ ema9?: number;
16
+ ema21?: number;
17
+ macd?: number;
18
+ macd_signal?: number;
19
+ macd_histogram?: number;
20
+ atr_14?: number;
21
+ bb_upper?: number;
22
+ bb_middle?: number;
23
+ bb_lower?: number;
24
+ volume_sma20?: number;
25
+ }
26
+ interface StockItem {
27
+ symbol: string;
28
+ company_name: string;
29
+ exchange: string;
30
+ sector?: string;
31
+ }
32
+ type WhaleSizeClass = "small" | "shark" | "whale";
33
+ type WhaleSide = "buy" | "sell";
34
+ interface WhaleOrder {
35
+ /** ISO 8601 timestamp string */
36
+ ts: string;
37
+ price: number;
38
+ volume: number;
39
+ matched_value: number;
40
+ side: WhaleSide;
41
+ size_class: WhaleSizeClass;
42
+ }
43
+ interface WhaleOrderSummary {
44
+ buy_value: number;
45
+ sell_value: number;
46
+ shark_buy: number;
47
+ shark_sell: number;
48
+ whale_buy: number;
49
+ whale_sell: number;
50
+ small_buy: number;
51
+ small_sell: number;
52
+ }
53
+ interface WhaleFeedResponse {
54
+ symbol: string;
55
+ whale_orders: WhaleOrder[];
56
+ summary: WhaleOrderSummary;
57
+ /**
58
+ * Native backend alerts (GET /realtime/whale-feed/{symbol}/, verified live 2026-09-21).
59
+ * Present when the server returns `{symbol, alerts[]}` instead of the legacy
60
+ * `{summary, whale_orders}` contract. Rendered as a notification list — never
61
+ * coerced into WhaleOrder (alerts carry no price/volume).
62
+ */
63
+ alerts?: WhaleAlert[];
64
+ }
65
+ /** One native whale/signal alert from GET /realtime/whale-feed/{symbol}/. */
66
+ interface WhaleAlert {
67
+ /** UUID string. */
68
+ id: string;
69
+ /** e.g. "signal" | "whale". */
70
+ alert_type: string;
71
+ /** e.g. "low" | "medium" | "high". */
72
+ severity: string;
73
+ title: string;
74
+ /** Score-ish string on signal alerts — NOT a VND value. Kept raw. */
75
+ value: string | number | null;
76
+ /** e.g. "buy" | "sell". */
77
+ direction: string;
78
+ /** ISO 8601 timestamp string. */
79
+ triggered_at: string;
80
+ }
81
+ /** One intraday CVD bucket from compute_cvd_series. */
82
+ interface CVDPoint {
83
+ /** ISO 8601 datetime - today + bucket start time. */
84
+ bucket_ts: string;
85
+ buy_value: number;
86
+ sell_value: number;
87
+ /** Net delta for this bucket (buy_value - sell_value). */
88
+ cvd: number;
89
+ /** Running cumulative delta from session start. */
90
+ cumulative_cvd: number;
91
+ }
92
+ type DarkFlowSignalType = "none" | "absorption" | "iceberg" | "twap_bot" | "mixed";
93
+ /** Dark flow strength result from detect_dark_flow. */
94
+ interface DarkFlowResult {
95
+ signal_type: DarkFlowSignalType;
96
+ /** 0-100 composite strength score. */
97
+ strength: number;
98
+ /** 0-1 confidence. */
99
+ confidence: number;
100
+ components?: Record<string, unknown>;
101
+ triggered_at?: string | null;
102
+ }
103
+ interface OrderFlowSignal {
104
+ id: number | string;
105
+ symbol: string;
106
+ signal_type: string;
107
+ strength: number;
108
+ confidence: number;
109
+ tick_rate: number;
110
+ small_order_ratio: number;
111
+ cvd_at_signal: number | null;
112
+ price_at_signal: number | null;
113
+ created_at: string;
114
+ event_id: string | null;
115
+ severity?: string;
116
+ }
117
+ /** Response from GET /api/stock-management/stocks/<symbol>/order-flow/. */
118
+ interface OrderFlowResponse {
119
+ ok: boolean;
120
+ symbol: string;
121
+ window: string;
122
+ window_minutes: number;
123
+ latest_signal: OrderFlowSignal | null;
124
+ signals: OrderFlowSignal[];
125
+ cvd_series: CVDPoint[];
126
+ dark_flow: DarkFlowResult;
127
+ tick_rate: Record<string, unknown>;
128
+ size_distribution: Record<string, unknown>;
129
+ }
130
+ /** A single intraday tape entry (one matched trade or large order). */
131
+ interface TapeEntry {
132
+ /** Unique identifier for React keying (server id or client-generated). */
133
+ id: string;
134
+ /** ISO 8601 timestamp of the trade. */
135
+ ts: string;
136
+ /** Trade price. */
137
+ price: number;
138
+ /** Volume in shares/contracts. */
139
+ volume: number;
140
+ /** Trade value in VND (raw, not billions). */
141
+ value: number;
142
+ /** Direction of the aggressive side. */
143
+ side: "buy" | "sell" | "unknown";
144
+ /** True when value exceeds whale threshold - triggers highlight. */
145
+ is_whale: boolean;
146
+ }
147
+ /** HTTP envelope for GET /core/v1/market-data/intraday-tape/ */
148
+ interface TapeResponse {
149
+ ok: boolean;
150
+ symbol: string;
151
+ entries: TapeEntry[];
152
+ }
153
+ /** Decision signal returned by AI advisory session. */
154
+ type AdvisoryDecision = "STRONG_BUY" | "BUY" | "HOLD" | "SELL" | "STRONG_SELL";
155
+ /** Per-agent score within an advisory session response. */
156
+ interface AgentScore {
157
+ /** Agent identifier: "whale" | "tech" | "risk" | "sentiment". */
158
+ name: string;
159
+ /** Portfolio weight (0-1), e.g. 0.4 for whale agent. */
160
+ weight: number;
161
+ /** Raw score in [−100, 100]. Positive = bullish. */
162
+ score: number;
163
+ /** Signal label for this agent. */
164
+ signal: AdvisoryDecision;
165
+ /** Markdown-formatted explanation from this agent. */
166
+ explanation: string;
167
+ }
168
+ /** Full advisory result returned from POST /api/stock_ai_advisory_session/. */
169
+ interface AdvisoryResult {
170
+ /** Aggregated decision across all agents. */
171
+ decision: AdvisoryDecision;
172
+ /** Aggregate confidence in [0, 1]. */
173
+ confidence: number;
174
+ /** Weighted composite score in [−100, 100]. */
175
+ weighted_score: number;
176
+ /** Per-agent breakdown - typically 4 agents. */
177
+ agents: readonly AgentScore[];
178
+ /** Markdown summary explanation. */
179
+ explanation: string;
180
+ /** ISO 8601 UTC timestamp when the analysis was triggered. */
181
+ triggered_at: string;
182
+ }
183
+ /** HTTP envelope for POST /api/stock_ai_advisory_session/ (legacy, 404 on current backend). */
184
+ interface AdvisorySessionResponse {
185
+ ok: boolean;
186
+ symbol: string;
187
+ result?: AdvisoryResult;
188
+ /** Error message when ok is false. */
189
+ error?: string;
190
+ }
191
+ /** Decision block inside aggregate — actions are lowercase backend values. */
192
+ interface AdvisoryDecisionBlock {
193
+ action: string | null;
194
+ risk: string | null;
195
+ score_band: string | null;
196
+ score: number | null;
197
+ }
198
+ /** Aggregate block of the native advisory session payload. */
199
+ interface AdvisoryAggregate {
200
+ advisory_id: string;
201
+ session_date: string;
202
+ selected_trade_date: string;
203
+ contract_version: string;
204
+ decision: AdvisoryDecisionBlock;
205
+ }
206
+ /** One analysis component (indicator/flow/summary) of the native session. */
207
+ interface AdvisoryComponent {
208
+ id: number;
209
+ symbol: string;
210
+ component_type: string;
211
+ indicator_name: string;
212
+ status: string;
213
+ confidence_score: number;
214
+ suggested_action: string;
215
+ rationale_text: string;
216
+ timeframe: string;
217
+ include_in_summary: boolean;
218
+ is_deleted: boolean;
219
+ created_at: string;
220
+ updated_at: string;
221
+ }
222
+ /** Executive summary built from active components. */
223
+ interface AdvisoryExecutiveSummary {
224
+ symbol: string;
225
+ session_date: string;
226
+ strategy_action: string | null;
227
+ risk_level: string | null;
228
+ overall_confidence: number | null;
229
+ score_band: string | null;
230
+ summary_text: string;
231
+ component_ids: number[];
232
+ active_components_count: number;
233
+ source: string;
234
+ }
235
+ /** Native record fields spread at session top level by the backend. */
236
+ interface AdvisoryRecordFields {
237
+ status?: string;
238
+ advisory_text?: string | null;
239
+ ai_model?: string | null;
240
+ tokens_used?: number | null;
241
+ strategy_action?: string | null;
242
+ risk_level?: string | null;
243
+ confidence_score?: number | null;
244
+ }
245
+ /**
246
+ * GET /core/v1/stock-management/stocks/{symbol}/ai-advisory-session/ response.
247
+ * Empty state: `{queued: false, reason: "no_advisory_data", advisory: null, ...}`.
248
+ * Record state: advisory/aggregate/components/executive_summary populated.
249
+ */
250
+ interface AdvisorySessionV2 extends AdvisoryRecordFields {
251
+ queued: boolean;
252
+ symbol: string;
253
+ contract_version: string;
254
+ reason?: string | null;
255
+ message?: string | null;
256
+ advisory: Record<string, unknown> | null;
257
+ aggregate: AdvisoryAggregate | null;
258
+ components: AdvisoryComponent[];
259
+ deleted_components: AdvisoryComponent[];
260
+ executive_summary: AdvisoryExecutiveSummary | null;
261
+ executive_summaries: AdvisoryExecutiveSummary[];
262
+ user_ai_provider: string | null;
263
+ effective_ai_provider: string | null;
264
+ effective_ai_model: string | null;
265
+ effective_ai_source: string | null;
266
+ }
267
+ interface RawOHLCVBar {
268
+ date: Date;
269
+ open: number;
270
+ high: number;
271
+ low: number;
272
+ close: number;
273
+ volume: number;
274
+ technical?: Partial<TechnicalIndicators>;
275
+ }
276
+
277
+ interface AdImageSource {
278
+ default: string;
279
+ retina?: string;
280
+ svg?: string;
281
+ }
282
+ interface AdCampaign {
283
+ campaign_id: string;
284
+ image_source: AdImageSource;
285
+ video_url?: string;
286
+ click_url: string;
287
+ click_tracking_url: string;
288
+ impression_tracking_url: string;
289
+ width: number;
290
+ height: number;
291
+ }
292
+
293
+ /**
294
+ * WP-02: VNInvestClient — moved from src/demo/dataSources/
295
+ * HTTP client for the VNInvest REST API with PAT Bearer authentication.
296
+ * No React dependency — safe to use in non-component contexts.
297
+ */
298
+
299
+ /** Resolve API base URL (priority: global override → localStorage → current origin → default). */
300
+ declare function resolveApiBase(): string;
301
+ /** Map of common timeframe aliases to VNInvest canonical formats. */
302
+ declare const TIMEFRAME_MAP: Record<string, string>;
303
+ /** Response of GET /core/v1/widget/ad — array of eligible campaigns. */
304
+ interface WidgetAdResponse {
305
+ campaigns: AdCampaign[];
306
+ }
307
+ interface AuthMeResponse {
308
+ access?: string;
309
+ refresh?: string;
310
+ token?: string;
311
+ token_prefix?: string;
312
+ plan: string;
313
+ active_pat_count: number;
314
+ max_active_pats: number;
315
+ tenant: {
316
+ tenant_id: string;
317
+ tenant_code: string;
318
+ display_name: string;
319
+ plan: string;
320
+ max_active_pats: number;
321
+ status: string;
322
+ features?: string[];
323
+ };
324
+ user: {
325
+ id: number;
326
+ username: string;
327
+ email: string;
328
+ first_name: string;
329
+ last_name: string;
330
+ is_staff: boolean;
331
+ };
332
+ abilities: string[];
333
+ entitlements: Record<string, unknown>;
334
+ }
335
+ /** Parameters for the cursor-paged /bars/ endpoint. */
336
+ type VNIBarsParams = {
337
+ type: "init";
338
+ symbol: string;
339
+ timeframe: string;
340
+ from?: number;
341
+ to?: number;
342
+ limit?: number;
343
+ } | {
344
+ type: "backward";
345
+ symbol: string;
346
+ timeframe: string;
347
+ before: number;
348
+ limit: number;
349
+ snapshotId?: string;
350
+ };
351
+ /** Response from the cursor-paged /bars/ endpoint. */
352
+ interface VNIBarsPageResponse {
353
+ bars: RawOHLCVBar[];
354
+ hasMoreBefore: boolean;
355
+ hasMoreAfter: boolean;
356
+ nextBefore: number | null;
357
+ nextAfter: number | null;
358
+ snapshotId: string | null;
359
+ }
360
+
361
+ type BarsHotWindowTelemetry = {
362
+ cacheHits: number;
363
+ inFlightCollapses: number;
364
+ networkRequests: number;
365
+ lastUpdatedAt: number | null;
366
+ };
367
+ type BarsHotWindowLoadGateStatus = "healthy" | "warning" | "rollback";
368
+ type BarsHotWindowLoadGateThresholds = {
369
+ minimumObservedRequests: number;
370
+ healthySavedRequestRatio: number;
371
+ rollbackSavedRequestRatio: number;
372
+ healthyNetworkRequestRatio: number;
373
+ rollbackNetworkRequestRatio: number;
374
+ };
375
+ type BarsHotWindowLoadGateReport = {
376
+ status: BarsHotWindowLoadGateStatus;
377
+ reasons: readonly string[];
378
+ telemetry: BarsHotWindowTelemetry;
379
+ totalRequests: number;
380
+ cacheHitRatio: number;
381
+ collapseRatio: number;
382
+ networkRequestRatio: number;
383
+ savedRequestRatio: number;
384
+ thresholds: BarsHotWindowLoadGateThresholds;
385
+ };
386
+ interface WidgetAuthHandler {
387
+ getToken: () => string | Promise<string>;
388
+ getRefreshToken?: () => string | Promise<string>;
389
+ onTokensUpdated?: (tokens: {
390
+ patToken: string;
391
+ refreshToken?: string;
392
+ }) => void | Promise<void>;
393
+ onAuthError?: (error: Error) => void;
394
+ }
395
+ declare class VNInvestClient {
396
+ private _pat;
397
+ private _base;
398
+ private _authHandler?;
399
+ constructor(patToken?: string);
400
+ setAuthHandler(handler: WidgetAuthHandler): void;
401
+ setPAT(token: string): void;
402
+ /**
403
+ * Transport-only credential sync. Sets `_pat` WITHOUT touching storage —
404
+ * storage belongs to credentialStore alone. The SaaS context calls this before
405
+ * validation when its resolved credential (tenant > user > env) differs from
406
+ * what this transport carries; otherwise a user-pasted PAT sits in storage
407
+ * while requests go out with a stale or empty token, and the backend 401s with
408
+ * "Authentication credentials were not provided." No-op when equal.
409
+ */
410
+ syncTransportPat(token: string): void;
411
+ private _notifyPatChanged;
412
+ getPAT(): string;
413
+ setBase(url: string): void;
414
+ getBase(): string;
415
+ hasPAT(): boolean;
416
+ private buildHeaders;
417
+ private _fetch;
418
+ getChart(symbol: string, options?: {
419
+ timeframe?: string;
420
+ days?: number;
421
+ }): Promise<RawOHLCVBar[]>;
422
+ validateMe(): Promise<AuthMeResponse>;
423
+ /** Fetch eligible ad campaigns. Bearer PAT auto-attached; premium → empty list. */
424
+ fetchAd(): Promise<WidgetAdResponse>;
425
+ getBarsPage(params: VNIBarsParams): Promise<VNIBarsPageResponse>;
426
+ static __resetBarsHotWindowCacheForTests(): void;
427
+ static getBarsHotWindowTelemetry(): BarsHotWindowTelemetry;
428
+ static __getBarsHotWindowTelemetryForTests(): BarsHotWindowTelemetry;
429
+ getStocks(query?: string, exchange?: string): Promise<StockItem[]>;
430
+ getWhaleFeed(symbol: string): Promise<WhaleFeedResponse | null>;
431
+ getOrderFlow(symbol: string, window?: "5m" | "15m" | "30m" | "1h"): Promise<OrderFlowResponse | null>;
432
+ /** Shared GET/POST fetch for the native advisory session endpoint. */
433
+ private fetchAdvisorySessionV2;
434
+ /**
435
+ * Follow-up advisory V2: read the native AI advisory session.
436
+ * Returns the session in both empty (`reason: "no_advisory_data"`) and record states;
437
+ * null only on transport/auth failure. Never throws for empty sessions.
438
+ */
439
+ getAdvisorySessionV2(symbol: string): Promise<AdvisorySessionV2 | null>;
440
+ /**
441
+ * Follow-up advisory V2: trigger a manual refresh (queues generation server-side).
442
+ * Returns the updated session payload; null on transport/auth failure.
443
+ */
444
+ refreshAdvisorySession(symbol: string): Promise<AdvisorySessionV2 | null>;
445
+ /** @deprecated Legacy POST path 404s on current backends — use getAdvisorySessionV2. */
446
+ getAdvisorySession(symbol: string): Promise<AdvisorySessionResponse | null>;
447
+ getTapeEntries(symbol: string, pageSize?: number): Promise<TapeResponse | null>;
448
+ private _revalidateBarsHotWindow;
449
+ }
450
+
451
+ /**
452
+ * WP-03: VNInvestWebSocketClient — moved from src/demo/dataSources/
453
+ * WebSocket client for the VNInvest Realtime channel.
454
+ */
455
+ interface TickerUpdateEvent {
456
+ event_type: "ticker_update";
457
+ symbol: string;
458
+ price: number;
459
+ current_price: number;
460
+ volume: number;
461
+ vwap?: number;
462
+ ts: string;
463
+ last_date?: string;
464
+ stale?: boolean;
465
+ seq?: number;
466
+ rsi_14?: number;
467
+ ma20_dist_pct?: number;
468
+ rvol?: number;
469
+ open_price?: number;
470
+ high_price?: number;
471
+ low_price?: number;
472
+ prev_price?: number | null;
473
+ change_value?: number | null;
474
+ change_pct?: number | null;
475
+ }
476
+ interface WhaleAlertWSEvent {
477
+ event_type: "whale_alert";
478
+ symbol: string;
479
+ side?: "buy" | "sell";
480
+ value?: number;
481
+ price?: number;
482
+ ts?: string;
483
+ }
484
+ type VNIWSEvent = TickerUpdateEvent | WhaleAlertWSEvent | {
485
+ event_type: string;
486
+ [key: string]: unknown;
487
+ };
488
+ declare class VNInvestWebSocketClient {
489
+ private static readonly MAX_RECONNECT_ATTEMPTS;
490
+ private static readonly RECONNECT_DELAY_MS;
491
+ private static readonly WS_PATH_CANDIDATES;
492
+ private ws;
493
+ private readonly pat;
494
+ private readonly apiBase;
495
+ private selectedWsPath;
496
+ private wsUnavailable;
497
+ private wsProbePromise;
498
+ private readonly subscribedSymbols;
499
+ private onTickerUpdateCb;
500
+ private onWhaleAlertCb;
501
+ private reconnectTimer;
502
+ private reconnectAttempts;
503
+ private _isConnected;
504
+ private _destroyed;
505
+ constructor(pat: string, apiBase?: string);
506
+ get isConnected(): boolean;
507
+ get destroyed(): boolean;
508
+ buildWsUrl(path?: string): string;
509
+ private buildHttpProbeUrl;
510
+ private probeWsPath;
511
+ private resolveWsPath;
512
+ connect(): void;
513
+ private openConnection;
514
+ subscribe(symbols: string[]): void;
515
+ unsubscribe(symbols: string[]): void;
516
+ setOnTickerUpdate(cb: ((event: TickerUpdateEvent) => void) | null): void;
517
+ setOnWhaleAlert(cb: ((event: WhaleAlertWSEvent) => void) | null): void;
518
+ destroy(): void;
519
+ private handleRawMessage;
520
+ private scheduleReconnect;
521
+ private sendJson;
522
+ }
523
+
524
+ /**
525
+ * WP-04: VNInvestDataAdapter
526
+ *
527
+ * Implements `StockDataAdapter` interface, wrapping VNInvestClient (REST)
528
+ * and VNInvestWebSocketClient (WebSocket) into a single cohesive adapter.
529
+ *
530
+ * This is the OPTIONAL subpath import — NOT bundled in core IIFE.
531
+ * Usage:
532
+ * import { VNInvestDataAdapter } from '@vninvestcharts/widget/adapters';
533
+ */
534
+
535
+ /** Configuration for VNInvestDataAdapter. */
536
+ interface VNInvestDataAdapterConfig {
537
+ /** Personal Access Token — never hardcoded, always passed by host app. */
538
+ patToken: string;
539
+ /** API base URL. Falls back to resolveApiBase() if not provided. */
540
+ apiBase?: string;
541
+ }
542
+ /**
543
+ * Full-featured data adapter for the VNInvest platform.
544
+ *
545
+ * Implements:
546
+ * - fetchBarsInRange / fetchBarsBefore (cursor-paged /bars/ endpoint)
547
+ * - subscribeToBar (WebSocket ticker_update)
548
+ * - searchSymbols (GET /stocks/)
549
+ *
550
+ * Not implemented (VNInvest does not provide these endpoints):
551
+ * - subscribeToTrades → returns no-op unsubscribe
552
+ * - subscribeToOrderbook → returns no-op unsubscribe
553
+ */
554
+ declare class VNInvestDataAdapter implements StockDataAdapter {
555
+ readonly name = "vninvest";
556
+ private client;
557
+ private wsClient;
558
+ private readonly barSubscribers;
559
+ private readonly snapshotIds;
560
+ private readonly lastBackfillCoverageMap;
561
+ private readonly lastRangeCoverageMap;
562
+ constructor(config: VNInvestDataAdapterConfig);
563
+ setAuthHandler(handler: WidgetAuthHandler): void;
564
+ getSourceSemantics(): SourceSemanticsDescriptor;
565
+ private coverageKey;
566
+ getLastBackfillCoverage(symbol?: string, timeframe?: Timeframe, chartId?: string): readonly CoverageFragment[] | null;
567
+ getLastRangeCoverage(symbol?: string, timeframe?: Timeframe, chartId?: string): readonly CoverageFragment[] | null;
568
+ /** Expose the underlying REST client for advanced use cases. */
569
+ get restClient(): VNInvestClient;
570
+ /**
571
+ * Fetch bars in a date range.
572
+ * Uses the cursor-paged /bars/ endpoint with backward pagination.
573
+ *
574
+ * 504-guard: a single wide intraday window (e.g. 90d of 1H) times the server
575
+ * out — each request is capped to MAX_INTRADAY_SPAN_MS and the existing
576
+ * hasMoreAfter/nextAfter loop walks the remainder. Daily+ ranges are unaffected.
577
+ */
578
+ fetchBarsInRange(symbol: string, timeframe: Timeframe, from: Date, to: Date, chartId?: string, signal?: AbortSignal): Promise<readonly OHLCVBar[]>;
579
+ /**
580
+ * Fetch bars before a given anchor date (backward pagination).
581
+ */
582
+ fetchBarsBefore(symbol: string, timeframe: Timeframe, before: Date, limit?: number, chartId?: string): Promise<readonly OHLCVBar[]>;
583
+ /**
584
+ * Subscribe to real-time bar updates via WebSocket.
585
+ * Maps ticker_update events to OHLCVBar callbacks.
586
+ */
587
+ subscribeToBar(symbol: string, timeframe: Timeframe, onBar: (bar: OHLCVBar) => void): Unsubscribe;
588
+ /** Not supported by VNInvest — returns no-op. */
589
+ subscribeToTrades(_symbol: string, _onTrade: (trade: Trade) => void): Unsubscribe;
590
+ /** Not supported by VNInvest — returns no-op. */
591
+ subscribeToOrderbook(_symbol: string, _onUpdate: (snapshot: OrderbookSnapshot) => void): Unsubscribe;
592
+ /** Search symbols via GET /stocks/ endpoint. */
593
+ searchSymbols(query: string): Promise<readonly SymbolInfo[]>;
594
+ /** Clean up: destroy WebSocket connection. */
595
+ destroy(): void;
596
+ private handleTickerUpdate;
597
+ }
598
+
599
+ /**
600
+ * WP-02: Bars paging policy — moved from src/demo/dataSources/
601
+ * Cursor-paged /bars/ endpoint response normalization.
602
+ */
603
+
604
+ interface BarsPagingMeta {
605
+ hasMoreBefore: boolean;
606
+ hasMoreAfter: boolean;
607
+ nextBefore: number | null;
608
+ nextAfter: number | null;
609
+ snapshotId: string | null;
610
+ }
611
+ declare function normalizeBarsPagingMeta(payload: Record<string, unknown>, bars: readonly RawOHLCVBar[]): BarsPagingMeta;
612
+ declare function buildBackwardPageRequest(meta: BarsPagingMeta, fallbackBefore: number, limit: number): {
613
+ before: number;
614
+ limit: number;
615
+ snapshotId?: string;
616
+ } | null;
617
+
618
+ interface UseWatchlistRealtimeSyncOptions {
619
+ /** Instance of the VNInvest WebSocket client. */
620
+ wsClient: VNInvestWebSocketClient | null;
621
+ /** Array of symbols to subscribe to in the watchlist/heatmap. */
622
+ symbols: string[];
623
+ /** Optional callback triggered on each state flush with the accumulated updates. */
624
+ onUpdate?: (updatedData: Map<string, TickerUpdateEvent>) => void;
625
+ /** Throttle duration in milliseconds. Defaults to 500ms. */
626
+ throttleMs?: number;
627
+ }
628
+ /**
629
+ * Hook to synchronize a list of symbols in real-time using VNInvestWebSocketClient.
630
+ * Uses throttled state updates to ensure smooth rendering of large watchlists/heatmaps.
631
+ */
632
+ declare function useWatchlistRealtimeSync({ wsClient, symbols, onUpdate, throttleMs, }: UseWatchlistRealtimeSyncOptions): Map<string, TickerUpdateEvent>;
633
+
634
+ declare class ContinuousFuturesStockDataAdapter implements StockDataAdapter {
635
+ private continuousAdapter;
636
+ private baseAdapter;
637
+ private symbol;
638
+ constructor(symbol: string, baseAdapter: StockDataAdapter);
639
+ fetchBarsInRange(symbol: string, timeframe: Timeframe, from: Date, to: Date, chartId?: string): Promise<readonly OHLCVBar[]>;
640
+ fetchBarsBefore(symbol: string, timeframe: Timeframe, before: Date, limit?: number, chartId?: string): Promise<readonly OHLCVBar[]>;
641
+ subscribeToBar(symbol: string, timeframe: Timeframe, onBar: (bar: OHLCVBar) => void): Unsubscribe;
642
+ subscribeToTrades(symbol: string, onTrade: (trade: Trade) => void): Unsubscribe;
643
+ subscribeToOrderbook(symbol: string, onUpdate: (snapshot: OrderbookSnapshot) => void): Unsubscribe;
644
+ searchSymbols(query: string): Promise<readonly SymbolInfo[]>;
645
+ getSourceSemantics(): SourceSemanticsDescriptor;
646
+ getLastBackfillCoverage?(symbol?: string, timeframe?: Timeframe, chartId?: string): readonly CoverageFragment[] | null;
647
+ getLastRangeCoverage?(symbol?: string, timeframe?: Timeframe, chartId?: string): readonly CoverageFragment[] | null;
648
+ }
649
+
650
+ interface SourceRoute {
651
+ pattern: RegExp;
652
+ adapter: StockDataAdapter;
653
+ }
654
+ interface MultiSourceDataAdapterConfig {
655
+ routes: SourceRoute[];
656
+ defaultAdapter: StockDataAdapter;
657
+ }
658
+ declare class MultiSourceDataAdapter implements StockDataAdapter {
659
+ private readonly config;
660
+ private readonly _cache;
661
+ constructor(config: MultiSourceDataAdapterConfig);
662
+ private _resolve;
663
+ fetchBarsInRange(symbol: string, timeframe: Timeframe, from: Date, to: Date, chartId?: string): Promise<readonly OHLCVBar[]>;
664
+ fetchBarsBefore(symbol: string, timeframe: Timeframe, before: Date, limit?: number, chartId?: string): Promise<readonly OHLCVBar[]>;
665
+ subscribeToBar(symbol: string, timeframe: Timeframe, onBar: (bar: OHLCVBar) => void): Unsubscribe;
666
+ subscribeToTrades(symbol: string, onTrade: (trade: Trade) => void): Unsubscribe;
667
+ subscribeToOrderbook(symbol: string, onUpdate: (snapshot: OrderbookSnapshot) => void): Unsubscribe;
668
+ searchSymbols(query: string): Promise<readonly SymbolInfo[]>;
669
+ getLastBackfillCoverage?(symbol?: string, timeframe?: Timeframe, chartId?: string): readonly CoverageFragment[] | null;
670
+ getLastRangeCoverage?(symbol?: string, timeframe?: Timeframe, chartId?: string): readonly CoverageFragment[] | null;
671
+ }
672
+
673
+ export { type BarsHotWindowLoadGateReport, type BarsHotWindowLoadGateStatus, type BarsHotWindowLoadGateThresholds, type BarsHotWindowTelemetry, type BarsPagingMeta, ContinuousFuturesStockDataAdapter, MultiSourceDataAdapter, type MultiSourceDataAdapterConfig, type SourceRoute, TIMEFRAME_MAP, type TickerUpdateEvent, type UseWatchlistRealtimeSyncOptions, type VNIBarsPageResponse, type VNIBarsParams, type VNIWSEvent, VNInvestClient, VNInvestDataAdapter, type VNInvestDataAdapterConfig, VNInvestWebSocketClient, type WhaleAlertWSEvent, buildBackwardPageRequest, normalizeBarsPagingMeta, resolveApiBase, useWatchlistRealtimeSync };