@simahfud/pine-to-kline 0.1.1 → 0.1.3

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 (117) hide show
  1. package/dist/index.d.ts +696 -21
  2. package/dist/pine-to-kline.js +17 -14
  3. package/dist/pine-to-kline.js.map +1 -1
  4. package/dist/pine-to-kline.umd.js +1 -1
  5. package/dist/pine-to-kline.umd.js.map +1 -1
  6. package/package.json +1 -1
  7. package/dist/PineInterpreter.d.ts +0 -19
  8. package/dist/PineInterpreter.d.ts.map +0 -1
  9. package/dist/PineInterpreter.js +0 -89
  10. package/dist/PineInterpreter.js.map +0 -1
  11. package/dist/adapter/FigureMapper.d.ts +0 -8
  12. package/dist/adapter/FigureMapper.d.ts.map +0 -1
  13. package/dist/adapter/FigureMapper.js +0 -22
  14. package/dist/adapter/FigureMapper.js.map +0 -1
  15. package/dist/adapter/KlineAdapter.d.ts +0 -11
  16. package/dist/adapter/KlineAdapter.d.ts.map +0 -1
  17. package/dist/adapter/KlineAdapter.js +0 -88
  18. package/dist/adapter/KlineAdapter.js.map +0 -1
  19. package/dist/adapter/StyleMapper.d.ts +0 -10
  20. package/dist/adapter/StyleMapper.d.ts.map +0 -1
  21. package/dist/adapter/StyleMapper.js +0 -28
  22. package/dist/adapter/StyleMapper.js.map +0 -1
  23. package/dist/builtins/color/constants.d.ts +0 -7
  24. package/dist/builtins/color/constants.d.ts.map +0 -1
  25. package/dist/builtins/color/constants.js +0 -25
  26. package/dist/builtins/color/constants.js.map +0 -1
  27. package/dist/builtins/color/functions.d.ts +0 -21
  28. package/dist/builtins/color/functions.d.ts.map +0 -1
  29. package/dist/builtins/color/functions.js +0 -52
  30. package/dist/builtins/color/functions.js.map +0 -1
  31. package/dist/builtins/index.d.ts +0 -15
  32. package/dist/builtins/index.d.ts.map +0 -1
  33. package/dist/builtins/index.js +0 -32
  34. package/dist/builtins/index.js.map +0 -1
  35. package/dist/builtins/input/functions.d.ts +0 -28
  36. package/dist/builtins/input/functions.d.ts.map +0 -1
  37. package/dist/builtins/input/functions.js +0 -114
  38. package/dist/builtins/input/functions.js.map +0 -1
  39. package/dist/builtins/math/functions.d.ts +0 -9
  40. package/dist/builtins/math/functions.d.ts.map +0 -1
  41. package/dist/builtins/math/functions.js +0 -57
  42. package/dist/builtins/math/functions.js.map +0 -1
  43. package/dist/builtins/ta/crossover.d.ts +0 -18
  44. package/dist/builtins/ta/crossover.d.ts.map +0 -1
  45. package/dist/builtins/ta/crossover.js +0 -59
  46. package/dist/builtins/ta/crossover.js.map +0 -1
  47. package/dist/builtins/ta/index.d.ts +0 -12
  48. package/dist/builtins/ta/index.d.ts.map +0 -1
  49. package/dist/builtins/ta/index.js +0 -61
  50. package/dist/builtins/ta/index.js.map +0 -1
  51. package/dist/builtins/ta/momentum.d.ts +0 -22
  52. package/dist/builtins/ta/momentum.d.ts.map +0 -1
  53. package/dist/builtins/ta/momentum.js +0 -81
  54. package/dist/builtins/ta/momentum.js.map +0 -1
  55. package/dist/builtins/ta/moving-averages.d.ts +0 -24
  56. package/dist/builtins/ta/moving-averages.d.ts.map +0 -1
  57. package/dist/builtins/ta/moving-averages.js +0 -108
  58. package/dist/builtins/ta/moving-averages.js.map +0 -1
  59. package/dist/builtins/ta/utility.d.ts +0 -28
  60. package/dist/builtins/ta/utility.d.ts.map +0 -1
  61. package/dist/builtins/ta/utility.js +0 -156
  62. package/dist/builtins/ta/utility.js.map +0 -1
  63. package/dist/builtins/ta/volatility.d.ts +0 -21
  64. package/dist/builtins/ta/volatility.d.ts.map +0 -1
  65. package/dist/builtins/ta/volatility.js +0 -71
  66. package/dist/builtins/ta/volatility.js.map +0 -1
  67. package/dist/index.d.ts.map +0 -1
  68. package/dist/index.js +0 -24
  69. package/dist/index.js.map +0 -1
  70. package/dist/lexer/Lexer.d.ts +0 -40
  71. package/dist/lexer/Lexer.d.ts.map +0 -1
  72. package/dist/lexer/Lexer.js +0 -383
  73. package/dist/lexer/Lexer.js.map +0 -1
  74. package/dist/lexer/Token.d.ts +0 -16
  75. package/dist/lexer/Token.d.ts.map +0 -1
  76. package/dist/lexer/Token.js +0 -26
  77. package/dist/lexer/Token.js.map +0 -1
  78. package/dist/lexer/TokenType.d.ts +0 -74
  79. package/dist/lexer/TokenType.d.ts.map +0 -1
  80. package/dist/lexer/TokenType.js +0 -111
  81. package/dist/lexer/TokenType.js.map +0 -1
  82. package/dist/parser/Parser.d.ts +0 -55
  83. package/dist/parser/Parser.d.ts.map +0 -1
  84. package/dist/parser/Parser.js +0 -569
  85. package/dist/parser/Parser.js.map +0 -1
  86. package/dist/parser/nodes/index.d.ts +0 -215
  87. package/dist/parser/nodes/index.d.ts.map +0 -1
  88. package/dist/parser/nodes/index.js +0 -7
  89. package/dist/parser/nodes/index.js.map +0 -1
  90. package/dist/plugin/KlineChartProPlugin.d.ts +0 -43
  91. package/dist/plugin/KlineChartProPlugin.d.ts.map +0 -1
  92. package/dist/plugin/KlineChartProPlugin.js +0 -44
  93. package/dist/plugin/KlineChartProPlugin.js.map +0 -1
  94. package/dist/runtime/BarContext.d.ts +0 -23
  95. package/dist/runtime/BarContext.d.ts.map +0 -1
  96. package/dist/runtime/BarContext.js +0 -41
  97. package/dist/runtime/BarContext.js.map +0 -1
  98. package/dist/runtime/PineRuntime.d.ts +0 -51
  99. package/dist/runtime/PineRuntime.d.ts.map +0 -1
  100. package/dist/runtime/PineRuntime.js +0 -471
  101. package/dist/runtime/PineRuntime.js.map +0 -1
  102. package/dist/runtime/SeriesEmulator.d.ts +0 -21
  103. package/dist/runtime/SeriesEmulator.d.ts.map +0 -1
  104. package/dist/runtime/SeriesEmulator.js +0 -32
  105. package/dist/runtime/SeriesEmulator.js.map +0 -1
  106. package/dist/runtime/VarPersistence.d.ts +0 -20
  107. package/dist/runtime/VarPersistence.d.ts.map +0 -1
  108. package/dist/runtime/VarPersistence.js +0 -28
  109. package/dist/runtime/VarPersistence.js.map +0 -1
  110. package/dist/types.d.ts +0 -97
  111. package/dist/types.d.ts.map +0 -1
  112. package/dist/types.js +0 -6
  113. package/dist/types.js.map +0 -1
  114. package/dist/utils/errors.d.ts +0 -24
  115. package/dist/utils/errors.d.ts.map +0 -1
  116. package/dist/utils/errors.js +0 -46
  117. package/dist/utils/errors.js.map +0 -1
