@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,818 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WP-11: Iframe PostMessage Protocol Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the typed message protocol for Host ↔ Iframe communication.
|
|
5
|
+
* Custom Data Adapters (callbacks) CANNOT be serialized over postMessage.
|
|
6
|
+
* Iframe mode only supports built-in adapters via JSON-serializable config.
|
|
7
|
+
*/
|
|
8
|
+
/** Base message envelope with correlation ID for request/response matching */
|
|
9
|
+
interface BaseMessage {
|
|
10
|
+
/** Unique message type identifier */
|
|
11
|
+
type: string;
|
|
12
|
+
/** Correlation ID for matching requests to responses */
|
|
13
|
+
correlationId: string;
|
|
14
|
+
/** Timestamp when message was sent */
|
|
15
|
+
timestamp: number;
|
|
16
|
+
/** Origin of the message (for security validation) */
|
|
17
|
+
origin: string;
|
|
18
|
+
}
|
|
19
|
+
/** Request message expecting a response */
|
|
20
|
+
interface RequestMessage<T = unknown> extends BaseMessage {
|
|
21
|
+
type: `request:${string}`;
|
|
22
|
+
payload: T;
|
|
23
|
+
}
|
|
24
|
+
/** Built-in adapter types supported in Iframe mode */
|
|
25
|
+
type BuiltInAdapterType = "vninvest" | "tvfeed" | "yahoo" | "binance" | "coinbase" | "twelvedata" | "alphavantage" | "finnhub" | "polygon";
|
|
26
|
+
/** Adapter configuration - MUST be JSON-serializable (no functions) */
|
|
27
|
+
interface AdapterConfig {
|
|
28
|
+
/** Built-in adapter type identifier */
|
|
29
|
+
type: BuiltInAdapterType;
|
|
30
|
+
/** Adapter-specific configuration options */
|
|
31
|
+
options?: Record<string, string | number | boolean | null>;
|
|
32
|
+
/** Authentication token (if required) */
|
|
33
|
+
token?: string;
|
|
34
|
+
}
|
|
35
|
+
/** Widget configuration for Iframe initialization */
|
|
36
|
+
interface WidgetConfig {
|
|
37
|
+
/** Symbol to display (e.g., "VNM", "AAPL") */
|
|
38
|
+
symbol: string;
|
|
39
|
+
/** Timeframe (e.g., "1D", "1H", "5m") */
|
|
40
|
+
timeframe: string;
|
|
41
|
+
/** Chart theme */
|
|
42
|
+
theme?: string;
|
|
43
|
+
/** Adapter configuration (built-in only, no custom callbacks) */
|
|
44
|
+
adapter?: AdapterConfig;
|
|
45
|
+
/** Initial visible range (e.g., "6M", "1Y", "ALL") */
|
|
46
|
+
range?: string;
|
|
47
|
+
/** Locale */
|
|
48
|
+
locale?: string;
|
|
49
|
+
/** Enable drawing tools UI */
|
|
50
|
+
drawingUiEnabled?: boolean;
|
|
51
|
+
/** Initial drawing tool */
|
|
52
|
+
drawingActiveTool?: string;
|
|
53
|
+
/** Pre-loaded drawings */
|
|
54
|
+
drawings?: readonly any[];
|
|
55
|
+
/** Drawing storage key for persistence */
|
|
56
|
+
drawingStorageKey?: string;
|
|
57
|
+
/** Show header with symbol search, fullscreen, etc. */
|
|
58
|
+
showHeader?: boolean;
|
|
59
|
+
/** Show footer with timeframe selector */
|
|
60
|
+
showFooter?: boolean;
|
|
61
|
+
/** Show drawing toolbar */
|
|
62
|
+
showToolbar?: boolean;
|
|
63
|
+
/** Measurement tool enabled */
|
|
64
|
+
measurementEnabled?: boolean;
|
|
65
|
+
/** Non-trading days visibility */
|
|
66
|
+
showNonTradingDays?: boolean;
|
|
67
|
+
/** Timezone */
|
|
68
|
+
timezone?: string;
|
|
69
|
+
/**
|
|
70
|
+
* E1: frame height. `"fill"` (default) = iframe fills the host container
|
|
71
|
+
* 100%/100% (host owns the frame — TradingView standard, zero resize
|
|
72
|
+
* messages). A number sets a fixed card height in px and enables the
|
|
73
|
+
* guarded `event:resized` reporter for bottom-panel expansion.
|
|
74
|
+
*/
|
|
75
|
+
height?: number | "fill";
|
|
76
|
+
/** Custom panes configuration */
|
|
77
|
+
panes?: readonly any[];
|
|
78
|
+
/** Tenant PAT for SaaS features */
|
|
79
|
+
tenantPat?: string;
|
|
80
|
+
/** CS-3: host-pinned offline license key (`vni1.*`) */
|
|
81
|
+
licenseKey?: string;
|
|
82
|
+
/** Debug features override */
|
|
83
|
+
debugFeatures?: Record<string, boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* E3: right dock in iframe. `show` maps to the widget `showDock` gate;
|
|
86
|
+
* `defaultTab` seeds the persisted dock tab; `watchlist` builds a static
|
|
87
|
+
* in-iframe adapter (JSON-only — custom adapters cannot cross postMessage).
|
|
88
|
+
*/
|
|
89
|
+
dock?: {
|
|
90
|
+
show?: boolean;
|
|
91
|
+
defaultTab?: string;
|
|
92
|
+
watchlist?: string[];
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** Initialize widget with configuration */
|
|
96
|
+
interface InitializeCommand {
|
|
97
|
+
type: "request:initialize";
|
|
98
|
+
correlationId: string;
|
|
99
|
+
timestamp: number;
|
|
100
|
+
origin: string;
|
|
101
|
+
payload: WidgetConfig;
|
|
102
|
+
}
|
|
103
|
+
/** Update widget symbol */
|
|
104
|
+
interface SetSymbolCommand {
|
|
105
|
+
type: "request:setSymbol";
|
|
106
|
+
correlationId: string;
|
|
107
|
+
timestamp: number;
|
|
108
|
+
origin: string;
|
|
109
|
+
payload: {
|
|
110
|
+
symbol: string;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** Update timeframe */
|
|
114
|
+
interface SetTimeframeCommand {
|
|
115
|
+
type: "request:setTimeframe";
|
|
116
|
+
correlationId: string;
|
|
117
|
+
timestamp: number;
|
|
118
|
+
origin: string;
|
|
119
|
+
payload: {
|
|
120
|
+
timeframe: string;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** Update visible range */
|
|
124
|
+
interface SetRangeCommand {
|
|
125
|
+
type: "request:setRange";
|
|
126
|
+
correlationId: string;
|
|
127
|
+
timestamp: number;
|
|
128
|
+
origin: string;
|
|
129
|
+
payload: {
|
|
130
|
+
range: string;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/** Update theme */
|
|
134
|
+
interface SetThemeCommand {
|
|
135
|
+
type: "request:setTheme";
|
|
136
|
+
correlationId: string;
|
|
137
|
+
timestamp: number;
|
|
138
|
+
origin: string;
|
|
139
|
+
payload: {
|
|
140
|
+
theme: "light" | "dark";
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** Update drawings (full replacement) */
|
|
144
|
+
interface SetDrawingsCommand {
|
|
145
|
+
type: "request:setDrawings";
|
|
146
|
+
correlationId: string;
|
|
147
|
+
timestamp: number;
|
|
148
|
+
origin: string;
|
|
149
|
+
payload: {
|
|
150
|
+
drawings: readonly any[];
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/** Add a single drawing */
|
|
154
|
+
interface AddDrawingCommand {
|
|
155
|
+
type: "request:addDrawing";
|
|
156
|
+
correlationId: string;
|
|
157
|
+
timestamp: number;
|
|
158
|
+
origin: string;
|
|
159
|
+
payload: {
|
|
160
|
+
drawing: any;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/** Remove a drawing by ID */
|
|
164
|
+
interface RemoveDrawingCommand {
|
|
165
|
+
type: "request:removeDrawing";
|
|
166
|
+
correlationId: string;
|
|
167
|
+
timestamp: number;
|
|
168
|
+
origin: string;
|
|
169
|
+
payload: {
|
|
170
|
+
drawingId: string;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/** Update drawing properties */
|
|
174
|
+
interface UpdateDrawingCommand {
|
|
175
|
+
type: "request:updateDrawing";
|
|
176
|
+
correlationId: string;
|
|
177
|
+
timestamp: number;
|
|
178
|
+
origin: string;
|
|
179
|
+
payload: {
|
|
180
|
+
drawingId: string;
|
|
181
|
+
updates: Partial<any>;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/** Set active drawing tool */
|
|
185
|
+
interface SetActiveToolCommand {
|
|
186
|
+
type: "request:setActiveTool";
|
|
187
|
+
correlationId: string;
|
|
188
|
+
timestamp: number;
|
|
189
|
+
origin: string;
|
|
190
|
+
payload: {
|
|
191
|
+
tool: string;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/** E3: switch the right-dock tab (no-op when the dock is closed or missing the tab) */
|
|
195
|
+
interface SetDockTabCommand {
|
|
196
|
+
type: "request:setDockTab";
|
|
197
|
+
correlationId: string;
|
|
198
|
+
timestamp: number;
|
|
199
|
+
origin: string;
|
|
200
|
+
payload: {
|
|
201
|
+
tab: string;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/** E3: replace the dock watchlist (static symbols; streaming arrives in E5) */
|
|
205
|
+
interface SetWatchlistCommand {
|
|
206
|
+
type: "request:setWatchlist";
|
|
207
|
+
correlationId: string;
|
|
208
|
+
timestamp: number;
|
|
209
|
+
origin: string;
|
|
210
|
+
payload: {
|
|
211
|
+
symbols: string[];
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/** E5: host subscribes to live quotes fan-out */
|
|
215
|
+
interface SubscribeQuotesCommand {
|
|
216
|
+
type: "request:subscribeQuotes";
|
|
217
|
+
correlationId: string;
|
|
218
|
+
timestamp: number;
|
|
219
|
+
origin: string;
|
|
220
|
+
payload: {
|
|
221
|
+
symbols: string[];
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/** E5: host unsubscribes (omitted symbols = all) */
|
|
225
|
+
interface UnsubscribeQuotesCommand {
|
|
226
|
+
type: "request:unsubscribeQuotes";
|
|
227
|
+
correlationId: string;
|
|
228
|
+
timestamp: number;
|
|
229
|
+
origin: string;
|
|
230
|
+
payload: {
|
|
231
|
+
symbols?: string[];
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/** Export current drawings */
|
|
235
|
+
interface ExportDrawingsCommand {
|
|
236
|
+
type: "request:exportDrawings";
|
|
237
|
+
correlationId: string;
|
|
238
|
+
timestamp: number;
|
|
239
|
+
origin: string;
|
|
240
|
+
payload: Record<string, never>;
|
|
241
|
+
}
|
|
242
|
+
/** Get current visible range */
|
|
243
|
+
interface GetVisibleRangeCommand {
|
|
244
|
+
type: "request:getVisibleRange";
|
|
245
|
+
correlationId: string;
|
|
246
|
+
timestamp: number;
|
|
247
|
+
origin: string;
|
|
248
|
+
payload: Record<string, never>;
|
|
249
|
+
}
|
|
250
|
+
/** Get current pane snapshots */
|
|
251
|
+
interface GetPaneSnapshotsCommand {
|
|
252
|
+
type: "request:getPaneSnapshots";
|
|
253
|
+
correlationId: string;
|
|
254
|
+
timestamp: number;
|
|
255
|
+
origin: string;
|
|
256
|
+
payload: Record<string, never>;
|
|
257
|
+
}
|
|
258
|
+
/** Capture snapshot as image */
|
|
259
|
+
interface CaptureSnapshotCommand {
|
|
260
|
+
type: "request:captureSnapshot";
|
|
261
|
+
correlationId: string;
|
|
262
|
+
timestamp: number;
|
|
263
|
+
origin: string;
|
|
264
|
+
payload: {
|
|
265
|
+
format?: "png" | "jpeg";
|
|
266
|
+
quality?: number;
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/** Toggle fullscreen */
|
|
270
|
+
interface ToggleFullscreenCommand {
|
|
271
|
+
type: "request:toggleFullscreen";
|
|
272
|
+
correlationId: string;
|
|
273
|
+
timestamp: number;
|
|
274
|
+
origin: string;
|
|
275
|
+
payload: Record<string, never>;
|
|
276
|
+
}
|
|
277
|
+
/** Set locale */
|
|
278
|
+
interface SetLocaleCommand {
|
|
279
|
+
type: "request:setLocale";
|
|
280
|
+
correlationId: string;
|
|
281
|
+
timestamp: number;
|
|
282
|
+
origin: string;
|
|
283
|
+
payload: {
|
|
284
|
+
locale: string;
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
/** Set timezone */
|
|
288
|
+
interface SetTimezoneCommand {
|
|
289
|
+
type: "request:setTimezone";
|
|
290
|
+
correlationId: string;
|
|
291
|
+
timestamp: number;
|
|
292
|
+
origin: string;
|
|
293
|
+
payload: {
|
|
294
|
+
timezone: string;
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
/** Destroy widget and cleanup */
|
|
298
|
+
interface DestroyCommand {
|
|
299
|
+
type: "request:destroy";
|
|
300
|
+
correlationId: string;
|
|
301
|
+
timestamp: number;
|
|
302
|
+
origin: string;
|
|
303
|
+
payload: Record<string, never>;
|
|
304
|
+
}
|
|
305
|
+
/** Union of all Host → Iframe commands */
|
|
306
|
+
type HostToIframeCommand = InitializeCommand | SetSymbolCommand | SetTimeframeCommand | SetRangeCommand | SetThemeCommand | SetDrawingsCommand | AddDrawingCommand | RemoveDrawingCommand | UpdateDrawingCommand | SetActiveToolCommand | SetDockTabCommand | SetWatchlistCommand | SubscribeQuotesCommand | UnsubscribeQuotesCommand | ExportDrawingsCommand | GetVisibleRangeCommand | GetPaneSnapshotsCommand | CaptureSnapshotCommand | ToggleFullscreenCommand | SetLocaleCommand | SetTimezoneCommand | DestroyCommand;
|
|
307
|
+
/** Widget initialized and ready */
|
|
308
|
+
interface ReadyEvent {
|
|
309
|
+
type: "event:ready";
|
|
310
|
+
correlationId: string;
|
|
311
|
+
timestamp: number;
|
|
312
|
+
origin: string;
|
|
313
|
+
payload: {
|
|
314
|
+
version: string;
|
|
315
|
+
capabilities: string[];
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
/** Symbol changed */
|
|
319
|
+
interface SymbolChangedEvent {
|
|
320
|
+
type: "event:symbolChanged";
|
|
321
|
+
correlationId: string;
|
|
322
|
+
timestamp: number;
|
|
323
|
+
origin: string;
|
|
324
|
+
payload: {
|
|
325
|
+
symbol: string;
|
|
326
|
+
previousSymbol: string | null;
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
/** Timeframe changed */
|
|
330
|
+
interface TimeframeChangedEvent {
|
|
331
|
+
type: "event:timeframeChanged";
|
|
332
|
+
correlationId: string;
|
|
333
|
+
timestamp: number;
|
|
334
|
+
origin: string;
|
|
335
|
+
payload: {
|
|
336
|
+
timeframe: string;
|
|
337
|
+
previousTimeframe: string | null;
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
/** Visible range changed (pan/zoom) */
|
|
341
|
+
interface VisibleRangeChangedEvent {
|
|
342
|
+
type: "event:visibleRangeChanged";
|
|
343
|
+
correlationId: string;
|
|
344
|
+
timestamp: number;
|
|
345
|
+
origin: string;
|
|
346
|
+
payload: {
|
|
347
|
+
startIndex: number;
|
|
348
|
+
endIndex: number;
|
|
349
|
+
startDate: string;
|
|
350
|
+
endDate: string;
|
|
351
|
+
barCount: number;
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
/** Drawings changed */
|
|
355
|
+
interface DrawingsChangedEvent {
|
|
356
|
+
type: "event:drawingsChanged";
|
|
357
|
+
correlationId: string;
|
|
358
|
+
timestamp: number;
|
|
359
|
+
origin: string;
|
|
360
|
+
payload: {
|
|
361
|
+
drawings: readonly any[];
|
|
362
|
+
action: "add" | "remove" | "update" | "replace";
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
/** Drawing tool changed */
|
|
366
|
+
interface ActiveToolChangedEvent {
|
|
367
|
+
type: "event:activeToolChanged";
|
|
368
|
+
correlationId: string;
|
|
369
|
+
timestamp: number;
|
|
370
|
+
origin: string;
|
|
371
|
+
payload: {
|
|
372
|
+
tool: string;
|
|
373
|
+
previousTool: string | null;
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
/** Theme changed */
|
|
377
|
+
interface ThemeChangedEvent {
|
|
378
|
+
type: "event:themeChanged";
|
|
379
|
+
correlationId: string;
|
|
380
|
+
timestamp: number;
|
|
381
|
+
origin: string;
|
|
382
|
+
payload: {
|
|
383
|
+
theme: "light" | "dark";
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
/** Error occurred */
|
|
387
|
+
interface ErrorEvent {
|
|
388
|
+
type: "event:error";
|
|
389
|
+
correlationId: string;
|
|
390
|
+
timestamp: number;
|
|
391
|
+
origin: string;
|
|
392
|
+
payload: {
|
|
393
|
+
code: string;
|
|
394
|
+
message: string;
|
|
395
|
+
recoverable: boolean;
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
/** Snapshot captured */
|
|
399
|
+
interface SnapshotCapturedEvent {
|
|
400
|
+
type: "event:snapshotCaptured";
|
|
401
|
+
correlationId: string;
|
|
402
|
+
timestamp: number;
|
|
403
|
+
origin: string;
|
|
404
|
+
payload: {
|
|
405
|
+
dataUrl: string;
|
|
406
|
+
format: string;
|
|
407
|
+
width: number;
|
|
408
|
+
height: number;
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
/** Fullscreen toggled */
|
|
412
|
+
interface FullscreenToggledEvent {
|
|
413
|
+
type: "event:fullscreenToggled";
|
|
414
|
+
correlationId: string;
|
|
415
|
+
timestamp: number;
|
|
416
|
+
origin: string;
|
|
417
|
+
payload: {
|
|
418
|
+
isFullscreen: boolean;
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
/** SaaS feature gate error (premium feature blocked) */
|
|
422
|
+
interface SaaSErrorEvent {
|
|
423
|
+
type: "event:saasError";
|
|
424
|
+
correlationId: string;
|
|
425
|
+
timestamp: number;
|
|
426
|
+
origin: string;
|
|
427
|
+
payload: {
|
|
428
|
+
feature: string;
|
|
429
|
+
message: string;
|
|
430
|
+
requiresUpgrade: boolean;
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
/** Adapter error (data fetch failed) */
|
|
434
|
+
interface AdapterErrorEvent {
|
|
435
|
+
type: "event:adapterError";
|
|
436
|
+
correlationId: string;
|
|
437
|
+
timestamp: number;
|
|
438
|
+
origin: string;
|
|
439
|
+
payload: {
|
|
440
|
+
code: string;
|
|
441
|
+
message: string;
|
|
442
|
+
adapterType: string;
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
/** Frame resized (E1: card mode only — fill mode never emits this) */
|
|
446
|
+
interface ResizedEvent {
|
|
447
|
+
type: "event:resized";
|
|
448
|
+
correlationId: string;
|
|
449
|
+
timestamp: number;
|
|
450
|
+
origin: string;
|
|
451
|
+
payload: {
|
|
452
|
+
height: number;
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
/** E5: batched live quotes (latest-wins per symbol, ≥250ms cadence) */
|
|
456
|
+
interface QuotesEvent {
|
|
457
|
+
type: "event:quotes";
|
|
458
|
+
correlationId: string;
|
|
459
|
+
timestamp: number;
|
|
460
|
+
origin: string;
|
|
461
|
+
payload: {
|
|
462
|
+
updates: Array<{
|
|
463
|
+
symbol: string;
|
|
464
|
+
price?: number;
|
|
465
|
+
change?: number;
|
|
466
|
+
changePercent?: number;
|
|
467
|
+
sparkline?: number[];
|
|
468
|
+
}>;
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
/** Union of all Iframe → Host events */
|
|
472
|
+
type IframeToHostEvent = ReadyEvent | SymbolChangedEvent | TimeframeChangedEvent | VisibleRangeChangedEvent | DrawingsChangedEvent | ActiveToolChangedEvent | ThemeChangedEvent | ErrorEvent | SnapshotCapturedEvent | FullscreenToggledEvent | SaaSErrorEvent | AdapterErrorEvent | ResizedEvent | QuotesEvent;
|
|
473
|
+
/** Initialize response */
|
|
474
|
+
interface InitializeResponse {
|
|
475
|
+
success: true;
|
|
476
|
+
widgetId: string;
|
|
477
|
+
}
|
|
478
|
+
/** Export drawings response */
|
|
479
|
+
interface ExportDrawingsResponse {
|
|
480
|
+
success: true;
|
|
481
|
+
drawings: readonly any[];
|
|
482
|
+
}
|
|
483
|
+
/** Get visible range response */
|
|
484
|
+
interface GetVisibleRangeResponse {
|
|
485
|
+
success: true;
|
|
486
|
+
range: {
|
|
487
|
+
startIndex: number;
|
|
488
|
+
endIndex: number;
|
|
489
|
+
startDate: string;
|
|
490
|
+
endDate: string;
|
|
491
|
+
barCount: number;
|
|
492
|
+
} | null;
|
|
493
|
+
}
|
|
494
|
+
/** Get pane snapshots response */
|
|
495
|
+
interface GetPaneSnapshotsResponse {
|
|
496
|
+
success: true;
|
|
497
|
+
snapshots: readonly any[];
|
|
498
|
+
}
|
|
499
|
+
/** Capture snapshot response */
|
|
500
|
+
interface CaptureSnapshotResponse {
|
|
501
|
+
success: true;
|
|
502
|
+
dataUrl: string;
|
|
503
|
+
}
|
|
504
|
+
/** Generic error response */
|
|
505
|
+
interface ErrorResponse {
|
|
506
|
+
success: false;
|
|
507
|
+
error: string;
|
|
508
|
+
}
|
|
509
|
+
/** Generic success response (for commands that don't return data) */
|
|
510
|
+
interface SuccessResponse {
|
|
511
|
+
success: true;
|
|
512
|
+
}
|
|
513
|
+
/** Union of all response payloads */
|
|
514
|
+
type ResponsePayload = InitializeResponse | ExportDrawingsResponse | GetVisibleRangeResponse | GetPaneSnapshotsResponse | CaptureSnapshotResponse | SuccessResponse | ErrorResponse;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* WP-11: Iframe Bridge - Host ↔ Iframe Communication Layer
|
|
518
|
+
*
|
|
519
|
+
* Handles postMessage communication with:
|
|
520
|
+
* - Origin validation against allowlist
|
|
521
|
+
* - Request/response correlation
|
|
522
|
+
* - Event emission
|
|
523
|
+
* - Automatic cleanup
|
|
524
|
+
*/
|
|
525
|
+
|
|
526
|
+
/** Allowed origins for postMessage security */
|
|
527
|
+
interface AllowedOriginsConfig {
|
|
528
|
+
/** List of allowed origins (exact match or wildcard patterns) */
|
|
529
|
+
allowedOrigins: string[];
|
|
530
|
+
/** Whether to allow any origin (DANGEROUS - only for development) */
|
|
531
|
+
allowAnyOrigin?: boolean;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Default allowed origins — override per deployment.
|
|
535
|
+
* SECURITY: Remove `http://localhost` entries in production.
|
|
536
|
+
*/
|
|
537
|
+
declare const DEFAULT_ALLOWED_ORIGINS: string[];
|
|
538
|
+
/** Message handler type */
|
|
539
|
+
type MessageHandler = (message: IframeToHostEvent) => void;
|
|
540
|
+
/** Request handler type (for Iframe side) */
|
|
541
|
+
type RequestHandler = (command: HostToIframeCommand) => Promise<ResponsePayload>;
|
|
542
|
+
/** Bridge configuration */
|
|
543
|
+
interface BridgeConfig {
|
|
544
|
+
/** Target window (iframe.contentWindow or window.parent) */
|
|
545
|
+
targetWindow: Window;
|
|
546
|
+
/** Target origin for sending messages */
|
|
547
|
+
targetOrigin: string;
|
|
548
|
+
/** Allowed origins for receiving messages */
|
|
549
|
+
allowedOrigins: string[];
|
|
550
|
+
/** Whether we are the Host (true) or Iframe (false) */
|
|
551
|
+
isHost: boolean;
|
|
552
|
+
/** Request timeout in ms */
|
|
553
|
+
requestTimeout?: number;
|
|
554
|
+
/** Callback when connection is established */
|
|
555
|
+
onReady?: () => void;
|
|
556
|
+
/** Callback on connection error */
|
|
557
|
+
onError?: (error: Error) => void;
|
|
558
|
+
/** Whether to allow any origin (DANGEROUS - only for development) */
|
|
559
|
+
allowAnyOrigin?: boolean;
|
|
560
|
+
/**
|
|
561
|
+
* SEC-01: maximum serialized size of an accepted inbound message.
|
|
562
|
+
* Oversized payloads are rejected before parsing or state mutation.
|
|
563
|
+
*/
|
|
564
|
+
maxPayloadBytes?: number;
|
|
565
|
+
/**
|
|
566
|
+
* SEC-01: inbound message budget. Once more than `maxMessages` are accepted
|
|
567
|
+
* within `rateWindowMs`, further traffic is dropped until the window rolls.
|
|
568
|
+
*/
|
|
569
|
+
maxMessages?: number;
|
|
570
|
+
rateWindowMs?: number;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Iframe Bridge - bidirectional postMessage communication
|
|
574
|
+
*/
|
|
575
|
+
declare class IframeBridge {
|
|
576
|
+
private config;
|
|
577
|
+
private pendingRequests;
|
|
578
|
+
private messageHandler;
|
|
579
|
+
private requestHandler;
|
|
580
|
+
private boundHandleMessage;
|
|
581
|
+
private isDestroyed;
|
|
582
|
+
private readyPromise;
|
|
583
|
+
private readyResolve;
|
|
584
|
+
/**
|
|
585
|
+
* Origin pinned from the first origin-allowlisted incoming message
|
|
586
|
+
* (iframe side). All outbound sends use it instead of the "*" fallback,
|
|
587
|
+
* so widget data is never broadcast to arbitrary windows once the host
|
|
588
|
+
* is known. Re-pinned on every validated message (allows host moves).
|
|
589
|
+
*/
|
|
590
|
+
private pinnedSendOrigin;
|
|
591
|
+
/** SEC-01: sliding-window counters for the inbound rate limit. */
|
|
592
|
+
private rateWindowStart;
|
|
593
|
+
private rateCount;
|
|
594
|
+
constructor(config: BridgeConfig);
|
|
595
|
+
/**
|
|
596
|
+
* Set handler for incoming events (Host side)
|
|
597
|
+
*/
|
|
598
|
+
setMessageHandler(handler: MessageHandler): void;
|
|
599
|
+
/**
|
|
600
|
+
* Set handler for incoming requests (Iframe side)
|
|
601
|
+
*/
|
|
602
|
+
setRequestHandler(handler: RequestHandler): void;
|
|
603
|
+
/**
|
|
604
|
+
* Resolve the target origin for outbound sends. Prefers the pinned
|
|
605
|
+
* validated origin; falls back to the configured targetOrigin ("*" only
|
|
606
|
+
* until the first allowlisted message arrives on the iframe side).
|
|
607
|
+
*/
|
|
608
|
+
private resolveSendOrigin;
|
|
609
|
+
/**
|
|
610
|
+
* Send a command to the other side
|
|
611
|
+
*/
|
|
612
|
+
sendCommand<T extends HostToIframeCommand>(command: T, timeoutMs?: number): Promise<ResponsePayload>;
|
|
613
|
+
/**
|
|
614
|
+
* Send an event (fire-and-forget)
|
|
615
|
+
*/
|
|
616
|
+
sendEvent(event: IframeToHostEvent): void;
|
|
617
|
+
/**
|
|
618
|
+
* Send a response to a request
|
|
619
|
+
*/
|
|
620
|
+
sendResponse(request: RequestMessage, payload: ResponsePayload, success?: boolean, error?: string): void;
|
|
621
|
+
/**
|
|
622
|
+
* Wait for the bridge to be ready (Iframe side)
|
|
623
|
+
*/
|
|
624
|
+
waitForReady(): Promise<void>;
|
|
625
|
+
/**
|
|
626
|
+
* Signal that Iframe is ready (Iframe side)
|
|
627
|
+
*/
|
|
628
|
+
signalReady(version: string, capabilities: string[]): void;
|
|
629
|
+
/**
|
|
630
|
+
* Validate message origin against allowlist.
|
|
631
|
+
*
|
|
632
|
+
* SEC-01: wildcard patterns are matched as PLAIN STRINGS, never compiled into
|
|
633
|
+
* a RegExp. The previous implementation replaced every `*` with `.*` and then
|
|
634
|
+
* ran `new RegExp`, which left every `.` unescaped, so a pattern like
|
|
635
|
+
* `https:` + wildcard-subdomain + `vninvestcharts.com` also matched origins
|
|
636
|
+
* such as `https://evilvninvestchartsXcom`. Only a leading subdomain
|
|
637
|
+
* wildcard is supported and it must sit on a scheme boundary.
|
|
638
|
+
*/
|
|
639
|
+
private isOriginAllowed;
|
|
640
|
+
/** SEC-01: counters for rejected traffic — surfaced for tests/monitoring. */
|
|
641
|
+
readonly stats: {
|
|
642
|
+
rejectedOrigin: number;
|
|
643
|
+
rejectedSize: number;
|
|
644
|
+
rejectedRate: number;
|
|
645
|
+
accepted: number;
|
|
646
|
+
};
|
|
647
|
+
/**
|
|
648
|
+
* SEC-01: size + rate gate, applied after the origin is trusted so that
|
|
649
|
+
* hostile origins are not charged against the budget.
|
|
650
|
+
*/
|
|
651
|
+
private passesTrafficBudget;
|
|
652
|
+
/**
|
|
653
|
+
* Handle incoming postMessage
|
|
654
|
+
*/
|
|
655
|
+
private handleMessage;
|
|
656
|
+
/**
|
|
657
|
+
* Destroy the bridge and cleanup
|
|
658
|
+
*/
|
|
659
|
+
destroy(): void;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Create Host-side bridge (parent page embedding iframe)
|
|
663
|
+
*/
|
|
664
|
+
declare function createHostBridge(iframe: HTMLIFrameElement, allowedOrigins?: string[], options?: Partial<BridgeConfig>): IframeBridge;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* WP-11: Host SDK - Type-safe API for embedding VNInvestCharts in an iframe
|
|
668
|
+
*
|
|
669
|
+
* Provides a clean Promise-based API for controlling the widget from the parent page.
|
|
670
|
+
* Handles connection lifecycle, origin validation, and automatic reconnection.
|
|
671
|
+
*/
|
|
672
|
+
|
|
673
|
+
/** Host SDK configuration */
|
|
674
|
+
interface HostSDKConfig {
|
|
675
|
+
/** Iframe element or selector */
|
|
676
|
+
iframe: HTMLIFrameElement | string;
|
|
677
|
+
/** Allowed origins for postMessage security */
|
|
678
|
+
allowedOrigins?: string[];
|
|
679
|
+
/** Connection timeout in ms */
|
|
680
|
+
connectionTimeout?: number;
|
|
681
|
+
/** Request timeout in ms */
|
|
682
|
+
requestTimeout?: number;
|
|
683
|
+
/** Callback when widget is ready */
|
|
684
|
+
onReady?: (info: {
|
|
685
|
+
version: string;
|
|
686
|
+
capabilities: string[];
|
|
687
|
+
}) => void;
|
|
688
|
+
/** Callback on widget events */
|
|
689
|
+
onEvent?: (event: IframeToHostEvent) => void;
|
|
690
|
+
/** Callback on connection error */
|
|
691
|
+
onError?: (error: Error) => void;
|
|
692
|
+
/** Callback when connection is lost */
|
|
693
|
+
onDisconnect?: () => void;
|
|
694
|
+
}
|
|
695
|
+
/** Widget control API returned by HostSDK */
|
|
696
|
+
interface WidgetController {
|
|
697
|
+
/** Initialize widget with configuration */
|
|
698
|
+
initialize(config: WidgetConfig): Promise<{
|
|
699
|
+
widgetId: string;
|
|
700
|
+
}>;
|
|
701
|
+
/** Change symbol */
|
|
702
|
+
setSymbol(symbol: string): Promise<void>;
|
|
703
|
+
/** Change timeframe */
|
|
704
|
+
setTimeframe(timeframe: string): Promise<void>;
|
|
705
|
+
/** Change visible range */
|
|
706
|
+
setRange(range: string): Promise<void>;
|
|
707
|
+
/** Change theme */
|
|
708
|
+
setTheme(theme: "light" | "dark"): Promise<void>;
|
|
709
|
+
/** Replace all drawings */
|
|
710
|
+
setDrawings(drawings: readonly any[]): Promise<void>;
|
|
711
|
+
/** Add a drawing */
|
|
712
|
+
addDrawing(drawing: any): Promise<void>;
|
|
713
|
+
/** Remove a drawing by ID */
|
|
714
|
+
removeDrawing(drawingId: string): Promise<void>;
|
|
715
|
+
/** Update a drawing */
|
|
716
|
+
updateDrawing(drawingId: string, updates: Partial<any>): Promise<void>;
|
|
717
|
+
/** Set active drawing tool */
|
|
718
|
+
setActiveTool(tool: string): Promise<void>;
|
|
719
|
+
/** E3: switch the right-dock tab */
|
|
720
|
+
setDockTab(tab: string): Promise<void>;
|
|
721
|
+
/** E3: replace the dock watchlist (static symbols) */
|
|
722
|
+
setWatchlist(symbols: string[]): Promise<void>;
|
|
723
|
+
/** Export current drawings */
|
|
724
|
+
exportDrawings(): Promise<readonly any[]>;
|
|
725
|
+
/** Get current visible range */
|
|
726
|
+
getVisibleRange(): Promise<{
|
|
727
|
+
startIndex: number;
|
|
728
|
+
endIndex: number;
|
|
729
|
+
startDate: string;
|
|
730
|
+
endDate: string;
|
|
731
|
+
barCount: number;
|
|
732
|
+
} | null>;
|
|
733
|
+
/** Get current pane snapshots */
|
|
734
|
+
getPaneSnapshots(): Promise<readonly any[]>;
|
|
735
|
+
/** Capture snapshot as image */
|
|
736
|
+
captureSnapshot(format?: "png" | "jpeg", quality?: number): Promise<string>;
|
|
737
|
+
/** Toggle fullscreen */
|
|
738
|
+
toggleFullscreen(): Promise<void>;
|
|
739
|
+
/** Set locale */
|
|
740
|
+
setLocale(locale: string): Promise<void>;
|
|
741
|
+
/** Set timezone */
|
|
742
|
+
setTimezone(timezone: string): Promise<void>;
|
|
743
|
+
/** Destroy widget and cleanup */
|
|
744
|
+
destroy(): Promise<void>;
|
|
745
|
+
/** E5: subscribe to live quote fan-out (batch ≥250ms); returns unsubscribe */
|
|
746
|
+
subscribeQuotes(symbols: string[], onQuotes: (updates: Array<{
|
|
747
|
+
symbol: string;
|
|
748
|
+
price?: number;
|
|
749
|
+
change?: number;
|
|
750
|
+
changePercent?: number;
|
|
751
|
+
}>) => void): Promise<() => Promise<void>>;
|
|
752
|
+
/** Check if widget is ready */
|
|
753
|
+
isReady(): boolean;
|
|
754
|
+
/** Get widget version */
|
|
755
|
+
getVersion(): string | null;
|
|
756
|
+
}
|
|
757
|
+
/** E4: typed embed error — `{code, recoverable, detail}` for the host matrix. */
|
|
758
|
+
declare class EmbedError extends Error {
|
|
759
|
+
readonly code: string;
|
|
760
|
+
readonly recoverable: boolean;
|
|
761
|
+
readonly detail?: string;
|
|
762
|
+
constructor(code: string, message: string, recoverable?: boolean, detail?: string);
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Host SDK for controlling VNInvestCharts widget in an iframe
|
|
766
|
+
*/
|
|
767
|
+
declare class VNInvestChartsHostSDK {
|
|
768
|
+
private config;
|
|
769
|
+
private iframe;
|
|
770
|
+
private bridge;
|
|
771
|
+
private isReady;
|
|
772
|
+
private version;
|
|
773
|
+
private capabilities;
|
|
774
|
+
private readyPromise;
|
|
775
|
+
private readyResolve;
|
|
776
|
+
private eventListeners;
|
|
777
|
+
constructor(config: HostSDKConfig);
|
|
778
|
+
/**
|
|
779
|
+
* Connect to the iframe widget
|
|
780
|
+
*/
|
|
781
|
+
connect(): Promise<void>;
|
|
782
|
+
/**
|
|
783
|
+
* Wait for iframe to finish loading
|
|
784
|
+
*/
|
|
785
|
+
private waitForIframeLoad;
|
|
786
|
+
/**
|
|
787
|
+
* Handle ready signal from iframe
|
|
788
|
+
*/
|
|
789
|
+
private handleReady;
|
|
790
|
+
/**
|
|
791
|
+
* Handle incoming events from iframe
|
|
792
|
+
*/
|
|
793
|
+
private handleEvent;
|
|
794
|
+
/**
|
|
795
|
+
* Get the widget controller API
|
|
796
|
+
*/
|
|
797
|
+
getController(): WidgetController;
|
|
798
|
+
/**
|
|
799
|
+
* Subscribe to specific event types
|
|
800
|
+
*/
|
|
801
|
+
on<K extends IframeToHostEvent["type"]>(eventType: K, listener: (payload: Extract<IframeToHostEvent, {
|
|
802
|
+
type: K;
|
|
803
|
+
}>["payload"]) => void): () => void;
|
|
804
|
+
/**
|
|
805
|
+
* Disconnect and cleanup
|
|
806
|
+
*/
|
|
807
|
+
disconnect(): void;
|
|
808
|
+
/**
|
|
809
|
+
* Check if connected and ready
|
|
810
|
+
*/
|
|
811
|
+
get connected(): boolean;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Convenience function to create and connect Host SDK in one call
|
|
815
|
+
*/
|
|
816
|
+
declare function createVNInvestChartsHost(config: HostSDKConfig): Promise<VNInvestChartsHostSDK>;
|
|
817
|
+
|
|
818
|
+
export { type AdapterConfig, type AllowedOriginsConfig, type BridgeConfig, DEFAULT_ALLOWED_ORIGINS, EmbedError, type HostSDKConfig, type HostToIframeCommand, IframeBridge, type IframeToHostEvent, type ResponsePayload, VNInvestChartsHostSDK, type WidgetConfig, type WidgetController, createHostBridge, createVNInvestChartsHost };
|