@guihz/trading-vue-editor-tes 0.1.25 → 0.1.26

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.
@@ -78978,7 +78978,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
78978
78978
  Fe.includes(E) && (E = `$${E}`);
78979
78979
  const T = `var ${b} = Date.now()`, _ = this._parserSingleExpression(s);
78980
78980
  if (n.length === 1)
78981
- m = `for (let ${E} of ${_}._value) {
78981
+ m = `for (let ${E} of (${_}?._value || [])) {
78982
78982
  if ((${_}).isMatrix) {
78983
78983
  ${E} = ${this._prefixNameFunc}.array.createPseudoArrayWithArray(${E}, (${_}).typeName)
78984
78984
  }
@@ -78991,7 +78991,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
78991
78991
  else {
78992
78992
  Fe.includes(x) && (x = `$${x}`);
78993
78993
  const z = `$$value${this._count}`;
78994
- m = `const ${z} = (${_}).isMap ? Object.entries((${_})._value) : (${_})._value.entries()
78994
+ m = `const ${z} = (${_})?.isMap ? Object.entries((${_})._value) : ((${_})?._value || []).entries()
78995
78995
  for (let [${E},${x}] of ${z}) {
78996
78996
  if ((${_}).isMatrix) {
78997
78997
  ${x} = ${this._prefixNameFunc}.array.createPseudoArrayWithArray(${x}, (${_}).typeName)
@@ -95251,9 +95251,8 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
95251
95251
  case "series <type>":
95252
95252
  o = this._getArrayType(s), o || (o = this._removePrefix(s)), n = [this._typeAddSeries(o)];
95253
95253
  break;
95254
- case "array<type>":
95255
95254
  case "matrix<type>":
95256
- case "type[]":
95255
+ case "array<type>":
95257
95256
  if (this._isMapType(s)) {
95258
95257
  const p = this._getMapType(s) || [];
95259
95258
  i.includes("keys") ? o = p[0] : o = p[1];
@@ -97757,7 +97756,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
97757
97756
  typeR: R[0]
97758
97757
  }),
97759
97758
  ctx: n
97760
- }), x === 0 ? (p = L, b = C, !L.length && (o = z[0])) : L.length ? (p[0]?.isLenErr && !L[0]?.isLenErr || p.length > L.length) && (p = L, b = C, f = x) : this._priorityComparison(o, z[0]) || (z[0] === `${P.ARRAY}<>` ? o = `array<${S.type}>` : o = z[0], p = L, b = C, f = x);
97759
+ }), x === 0 ? (p = L, b = C, L.length || (z[0] === `${P.ARRAY}<>` ? o = `array<${S.type}>` : o = z[0])) : L.length ? (p[0]?.isLenErr && !L[0]?.isLenErr || p.length > L.length) && (p = L, b = C, f = x) : this._priorityComparison(o, z[0]) || (z[0] === `${P.ARRAY}<>` ? o = `array<${S.type}>` : o = z[0], p = L, b = C, f = x);
97761
97760
  }
97762
97761
  for (const x of p)
97763
97762
  this._errorHandle(x.msg, x.ctx);
@@ -98005,6 +98004,16 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
98005
98004
  typeR: this._typeAddSeries(_)
98006
98005
  });
98007
98006
  break;
98007
+ case "series int/float/color/string/label/line/box/table/linefill/polyline/array<>/matrix<>/map<>":
98008
+ if (this._isMatrixType(m) || this._isArrayType(m) || this._isMapType(m))
98009
+ return;
98010
+ g0(d0.typeMismatch, {
98011
+ operator: n,
98012
+ index: T,
98013
+ typeE: m,
98014
+ typeR: x
98015
+ });
98016
+ break;
98008
98017
  case "any matrix type":
98009
98018
  if (this._isMatrixType(m)) {
98010
98019
  if (T === "id2") {
@@ -98151,14 +98160,15 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
98151
98160
  typeR: i?.type
98152
98161
  });
98153
98162
  break;
98154
- case "simple enum":
98163
+ case "const enum":
98164
+ case "series enum":
98155
98165
  const L = this._removePrefix(m);
98156
98166
  if (!this._enums.has(L))
98157
98167
  return g0(d0.typeMismatch, {
98158
98168
  operator: n,
98159
98169
  index: T,
98160
98170
  typeE: m,
98161
- typeR: "const enum"
98171
+ typeR: x
98162
98172
  });
