@itssumitrai/fin-charter 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.md +96 -0
  2. package/dist/api/chart-api.d.ts +173 -0
  3. package/dist/api/export.d.ts +46 -0
  4. package/dist/api/indicator-api.d.ts +38 -0
  5. package/dist/api/options.d.ts +226 -0
  6. package/dist/api/pane-api.d.ts +28 -0
  7. package/dist/api/series-api.d.ts +115 -0
  8. package/dist/core/accessibility.d.ts +90 -0
  9. package/dist/core/alert-line.d.ts +49 -0
  10. package/dist/core/chart-state.d.ts +39 -0
  11. package/dist/core/chart-sync.d.ts +83 -0
  12. package/dist/core/crosshair.d.ts +28 -0
  13. package/dist/core/css-theme.d.ts +41 -0
  14. package/dist/core/custom-indicator.d.ts +70 -0
  15. package/dist/core/data-feed.d.ts +59 -0
  16. package/dist/core/data-layer.d.ts +38 -0
  17. package/dist/core/invalidation.d.ts +24 -0
  18. package/dist/core/market-session.d.ts +11 -0
  19. package/dist/core/order-line.d.ts +134 -0
  20. package/dist/core/pane-divider.d.ts +22 -0
  21. package/dist/core/pane.d.ts +32 -0
  22. package/dist/core/periodicity.d.ts +6 -0
  23. package/dist/core/plugin.d.ts +90 -0
  24. package/dist/core/price-line.d.ts +17 -0
  25. package/dist/core/price-scale.d.ts +74 -0
  26. package/dist/core/replay.d.ts +73 -0
  27. package/dist/core/rtl.d.ts +22 -0
  28. package/dist/core/segment-tree.d.ts +38 -0
  29. package/dist/core/series-markers.d.ts +18 -0
  30. package/dist/core/storage-adapter.d.ts +50 -0
  31. package/dist/core/streaming-adapter.d.ts +102 -0
  32. package/dist/core/symbol-resolver.d.ts +32 -0
  33. package/dist/core/text-label.d.ts +72 -0
  34. package/dist/core/time-scale.d.ts +109 -0
  35. package/dist/core/types.d.ts +144 -0
  36. package/dist/core/undo-redo.d.ts +46 -0
  37. package/dist/currency/currency.d.ts +8 -0
  38. package/dist/currency/index.d.ts +2 -0
  39. package/dist/drawings/arrow.d.ts +10 -0
  40. package/dist/drawings/base.d.ts +79 -0
  41. package/dist/drawings/channel.d.ts +10 -0
  42. package/dist/drawings/crossline.d.ts +10 -0
  43. package/dist/drawings/ellipse.d.ts +10 -0
  44. package/dist/drawings/fib-arc.d.ts +10 -0
  45. package/dist/drawings/fib-fan.d.ts +12 -0
  46. package/dist/drawings/fib-projection.d.ts +11 -0
  47. package/dist/drawings/fibonacci.d.ts +11 -0
  48. package/dist/drawings/horizontal-line.d.ts +10 -0
  49. package/dist/drawings/index.d.ts +7 -0
  50. package/dist/drawings/measurement.d.ts +11 -0
  51. package/dist/drawings/pitchfork.d.ts +12 -0
  52. package/dist/drawings/ray.d.ts +12 -0
  53. package/dist/drawings/rectangle.d.ts +10 -0
  54. package/dist/drawings/text-annotation.d.ts +11 -0
  55. package/dist/drawings/trendline.d.ts +10 -0
  56. package/dist/drawings/vertical-line.d.ts +10 -0
  57. package/dist/formatting/index.d.ts +5 -0
  58. package/dist/formatting/price-formatter.d.ts +6 -0
  59. package/dist/formatting/time-formatter.d.ts +7 -0
  60. package/dist/formatting/volume-formatter.d.ts +1 -0
  61. package/dist/i18n/i18n.d.ts +6 -0
  62. package/dist/i18n/index.d.ts +3 -0
  63. package/dist/i18n/locales/en.d.ts +3 -0
  64. package/dist/index.d.ts +63 -0
  65. package/dist/index.js +2 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/index10.js +2 -0
  68. package/dist/index10.js.map +1 -0
  69. package/dist/index100.js +2 -0
  70. package/dist/index100.js.map +1 -0
  71. package/dist/index101.js +2 -0
  72. package/dist/index101.js.map +1 -0
  73. package/dist/index102.js +2 -0
  74. package/dist/index102.js.map +1 -0
  75. package/dist/index103.js +2 -0
  76. package/dist/index103.js.map +1 -0
  77. package/dist/index104.js +2 -0
  78. package/dist/index104.js.map +1 -0
  79. package/dist/index105.js +2 -0
  80. package/dist/index105.js.map +1 -0
  81. package/dist/index106.js +2 -0
  82. package/dist/index106.js.map +1 -0
  83. package/dist/index107.js +2 -0
  84. package/dist/index107.js.map +1 -0
  85. package/dist/index108.js +2 -0
  86. package/dist/index108.js.map +1 -0
  87. package/dist/index109.js +2 -0
  88. package/dist/index109.js.map +1 -0
  89. package/dist/index11.js +2 -0
  90. package/dist/index11.js.map +1 -0
  91. package/dist/index110.js +2 -0
  92. package/dist/index110.js.map +1 -0
  93. package/dist/index111.js +2 -0
  94. package/dist/index111.js.map +1 -0
  95. package/dist/index112.js +2 -0
  96. package/dist/index112.js.map +1 -0
  97. package/dist/index113.js +2 -0
  98. package/dist/index113.js.map +1 -0
  99. package/dist/index114.js +2 -0
  100. package/dist/index114.js.map +1 -0
  101. package/dist/index115.js +2 -0
  102. package/dist/index115.js.map +1 -0
  103. package/dist/index116.js +2 -0
  104. package/dist/index116.js.map +1 -0
  105. package/dist/index117.js +2 -0
  106. package/dist/index117.js.map +1 -0
  107. package/dist/index118.js +2 -0
  108. package/dist/index118.js.map +1 -0
  109. package/dist/index119.js +2 -0
  110. package/dist/index119.js.map +1 -0
  111. package/dist/index12.js +2 -0
  112. package/dist/index12.js.map +1 -0
  113. package/dist/index120.js +2 -0
  114. package/dist/index120.js.map +1 -0
  115. package/dist/index121.js +2 -0
  116. package/dist/index121.js.map +1 -0
  117. package/dist/index122.js +2 -0
  118. package/dist/index122.js.map +1 -0
  119. package/dist/index123.js +2 -0
  120. package/dist/index123.js.map +1 -0
  121. package/dist/index124.js +2 -0
  122. package/dist/index124.js.map +1 -0
  123. package/dist/index13.js +2 -0
  124. package/dist/index13.js.map +1 -0
  125. package/dist/index14.js +2 -0
  126. package/dist/index14.js.map +1 -0
  127. package/dist/index15.js +2 -0
  128. package/dist/index15.js.map +1 -0
  129. package/dist/index16.js +2 -0
  130. package/dist/index16.js.map +1 -0
  131. package/dist/index17.js +2 -0
  132. package/dist/index17.js.map +1 -0
  133. package/dist/index18.js +2 -0
  134. package/dist/index18.js.map +1 -0
  135. package/dist/index19.js +2 -0
  136. package/dist/index19.js.map +1 -0
  137. package/dist/index2.js +2 -0
  138. package/dist/index2.js.map +1 -0
  139. package/dist/index20.js +2 -0
  140. package/dist/index20.js.map +1 -0
  141. package/dist/index21.js +2 -0
  142. package/dist/index21.js.map +1 -0
  143. package/dist/index22.js +2 -0
  144. package/dist/index22.js.map +1 -0
  145. package/dist/index23.js +2 -0
  146. package/dist/index23.js.map +1 -0
  147. package/dist/index24.js +2 -0
  148. package/dist/index24.js.map +1 -0
  149. package/dist/index25.js +2 -0
  150. package/dist/index25.js.map +1 -0
  151. package/dist/index26.js +2 -0
  152. package/dist/index26.js.map +1 -0
  153. package/dist/index27.js +2 -0
  154. package/dist/index27.js.map +1 -0
  155. package/dist/index28.js +2 -0
  156. package/dist/index28.js.map +1 -0
  157. package/dist/index29.js +2 -0
  158. package/dist/index29.js.map +1 -0
  159. package/dist/index3.js +2 -0
  160. package/dist/index3.js.map +1 -0
  161. package/dist/index30.js +2 -0
  162. package/dist/index30.js.map +1 -0
  163. package/dist/index31.js +2 -0
  164. package/dist/index31.js.map +1 -0
  165. package/dist/index32.js +2 -0
  166. package/dist/index32.js.map +1 -0
  167. package/dist/index33.js +2 -0
  168. package/dist/index33.js.map +1 -0
  169. package/dist/index34.js +2 -0
  170. package/dist/index34.js.map +1 -0
  171. package/dist/index35.js +2 -0
  172. package/dist/index35.js.map +1 -0
  173. package/dist/index36.js +2 -0
  174. package/dist/index36.js.map +1 -0
  175. package/dist/index37.js +2 -0
  176. package/dist/index37.js.map +1 -0
  177. package/dist/index38.js +2 -0
  178. package/dist/index38.js.map +1 -0
  179. package/dist/index39.js +2 -0
  180. package/dist/index39.js.map +1 -0
  181. package/dist/index4.js +2 -0
  182. package/dist/index4.js.map +1 -0
  183. package/dist/index40.js +2 -0
  184. package/dist/index40.js.map +1 -0
  185. package/dist/index41.js +2 -0
  186. package/dist/index41.js.map +1 -0
  187. package/dist/index42.js +2 -0
  188. package/dist/index42.js.map +1 -0
  189. package/dist/index43.js +2 -0
  190. package/dist/index43.js.map +1 -0
  191. package/dist/index44.js +2 -0
  192. package/dist/index44.js.map +1 -0
  193. package/dist/index45.js +2 -0
  194. package/dist/index45.js.map +1 -0
  195. package/dist/index46.js +2 -0
  196. package/dist/index46.js.map +1 -0
  197. package/dist/index47.js +2 -0
  198. package/dist/index47.js.map +1 -0
  199. package/dist/index48.js +2 -0
  200. package/dist/index48.js.map +1 -0
  201. package/dist/index49.js +2 -0
  202. package/dist/index49.js.map +1 -0
  203. package/dist/index5.js +2 -0
  204. package/dist/index5.js.map +1 -0
  205. package/dist/index50.js +2 -0
  206. package/dist/index50.js.map +1 -0
  207. package/dist/index51.js +2 -0
  208. package/dist/index51.js.map +1 -0
  209. package/dist/index52.js +2 -0
  210. package/dist/index52.js.map +1 -0
  211. package/dist/index53.js +2 -0
  212. package/dist/index53.js.map +1 -0
  213. package/dist/index54.js +2 -0
  214. package/dist/index54.js.map +1 -0
  215. package/dist/index55.js +2 -0
  216. package/dist/index55.js.map +1 -0
  217. package/dist/index56.js +2 -0
  218. package/dist/index56.js.map +1 -0
  219. package/dist/index57.js +2 -0
  220. package/dist/index57.js.map +1 -0
  221. package/dist/index58.js +2 -0
  222. package/dist/index58.js.map +1 -0
  223. package/dist/index59.js +2 -0
  224. package/dist/index59.js.map +1 -0
  225. package/dist/index6.js +2 -0
  226. package/dist/index6.js.map +1 -0
  227. package/dist/index60.js +2 -0
  228. package/dist/index60.js.map +1 -0
  229. package/dist/index61.js +2 -0
  230. package/dist/index61.js.map +1 -0
  231. package/dist/index62.js +2 -0
  232. package/dist/index62.js.map +1 -0
  233. package/dist/index63.js +2 -0
  234. package/dist/index63.js.map +1 -0
  235. package/dist/index64.js +2 -0
  236. package/dist/index64.js.map +1 -0
  237. package/dist/index65.js +3 -0
  238. package/dist/index65.js.map +1 -0
  239. package/dist/index66.js +2 -0
  240. package/dist/index66.js.map +1 -0
  241. package/dist/index67.js +2 -0
  242. package/dist/index67.js.map +1 -0
  243. package/dist/index68.js +2 -0
  244. package/dist/index68.js.map +1 -0
  245. package/dist/index69.js +2 -0
  246. package/dist/index69.js.map +1 -0
  247. package/dist/index7.js +2 -0
  248. package/dist/index7.js.map +1 -0
  249. package/dist/index70.js +2 -0
  250. package/dist/index70.js.map +1 -0
  251. package/dist/index71.js +2 -0
  252. package/dist/index71.js.map +1 -0
  253. package/dist/index72.js +2 -0
  254. package/dist/index72.js.map +1 -0
  255. package/dist/index73.js +2 -0
  256. package/dist/index73.js.map +1 -0
  257. package/dist/index74.js +2 -0
  258. package/dist/index74.js.map +1 -0
  259. package/dist/index75.js +2 -0
  260. package/dist/index75.js.map +1 -0
  261. package/dist/index76.js +2 -0
  262. package/dist/index76.js.map +1 -0
  263. package/dist/index77.js +2 -0
  264. package/dist/index77.js.map +1 -0
  265. package/dist/index78.js +2 -0
  266. package/dist/index78.js.map +1 -0
  267. package/dist/index79.js +2 -0
  268. package/dist/index79.js.map +1 -0
  269. package/dist/index8.js +2 -0
  270. package/dist/index8.js.map +1 -0
  271. package/dist/index80.js +2 -0
  272. package/dist/index80.js.map +1 -0
  273. package/dist/index81.js +2 -0
  274. package/dist/index81.js.map +1 -0
  275. package/dist/index82.js +2 -0
  276. package/dist/index82.js.map +1 -0
  277. package/dist/index83.js +2 -0
  278. package/dist/index83.js.map +1 -0
  279. package/dist/index84.js +2 -0
  280. package/dist/index84.js.map +1 -0
  281. package/dist/index85.js +2 -0
  282. package/dist/index85.js.map +1 -0
  283. package/dist/index86.js +2 -0
  284. package/dist/index86.js.map +1 -0
  285. package/dist/index87.js +2 -0
  286. package/dist/index87.js.map +1 -0
  287. package/dist/index88.js +2 -0
  288. package/dist/index88.js.map +1 -0
  289. package/dist/index89.js +2 -0
  290. package/dist/index89.js.map +1 -0
  291. package/dist/index9.js +2 -0
  292. package/dist/index9.js.map +1 -0
  293. package/dist/index90.js +2 -0
  294. package/dist/index90.js.map +1 -0
  295. package/dist/index91.js +2 -0
  296. package/dist/index91.js.map +1 -0
  297. package/dist/index92.js +2 -0
  298. package/dist/index92.js.map +1 -0
  299. package/dist/index93.js +2 -0
  300. package/dist/index93.js.map +1 -0
  301. package/dist/index94.js +2 -0
  302. package/dist/index94.js.map +1 -0
  303. package/dist/index95.js +2 -0
  304. package/dist/index95.js.map +1 -0
  305. package/dist/index96.js +2 -0
  306. package/dist/index96.js.map +1 -0
  307. package/dist/index97.js +2 -0
  308. package/dist/index97.js.map +1 -0
  309. package/dist/index98.js +2 -0
  310. package/dist/index98.js.map +1 -0
  311. package/dist/index99.js +2 -0
  312. package/dist/index99.js.map +1 -0
  313. package/dist/indicators/adx.d.ts +6 -0
  314. package/dist/indicators/aroon.d.ts +5 -0
  315. package/dist/indicators/atr.d.ts +1 -0
  316. package/dist/indicators/awesome-oscillator.d.ts +1 -0
  317. package/dist/indicators/bollinger.d.ts +6 -0
  318. package/dist/indicators/cci.d.ts +1 -0
  319. package/dist/indicators/chaikin-mf.d.ts +1 -0
  320. package/dist/indicators/choppiness.d.ts +1 -0
  321. package/dist/indicators/coppock.d.ts +1 -0
  322. package/dist/indicators/donchian.d.ts +6 -0
  323. package/dist/indicators/elder-force.d.ts +1 -0
  324. package/dist/indicators/ema.d.ts +1 -0
  325. package/dist/indicators/ichimoku.d.ts +8 -0
  326. package/dist/indicators/index.d.ts +31 -0
  327. package/dist/indicators/keltner.d.ts +6 -0
  328. package/dist/indicators/linear-regression.d.ts +1 -0
  329. package/dist/indicators/macd.d.ts +6 -0
  330. package/dist/indicators/mfi.d.ts +1 -0
  331. package/dist/indicators/obv.d.ts +1 -0
  332. package/dist/indicators/parabolic-sar.d.ts +1 -0
  333. package/dist/indicators/pivot-points.d.ts +10 -0
  334. package/dist/indicators/roc.d.ts +1 -0
  335. package/dist/indicators/rsi.d.ts +1 -0
  336. package/dist/indicators/sma.d.ts +1 -0
  337. package/dist/indicators/stochastic.d.ts +5 -0
  338. package/dist/indicators/supertrend.d.ts +5 -0
  339. package/dist/indicators/trix.d.ts +5 -0
  340. package/dist/indicators/utils.d.ts +20 -0
  341. package/dist/indicators/volume-profile.d.ts +37 -0
  342. package/dist/indicators/volume.d.ts +1 -0
  343. package/dist/indicators/vwap.d.ts +1 -0
  344. package/dist/indicators/vwma.d.ts +1 -0
  345. package/dist/indicators/williams-r.d.ts +1 -0
  346. package/dist/interactions/axis-drag.d.ts +24 -0
  347. package/dist/interactions/context-menu-handler.d.ts +42 -0
  348. package/dist/interactions/crosshair.d.ts +20 -0
  349. package/dist/interactions/drawing-handler.d.ts +39 -0
  350. package/dist/interactions/event-router.d.ts +37 -0
  351. package/dist/interactions/keyboard-nav.d.ts +11 -0
  352. package/dist/interactions/pan-zoom.d.ts +39 -0
  353. package/dist/interactions/range-selection.d.ts +103 -0
  354. package/dist/interactions/touch-gestures.d.ts +36 -0
  355. package/dist/logo.svg +40 -0
  356. package/dist/market/exchange-map.d.ts +3 -0
  357. package/dist/market/index.d.ts +4 -0
  358. package/dist/market/market-calendar.d.ts +4 -0
  359. package/dist/market/market-definition.d.ts +22 -0
  360. package/dist/mockServiceWorker.js +349 -0
  361. package/dist/renderers/area.d.ts +17 -0
  362. package/dist/renderers/bar-ohlc.d.ts +17 -0
  363. package/dist/renderers/baseline-delta-mountain.d.ts +22 -0
  364. package/dist/renderers/baseline.d.ts +19 -0
  365. package/dist/renderers/candlestick.d.ts +21 -0
  366. package/dist/renderers/canvas-renderer.d.ts +28 -0
  367. package/dist/renderers/colored-line.d.ts +15 -0
  368. package/dist/renderers/colored-mountain.d.ts +18 -0
  369. package/dist/renderers/column.d.ts +14 -0
  370. package/dist/renderers/high-low.d.ts +14 -0
  371. package/dist/renderers/histogram.d.ts +16 -0
  372. package/dist/renderers/hlc-area.d.ts +16 -0
  373. package/dist/renderers/hollow-candle.d.ts +18 -0
  374. package/dist/renderers/kagi.d.ts +22 -0
  375. package/dist/renderers/line-break.d.ts +20 -0
  376. package/dist/renderers/line.d.ts +17 -0
  377. package/dist/renderers/point-figure.d.ts +20 -0
  378. package/dist/renderers/renderer.d.ts +59 -0
  379. package/dist/renderers/renko.d.ts +24 -0
  380. package/dist/renderers/step-line.d.ts +14 -0
  381. package/dist/renderers/text-cache.d.ts +23 -0
  382. package/dist/renderers/volume-candle.d.ts +20 -0
  383. package/dist/renderers/webgl/area-webgl.d.ts +28 -0
  384. package/dist/renderers/webgl/candlestick-webgl.d.ts +30 -0
  385. package/dist/renderers/webgl/index.d.ts +7 -0
  386. package/dist/renderers/webgl/line-webgl.d.ts +23 -0
  387. package/dist/renderers/webgl/webgl-utils.d.ts +23 -0
  388. package/dist/timezone/index.d.ts +2 -0
  389. package/dist/timezone/timezone.d.ts +12 -0
  390. package/dist/transforms/aggregate.d.ts +2 -0
  391. package/dist/transforms/heikin-ashi.d.ts +2 -0
  392. package/dist/transforms/index.d.ts +2 -0
  393. package/dist/ui/context-menu.d.ts +14 -0
  394. package/dist/ui/hud.d.ts +43 -0
  395. package/dist/ui/settings-popup.d.ts +15 -0
  396. package/package.json +129 -0
