@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.
- package/LICENSE +201 -0
- package/NOTICE.md +83 -0
- package/README.md +851 -3
- package/dist/AlertsModal-WKEUDTUZ.js +2 -0
- package/dist/ConnectedTradingPanel-KWJMIKTN.css +2 -0
- package/dist/ConnectedTradingPanel-XDKMOQY5.js +2 -0
- package/dist/PineEditorPanel-AUXB4FD3.js +2 -0
- package/dist/PineEditorPanel-V6YN2OTU.css +2 -0
- package/dist/RightSidebarDockHost-6FPZ6EKV.css +2 -0
- package/dist/RightSidebarDockHost-OBFXKSIY.js +2 -0
- package/dist/StrategyTesterPanel-6IUTS2P4.js +2 -0
- package/dist/StrategyTesterPanel-LEWEUMXP.css +2 -0
- package/dist/VolumeProfileWorker-UREKVPUE.js +189 -0
- package/dist/adapters/index.cjs +2532 -0
- package/dist/adapters/index.d.mts +673 -0
- package/dist/adapters/index.d.ts +673 -0
- package/dist/adapters/index.js +2521 -0
- package/dist/adapters/index.umd.js +2535 -0
- package/dist/chunk-5T6DGB3V.js +2 -0
- package/dist/chunk-66JBEGR3.js +4 -0
- package/dist/chunk-6D7DVBIK.js +2 -0
- package/dist/chunk-76E7CKUD.js +2 -0
- package/dist/chunk-AKWVXRQ6.js +2 -0
- package/dist/chunk-FHHSTO6Z.js +2 -0
- package/dist/chunk-HPL723JA.js +2 -0
- package/dist/chunk-NVGTF73S.js +2 -0
- package/dist/chunk-PNIB4OM3.js +2 -0
- package/dist/chunk-UKJ5AKQX.js +595 -0
- package/dist/chunk-UYJTX3SD.js +2 -0
- package/dist/combined.css +3068 -0
- package/dist/css-modules-manifest.json +297 -0
- package/dist/dist-Y6PZ2RN3.js +12 -0
- package/dist/drawing/index.cjs +53 -0
- package/dist/drawing/index.d.mts +2 -0
- package/dist/drawing/index.d.ts +2 -0
- package/dist/drawing/index.js +2 -0
- package/dist/drawing/index.umd.js +54 -0
- package/dist/dts/drawing-shim.d.ts +3 -0
- package/dist/dts/index.d.ts +31 -0
- package/dist/dts/lib/Chart.d.ts +31 -0
- package/dist/dts/lib/ChartContext.d.ts +10 -0
- package/dist/dts/lib/EventCapture.d.ts +3 -0
- package/dist/dts/lib/GenericChartComponent.d.ts +5 -0
- package/dist/dts/lib/GenericComponent.d.ts +124 -0
- package/dist/dts/lib/StockChartContext.d.ts +53 -0
- package/dist/dts/lib/adapters/BaseAdapter.d.ts +25 -0
- package/dist/dts/lib/adapters/BinanceAdapter.d.ts +51 -0
- package/dist/dts/lib/adapters/CSVAdapter.d.ts +17 -0
- package/dist/dts/lib/adapters/ContinuousContractAdapter.d.ts +63 -0
- package/dist/dts/lib/adapters/ContinuousContractTypes.d.ts +154 -0
- package/dist/dts/lib/adapters/DBAdapter.d.ts +16 -0
- package/dist/dts/lib/adapters/DataAdapter.d.ts +136 -0
- package/dist/dts/lib/adapters/DjangoVnstockAdapter.d.ts +15 -0
- package/dist/dts/lib/adapters/LocalCacheAdapter.d.ts +18 -0
- package/dist/dts/lib/adapters/MockAdapter.d.ts +22 -0
- package/dist/dts/lib/adapters/RESTAdapter.d.ts +16 -0
- package/dist/dts/lib/adapters/StockDataAdapter.d.ts +1 -0
- package/dist/dts/lib/adapters/UDFDataAdapter.d.ts +29 -0
- package/dist/dts/lib/adapters/VNStocksAdapter.d.ts +8 -0
- package/dist/dts/lib/adapters/WSAdapter.d.ts +30 -0
- package/dist/dts/lib/adapters/gapFixture.d.ts +71 -0
- package/dist/dts/lib/adapters/index.d.ts +15 -0
- package/dist/dts/lib/adapters/rollAlgorithms.d.ts +68 -0
- package/dist/dts/lib/advisory/AdvisoryPanel.d.ts +5 -0
- package/dist/dts/lib/alerts/AlertEvaluator.d.ts +5 -0
- package/dist/dts/lib/alerts/AlertManager.d.ts +123 -0
- package/dist/dts/lib/alerts/types.d.ts +58 -0
- package/dist/dts/lib/cache/cacheDebug.d.ts +3 -0
- package/dist/dts/lib/calendars/ExchangeCalendar.d.ts +23 -0
- package/dist/dts/lib/calendars/calendarRegistry.d.ts +10 -0
- package/dist/dts/lib/calendars/index.d.ts +3 -0
- package/dist/dts/lib/core/ChartPane.d.ts +8 -0
- package/dist/dts/lib/core/ChartSplitter.d.ts +70 -0
- package/dist/dts/lib/core/ChartTerminal.d.ts +12 -0
- package/dist/dts/lib/core/ErrorBoundary.d.ts +17 -0
- package/dist/dts/lib/core/IndicatorLegend.d.ts +47 -0
- package/dist/dts/lib/core/PaneHeader.d.ts +24 -0
- package/dist/dts/lib/core/PaneLabel.d.ts +8 -0
- package/dist/dts/lib/core/PaneSplitter.d.ts +9 -0
- package/dist/dts/lib/core/SeriesPicker.d.ts +10 -0
- package/dist/dts/lib/core/calculators/alignBarsByDate.d.ts +38 -0
- package/dist/dts/lib/core/calculators/buildIndicatorComputationPlan.d.ts +16 -0
- package/dist/dts/lib/core/calculators/calcCVDApprox.d.ts +6 -0
- package/dist/dts/lib/core/calculators/calcStrengthElder.d.ts +7 -0
- package/dist/dts/lib/core/calculators/calcWhaleApprox.d.ts +6 -0
- package/dist/dts/lib/core/calculators/computationHelpers.d.ts +12 -0
- package/dist/dts/lib/core/calculators/computeIndicatorComputationResult.d.ts +3 -0
- package/dist/dts/lib/core/calculators/computeMarketStructure.d.ts +8 -0
- package/dist/dts/lib/core/calculators/computeMomentum.d.ts +22 -0
- package/dist/dts/lib/core/calculators/computeMovingAverage.d.ts +15 -0
- package/dist/dts/lib/core/calculators/computeProfile.d.ts +9 -0
- package/dist/dts/lib/core/calculators/computeTrend.d.ts +10 -0
- package/dist/dts/lib/core/calculators/computeVolatility.d.ts +14 -0
- package/dist/dts/lib/core/calculators/computeVolumeFlow.d.ts +19 -0
- package/dist/dts/lib/core/calculators/enrichData.d.ts +7 -0
- package/dist/dts/lib/core/calculators/enrichDataWithCanonicalStore.d.ts +33 -0
- package/dist/dts/lib/core/calculators/exoticChartData.d.ts +140 -0
- package/dist/dts/lib/core/calculators/fixtures/mockData.d.ts +2 -0
- package/dist/dts/lib/core/calculators/indicatorComputation.d.ts +27 -0
- package/dist/dts/lib/core/calculators/indicatorComputationTypes.d.ts +249 -0
- package/dist/dts/lib/core/calculators/materializeIndicatorValues.d.ts +3 -0
- package/dist/dts/lib/core/calculators/normalizePrices.d.ts +36 -0
- package/dist/dts/lib/core/calculators/resolveCalculationOrder.d.ts +17 -0
- package/dist/dts/lib/core/calculators/types.d.ts +269 -0
- package/dist/dts/lib/core/canvas/ChartRenderContext.d.ts +14 -0
- package/dist/dts/lib/core/canvas/OverlayCanvas.d.ts +19 -0
- package/dist/dts/lib/core/context/ChartSyncContext.d.ts +21 -0
- package/dist/dts/lib/core/context/DataContext.d.ts +15 -0
- package/dist/dts/lib/core/context/PaneManagerContext.d.ts +10 -0
- package/dist/dts/lib/core/hooks/paneSizingHelpers.d.ts +13 -0
- package/dist/dts/lib/core/hooks/useCanvasResize.d.ts +8 -0
- package/dist/dts/lib/core/hooks/useChartTheme.d.ts +12 -0
- package/dist/dts/lib/core/hooks/useDynamicPanes.d.ts +155 -0
- package/dist/dts/lib/core/hooks/useIndicatorSets.d.ts +20 -0
- package/dist/dts/lib/core/hooks/usePaneManager.d.ts +39 -0
- package/dist/dts/lib/core/hooks/usePaneSizes.d.ts +52 -0
- package/dist/dts/lib/core/index.d.ts +41 -0
- package/dist/dts/lib/core/paneScaleSlotDomains.d.ts +3 -0
- package/dist/dts/lib/core/registry/SeriesRegistry.d.ts +22 -0
- package/dist/dts/lib/core/registry/filterPanesBySeriesTier.d.ts +43 -0
- package/dist/dts/lib/core/registry/marketStructure.d.ts +7 -0
- package/dist/dts/lib/core/registry/momentum.d.ts +20 -0
- package/dist/dts/lib/core/registry/movingAverage.d.ts +14 -0
- package/dist/dts/lib/core/registry/priceChartTypes.d.ts +16 -0
- package/dist/dts/lib/core/registry/profile.d.ts +8 -0
- package/dist/dts/lib/core/registry/registerAll.d.ts +1 -0
- package/dist/dts/lib/core/registry/registerPhaseOne.d.ts +3 -0
- package/dist/dts/lib/core/registry/registryCore.d.ts +77 -0
- package/dist/dts/lib/core/registry/trend.d.ts +11 -0
- package/dist/dts/lib/core/registry/volatility.d.ts +11 -0
- package/dist/dts/lib/core/registry/volumeFlow.d.ts +20 -0
- package/dist/dts/lib/core/replay/BarReplayController.d.ts +62 -0
- package/dist/dts/lib/core/replay/ReplayEventBus.d.ts +68 -0
- package/dist/dts/lib/core/replay/ReplayFillSimulator.d.ts +33 -0
- package/dist/dts/lib/core/replay/ReplayOrderBook.d.ts +24 -0
- package/dist/dts/lib/core/replay/ReplayPositionManager.d.ts +30 -0
- package/dist/dts/lib/core/replay/ReplaySessionAnalytics.d.ts +31 -0
- package/dist/dts/lib/core/replay/createReplayTradeMarkerPrimitives.d.ts +7 -0
- package/dist/dts/lib/core/replay/pnlUtils.d.ts +2 -0
- package/dist/dts/lib/core/replay/replayBrokerAdapters.d.ts +51 -0
- package/dist/dts/lib/core/replay/replayTradingTypes.d.ts +61 -0
- package/dist/dts/lib/core/scales/computeScales.d.ts +8 -0
- package/dist/dts/lib/core/seriesValueResolver.d.ts +27 -0
- package/dist/dts/lib/core/sets/builtins.d.ts +2 -0
- package/dist/dts/lib/core/sets/indicatorSetCodec.d.ts +15 -0
- package/dist/dts/lib/core/trading/AnalyticsEngine.d.ts +56 -0
- package/dist/dts/lib/core/trading/BrokerAPI.d.ts +40 -0
- package/dist/dts/lib/core/trading/ExecutionSimulator.d.ts +53 -0
- package/dist/dts/lib/core/trading/FillSettlement.d.ts +38 -0
- package/dist/dts/lib/core/trading/MarketDataPort.d.ts +41 -0
- package/dist/dts/lib/core/trading/MarketRules.d.ts +58 -0
- package/dist/dts/lib/core/trading/OrderManagementSystem.d.ts +57 -0
- package/dist/dts/lib/core/trading/PositionManager.d.ts +79 -0
- package/dist/dts/lib/core/trading/RiskEngine.d.ts +40 -0
- package/dist/dts/lib/core/trading/SettlementCalendar.d.ts +10 -0
- package/dist/dts/lib/core/trading/VirtualBrokerEngine.d.ts +92 -0
- package/dist/dts/lib/core/trading/orderMargin.d.ts +3 -0
- package/dist/dts/lib/core/trading/storage/InMemoryStorageAdapter.d.ts +10 -0
- package/dist/dts/lib/core/trading/storage/TradingStorage.d.ts +34 -0
- package/dist/dts/lib/core/trading/types.d.ts +99 -0
- package/dist/dts/lib/core/types/chart.d.ts +21 -0
- package/dist/dts/lib/core/types/indicator-catalog.d.ts +38 -0
- package/dist/dts/lib/core/types/indicator-set.d.ts +19 -0
- package/dist/dts/lib/core/types/pane-descriptor.d.ts +46 -0
- package/dist/dts/lib/core/types/seriesComponents.d.ts +15 -0
- package/dist/dts/lib/credentials/credentialStore.d.ts +93 -0
- package/dist/dts/lib/helper/SaveChartAsImage.d.ts +90 -0
- package/dist/dts/lib/indicator/defaultOptionsForAppearance.d.ts +105 -0
- package/dist/dts/lib/indicators/builtin/MTFWrapper.d.ts +3 -0
- package/dist/dts/lib/indicators/builtin/VolumeProfileWorker.d.ts +19 -0
- package/dist/dts/lib/indicators/builtin/ac.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/alligator.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/anchoredVwap.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/ao.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/bbi.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/bias.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/bollinger.d.ts +9 -0
- package/dist/dts/lib/indicators/builtin/brar.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cci.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/chaikinOscillator.d.ts +14 -0
- package/dist/dts/lib/indicators/builtin/chaikinVol.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/ci.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cmf.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cr.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/cvd.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/deltaProfile.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/dema.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/dma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/dmi.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/donchian.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/ema.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/emv.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/footprint.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/fractals.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/gator.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/hma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/hv.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/ichimoku.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/kdj.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/keltner.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/ma.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/maRibbon.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/macd.d.ts +9 -0
- package/dist/dts/lib/indicators/builtin/marketProfile.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/mfi.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/mtm.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/obv.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/pivotHighLow.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/pivotStandard.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/psy.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/pvt.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/roc.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/rsi.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/sar.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/sma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/smfi.d.ts +8 -0
- package/dist/dts/lib/indicators/builtin/stdDev.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/strengthRelative.d.ts +7 -0
- package/dist/dts/lib/indicators/builtin/supertrend.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/tema.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/trix.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/volOsc.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/volume.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/volumeProfile.d.ts +8 -0
- package/dist/dts/lib/indicators/builtin/vr.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/vwap.d.ts +5 -0
- package/dist/dts/lib/indicators/builtin/vwma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/wma.d.ts +4 -0
- package/dist/dts/lib/indicators/builtin/wr.d.ts +10 -0
- package/dist/dts/lib/indicators/builtin/wyckoffWave.d.ts +15 -0
- package/dist/dts/lib/indicators/index.d.ts +63 -0
- package/dist/dts/lib/indicators/indicatorValueShapes.d.ts +15 -0
- package/dist/dts/lib/indicators/outputKeys.d.ts +50 -0
- package/dist/dts/lib/indicators/overlays/CVDIndicator.d.ts +26 -0
- package/dist/dts/lib/indicators/overlays/DarkFlowBadge.d.ts +19 -0
- package/dist/dts/lib/indicators/overlays/ExternalCVDOverlay.d.ts +15 -0
- package/dist/dts/lib/indicators/overlays/WhaleBubbleOverlay.d.ts +14 -0
- package/dist/dts/lib/indicators/overlays/WhaleMarketBubbleOverlay.d.ts +27 -0
- package/dist/dts/lib/indicators/overlays/whaleDetector.d.ts +66 -0
- package/dist/dts/lib/indicators/registry.d.ts +6 -0
- package/dist/dts/lib/indicators/types.d.ts +5 -0
- package/dist/dts/lib/indicators/utils.d.ts +259 -0
- package/dist/dts/lib/pinescript/PineCompiler.d.ts +34 -0
- package/dist/dts/lib/pinescript/ast.d.ts +73 -0
- package/dist/dts/lib/pinescript/compile.d.ts +40 -0
- package/dist/dts/lib/pinescript/grammar.d.ts +12 -0
- package/dist/dts/lib/pinescript/pine.worker.d.ts +1 -0
- package/dist/dts/lib/pinescript/pineBlocks.d.ts +54 -0
- package/dist/dts/lib/pinescript/pineBuiltins.d.ts +47 -0
- package/dist/dts/lib/pinescript/pineEnv.d.ts +46 -0
- package/dist/dts/lib/pinescript/pineMath.d.ts +13 -0
- package/dist/dts/lib/pinescript/pineParse.d.ts +25 -0
- package/dist/dts/lib/pinescript/pineStrings.d.ts +50 -0
- package/dist/dts/lib/pinescript/runtime.d.ts +5 -0
- package/dist/dts/lib/pinescript/scriptRegistry.d.ts +40 -0
- package/dist/dts/lib/pinescript/series-value.d.ts +64 -0
- package/dist/dts/lib/pinescript/vnscript-completion.d.ts +1 -0
- package/dist/dts/lib/pinescript/vnscript-grammar.d.ts +19 -0
- package/dist/dts/lib/scale/discontinuousTimeScaleProvider.d.ts +3 -0
- package/dist/dts/lib/scale/financeDiscontinuousScale.d.ts +15 -0
- package/dist/dts/lib/scale/index.d.ts +1 -0
- package/dist/dts/lib/scale/levels.d.ts +12 -0
- package/dist/dts/lib/series/AlternatingFillAreaSeries.d.ts +13 -0
- package/dist/dts/lib/series/AreaOnlySeries.d.ts +10 -0
- package/dist/dts/lib/series/AreaSeries.d.ts +30 -0
- package/dist/dts/lib/series/BarSeries.d.ts +40 -0
- package/dist/dts/lib/series/BollingerSeries.d.ts +11 -0
- package/dist/dts/lib/series/CandlestickSeries.d.ts +56 -0
- package/dist/dts/lib/series/CircleMarker.d.ts +28 -0
- package/dist/dts/lib/series/ElderRaySeries.d.ts +14 -0
- package/dist/dts/lib/series/FootprintSeries.d.ts +21 -0
- package/dist/dts/lib/series/GroupedBarSeries.d.ts +9 -0
- package/dist/dts/lib/series/HTFOverlaySeries.d.ts +32 -0
- package/dist/dts/lib/series/HistogramSeries.d.ts +51 -0
- package/dist/dts/lib/series/KagiSeries.d.ts +9 -0
- package/dist/dts/lib/series/LineBreakSeries.d.ts +28 -0
- package/dist/dts/lib/series/LineSeries.d.ts +54 -0
- package/dist/dts/lib/series/MACDSeries.d.ts +28 -0
- package/dist/dts/lib/series/MarketProfileSeries.d.ts +18 -0
- package/dist/dts/lib/series/OHLCSeries.d.ts +9 -0
- package/dist/dts/lib/series/OverlayBarSeries.d.ts +9 -0
- package/dist/dts/lib/series/PointAndFigureSeries.d.ts +45 -0
- package/dist/dts/lib/series/RSISeries.d.ts +38 -0
- package/dist/dts/lib/series/RenkoSeries.d.ts +9 -0
- package/dist/dts/lib/series/SARSeries.d.ts +10 -0
- package/dist/dts/lib/series/SVGComponent.d.ts +5 -0
- package/dist/dts/lib/series/ScatterSeries.d.ts +9 -0
- package/dist/dts/lib/series/SquareMarker.d.ts +28 -0
- package/dist/dts/lib/series/StackedBarSeries.d.ts +19 -0
- package/dist/dts/lib/series/StochasticSeries.d.ts +9 -0
- package/dist/dts/lib/series/StraightLine.d.ts +18 -0
- package/dist/dts/lib/series/TriangleMarker.d.ts +30 -0
- package/dist/dts/lib/series/VolumeProfileSeries.d.ts +9 -0
- package/dist/dts/lib/series/index.d.ts +28 -0
- package/dist/dts/lib/strategy/BrokerSimulator.d.ts +11 -0
- package/dist/dts/lib/strategy/types.d.ts +35 -0
- package/dist/dts/lib/tape/TapePanel.d.ts +5 -0
- package/dist/dts/lib/types/adapter.d.ts +1 -0
- package/dist/dts/lib/types/index.d.ts +5 -0
- package/dist/dts/lib/types/indicator.d.ts +11 -0
- package/dist/dts/lib/types/ohlcv.d.ts +1 -0
- package/dist/dts/lib/types/pane.d.ts +23 -0
- package/dist/dts/lib/types/runtime.d.ts +11 -0
- package/dist/dts/lib/types/vninvest.d.ts +320 -0
- package/dist/dts/lib/types.d.ts +45 -0
- package/dist/dts/lib/utils/ChartDataUtil.d.ts +26 -0
- package/dist/dts/lib/utils/PureComponent.d.ts +5 -0
- package/dist/dts/lib/utils/accumulatingWindow.d.ts +1 -0
- package/dist/dts/lib/utils/axisPriceFormat.d.ts +6 -0
- package/dist/dts/lib/utils/barWidth.d.ts +14 -0
- package/dist/dts/lib/utils/identity.d.ts +1 -0
- package/dist/dts/lib/utils/index.d.ts +70 -0
- package/dist/dts/lib/utils/logger.d.ts +28 -0
- package/dist/dts/lib/utils/mappedSlidingWindow.d.ts +1 -0
- package/dist/dts/lib/utils/merge.d.ts +6 -0
- package/dist/dts/lib/utils/noop.d.ts +1 -0
- package/dist/dts/lib/utils/rebind.d.ts +1 -0
- package/dist/dts/lib/utils/shallowEqual.d.ts +1 -0
- package/dist/dts/lib/utils/slidingWindow.d.ts +1 -0
- package/dist/dts/lib/utils/storage.d.ts +32 -0
- package/dist/dts/lib/utils/strokeDasharray.d.ts +3 -0
- package/dist/dts/lib/utils/timezoneFormatter.d.ts +14 -0
- package/dist/dts/lib/utils/zipper.d.ts +4 -0
- package/dist/dts/public-api.d.ts +31 -0
- package/dist/dts/widget/BackfillWorkerFlags.d.ts +12 -0
- package/dist/dts/widget/CanaryRollbackHelper.d.ts +95 -0
- package/dist/dts/widget/CanaryRolloutConfig.d.ts +100 -0
- package/dist/dts/widget/DrawingPriceLabelsOverlay.d.ts +20 -0
- package/dist/dts/widget/ForkDrawingsOverlay.d.ts +16 -0
- package/dist/dts/widget/MeasurementOverlay.d.ts +24 -0
- package/dist/dts/widget/VNInvestCharts.d.ts +5 -0
- package/dist/dts/widget/VNInvestChartsProps.d.ts +302 -0
- package/dist/dts/widget/VNInvestMultiCharts.d.ts +8 -0
- package/dist/dts/widget/VNInvestMultiCharts.types.d.ts +130 -0
- package/dist/dts/widget/WidgetEmptyState.d.ts +11 -0
- package/dist/dts/widget/WidgetErrorBoundary.d.ts +26 -0
- package/dist/dts/widget/adapters/ContinuousFuturesStockDataAdapter.d.ts +18 -0
- package/dist/dts/widget/adapters/DataProviderAdapterWrapper.d.ts +14 -0
- package/dist/dts/widget/adapters/MultiSourceDataAdapter.d.ts +24 -0
- package/dist/dts/widget/adapters/VNInvestClient.d.ts +161 -0
- package/dist/dts/widget/adapters/VNInvestDataAdapter.d.ts +77 -0
- package/dist/dts/widget/adapters/VNInvestWebSocketClient.d.ts +79 -0
- package/dist/dts/widget/adapters/barsPagingPolicy.d.ts +18 -0
- package/dist/dts/widget/adapters/corporateEvents.d.ts +13 -0
- package/dist/dts/widget/adapters/index.d.ts +20 -0
- package/dist/dts/widget/adapters/nativeShapes.d.ts +32 -0
- package/dist/dts/widget/adapters/watchlistRealtimeSync.d.ts +16 -0
- package/dist/dts/widget/alerts/DrawingAlertsHost.d.ts +18 -0
- package/dist/dts/widget/alerts/useDrawingAlerts.d.ts +37 -0
- package/dist/dts/widget/canaryBarFiltering.d.ts +35 -0
- package/dist/dts/widget/capabilities/CapabilityResolver.d.ts +71 -0
- package/dist/dts/widget/capabilities/capabilityProbe.d.ts +28 -0
- package/dist/dts/widget/capabilities/useTierGatedFeatures.d.ts +48 -0
- package/dist/dts/widget/components/BottomPanelHost.d.ts +80 -0
- package/dist/dts/widget/components/BottomPanelSplitter.d.ts +15 -0
- package/dist/dts/widget/components/CapabilityGate.d.ts +65 -0
- package/dist/dts/widget/components/ChartDiagOverlay.d.ts +31 -0
- package/dist/dts/widget/components/ConfirmDialog.d.ts +12 -0
- package/dist/dts/widget/components/DowngradeBanner.d.ts +9 -0
- package/dist/dts/widget/components/ForkPaneSeparators.d.ts +11 -0
- package/dist/dts/widget/components/ForkPaneTooltips.d.ts +23 -0
- package/dist/dts/widget/components/ForkXAxisOverlay.d.ts +11 -0
- package/dist/dts/widget/components/ForkYAxisCrosshairLabels.d.ts +9 -0
- package/dist/dts/widget/components/LayoutDesigner.d.ts +26 -0
- package/dist/dts/widget/components/PremiumFeatureGate.d.ts +10 -0
- package/dist/dts/widget/components/ShortcutHelpModal.d.ts +44 -0
- package/dist/dts/widget/components/SystemMenu.d.ts +66 -0
- package/dist/dts/widget/components/Toast.d.ts +20 -0
- package/dist/dts/widget/components/canvas/BarCountdownBadge.d.ts +8 -0
- package/dist/dts/widget/components/canvas/ChartA11ySummary.d.ts +40 -0
- package/dist/dts/widget/components/canvas/ChartStatusLine.d.ts +39 -0
- package/dist/dts/widget/components/canvas/PricePaneHeader.d.ts +24 -0
- package/dist/dts/widget/components/canvas/PriceScaleMenu.d.ts +27 -0
- package/dist/dts/widget/components/canvas/TimeAxisScrollbar.d.ts +18 -0
- package/dist/dts/widget/components/common/Icons.d.ts +67 -0
- package/dist/dts/widget/components/dock/DataWindow.d.ts +7 -0
- package/dist/dts/widget/components/dock/DockUpgradeNudge.d.ts +10 -0
- package/dist/dts/widget/components/dock/RightSidebarDockHost.d.ts +57 -0
- package/dist/dts/widget/components/dock/WatchlistPanel.d.ts +7 -0
- package/dist/dts/widget/components/dock/WorkspaceRightDockSlot.d.ts +46 -0
- package/dist/dts/widget/components/dock/dockAccess.d.ts +20 -0
- package/dist/dts/widget/components/dock/drawingDockContentBuilders.d.ts +29 -0
- package/dist/dts/widget/components/drawing/DrawingDock.d.ts +47 -0
- package/dist/dts/widget/components/drawing/DrawingInspector.d.ts +94 -0
- package/dist/dts/widget/components/drawing/DrawingListPanel.d.ts +62 -0
- package/dist/dts/widget/components/drawing/DrawingSemanticPointLegend.d.ts +14 -0
- package/dist/dts/widget/components/drawing/FloatingDrawingInspector.d.ts +18 -0
- package/dist/dts/widget/components/drawing/IconPickerPanel.d.ts +5 -0
- package/dist/dts/widget/components/drawing/InlineTextEditor.d.ts +20 -0
- package/dist/dts/widget/components/drawing/PatternScanPanel.d.ts +27 -0
- package/dist/dts/widget/components/drawing/TemplateManagerPanel.d.ts +18 -0
- package/dist/dts/widget/components/events/CorporateEventsOverlay.d.ts +23 -0
- package/dist/dts/widget/components/events/EventMarkerIcon.d.ts +6 -0
- package/dist/dts/widget/components/footer/ChartFooter.d.ts +26 -0
- package/dist/dts/widget/components/footer/MultiChartsFooter.d.ts +37 -0
- package/dist/dts/widget/components/footer/TimeframeFooter.d.ts +25 -0
- package/dist/dts/widget/components/footer/useBarCountdown.d.ts +5 -0
- package/dist/dts/widget/components/header/OHLCHeader.d.ts +72 -0
- package/dist/dts/widget/components/layout/DrawingConflictNotice.d.ts +4 -0
- package/dist/dts/widget/components/layout/GridContainer.d.ts +70 -0
- package/dist/dts/widget/components/layout/GridSlotErrorBoundary.d.ts +17 -0
- package/dist/dts/widget/components/layout/Splitter.d.ts +23 -0
- package/dist/dts/widget/components/layout/gridSplitterMath.d.ts +40 -0
- package/dist/dts/widget/components/layout/useGridSplitterDrag.d.ts +18 -0
- package/dist/dts/widget/components/mobile/MobileChartCarousel.d.ts +11 -0
- package/dist/dts/widget/components/mobile/MobileToolbar.d.ts +29 -0
- package/dist/dts/widget/components/overlays/AdvisoryPanel.d.ts +25 -0
- package/dist/dts/widget/components/overlays/TapePanel.d.ts +25 -0
- package/dist/dts/widget/components/overlays/WhalePanel.d.ts +5 -0
- package/dist/dts/widget/components/panels/AdvisoryPanel.d.ts +25 -0
- package/dist/dts/widget/components/panels/PineEditorPanel.d.ts +18 -0
- package/dist/dts/widget/components/panels/StrategyTesterPanel.d.ts +7 -0
- package/dist/dts/widget/components/panels/TapePanel.d.ts +17 -0
- package/dist/dts/widget/components/panels/index.d.ts +8 -0
- package/dist/dts/widget/components/replay/FloatingReplayToolbar.d.ts +24 -0
- package/dist/dts/widget/components/replay/ReplayCutOverlay.d.ts +8 -0
- package/dist/dts/widget/components/search/SymbolCompareModal.d.ts +24 -0
- package/dist/dts/widget/components/search/SymbolSearchModal.d.ts +12 -0
- package/dist/dts/widget/components/search/VNSymbolSearch.d.ts +83 -0
- package/dist/dts/widget/components/settings/AlertsModal.d.ts +74 -0
- package/dist/dts/widget/components/settings/SettingsContext.d.ts +58 -0
- package/dist/dts/widget/components/settings/SettingsModal.d.ts +78 -0
- package/dist/dts/widget/components/settings/SettingsRangeSlider.d.ts +17 -0
- package/dist/dts/widget/components/settings/SnapshotPreviewModal.d.ts +16 -0
- package/dist/dts/widget/components/settings/WorkspaceSettingsContext.d.ts +27 -0
- package/dist/dts/widget/components/settings/helpers/seriesFormatters.d.ts +11 -0
- package/dist/dts/widget/components/settings/model/appearancePayload.d.ts +31 -0
- package/dist/dts/widget/components/settings/model/chartSettingsSchema.d.ts +100 -0
- package/dist/dts/widget/components/settings/model/defaultSettings.d.ts +5 -0
- package/dist/dts/widget/components/settings/model/indicatorShare.d.ts +29 -0
- package/dist/dts/widget/components/settings/storageKeys.d.ts +29 -0
- package/dist/dts/widget/components/settings/tabs/AppearanceSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/IndicatorParamsForm.d.ts +12 -0
- package/dist/dts/widget/components/settings/tabs/IndicatorsSettingsTab.d.ts +34 -0
- package/dist/dts/widget/components/settings/tabs/LicensingSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/PanesLayoutSettingsTab.d.ts +11 -0
- package/dist/dts/widget/components/settings/tabs/ResetSettingsTab.d.ts +8 -0
- package/dist/dts/widget/components/settings/tabs/ScalesSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/StatusLineSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/SymbolSettingsTab.d.ts +5 -0
- package/dist/dts/widget/components/settings/tabs/ThemePaletteSettingsTab.d.ts +9 -0
- package/dist/dts/widget/components/settings/tabs/TradingEventsSettingsTab.d.ts +8 -0
- package/dist/dts/widget/components/toolbar/DrawingToolIcon.d.ts +10 -0
- package/dist/dts/widget/components/toolbar/DrawingToolbar.d.ts +33 -0
- package/dist/dts/widget/components/toolbar/FloatingChartBar.d.ts +20 -0
- package/dist/dts/widget/components/toolbar/FloatingFavoritesBar.d.ts +18 -0
- package/dist/dts/widget/components/toolbar/MultiChartTopbar.d.ts +47 -0
- package/dist/dts/widget/components/toolbar/UnifiedDrawingToolbar.d.ts +28 -0
- package/dist/dts/widget/components/trading/PaperTradePanel.d.ts +41 -0
- package/dist/dts/widget/components/workspace/WorkspaceToolbar.d.ts +25 -0
- package/dist/dts/widget/config/toolGroups.d.ts +11 -0
- package/dist/dts/widget/config/toolShortcuts.d.ts +27 -0
- package/dist/dts/widget/constants/comparison.d.ts +1 -0
- package/dist/dts/widget/constants/symbolSearch.d.ts +14 -0
- package/dist/dts/widget/constants/vn30.d.ts +7 -0
- package/dist/dts/widget/context/DataProviderContext.d.ts +7 -0
- package/dist/dts/widget/context/HoverEmitter.d.ts +50 -0
- package/dist/dts/widget/context/SyncContextShare.d.ts +11 -0
- package/dist/dts/widget/context/VNInvestChartsConfigContext.d.ts +24 -0
- package/dist/dts/widget/context/VNInvestChartsContext.d.ts +70 -0
- package/dist/dts/widget/context/VNInvestChartsStateContext.d.ts +50 -0
- package/dist/dts/widget/context/WidgetI18nContext.d.ts +25 -0
- package/dist/dts/widget/context/WorkspaceLiveTradingContext.d.ts +30 -0
- package/dist/dts/widget/context/WorkspacePaperVisibilityContext.d.ts +23 -0
- package/dist/dts/widget/context/WorkspaceReplayTradingContext.d.ts +36 -0
- package/dist/dts/widget/contexts/SaaSFeatureContext.d.ts +23 -0
- package/dist/dts/widget/data/DataEnvelope.d.ts +100 -0
- package/dist/dts/widget/drawingPriceLabelInputs.d.ts +3 -0
- package/dist/dts/widget/export/chartCsv.d.ts +59 -0
- package/dist/dts/widget/forkAnchorReconciliation.d.ts +6 -0
- package/dist/dts/widget/forkInteractionHelpers.d.ts +69 -0
- package/dist/dts/widget/grid/DeviceProfiles.d.ts +49 -0
- package/dist/dts/widget/grid/GridChartRegistry.d.ts +9 -0
- package/dist/dts/widget/grid/MemoryBudgetManager.d.ts +63 -0
- package/dist/dts/widget/grid/PerformanceMonitor.d.ts +70 -0
- package/dist/dts/widget/grid/customPresets.d.ts +42 -0
- package/dist/dts/widget/grid/presets.d.ts +18 -0
- package/dist/dts/widget/grid/types.d.ts +39 -0
- package/dist/dts/widget/history/BackfillDedupContext.d.ts +63 -0
- package/dist/dts/widget/history/RequestCoordinator.d.ts +59 -0
- package/dist/dts/widget/history/SharedBarStoreContext.d.ts +22 -0
- package/dist/dts/widget/history/cache/IndexedDBCacheMatrix.d.ts +16 -0
- package/dist/dts/widget/history/cache/LocalCacheMatrix.d.ts +86 -0
- package/dist/dts/widget/history/cache/index.d.ts +3 -0
- package/dist/dts/widget/history/chunkStore.d.ts +77 -0
- package/dist/dts/widget/history/externalBarsNormalization.d.ts +9 -0
- package/dist/dts/widget/history/externalBarsNormalization.worker.d.ts +1 -0
- package/dist/dts/widget/history/externalBarsNormalizationAsync.d.ts +25 -0
- package/dist/dts/widget/history/historyDataUtils.d.ts +82 -0
- package/dist/dts/widget/history/historyWindowPlanner.d.ts +89 -0
- package/dist/dts/widget/history/inflightController.d.ts +15 -0
- package/dist/dts/widget/history/requestCoalescing.d.ts +10 -0
- package/dist/dts/widget/history/sessionGuards.d.ts +3 -0
- package/dist/dts/widget/history/singleWriterLane.d.ts +4 -0
- package/dist/dts/widget/history/useExternalBarsNormalization.d.ts +5 -0
- package/dist/dts/widget/hooks/ShortcutManager.d.ts +65 -0
- package/dist/dts/widget/hooks/overlays/PaneHeaderWrapper.d.ts +11 -0
- package/dist/dts/widget/hooks/overlays/overlayHelpers.d.ts +60 -0
- package/dist/dts/widget/hooks/overlays/useDrawingDockNode.d.ts +15 -0
- package/dist/dts/widget/hooks/overlays/useLegendChrome.d.ts +36 -0
- package/dist/dts/widget/hooks/overlays/useMultiSelectActions.d.ts +22 -0
- package/dist/dts/widget/hooks/overlays/useSidebarResize.d.ts +13 -0
- package/dist/dts/widget/hooks/resolveEntitlement.d.ts +73 -0
- package/dist/dts/widget/hooks/useBottomPanelBehavior.d.ts +38 -0
- package/dist/dts/widget/hooks/useBottomPanelHeight.d.ts +39 -0
- package/dist/dts/widget/hooks/useCanvasTheme.d.ts +24 -0
- package/dist/dts/widget/hooks/useChartImperativeHandle.d.ts +57 -0
- package/dist/dts/widget/hooks/useClockAdapter.d.ts +11 -0
- package/dist/dts/widget/hooks/useComparisonState.d.ts +29 -0
- package/dist/dts/widget/hooks/useDialogFocus.d.ts +25 -0
- package/dist/dts/widget/hooks/useDrawingToolShortcuts.d.ts +16 -0
- package/dist/dts/widget/hooks/useFeatureGate.d.ts +28 -0
- package/dist/dts/widget/hooks/useFloatingChartBar.d.ts +33 -0
- package/dist/dts/widget/hooks/useForkRuntime.d.ts +155 -0
- package/dist/dts/widget/hooks/useIndicatorsShareApplier.d.ts +1 -0
- package/dist/dts/widget/hooks/useIntersectionObserver.d.ts +49 -0
- package/dist/dts/widget/hooks/useKeyboardAdapter.d.ts +9 -0
- package/dist/dts/widget/hooks/useLayoutHistory.d.ts +8 -0
- package/dist/dts/widget/hooks/useLicenseDiagnostics.d.ts +15 -0
- package/dist/dts/widget/hooks/useMultiChartReplaySync.d.ts +31 -0
- package/dist/dts/widget/hooks/useMultiWorkspacePersistence.d.ts +49 -0
- package/dist/dts/widget/hooks/usePaperTradeConfig.d.ts +27 -0
- package/dist/dts/widget/hooks/usePaperTradeInteraction.d.ts +27 -0
- package/dist/dts/widget/hooks/usePatTierAuthentication.d.ts +42 -0
- package/dist/dts/widget/hooks/usePineScriptRestore.d.ts +23 -0
- package/dist/dts/widget/hooks/usePortalAdapter.d.ts +8 -0
- package/dist/dts/widget/hooks/useRecentSymbols.d.ts +3 -0
- package/dist/dts/widget/hooks/useReplayState.d.ts +28 -0
- package/dist/dts/widget/hooks/useReplayTrading.d.ts +26 -0
- package/dist/dts/widget/hooks/useResizeAdapter.d.ts +13 -0
- package/dist/dts/widget/hooks/useScaleOverlays.d.ts +62 -0
- package/dist/dts/widget/hooks/useScriptPersistence.d.ts +72 -0
- package/dist/dts/widget/hooks/useSymbolSearch.d.ts +30 -0
- package/dist/dts/widget/hooks/useViewportBreakpoint.d.ts +15 -0
- package/dist/dts/widget/hooks/useWidgetCoordinateBridge.d.ts +70 -0
- package/dist/dts/widget/hooks/useWidgetData.d.ts +138 -0
- package/dist/dts/widget/hooks/useWidgetDataBackfill.d.ts +67 -0
- package/dist/dts/widget/hooks/useWidgetDataEnrichment.d.ts +32 -0
- package/dist/dts/widget/hooks/useWidgetDrawings.d.ts +38 -0
- package/dist/dts/widget/hooks/useWidgetForkInteraction.d.ts +68 -0
- package/dist/dts/widget/hooks/useWidgetInteractionActions.d.ts +36 -0
- package/dist/dts/widget/hooks/useWidgetOverlays.d.ts +190 -0
- package/dist/dts/widget/hooks/useWidgetRuntime.d.ts +20 -0
- package/dist/dts/widget/hooks/useWidgetSettings.d.ts +244 -0
- package/dist/dts/widget/hooks/useWidgetWorkspaceIO.d.ts +24 -0
- package/dist/dts/widget/hooks/useWorkspaceDockPanels.d.ts +11 -0
- package/dist/dts/widget/hooks/useWorkspaceLiveTrading.d.ts +28 -0
- package/dist/dts/widget/hooks/useWorkspaceReplayTrading.d.ts +22 -0
- package/dist/dts/widget/i18n/a11y.messages.en.d.ts +8 -0
- package/dist/dts/widget/i18n/a11y.messages.vi.d.ts +3 -0
- package/dist/dts/widget/i18n/capability.messages.en.d.ts +7 -0
- package/dist/dts/widget/i18n/capability.messages.vi.d.ts +3 -0
- package/dist/dts/widget/i18n/dock.messages.en.d.ts +2 -0
- package/dist/dts/widget/i18n/dock.messages.vi.d.ts +2 -0
- package/dist/dts/widget/i18n/messages.en.d.ts +2 -0
- package/dist/dts/widget/i18n/messages.licensing.d.ts +48 -0
- package/dist/dts/widget/i18n/messages.vi.d.ts +2 -0
- package/dist/dts/widget/i18n/trading.messages.en.d.ts +2 -0
- package/dist/dts/widget/i18n/trading.messages.vi.d.ts +2 -0
- package/dist/dts/widget/i18n/types.d.ts +3 -0
- package/dist/dts/widget/iframe/builtInAdapters.d.ts +63 -0
- package/dist/dts/widget/iframe/host-entry.d.ts +11 -0
- package/dist/dts/widget/iframe/hostSDK.d.ts +151 -0
- package/dist/dts/widget/iframe/iframeBridge.d.ts +165 -0
- package/dist/dts/widget/iframe/iframeEntry.d.ts +52 -0
- package/dist/dts/widget/iframe/iframeFrame.d.ts +15 -0
- package/dist/dts/widget/iframe/iframeQuotes.d.ts +20 -0
- package/dist/dts/widget/iframe/messageProtocol.d.ts +545 -0
- package/dist/dts/widget/iframe/quoteHub.d.ts +20 -0
- package/dist/dts/widget/iframe/useVNInvestChartsHost.d.ts +8 -0
- package/dist/dts/widget/iife-entry.d.ts +61 -0
- package/dist/dts/widget/iifeWidgetInstance.d.ts +60 -0
- package/dist/dts/widget/index.d.ts +56 -0
- package/dist/dts/widget/multiChartDefaults.d.ts +18 -0
- package/dist/dts/widget/paneInteractionUtils.d.ts +25 -0
- package/dist/dts/widget/patterns/autoPatternScan.d.ts +77 -0
- package/dist/dts/widget/patterns/patternDrawingFactory.d.ts +87 -0
- package/dist/dts/widget/plugin/ProPluginRegistry.d.ts +40 -0
- package/dist/dts/widget/runtime/ChartScaleAdapter.d.ts +73 -0
- package/dist/dts/widget/runtime/ChartSerializer.d.ts +12 -0
- package/dist/dts/widget/runtime/ForkRuntimeAdapter.d.ts +19 -0
- package/dist/dts/widget/runtime/IRuntimeEngine.d.ts +40 -0
- package/dist/dts/widget/runtime/WorkspaceSerializer.d.ts +31 -0
- package/dist/dts/widget/runtimePolicy.d.ts +36 -0
- package/dist/dts/widget/styles/injectStyles.d.ts +9 -0
- package/dist/dts/widget/theme/ThemeConfig.d.ts +21 -0
- package/dist/dts/widget/theme/applyTheme.d.ts +3 -0
- package/dist/dts/widget/trading/chart/DraggableOrderHandles.d.ts +15 -0
- package/dist/dts/widget/trading/chart/InteractivePositionOverlay.d.ts +19 -0
- package/dist/dts/widget/trading/chart/PendingOrderOverlay.d.ts +11 -0
- package/dist/dts/widget/trading/chart/QuickTradingHeader.d.ts +20 -0
- package/dist/dts/widget/trading/chart/TradingChartSurface.d.ts +8 -0
- package/dist/dts/widget/trading/chart/TradingOverlaysHost.d.ts +28 -0
- package/dist/dts/widget/trading/chart/priceTicks.d.ts +1 -0
- package/dist/dts/widget/trading/chart/useFloatingDrag.d.ts +40 -0
- package/dist/dts/widget/trading/chart/useTradingHotkeys.d.ts +21 -0
- package/dist/dts/widget/trading/config/paperRuntimeConfig.d.ts +53 -0
- package/dist/dts/widget/trading/context/PaperPanelRegistry.d.ts +45 -0
- package/dist/dts/widget/trading/context/TradingContext.d.ts +80 -0
- package/dist/dts/widget/trading/context/WorkspaceTradingSync.d.ts +24 -0
- package/dist/dts/widget/trading/hooks/usePaperRuntimeConfig.d.ts +36 -0
- package/dist/dts/widget/trading/index.d.ts +5 -0
- package/dist/dts/widget/trading/panel/AccountSummaryTab.d.ts +7 -0
- package/dist/dts/widget/trading/panel/ActiveChartPaperPanel.d.ts +26 -0
- package/dist/dts/widget/trading/panel/ConnectedTradingPanel.d.ts +3 -0
- package/dist/dts/widget/trading/panel/HistoryTab.d.ts +5 -0
- package/dist/dts/widget/trading/panel/MarketFallbackBanner.d.ts +4 -0
- package/dist/dts/widget/trading/panel/OrdersTab.d.ts +8 -0
- package/dist/dts/widget/trading/panel/PaperCapitalDialog.d.ts +8 -0
- package/dist/dts/widget/trading/panel/PaperSettingsModal.d.ts +17 -0
- package/dist/dts/widget/trading/panel/PositionsTab.d.ts +15 -0
- package/dist/dts/widget/trading/panel/TradeHistoryTab.d.ts +5 -0
- package/dist/dts/widget/trading/panel/TradingBottomPanel.d.ts +36 -0
- package/dist/dts/widget/trading/panel/TradingLogTab.d.ts +8 -0
- package/dist/dts/widget/trading/panel/TradingPanelHeader.d.ts +17 -0
- package/dist/dts/widget/trading/panel/csvExport.d.ts +18 -0
- package/dist/dts/widget/trading/ticket/ConnectedTradingDockPanel.d.ts +5 -0
- package/dist/dts/widget/trading/ticket/OrderTicketForm.d.ts +31 -0
- package/dist/dts/widget/trading/ticket/OrderTicketModal.d.ts +29 -0
- package/dist/dts/widget/trading/ticket/RegistryTradingDockPanel.d.ts +9 -0
- package/dist/dts/widget/trading/ticket/RiskCalculatorView.d.ts +9 -0
- package/dist/dts/widget/trading/ticket/TradingDockPanel.d.ts +36 -0
- package/dist/dts/widget/trading/ticket/orderTicketModel.d.ts +49 -0
- package/dist/dts/widget/trading/visibility/paperVisibility.d.ts +38 -0
- package/dist/dts/widget/types/dataProvider.d.ts +8 -0
- package/dist/dts/widget/types/fullChartHandle.d.ts +25 -0
- package/dist/dts/widget/types/saas.d.ts +83 -0
- package/dist/dts/widget/types/symbolSearch.d.ts +9 -0
- package/dist/dts/widget/types/watchlist.d.ts +26 -0
- package/dist/dts/widget/utils/axisHit.d.ts +16 -0
- package/dist/dts/widget/utils/chartRange.d.ts +12 -0
- package/dist/dts/widget/utils/chartTypeOptions.d.ts +38 -0
- package/dist/dts/widget/utils/clickOutside.d.ts +1 -0
- package/dist/dts/widget/utils/coordinateBridge.d.ts +31 -0
- package/dist/dts/widget/utils/crosshairSync.d.ts +50 -0
- package/dist/dts/widget/utils/drawingSync.d.ts +198 -0
- package/dist/dts/widget/utils/enrichedHash.d.ts +15 -0
- package/dist/dts/widget/utils/headerSync.d.ts +12 -0
- package/dist/dts/widget/utils/numberFormat.d.ts +13 -0
- package/dist/dts/widget/utils/paperTradeAdapters.d.ts +11 -0
- package/dist/dts/widget/utils/pineSeriesData.d.ts +71 -0
- package/dist/dts/widget/utils/rangeSync.d.ts +29 -0
- package/dist/dts/widget/utils/telemetry.d.ts +19 -0
- package/dist/dts/widget/utils/widgetEquality.d.ts +57 -0
- package/dist/dts/widget/utils/widgetErrors.d.ts +29 -0
- package/dist/dts/widget/utils/widgetHelpers.d.ts +395 -0
- package/dist/dts/widget/utils/xAxisTickFormatter.d.ts +33 -0
- package/dist/dts/widget/visibleRangeBridge.d.ts +28 -0
- package/dist/dts/widget/visibleRangeDiagnostics.d.ts +10 -0
- package/dist/dts/widget/visibleRangePolicies.d.ts +6 -0
- package/dist/dts/widget/workspace/WorkspaceManager.d.ts +23 -0
- package/dist/dts/widget/workspace/WorkspaceStore.d.ts +85 -0
- package/dist/dts/widget/workspace/types.d.ts +21 -0
- package/dist/externalBarsNormalization.worker.js +108 -0
- package/dist/iframe/index.html +63 -0
- package/dist/iframe/injected.css +6456 -0
- package/dist/iframe/vninvestchart.iframe.css +2 -0
- package/dist/iframe/vninvestchart.iframe.js +945 -0
- package/dist/iframe-host/host-entry.cjs +687 -0
- package/dist/iframe-host/host-entry.d.mts +818 -0
- package/dist/iframe-host/host-entry.d.ts +818 -0
- package/dist/iframe-host/host-entry.js +680 -0
- package/dist/index.cjs +7253 -0
- package/dist/index.css +3390 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +6461 -0
- package/dist/injected.css +6456 -0
- package/dist/rollAlgorithms-2P2ZKKHO.js +2 -0
- package/dist/types/runtime.cjs +8 -0
- package/dist/types/runtime.d.mts +92 -0
- package/dist/types/runtime.d.ts +92 -0
- package/dist/types/runtime.js +5 -0
- package/dist/types/runtime.umd.js +14 -0
- package/dist/vninvestchart.iife.css +2 -0
- package/dist/vninvestchart.iife.js +945 -0
- package/package.json +225 -5
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface MemoryReport {
|
|
2
|
+
totalHeapEstimate: number;
|
|
3
|
+
activeContexts: number;
|
|
4
|
+
status: 'normal' | 'warning' | 'critical' | 'emergency';
|
|
5
|
+
}
|
|
6
|
+
export interface DeviceProfile {
|
|
7
|
+
maxWebGLContexts: number;
|
|
8
|
+
maxHeapBudget: number;
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
isLowEnd: boolean;
|
|
11
|
+
deviceType: 'ios-safari' | 'android-chrome' | 'desktop' | 'unknown';
|
|
12
|
+
}
|
|
13
|
+
export declare class MemoryBudgetManager {
|
|
14
|
+
private static lruList;
|
|
15
|
+
private static MAX_HEAP_BUDGET;
|
|
16
|
+
private static MAX_WEBGL_CONTEXTS;
|
|
17
|
+
private static deviceProfile;
|
|
18
|
+
static register(id: string): void;
|
|
19
|
+
static unregister(id: string): void;
|
|
20
|
+
static touch(id: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Detect device performance profile based on user agent and hardware concurrency
|
|
23
|
+
* Returns dynamic limits for WebGL contexts and heap budget
|
|
24
|
+
* Uses DeviceProfiles for centralized configuration
|
|
25
|
+
*/
|
|
26
|
+
static getDevicePerformanceProfile(): DeviceProfile;
|
|
27
|
+
/**
|
|
28
|
+
* Get the current device profile (computes if not cached)
|
|
29
|
+
*/
|
|
30
|
+
static getCurrentProfile(): DeviceProfile;
|
|
31
|
+
/**
|
|
32
|
+
* Reset device profile cache (useful for testing)
|
|
33
|
+
*/
|
|
34
|
+
static resetDeviceProfile(): void;
|
|
35
|
+
static getEstimate(): MemoryReport;
|
|
36
|
+
static enforceBudget(activeChartId: string | null): void;
|
|
37
|
+
/**
|
|
38
|
+
* Freeze a specific chart context (called by IntersectionObserver)
|
|
39
|
+
* Captures snapshot before freezing for visual continuity
|
|
40
|
+
*/
|
|
41
|
+
static freezeContext(chartId: string): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Thaw a specific chart context (called by IntersectionObserver)
|
|
44
|
+
* Restores from snapshot for seamless visual transition
|
|
45
|
+
*/
|
|
46
|
+
static thawContext(chartId: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Get performance metrics for devtools
|
|
49
|
+
*/
|
|
50
|
+
static getPerformanceMetrics(): import("./PerformanceMonitor").PerformanceReport;
|
|
51
|
+
/**
|
|
52
|
+
* Start frame time monitoring
|
|
53
|
+
*/
|
|
54
|
+
static startPerformanceMonitoring(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Stop frame time monitoring
|
|
57
|
+
*/
|
|
58
|
+
static stopPerformanceMonitoring(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Log performance report to console
|
|
61
|
+
*/
|
|
62
|
+
static logPerformanceReport(): void;
|
|
63
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PerformanceMonitor - Tracks freeze/thaw performance metrics for WebGL management
|
|
3
|
+
* Exposes metrics to devtools for debugging and optimization
|
|
4
|
+
*/
|
|
5
|
+
export interface FreezeThawMetrics {
|
|
6
|
+
freezeCount: number;
|
|
7
|
+
thawCount: number;
|
|
8
|
+
totalFreezeLatencyMs: number;
|
|
9
|
+
totalThawLatencyMs: number;
|
|
10
|
+
totalSnapshotCaptureMs: number;
|
|
11
|
+
totalSnapshotRestoreMs: number;
|
|
12
|
+
totalMemoryReclaimedBytes: number;
|
|
13
|
+
lastFreezeTimestamp: number | null;
|
|
14
|
+
lastThawTimestamp: number | null;
|
|
15
|
+
averageFreezeLatencyMs: number;
|
|
16
|
+
averageThawLatencyMs: number;
|
|
17
|
+
averageSnapshotCaptureMs: number;
|
|
18
|
+
averageSnapshotRestoreMs: number;
|
|
19
|
+
}
|
|
20
|
+
export interface FrameTimeMetrics {
|
|
21
|
+
frameCount: number;
|
|
22
|
+
totalFrameTimeMs: number;
|
|
23
|
+
averageFrameTimeMs: number;
|
|
24
|
+
maxFrameTimeMs: number;
|
|
25
|
+
minFrameTimeMs: number;
|
|
26
|
+
droppedFrames: number;
|
|
27
|
+
}
|
|
28
|
+
export interface PerformanceReport {
|
|
29
|
+
freezeThaw: FreezeThawMetrics;
|
|
30
|
+
frameTime: FrameTimeMetrics;
|
|
31
|
+
memory: {
|
|
32
|
+
currentHeapUsed: number;
|
|
33
|
+
currentHeapTotal: number;
|
|
34
|
+
peakHeapUsed: number;
|
|
35
|
+
webglContextsActive: number;
|
|
36
|
+
};
|
|
37
|
+
timestamp: number;
|
|
38
|
+
}
|
|
39
|
+
declare class PerformanceMonitor {
|
|
40
|
+
private static instance;
|
|
41
|
+
private freezeThawMetrics;
|
|
42
|
+
private frameTimeMetrics;
|
|
43
|
+
private frameTimeHistory;
|
|
44
|
+
private maxHistorySize;
|
|
45
|
+
private rafId;
|
|
46
|
+
private lastFrameTime;
|
|
47
|
+
private isMonitoring;
|
|
48
|
+
private constructor();
|
|
49
|
+
static getInstance(): PerformanceMonitor;
|
|
50
|
+
recordFreezeStart(): number;
|
|
51
|
+
recordFreezeEnd(startTime: number, memoryReclaimed?: number, snapshotCaptureMs?: number): void;
|
|
52
|
+
recordThawStart(): number;
|
|
53
|
+
recordThawEnd(startTime: number, snapshotRestoreMs?: number): void;
|
|
54
|
+
startFrameMonitoring(): void;
|
|
55
|
+
stopFrameMonitoring(): void;
|
|
56
|
+
private tick;
|
|
57
|
+
getReport(): PerformanceReport;
|
|
58
|
+
logReport(): void;
|
|
59
|
+
exposeToDevTools(): void;
|
|
60
|
+
reset(): void;
|
|
61
|
+
getFrameTimePercentile(percentile: number): number;
|
|
62
|
+
getFrameTimeStats(): {
|
|
63
|
+
p50: number;
|
|
64
|
+
p90: number;
|
|
65
|
+
p95: number;
|
|
66
|
+
p99: number;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export declare const performanceMonitor: PerformanceMonitor;
|
|
70
|
+
export default PerformanceMonitor;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { LayoutPreset } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* P0 — lưu layout preset do người dùng định nghĩa.
|
|
4
|
+
*
|
|
5
|
+
* Trước P0: `LayoutDesigner.handleSavePreset` build preset rồi gọi
|
|
6
|
+
* `onSaveAsPreset?.(preset)`, mà call site duy nhất là `onSaveAsPreset={() => {}}` +
|
|
7
|
+
* `availablePresets={[]}` (`VNInvestMultiCharts.tsx:1455-1456`). Người dùng đặt tên, bấm
|
|
8
|
+
* Save, modal đóng, **không có gì được lưu và không có báo lỗi** ⇒ vi phạm Rule 15
|
|
9
|
+
* (cấm nuốt im lặng).
|
|
10
|
+
*
|
|
11
|
+
* Hàm thuần, không React, nhận `StorageLike` ⇒ test được trong node. Dùng storage **tiêm
|
|
12
|
+
* vào** (`storageAdapter`) chứ không `localStorage` trực tiếp, khác với
|
|
13
|
+
* `ChartSerializer` — vì raw `localStorage` làm hỏng SSR/iframe/host-injected storage.
|
|
14
|
+
*
|
|
15
|
+
* Capability: `layout_user` là **pro** (`engine capabilities.ts:140`). Vì vậy gate thuộc
|
|
16
|
+
* về call site (`VNInvestMultiCharts`), không gate ở đây — store chỉ lo "lưu/đọc đúng".
|
|
17
|
+
*/
|
|
18
|
+
export declare const CUSTOM_PRESETS_KEY = "vnsc.layout.customPresets";
|
|
19
|
+
/** Chỉ cần đúng hai phép; `StorageAdapter` của widget thỏa cả hai. */
|
|
20
|
+
export interface StorageLike {
|
|
21
|
+
getItem(key: string): string | null;
|
|
22
|
+
setItem(key: string, value: string): void;
|
|
23
|
+
removeItem(key: string): void;
|
|
24
|
+
}
|
|
25
|
+
export interface StoredPresetShape {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
layout: unknown;
|
|
29
|
+
category?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Đọc danh sách preset đã lưu. **Luôn trả mảng** — JSON hỏng hoặc storage lỗi thì trả
|
|
33
|
+
* `[]`, không ném. Người dùng phải còn dùng được chart khi storage hỏng.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readCustomPresets(storage: StorageLike | null | undefined): LayoutPreset[];
|
|
36
|
+
/**
|
|
37
|
+
* Ghi thêm một preset. Trả `false` nếu không lưu được (storage lỗi) — **không** im lặng
|
|
38
|
+
* thành công, vì đó chính là lỗi mà P0 đang sửa.
|
|
39
|
+
*/
|
|
40
|
+
export declare function addCustomPreset(storage: StorageLike | null | undefined, preset: LayoutPreset): boolean;
|
|
41
|
+
/** Xoá preset theo id. Trả `true` nếu thực sự có thay đổi. */
|
|
42
|
+
export declare function removeCustomPreset(storage: StorageLike | null | undefined, id: string): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LayoutPreset } from "./types";
|
|
2
|
+
import type { ChartLayout } from "@vninvestcharts/engine-react";
|
|
3
|
+
export declare const L_SHAPE_PRESET: LayoutPreset;
|
|
4
|
+
export declare const T_SHAPE_PRESET: LayoutPreset;
|
|
5
|
+
export declare const MAIN_3_SIDEBAR_PRESET: LayoutPreset;
|
|
6
|
+
export declare const QUAD_FOCUS_PRESET: LayoutPreset;
|
|
7
|
+
export declare const SYMMETRIC_PRESETS: LayoutPreset[];
|
|
8
|
+
export declare const ASYMMETRIC_PRESETS: LayoutPreset[];
|
|
9
|
+
export declare const CUSTOM_PRESET: LayoutPreset;
|
|
10
|
+
export declare const ALL_PRESETS: LayoutPreset[];
|
|
11
|
+
export declare const PRESETS_BY_CATEGORY: {
|
|
12
|
+
symmetric: LayoutPreset[];
|
|
13
|
+
asymmetric: LayoutPreset[];
|
|
14
|
+
focus: LayoutPreset[];
|
|
15
|
+
custom: LayoutPreset[];
|
|
16
|
+
};
|
|
17
|
+
export declare function findMatchingPreset(layout: ChartLayout): LayoutPreset;
|
|
18
|
+
export default ALL_PRESETS;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SymbolLinkGroupId } from '@vninvestcharts/engine-react';
|
|
2
|
+
export interface SlotConfig {
|
|
3
|
+
id: string;
|
|
4
|
+
rowStart: number;
|
|
5
|
+
rowEnd: number;
|
|
6
|
+
colStart: number;
|
|
7
|
+
colEnd: number;
|
|
8
|
+
symbol?: string;
|
|
9
|
+
timeframe?: string;
|
|
10
|
+
symbolLinkGroup?: SymbolLinkGroupId | null;
|
|
11
|
+
areaName?: string;
|
|
12
|
+
zIndex?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface GridLayout {
|
|
15
|
+
rows: number;
|
|
16
|
+
cols: number;
|
|
17
|
+
slots: SlotConfig[];
|
|
18
|
+
rowSizes: string[];
|
|
19
|
+
colSizes: string[];
|
|
20
|
+
templateAreas?: string[];
|
|
21
|
+
areas?: Record<string, SlotConfig>;
|
|
22
|
+
}
|
|
23
|
+
export interface SplitterConfig {
|
|
24
|
+
id: string;
|
|
25
|
+
orientation: 'vertical' | 'horizontal';
|
|
26
|
+
gridIndex: number;
|
|
27
|
+
minSizeBeforePx: number;
|
|
28
|
+
minSizeAfterPx: number;
|
|
29
|
+
}
|
|
30
|
+
export interface LayoutPreset {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
nameKey?: string;
|
|
34
|
+
layout: GridLayout;
|
|
35
|
+
description?: string;
|
|
36
|
+
descriptionKey?: string;
|
|
37
|
+
thumbnail?: string;
|
|
38
|
+
category?: 'symmetric' | 'asymmetric' | 'focus' | 'custom';
|
|
39
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { StockDataAdapter } from "../../lib/types/adapter";
|
|
3
|
+
import { createHistoryChunkStore, type ResidentWindow } from "./chunkStore";
|
|
4
|
+
import { createSingleWriterLane } from "./singleWriterLane";
|
|
5
|
+
/**
|
|
6
|
+
* Cross-chart backfill deduplication (Layer B).
|
|
7
|
+
*
|
|
8
|
+
* Backfill (reconcileVisibleHistoryWindow) calls `adapter.fetchBarsBefore` /
|
|
9
|
+
* `fetchBarsInRange` directly and does NOT go through `RequestCoordinator`
|
|
10
|
+
* (Layer A). When several charts in a MultiChart view the same symbol@tf and
|
|
11
|
+
* pan simultaneously, each fires its own identical request → N× API calls.
|
|
12
|
+
*
|
|
13
|
+
* This context holds an in-flight map keyed by request signature so that
|
|
14
|
+
* concurrent identical backfill requests from different charts share a single
|
|
15
|
+
* network call. It is intentionally SEPARATE from `RequestCoordinator` (which
|
|
16
|
+
* only coordinates initial load / MTF / compare).
|
|
17
|
+
*
|
|
18
|
+
* The dedup key excludes `chartId`: if the underlying adapter returns different
|
|
19
|
+
* data for the same range depending on chartId, dedup must NOT be applied (see
|
|
20
|
+
* test "dedup respects chartId independence").
|
|
21
|
+
*/
|
|
22
|
+
export type BackfillDedupValue = {
|
|
23
|
+
register(key: string, p: Promise<readonly any[]>): void;
|
|
24
|
+
get(key: string): Promise<readonly any[]> | undefined;
|
|
25
|
+
};
|
|
26
|
+
export declare function BackfillDedupProvider({ children }: {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}): React.JSX.Element;
|
|
29
|
+
export declare function useBackfillDedup(): BackfillDedupValue | null;
|
|
30
|
+
/**
|
|
31
|
+
* Run `fn` once per `key`. Concurrent callers with the same key share the same
|
|
32
|
+
* promise. When no dedup context is present (SingleChart standalone), `fn`
|
|
33
|
+
* runs normally.
|
|
34
|
+
*/
|
|
35
|
+
export declare function withBackfillDedup(ctx: BackfillDedupValue | null, key: string, fn: () => Promise<readonly any[] | null>): Promise<readonly any[] | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Wrap an adapter so that `fetchBarsBefore` / `fetchBarsInRange` participate in
|
|
38
|
+
* cross-chart backfill dedup. The dedup key is derived purely from the request
|
|
39
|
+
* arguments (symbol, tf, range) and deliberately EXCLUDES chartId.
|
|
40
|
+
*/
|
|
41
|
+
export declare function dedupWrapAdapter(adapter: StockDataAdapter, ctx: BackfillDedupValue): StockDataAdapter;
|
|
42
|
+
interface SharedStoreEntry {
|
|
43
|
+
store: ReturnType<typeof createHistoryChunkStore>;
|
|
44
|
+
lane: ReturnType<typeof createSingleWriterLane>;
|
|
45
|
+
refCount: number;
|
|
46
|
+
residents: Map<string, ResidentWindow>;
|
|
47
|
+
}
|
|
48
|
+
type SharedBarStoreValue = {
|
|
49
|
+
getOrCreate(key: string): SharedStoreEntry;
|
|
50
|
+
release(key: string, subscriberId: string): void;
|
|
51
|
+
registerResident(key: string, subscriberId: string, resident: ResidentWindow): void;
|
|
52
|
+
getUnionResident(key: string): ResidentWindow | null;
|
|
53
|
+
updateResident(key: string, subscriberId: string, resident: ResidentWindow): void;
|
|
54
|
+
};
|
|
55
|
+
export declare function SharedBarStoreProvider({ children }: {
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
}): React.JSX.Element;
|
|
58
|
+
export declare function useSharedBarStore(): SharedBarStoreValue | null;
|
|
59
|
+
export declare function useSharedBarStoreSubscription(key: string, subscriberId: string, _initialResident?: ResidentWindow): {
|
|
60
|
+
store: ReturnType<typeof createHistoryChunkStore>;
|
|
61
|
+
lane: ReturnType<typeof createSingleWriterLane>;
|
|
62
|
+
} | null;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface CoordinatorFetchParams {
|
|
3
|
+
symbol: string;
|
|
4
|
+
timeframe: string;
|
|
5
|
+
from: Date;
|
|
6
|
+
to: Date;
|
|
7
|
+
chartId?: string;
|
|
8
|
+
/**
|
|
9
|
+
* DATA-03: data-source identity. Without it the cache/dedup key was
|
|
10
|
+
* `symbol|timeframe|from|to`, so two widgets pointing at DIFFERENT adapters
|
|
11
|
+
* (e.g. two tenants, or live vs demo) shared one cache entry and could serve
|
|
12
|
+
* each other's bars. Callers pass a stable, non-secret identifier of the
|
|
13
|
+
* source (e.g. adapter class + base). Never put a raw PAT in here.
|
|
14
|
+
*/
|
|
15
|
+
scope?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Cross-chart request coordinator.
|
|
19
|
+
*
|
|
20
|
+
* - Global max inflight: 4 requests across all charts
|
|
21
|
+
* - Per-adapter rate limit: token bucket (2 requests / 500ms sliding window)
|
|
22
|
+
* - Cross-chart dedup via coarse key (symbol|tf|rounded-hour-from|rounded-hour-to)
|
|
23
|
+
* for historical data; exact timestamps used when `to` is within 1h of "now"
|
|
24
|
+
* to prevent stale current-candle from cache.
|
|
25
|
+
* - Near-now requests (to within 1h of now) bypass cache entirely — current
|
|
26
|
+
* candle is mutable and will be updated by WS ticker_update.
|
|
27
|
+
* - Subscriber tracking: only abort inflight when ALL subscribers have unmounted
|
|
28
|
+
* - Result cache with 30s TTL + LRU eviction (max 50 entries)
|
|
29
|
+
*/
|
|
30
|
+
export declare class RequestCoordinator {
|
|
31
|
+
readonly maxGlobalInflight = 4;
|
|
32
|
+
readonly perAdapterTokens = 2;
|
|
33
|
+
private inflight;
|
|
34
|
+
private subscribers;
|
|
35
|
+
private cache;
|
|
36
|
+
private adapterTokenBuckets;
|
|
37
|
+
private pendingQueue;
|
|
38
|
+
private processing;
|
|
39
|
+
private makeKey;
|
|
40
|
+
private getAdapterLabel;
|
|
41
|
+
private checkAdapterTokens;
|
|
42
|
+
private evictStaleCache;
|
|
43
|
+
private processQueue;
|
|
44
|
+
enqueue<T>(fetchFn: (signal: AbortSignal) => Promise<T>, params: CoordinatorFetchParams, priority: number, callerId: string, signal?: AbortSignal): Promise<T>;
|
|
45
|
+
getInflightCount(): number;
|
|
46
|
+
getPendingCount(): number;
|
|
47
|
+
reset(): void;
|
|
48
|
+
}
|
|
49
|
+
export declare function useRequestCoordinator(): RequestCoordinator;
|
|
50
|
+
/**
|
|
51
|
+
* Test isolation hook: reset the module-level fallback coordinator between
|
|
52
|
+
* tests. Contract tests render without a RequestCoordinatorProvider (like
|
|
53
|
+
* single-chart embeds), so they share this instance — without a reset,
|
|
54
|
+
* token-bucket + cache state leaks across tests and starves later fetches.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resetFallbackRequestCoordinatorForTests(): void;
|
|
57
|
+
export declare function RequestCoordinatorProvider({ children }: {
|
|
58
|
+
children: React.ReactNode;
|
|
59
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ResidentWindow } from "./chunkStore";
|
|
3
|
+
import { createHistoryChunkStore } from "./chunkStore";
|
|
4
|
+
import { createSingleWriterLane } from "./singleWriterLane";
|
|
5
|
+
interface SharedBarStoreContextValue {
|
|
6
|
+
/**
|
|
7
|
+
* Get or create a shared store for the given cache key.
|
|
8
|
+
* Returns the shared store and a release function to call on unmount or key change.
|
|
9
|
+
*/
|
|
10
|
+
getOrCreate: (cacheKey: string, chartId: string, initialResident: ResidentWindow) => {
|
|
11
|
+
store: ReturnType<typeof createHistoryChunkStore>;
|
|
12
|
+
lane: ReturnType<typeof createSingleWriterLane>;
|
|
13
|
+
release: () => void;
|
|
14
|
+
updateResident: (resident: ResidentWindow) => void;
|
|
15
|
+
trimToSharedWindow: (resident: ResidentWindow, maxBars?: number, trimLeft?: boolean, trimRight?: boolean) => void;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function useSharedBarStore(): SharedBarStoreContextValue | null;
|
|
19
|
+
export declare function SharedBarStoreProvider({ children }: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LocalCacheMatrix, LocalCacheMatrixFactory, TimeRange } from "./LocalCacheMatrix";
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes an array of ranges by union-merging overlapping or contiguous intervals.
|
|
4
|
+
* Expects ranges to be sorted or will sort them internally.
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeRanges(ranges: readonly TimeRange[]): readonly TimeRange[];
|
|
7
|
+
/**
|
|
8
|
+
* Computes missing segments (gaps) in targetRange not covered by coverageRanges.
|
|
9
|
+
*/
|
|
10
|
+
export declare function computeMissingTimeRanges(targetRange: TimeRange, coverageRanges: readonly TimeRange[]): TimeRange[];
|
|
11
|
+
/**
|
|
12
|
+
* Native factory class matching barrel exports
|
|
13
|
+
*/
|
|
14
|
+
export declare class LocalCacheMatrixFactoryImpl implements LocalCacheMatrixFactory {
|
|
15
|
+
create(cacheRoot: string): LocalCacheMatrix;
|
|
16
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { SourceSemanticsDescriptor } from "../../../lib/adapters";
|
|
2
|
+
import type { OHLCVBar } from "../../../lib/types/ohlcv";
|
|
3
|
+
export interface CacheKeyParts {
|
|
4
|
+
readonly source: string;
|
|
5
|
+
readonly symbol: string;
|
|
6
|
+
readonly timeframe: string;
|
|
7
|
+
readonly adjustmentPolicy: string;
|
|
8
|
+
readonly schemaVersion: string;
|
|
9
|
+
}
|
|
10
|
+
export type CacheKey = string;
|
|
11
|
+
export interface TimeRange {
|
|
12
|
+
readonly fromTs: number;
|
|
13
|
+
readonly toTs: number;
|
|
14
|
+
}
|
|
15
|
+
export interface CacheSegmentMeta {
|
|
16
|
+
readonly file: string;
|
|
17
|
+
readonly fromTs: number;
|
|
18
|
+
readonly toTs: number;
|
|
19
|
+
readonly barCount: number;
|
|
20
|
+
readonly checksum: string;
|
|
21
|
+
readonly lastAccessedAt: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CacheSemanticScope {
|
|
24
|
+
readonly sourceContractVersion: SourceSemanticsDescriptor["sourceContractVersion"];
|
|
25
|
+
readonly instrumentClass: SourceSemanticsDescriptor["instrumentClass"];
|
|
26
|
+
readonly sessionModel: SourceSemanticsDescriptor["sessionModel"];
|
|
27
|
+
readonly sessionCalendarId?: SourceSemanticsDescriptor["sessionCalendarId"];
|
|
28
|
+
readonly timezone: SourceSemanticsDescriptor["timezone"];
|
|
29
|
+
readonly finalityMode: SourceSemanticsDescriptor["finalityMode"];
|
|
30
|
+
readonly correctionLookbackMs?: SourceSemanticsDescriptor["correctionLookbackMs"];
|
|
31
|
+
}
|
|
32
|
+
export interface CacheCoverageIndex {
|
|
33
|
+
readonly schemaVersion: string;
|
|
34
|
+
readonly cacheKey: CacheKey;
|
|
35
|
+
readonly revision: number;
|
|
36
|
+
readonly semanticScope?: CacheSemanticScope;
|
|
37
|
+
readonly ranges: readonly TimeRange[];
|
|
38
|
+
readonly segments: readonly CacheSegmentMeta[];
|
|
39
|
+
}
|
|
40
|
+
export interface CacheReadResult {
|
|
41
|
+
readonly bars: readonly OHLCVBar[];
|
|
42
|
+
readonly missingRanges: readonly TimeRange[];
|
|
43
|
+
}
|
|
44
|
+
export interface CacheWriteMeta {
|
|
45
|
+
readonly requestId: string;
|
|
46
|
+
readonly sessionRevision: number;
|
|
47
|
+
readonly reason: "remote-fill" | "warmup" | "repair";
|
|
48
|
+
readonly semanticScope?: CacheSemanticScope;
|
|
49
|
+
}
|
|
50
|
+
export interface CacheWriteResult {
|
|
51
|
+
readonly cacheKey: CacheKey;
|
|
52
|
+
readonly revision: number;
|
|
53
|
+
readonly writtenBarCount: number;
|
|
54
|
+
readonly affectedRanges: readonly TimeRange[];
|
|
55
|
+
}
|
|
56
|
+
export type CacheInvalidateReason = "schema-mismatch" | "adjustment-policy-changed" | "source-contract-changed" | "manual";
|
|
57
|
+
export interface CacheEvictPolicy {
|
|
58
|
+
readonly globalQuotaMb: number;
|
|
59
|
+
readonly symbolSoftCapMb: number;
|
|
60
|
+
}
|
|
61
|
+
export interface CacheEvictResult {
|
|
62
|
+
readonly reclaimedBytes: number;
|
|
63
|
+
readonly deletedSegmentCount: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Runtime abstraction for local file-cache matrix.
|
|
67
|
+
*
|
|
68
|
+
* Notes:
|
|
69
|
+
* - readRanges must not throw on cache misses; it should return missingRanges.
|
|
70
|
+
* - writePatch is expected to enforce validation + dedupe + sort before commit.
|
|
71
|
+
*/
|
|
72
|
+
export interface LocalCacheMatrix {
|
|
73
|
+
getCoverage(cacheKey: CacheKey, expectedScope?: CacheSemanticScope): Promise<CacheCoverageIndex | null>;
|
|
74
|
+
readRanges(cacheKey: CacheKey, ranges: readonly TimeRange[], expectedScope?: CacheSemanticScope): Promise<CacheReadResult>;
|
|
75
|
+
writePatch(cacheKey: CacheKey, bars: readonly OHLCVBar[], meta: CacheWriteMeta): Promise<CacheWriteResult>;
|
|
76
|
+
invalidate(cacheKey: CacheKey, reason: CacheInvalidateReason): Promise<void>;
|
|
77
|
+
evict(policy: CacheEvictPolicy): Promise<CacheEvictResult>;
|
|
78
|
+
}
|
|
79
|
+
export interface LocalCacheMatrixFactory {
|
|
80
|
+
create(cacheRoot: string): LocalCacheMatrix;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Canonical cache key formatter matching CACHE_FILE_CONTRACT.
|
|
84
|
+
*/
|
|
85
|
+
export declare function toCacheKey(parts: CacheKeyParts): CacheKey;
|
|
86
|
+
export declare function toCacheSemanticScope(sourceSemantics: SourceSemanticsDescriptor): CacheSemanticScope;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { CacheCoverageIndex, CacheEvictPolicy, CacheEvictResult, CacheInvalidateReason, CacheKey, CacheKeyParts, CacheReadResult, CacheSemanticScope, CacheSegmentMeta, CacheWriteMeta, CacheWriteResult, LocalCacheMatrix, LocalCacheMatrixFactory, TimeRange, } from "./LocalCacheMatrix";
|
|
2
|
+
export { toCacheKey, toCacheSemanticScope } from "./LocalCacheMatrix";
|
|
3
|
+
export { LocalCacheMatrixFactoryImpl } from "./IndexedDBCacheMatrix";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { OHLCVBar } from "../../lib/types/ohlcv";
|
|
2
|
+
/** A time window defined by inclusive epoch-millisecond bounds. */
|
|
3
|
+
export interface ResidentWindow {
|
|
4
|
+
readonly startMs: number;
|
|
5
|
+
readonly endMs: number;
|
|
6
|
+
}
|
|
7
|
+
/** The kind of mutation that produced a HistoryPatch. */
|
|
8
|
+
export type HistoryPatchKind = "replace" | "prepend" | "append" | "trim";
|
|
9
|
+
/**
|
|
10
|
+
* An immutable snapshot of the full resident bar set at a given revision.
|
|
11
|
+
* Consumers may hold onto this without worrying about the store mutating it.
|
|
12
|
+
*/
|
|
13
|
+
export interface HistorySnapshot {
|
|
14
|
+
readonly bars: readonly OHLCVBar[];
|
|
15
|
+
readonly revision: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A description of one mutation applied to a HistoryChunkStore.
|
|
19
|
+
* `snapshot` reflects the store state AFTER the mutation.
|
|
20
|
+
*/
|
|
21
|
+
export interface HistoryPatch {
|
|
22
|
+
readonly kind: HistoryPatchKind;
|
|
23
|
+
readonly snapshot: HistorySnapshot;
|
|
24
|
+
/** Number of bars added at the head (prepend / replace that extends head). */
|
|
25
|
+
readonly prependedCount: number;
|
|
26
|
+
/** Number of bars added at the tail (append / replace that extends tail). */
|
|
27
|
+
readonly appendedCount: number;
|
|
28
|
+
/** Number of bars removed from the head (trim). */
|
|
29
|
+
readonly trimmedFromHead: number;
|
|
30
|
+
/** Number of bars removed from the tail (trim). */
|
|
31
|
+
readonly trimmedFromTail: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* HistoryChunkStore manages the resident OHLCV bar set for a single
|
|
35
|
+
* symbol/timeframe session. It enforces:
|
|
36
|
+
* - Chronological sort order (by `date` ascending)
|
|
37
|
+
* - No duplicate timestamps
|
|
38
|
+
* - Stable logical timeline: prepend/trim never shift existing bar positions
|
|
39
|
+
*
|
|
40
|
+
* The store is intentionally synchronous and mutation-safe. All mutating
|
|
41
|
+
* methods return the resulting HistorySnapshot or HistoryPatch so callers
|
|
42
|
+
* can decide when to flush the change into React state.
|
|
43
|
+
*/
|
|
44
|
+
export interface HistoryChunkStore {
|
|
45
|
+
/**
|
|
46
|
+
* Replace the entire resident set with `bars`. Bars are sorted by date;
|
|
47
|
+
* duplicates are deduplicated (last occurrence wins).
|
|
48
|
+
* Returns the new snapshot.
|
|
49
|
+
*/
|
|
50
|
+
replaceAll(bars: readonly OHLCVBar[]): HistorySnapshot;
|
|
51
|
+
/**
|
|
52
|
+
* Prepend bars that are OLDER than the current head.
|
|
53
|
+
* Bars with timestamps >= current head are silently dropped to preserve
|
|
54
|
+
* logical timeline stability (no re-ordering of existing bars).
|
|
55
|
+
* Returns a HistoryPatch describing what changed.
|
|
56
|
+
*/
|
|
57
|
+
prepend(bars: readonly OHLCVBar[]): HistoryPatch;
|
|
58
|
+
/**
|
|
59
|
+
* Append one or more bars newer than the current tail, or update/insert
|
|
60
|
+
* a single bar at any position (for live tick updates).
|
|
61
|
+
* Returns a HistoryPatch describing what changed.
|
|
62
|
+
*/
|
|
63
|
+
append(bars: readonly OHLCVBar[]): HistoryPatch;
|
|
64
|
+
/**
|
|
65
|
+
* Remove bars outside `window`. Returns null when nothing was trimmed,
|
|
66
|
+
* or a HistoryPatch with trimmedFromHead / trimmedFromTail counts.
|
|
67
|
+
* Optionally caps the remaining bars at `maxBars` to protect memory.
|
|
68
|
+
*/
|
|
69
|
+
trimToWindow(window: ResidentWindow, maxBars?: number, trimLeft?: boolean, trimRight?: boolean): HistoryPatch | null;
|
|
70
|
+
/** Return the current snapshot without mutating the store. */
|
|
71
|
+
toSnapshot(): HistorySnapshot;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create a new, empty HistoryChunkStore.
|
|
75
|
+
* Call once per widget history session; reset via `replaceAll([])`.
|
|
76
|
+
*/
|
|
77
|
+
export declare function createHistoryChunkStore(): HistoryChunkStore;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OHLCVBar } from "../../lib/types/ohlcv";
|
|
2
|
+
export interface ExternalBarsNormalizationResult {
|
|
3
|
+
bars: OHLCVBar[];
|
|
4
|
+
invalidCount: number;
|
|
5
|
+
firstError: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildExternalDataValidationError(result: ExternalBarsNormalizationResult): Error | null;
|
|
8
|
+
export declare function normalizeExternalBar(bar: unknown, index: number): OHLCVBar;
|
|
9
|
+
export declare function normalizeExternalBars(data: readonly unknown[] | undefined | null): ExternalBarsNormalizationResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ExternalBarsNormalizationResult } from "./externalBarsNormalization";
|
|
2
|
+
export declare const EXTERNAL_BARS_WORKER_THRESHOLD = 10000;
|
|
3
|
+
export interface ExternalBarsNormalizationWorkerRequest {
|
|
4
|
+
readonly requestId: number;
|
|
5
|
+
readonly data: readonly unknown[] | undefined | null;
|
|
6
|
+
}
|
|
7
|
+
export interface ExternalBarsNormalizationWorkerResponse {
|
|
8
|
+
readonly requestId: number;
|
|
9
|
+
readonly result?: ExternalBarsNormalizationResult;
|
|
10
|
+
readonly error?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ExternalBarsNormalizationWorkerLike {
|
|
13
|
+
onmessage: ((this: Worker, event: MessageEvent<ExternalBarsNormalizationWorkerResponse>) => void) | null;
|
|
14
|
+
onerror: ((this: AbstractWorker, event: ErrorEvent) => void) | null;
|
|
15
|
+
postMessage(message: ExternalBarsNormalizationWorkerRequest): void;
|
|
16
|
+
terminate(): void;
|
|
17
|
+
}
|
|
18
|
+
export interface NormalizeExternalBarsAsyncOptions {
|
|
19
|
+
readonly signal?: AbortSignal;
|
|
20
|
+
readonly workerFactory?: () => ExternalBarsNormalizationWorkerLike;
|
|
21
|
+
readonly useWorker?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const EMPTY_EXTERNAL_BARS_NORMALIZATION_RESULT: ExternalBarsNormalizationResult;
|
|
24
|
+
export declare function shouldUseExternalBarsWorker(data: readonly unknown[] | undefined | null): boolean;
|
|
25
|
+
export declare function normalizeExternalBarsAsync(data: readonly unknown[] | undefined | null, options?: NormalizeExternalBarsAsyncOptions): Promise<ExternalBarsNormalizationResult>;
|