98163
98173
  break;
98164
98174
  case "tuple of enum fields: [enumName.field1, enumName.field2, ...]":
@@ -98557,7 +98567,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
98557
98567
  ln.includes(E) && (E = `$${E}`);
98558
98568
  const T = `var ${b} = Date.now()`, _ = this._parserSingleExpression(s);
98559
98569
  if (n.length === 1)
98560
- m = `for (let ${E} of ${_}._value) {
98570
+ m = `for (let ${E} of (${_}?._value || [])) {
98561
98571
  if ((${_}).isMatrix) {
98562
98572
  ${E} = ${this._prefixNameFunc}.array.createPseudoArrayWithArray(${E}, (${_}).typeName)
98563
98573
  }
@@ -98570,7 +98580,7 @@ ${this._prefixNameVar}.setCacheData("m${b}_" + ${f}, ${m})
98570
98580
  else {
98571
98581
  ln.includes(x) && (x = `$${x}`);
98572
98582
  const z = `$$value${this._count}`;
98573
- m = `const ${z} = (${_}).isMap ? Object.entries((${_})._value) : (${_})._value.entries()
98583
+ m = `const ${z} = (${_})?.isMap ? Object.entries((${_})._value) : ((${_})?._value || []).entries()
98574
98584
  for (let [${E},${x}] of ${z}) {
98575
98585
  if ((${_}).isMatrix) {
98576
98586
  ${x} = ${this._prefixNameFunc}.array.createPseudoArrayWithArray(${x}, (${_}).typeName)
@@ -8478,9 +8478,13 @@ function print() { __p += __j.call(arguments, '') }
8478
8478
  _currentData;
8479
8479
  _preData;
8480
8480
  _id;
8481
+ timeframeFunc;
8481
8482
  constructor(e) {
8482
8483
  this._preAccdist = 0, this._preVwap = {}, this._preValue = {}, this._currentData = {}, this._preData = {}, this._id = e;
8483
8484
  }
8485
+ set buildInTimeframeFunc(e) {
8486
+ this.timeframeFunc = e;
8487
+ }
8484
8488
  get _varTaCacheData() {
8485
8489
  return {
8486
8490
  preAccdist: this._preAccdist,
@@ -8522,7 +8526,7 @@ function print() { __p += __j.call(arguments, '') }
8522
8526
  return this._preValue.vwap;
8523
8527
  const { hlc3: e, volume: t } = this._currentData;
8524
8528
  let { sum: r = 0, sumV: i = 0, isReset: s } = this._preVwap;
8525
- if (self.workerStorage?.get(this._id)?.buildInFunctions.timeframe.change({ timeframe: "1D" }, "vwap_buildin") && (s = !0, r = i = 0), !s)
8529
+ if (this.timeframeFunc?.change({ timeframe: "1D" }, "vwap_buildin") && (s = !0, r = i = 0), !s)
8526
8530
  return;
8527
8531
  const a = e * t + r, c = t + i;
8528
8532
  !this.isRealTime && (this._preVwap = { sum: a, sumV: c, isReset: s });
@@ -20169,7 +20173,7 @@ ${u}`), u;
20169
20173
  strategy;
20170
20174
  _count = 0;
20171
20175
  constructor(e, t, r) {
20172
- super(t, r), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.strategy = new eB(this._variables, this._options, e, this._errorListener, r);
20176
+ super(t, r), t.buildInTimeframeFunc = this._timeframe, this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.strategy = new eB(this._variables, this._options, e, this._errorListener, r);
20173
20177
  }
20174
20178
  getFuncCacheData() {
20175
20179
  return {
@@ -1,4 +1,5 @@
1
1
  import { IKeyObjectValue } from "../../../type";
2
+ import { BuildInTimeframe } from "../buildInFuncNamespace";
2
3
  export declare class Ta {
3
4
  private _preAccdist;
4
5
  private _preVwap;
@@ -6,7 +7,9 @@ export declare class Ta {
6
7
  private _currentData;
7
8
  private _preData;
8
9
  private _id;
10
+ protected timeframeFunc?: BuildInTimeframe;
9
11
  constructor(id: string);
12
+ set buildInTimeframeFunc(timeframeFunc: BuildInTimeframe);
10
13
  get _varTaCacheData(): IKeyObjectValue;
11
14
  set _varTaCacheData(data: IKeyObjectValue);
12
15
  update(currentData: IKeyObjectValue): void;