@@ -0,0 +1,39 @@
1
+ import { EventHandler } from './event-router';
2
+ import { ISeriesPrimitive } from '../core/types';
3
+ import { DrawingPrimitive, DrawingContext } from '../drawings/base';
4
+ export type DrawingHandlerState = 'IDLE' | 'SELECTING' | 'PLACING' | 'EDITING';
5
+ export interface DrawingHandlerCallbacks {
6
+ getDrawings(): (ISeriesPrimitive & DrawingPrimitive)[];
7
+ getDrawingContext(): DrawingContext | null;
8
+ onDrawingCreated(drawing: ISeriesPrimitive & DrawingPrimitive): void;
9
+ onDrawingUpdated(drawing?: ISeriesPrimitive & DrawingPrimitive): void;
10
+ xToTime(x: number): number;
11
+ yToPrice(y: number): number;
12
+ }
13
+ /**
14
+ * Interaction handler for drawing tools.
15
+ * Manages placement of new drawings and selection/editing of existing drawings.
16
+ */
17
+ export declare class DrawingHandler implements EventHandler {
18
+ private _state;
19
+ private _activeToolType;
20
+ private _callbacks;
21
+ private _placingDrawing;
22
+ private _placedPointCount;
23
+ private _nextId;
24
+ private _selectedDrawing;
25
+ private _editHit;
26
+ private _dragStartX;
27
+ private _dragStartY;
28
+ private _dragStartPoints;
29
+ constructor(callbacks: DrawingHandlerCallbacks);
30
+ get state(): DrawingHandlerState;
31
+ setActiveToolType(type: string | null): void;
32
+ onPointerDown(x: number, y: number, _pointerId: number): boolean;
33
+ onPointerMove(x: number, y: number, _pointerId: number): boolean;
34
+ onPointerUp(_pointerId: number): boolean;
35
+ onKeyDown(key: string, _shiftKey: boolean): boolean;
36
+ private _handlePlacementClick;
37
+ private _hitTestDrawings;
38
+ private _applyDrag;
39
+ }
@@ -0,0 +1,37 @@
1
+ export interface EventHandler {
2
+ /**
3
+ * Called on pointer down. Return `true` to consume the event and prevent
4
+ * subsequent handlers from receiving it; return `false` or `undefined` to
5
+ * let the event propagate.
6
+ */
7
+ onPointerDown?(x: number, y: number, pointerId: number): boolean | void;
8
+ onPointerMove?(x: number, y: number, pointerId: number): boolean | void;
9
+ onPointerUp?(pointerId: number): boolean | void;
10
+ onWheel?(x: number, y: number, deltaY: number): void;
11
+ onKeyDown?(key: string, shiftKey: boolean): boolean | void;
12
+ onContextMenu?(x: number, y: number): boolean | void;
13
+ }
14
+ export declare class EventRouter {
15
+ private _element;
16
+ private _handlers;
17
+ private _boundPointerDown;
18
+ private _boundPointerMove;
19
+ private _boundPointerUp;
20
+ private _boundPointerLeave;
21
+ private _boundWheel;
22
+ private _boundKeyDown;
23
+ private _boundContextMenu;
24
+ constructor();
25
+ attach(element: HTMLElement): void;
26
+ detach(): void;
27
+ addHandler(handler: EventHandler): void;
28
+ removeHandler(handler: EventHandler): void;
29
+ private _getLocalCoords;
30
+ private _handlePointerDown;
31
+ private _handlePointerMove;
32
+ private _handlePointerUp;
33
+ private _handlePointerLeave;
34
+ private _handleWheel;
35
+ private _handleKeyDown;
36
+ private _handleContextMenu;
37
+ }
@@ -0,0 +1,11 @@
1
+ import { EventHandler } from './event-router';
2
+ import { TimeScale } from '../core/time-scale';
3
+ export declare class KeyboardNavHandler implements EventHandler {
4
+ private _timeScale;
5
+ private _requestInvalidation;
6
+ constructor(timeScale: TimeScale, requestInvalidation: () => void);
7
+ onKeyDown(key: string, shiftKey: boolean): void;
8
+ /** Best-effort center x — 0 means zoom around left edge if width unknown. */
9
+ private _getCenterX;
10
+ private _scrollToStart;
11
+ }
@@ -0,0 +1,39 @@
1
+ import { EventHandler } from './event-router';
2
+ import { TimeScale } from '../core/time-scale';
3
+ /**
4
+ * Pan and zoom handler for chart navigation.
5
+ *
6
+ * Pan:
7
+ * - On pointer down: store scrollStartX and savedRightOffset
8
+ * - On pointer move: timeScale.scrollTo(scrollStartX, currentX, savedRightOffset)
9
+ * - Dragging right → x increases → shift is negative → rightOffset decreases
10
+ * → chart moves toward future/recent data.
11
+ *
12
+ * Zoom (wheel):
13
+ * - TV negates deltaY and clamps to ±1 for the zoom scale.
14
+ * - timeScale.zoomAt(x, scale)
15
+ */
16
+ export declare class PanZoomHandler implements EventHandler {
17
+ private _timeScale;
18
+ private _requestInvalidation;
19
+ private _scrollStartX;
20
+ private _savedRightOffset;
21
+ private _isPanning;
22
+ private _activePointerId;
23
+ /** Track last N positions for kinetic velocity calculation. */
24
+ private _positions;
25
+ private _kineticRafId;
26
+ constructor(timeScale: TimeScale, requestInvalidation: () => void);
27
+ onPointerDown(x: number, _y: number, pointerId: number): void;
28
+ onPointerMove(x: number, _y: number, pointerId: number): void;
29
+ onPointerUp(pointerId: number): void;
30
+ onWheel(x: number, _y: number, deltaY: number): void;
31
+ destroy(): void;
32
+ /**
33
+ * Compute velocity (pixels per millisecond) from tracked positions,
34
+ * then convert to pixels-per-frame (~16ms).
35
+ */
36
+ private _computeVelocity;
37
+ private _startKinetic;
38
+ private _cancelKinetic;
39
+ }
@@ -0,0 +1,103 @@
1
+ import { EventHandler } from './event-router';
2
+ import { TimeScale } from '../core/time-scale';
3
+ import { PriceScale } from '../core/price-scale';
4
+ import { ColumnStore } from '../core/types';
5
+ export interface RangeSelectionStats {
6
+ fromTime: number;
7
+ toTime: number;
8
+ fromPrice: number;
9
+ toPrice: number;
10
+ high: number;
11
+ low: number;
12
+ priceChange: number;
13
+ percentChange: number;
14
+ barCount: number;
15
+ totalVolume: number;
16
+ }
17
+ export type RangeSelectionCallback = (stats: RangeSelectionStats | null) => void;
18
+ /**
19
+ * RangeSelectionHandler — allows users to drag-select a time range on the
20
+ * chart and see summary statistics (high, low, change, volume).
21
+ *
22
+ * Activated by setting `active = true`. When active, pointer-down starts a
23
+ * selection; pointer-move extends it; pointer-up finalizes and fires the
24
+ * callback.
25
+ */
26
+ export declare class RangeSelectionHandler implements EventHandler {
27
+ private _active;
28
+ private _selecting;
29
+ private _startX;
30
+ private _startY;
31
+ private _endX;
32
+ private _endY;
33
+ private _timeScale;
34
+ private _priceScale;
35
+ private _getStore;
36
+ private _requestRepaint;
37
+ private _callbacks;
38
+ constructor(timeScale: TimeScale, priceScale: PriceScale, getStore: () => ColumnStore | null, requestRepaint: () => void);
39
+ get active(): boolean;
40
+ set active(value: boolean);
41
+ get selecting(): boolean;
42
+ get startX(): number;
43
+ get startY(): number;
44
+ get endX(): number;
45
+ get endY(): number;
46
+ onRangeSelected(callback: RangeSelectionCallback): void;
47
+ offRangeSelected(callback: RangeSelectionCallback): void;
48
+ clear(): void;
49
+ onPointerDown(x: number, y: number): boolean | void;
50
+ onPointerMove(x: number, y: number): boolean | void;
51
+ onPointerUp(): boolean | void;
52
+ onKeyDown(key: string): boolean | void;
53
+ private _computeStats;
54
+ }
55
+ export interface MeasureResult {
56
+ fromTime: number;
57
+ toTime: number;
58
+ fromPrice: number;
59
+ toPrice: number;
60
+ priceChange: number;
61
+ percentChange: number;
62
+ barCount: number;
63
+ timeElapsed: number;
64
+ }
65
+ export type MeasureCallback = (result: MeasureResult | null) => void;
66
+ /**
67
+ * MeasureHandler — click two points to see price change, % change, bar count,
68
+ * and time elapsed between them.
69
+ */
70
+ export declare class MeasureHandler implements EventHandler {
71
+ private _active;
72
+ private _firstPoint;
73
+ private _secondPoint;
74
+ private _hovering;
75
+ private _hoverX;
76
+ private _hoverY;
77
+ private _timeScale;
78
+ private _priceScale;
79
+ private _getStore;
80
+ private _requestRepaint;
81
+ private _callbacks;
82
+ constructor(timeScale: TimeScale, priceScale: PriceScale, getStore: () => ColumnStore | null, requestRepaint: () => void);
83
+ get active(): boolean;
84
+ set active(value: boolean);
85
+ get firstPoint(): {
86
+ x: number;
87
+ y: number;
88
+ } | null;
89
+ get secondPoint(): {
90
+ x: number;
91
+ y: number;
92
+ } | null;
93
+ get hovering(): boolean;
94
+ get hoverX(): number;
95
+ get hoverY(): number;
96
+ onMeasure(callback: MeasureCallback): void;
97
+ offMeasure(callback: MeasureCallback): void;
98
+ clear(): void;
99
+ onPointerDown(x: number, y: number): boolean | void;
100
+ onPointerMove(x: number, y: number): boolean | void;
101
+ onKeyDown(key: string): boolean | void;
102
+ private _computeResult;
103
+ }
@@ -0,0 +1,36 @@
1
+ import { EventHandler } from './event-router';
2
+ import { TimeScale } from '../core/time-scale';
3
+ export interface TouchGestureOptions {
4
+ /** Enable pinch-to-zoom (default: true). */
5
+ pinchZoom?: boolean;
6
+ /** Enable two-finger pan (default: true). */
7
+ twoFingerPan?: boolean;
8
+ /** Enable momentum scrolling after pan release (default: true). */
9
+ momentum?: boolean;
10
+ /** Momentum friction factor 0–1 (default: 0.95). */
11
+ momentumFriction?: number;
12
+ }
13
+ /**
14
+ * TouchGestureHandler — detects pinch-to-zoom and two-finger pan
15
+ * on touch devices and applies them to the chart's TimeScale.
16
+ */
17
+ export declare class TouchGestureHandler implements EventHandler {
18
+ private _options;
19
+ private _timeScale;
20
+ private _requestRepaint;
21
+ private _activeTouches;
22
+ private _initialPinchDistance;
23
+ private _initialBarSpacing;
24
+ private _lastPanX;
25
+ private _velocityX;
26
+ private _momentumRafId;
27
+ constructor(timeScale: TimeScale, requestRepaint: () => void, options?: TouchGestureOptions);
28
+ get activeTouchCount(): number;
29
+ onPointerDown(x: number, y: number, pointerId: number): boolean | void;
30
+ onPointerMove(x: number, y: number, pointerId: number): boolean | void;
31
+ onPointerUp(pointerId: number): boolean | void;
32
+ dispose(): void;
33
+ private _distance;
34
+ private _startMomentum;
35
+ private _stopMomentum;
36
+ }
package/dist/logo.svg ADDED
@@ -0,0 +1,40 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="none">
2
+ <defs>
3
+ <linearGradient id="g1" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0%" stop-color="#2962ff"/>
5
+ <stop offset="100%" stop-color="#00bcd4"/>
6
+ </linearGradient>
7
+ <linearGradient id="g2" x1="0" y1="0" x2="0" y2="1">
8
+ <stop offset="0%" stop-color="#26a69a"/>
9
+ <stop offset="100%" stop-color="#1b5e20"/>
10
+ </linearGradient>
11
+ <linearGradient id="g3" x1="0" y1="1" x2="0" y2="0">
12
+ <stop offset="0%" stop-color="#ef5350"/>
13
+ <stop offset="100%" stop-color="#b71c1c"/>
14
+ </linearGradient>
15
+ </defs>
16
+ <!-- Background rounded square -->
17
+ <rect x="16" y="16" width="480" height="480" rx="64" fill="#0d1117"/>
18
+ <!-- Grid lines (subtle) -->
19
+ <line x1="80" y1="100" x2="432" y2="100" stroke="#1a2332" stroke-width="1"/>
20
+ <line x1="80" y1="180" x2="432" y2="180" stroke="#1a2332" stroke-width="1"/>
21
+ <line x1="80" y1="260" x2="432" y2="260" stroke="#1a2332" stroke-width="1"/>
22
+ <line x1="80" y1="340" x2="432" y2="340" stroke="#1a2332" stroke-width="1"/>
23
+ <line x1="80" y1="420" x2="432" y2="420" stroke="#1a2332" stroke-width="1"/>
24
+ <!-- Candlestick 1 (green/up) -->
25
+ <line x1="140" y1="140" x2="140" y2="380" stroke="url(#g2)" stroke-width="4" stroke-linecap="round"/>
26
+ <rect x="120" y="200" width="40" height="120" rx="4" fill="url(#g2)"/>
27
+ <!-- Candlestick 2 (red/down) -->
28
+ <line x1="220" y1="100" x2="220" y2="360" stroke="url(#g3)" stroke-width="4" stroke-linecap="round"/>
29
+ <rect x="200" y="140" width="40" height="140" rx="4" fill="url(#g3)"/>
30
+ <!-- Candlestick 3 (green/up, tall) -->
31
+ <line x1="300" y1="80" x2="300" y2="340" stroke="url(#g2)" stroke-width="4" stroke-linecap="round"/>
32
+ <rect x="280" y="120" width="40" height="160" rx="4" fill="url(#g2)"/>
33
+ <!-- Candlestick 4 (green/up) -->
34
+ <line x1="380" y1="100" x2="380" y2="300" stroke="url(#g2)" stroke-width="4" stroke-linecap="round"/>
35
+ <rect x="360" y="140" width="40" height="100" rx="4" fill="url(#g2)"/>
36
+ <!-- Trend line overlay -->
37
+ <line x1="120" y1="320" x2="400" y2="130" stroke="url(#g1)" stroke-width="3" stroke-linecap="round" stroke-dasharray="8 4" opacity="0.8"/>
38
+ <!-- Glow effect on trend line -->
39
+ <line x1="120" y1="320" x2="400" y2="130" stroke="#2962ff" stroke-width="8" stroke-linecap="round" opacity="0.15"/>
40
+ </svg>
@@ -0,0 +1,3 @@
1
+ import { MarketDefinition } from './market-definition';
2
+ export declare function getMarketForExchange(exchangeCode: string): MarketDefinition | undefined;
3
+ export declare function registerExchange(exchangeCode: string, marketId: string): void;
@@ -0,0 +1,4 @@
1
+ export { getMarket, registerMarket, US_MARKET, UK_MARKET, JP_MARKET, DE_MARKET, AU_MARKET, CRYPTO_MARKET, } from './market-definition';
2
+ export type { MarketDefinition, MarketHoliday } from './market-definition';
3
+ export { isMarketDate, getNextOpen, isEarlyClose } from './market-calendar';
4
+ export { getMarketForExchange, registerExchange } from './exchange-map';
@@ -0,0 +1,4 @@
1
+ import { MarketDefinition } from './market-definition';
2
+ export declare function isMarketDate(dateStr: string, market: MarketDefinition): boolean;
3
+ export declare function isEarlyClose(dateStr: string, market: MarketDefinition): number | null;
4
+ export declare function getNextOpen(timestampSec: number, market: MarketDefinition): number;
@@ -0,0 +1,22 @@
1
+ import { MarketSession } from '../core/market-session';
2
+ export interface MarketHoliday {
3
+ date: string;
4
+ name?: string;
5
+ earlyClose?: number;
6
+ }
7
+ export interface MarketDefinition {
8
+ id: string;
9
+ name: string;
10
+ timezone: string;
11
+ currency: string;
12
+ sessions: MarketSession[];
13
+ holidays: MarketHoliday[];
14
+ }
15
+ export declare const US_MARKET: MarketDefinition;
16
+ export declare const UK_MARKET: MarketDefinition;
17
+ export declare const JP_MARKET: MarketDefinition;
18
+ export declare const DE_MARKET: MarketDefinition;
19
+ export declare const AU_MARKET: MarketDefinition;
20
+ export declare const CRYPTO_MARKET: MarketDefinition;
21
+ export declare function getMarket(id: string): MarketDefinition | undefined;
22
+ export declare function registerMarket(market: MarketDefinition): void;