@@ -57,7 +57,7 @@ const G = {
57
57
  * pine-to-kline — Error Classes
58
58
  * @license Apache-2.0
59
59
  */
60
- class x extends Error {
60
+ class w extends Error {
61
61
  constructor(t, e, s, r) {
62
62
  super(t), this.line = e, this.column = s, this.source = r, this.name = "PineError";
63
63
  }
@@ -66,22 +66,22 @@ class x extends Error {
66
66
  return `${this.name}: ${this.message}${t}${e}`;
67
67
  }
68
68
  }
69
- class S extends x {
69
+ class S extends w {
70
70
  constructor(t, e, s) {
71
71
  super(t, e, s), this.name = "LexerError";
72
72
  }
73
73
  }
74
- class C extends x {
74
+ class C extends w {
75
75
  constructor(t, e, s) {
76
76
  super(t, e, s), this.name = "ParseError";
77
77
  }
78
78
  }
79
- class Ht extends x {
79
+ class Ht extends w {
80
80
  constructor(t, e, s) {
81
81
  super(t, e, s), this.name = "RuntimeError";
82
82
  }
83
83
  }
84
- class jt extends x {
84
+ class jt extends w {
85
85
  constructor(t) {
86
86
  super(t), this.name = "AdapterError";
87
87
  }
@@ -862,7 +862,7 @@ function m(i, t) {
862
862
  }
863
863
  return s;
864
864
  }
865
- function w(i, t) {
865
+ function x(i, t) {
866
866
  const e = 1 / t, s = [];
867
867
  for (let r = 0; r < i.length; r++) {
868
868
  if (r < t - 1) {
@@ -923,7 +923,7 @@ function Q(i, t) {
923
923
  const h = i[l] - i[l - 1];
924
924
  e.push(h > 0 ? h : 0), s.push(h < 0 ? Math.abs(h) : 0);
925
925
  }
926
- const r = w(e, t), n = w(s, t);
926
+ const r = x(e, t), n = x(s, t);
927
927
  return i.map((l, h) => isNaN(r[h]) || isNaN(n[h]) ? NaN : n[h] === 0 ? 100 : 100 - 100 / (1 + r[h] / n[h]));
928
928
  }
929
929
  function q(i, t = 12, e = 26, s = 9) {
@@ -970,7 +970,7 @@ function F(i, t, e, s) {
970
970
  Math.abs(n - e[l - 1]),
971
971
  Math.abs(t[l] - e[l - 1])
972
972
  ));
973
- return w(r, s);
973
+ return x(r, s);
974
974
  }
975
975
  function tt(i, t, e = 2) {
976
976
  const s = L(i, t);
@@ -1151,7 +1151,7 @@ const St = {
1151
1151
  // Moving averages
1152
1152
  "ta.sma": L,
1153
1153
  "ta.ema": m,
1154
- "ta.rma": w,
1154
+ "ta.rma": x,
1155
1155
  "ta.wma": y,
1156
1156
  "ta.hma": H,
1157
1157
  "ta.vwma": j,
@@ -1271,7 +1271,7 @@ const d = {
1271
1271
  * Implements: color.new(), color.rgb(), color.from_gradient()
1272
1272
  * @license Apache-2.0
1273
1273
  */
1274
- function wt(i, t) {
1274
+ function xt(i, t) {
1275
1275
  const e = Math.round((1 - t / 100) * 255), s = i.startsWith("#") ? i : "#000000";
1276
1276
  return (s.length === 9 ? s.slice(0, 7) : s) + e.toString(16).padStart(2, "0");
1277
1277
  }
@@ -1279,7 +1279,7 @@ function T(i, t, e, s = 0) {
1279
1279
  const r = (l) => Math.max(0, Math.min(255, Math.round(l))), n = Math.round((1 - s / 100) * 255);
1280
1280
  return "#" + r(i).toString(16).padStart(2, "0") + r(t).toString(16).padStart(2, "0") + r(e).toString(16).padStart(2, "0") + (n < 255 ? n.toString(16).padStart(2, "0") : "");
1281
1281
  }
1282
- function xt(i, t, e, s, r) {
1282
+ function wt(i, t, e, s, r) {
1283
1283
  const n = Math.max(0, Math.min(1, (i - t) / (e - t))), l = (u) => {
1284
1284
  const f = u.replace("#", "");
1285
1285
  return {
@@ -1291,9 +1291,9 @@ function xt(i, t, e, s, r) {
1291
1291
  return T(o(h.r, c.r), o(h.g, c.g), o(h.b, c.b));
1292
1292
  }
1293
1293
  const gt = {
1294
- "color.new": wt,
1294
+ "color.new": xt,
1295
1295
  "color.rgb": T,
1296
- "color.from_gradient": xt
1296
+ "color.from_gradient": wt
1297
1297
  };
1298
1298
  /**
1299
1299
  * pine-to-kline — Input Functions
@@ -1811,6 +1811,9 @@ class Ut {
1811
1811
  shortName: e.shortName ?? e.name,
1812
1812
  series: e.overlay ? "price" : "normal",
1813
1813
  calcParams: s.map((c) => c.defaultValue),
1814
+ extendData: {
1815
+ pineInputs: s.map((c) => c.title || c.id || "Param")
1816
+ },
1814
1817
  figures: this.mapFigures(r),
1815
1818
  regenerateFigures: s.length > 0 ? (c) => this.mapFigures(r) : void 0,
1816
1819
  calc: (c, o) => {
@@ -1983,7 +1986,7 @@ export {
1983
1986
  S as LexerError,
1984
1987
  C as ParseError,
1985
1988
  _ as Parser,
1986
- x as PineError,
1989
+ w as PineError,
1987
1990
  Vt as PineInterpreter,
1988
1991
  D as PineRuntime,
1989
1992
  Ht as RuntimeError,