@guihz/trading-vue-editor-tes 0.1.35 → 0.1.37

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 (23) hide show
  1. package/lib/assets/{parserTccWorker-BvDdoR3P.js → parserTccWorker-Douk71sp.js} +13369 -12999
  2. package/lib/assets/{scriptsRunWorker-8a33SSnQ.js → scriptsRunWorker-DwBycCfp.js} +560 -529
  3. package/lib/components/editor/tokenizer/config.d.ts +3 -1
  4. package/lib/components/editor/type/index.d.ts +2 -0
  5. package/lib/components/editor/v5/parseScript/constants.d.ts +1 -0
  6. package/lib/components/editor/v5/parseScript/parseToJs.d.ts +19 -2
  7. package/lib/components/editor/v6/parseScript/constants.d.ts +1 -0
  8. package/lib/components/editor/v6/parseScript/parseToJs.d.ts +19 -2
  9. package/lib/components/editor/v6/parseScript/visitorParser.d.ts +5 -2
  10. package/lib/components/editor/v6/parserTccWorker.d.ts +3 -0
  11. package/lib/components/editor/v6/tccParser/tccScriptParserVisitor.d.ts +7 -0
  12. package/lib/i18n/local/en.d.ts +2 -0
  13. package/lib/i18n/local/zh_cn.d.ts +2 -0
  14. package/lib/{index-Clupi1hX.js → index-DALxzLez.js} +67 -67
  15. package/lib/{index-D22ipYhi.js → index-DBn672U2.js} +91 -91
  16. package/lib/{index-CjECfhIW.js → index-Qjp-Unq2.js} +28 -28
  17. package/lib/{monarchTokens-BNkQaBBZ.js → monarchTokens-C5rW_kP9.js} +1 -1
  18. package/lib/{monarchTokens-BkGYzRcP.js → monarchTokens-h2q3KbTF.js} +1 -1
  19. package/lib/trading-vue-editor.es.packages.js +689 -661
  20. package/lib/trading-vue-editor.umd.packages.mjs +40 -40
  21. package/package.json +1 -1
  22. package/lib/components/editor/v5/parseScript/buildInFuncNamespace/strategyNew.d.ts +0 -261
  23. package/lib/components/editor/v6/parseScript/parseToLibJs.d.ts +0 -71
@@ -46,5 +46,7 @@ export declare enum Actions {
46
46
  RunScript = "runScript",
47
47
  Open = "open",
48
48
  NewWindow = "newWindow",
49
- NewTab = "newTab"
49
+ NewTab = "newTab",
50
+ NewIndicator = "newIndicator",
51
+ NewStrategy = "newStrategy"
50
52
  }
@@ -121,6 +121,8 @@ export interface IImportLibrary {
121
121
  functions: IDocValue[];
122
122
  types: IDocValue[];
123
123
  methods: IDocValue[];
124
+ variables: IDocValue[];
125
+ enums: IDocValue[];
124
126
  }
125
127
  export type IShapeRatioType = "D" | "M" | "NONE";
126
128
  export {};
@@ -104,6 +104,7 @@ export declare const ERRORS_TIPS: {
104
104
  matrixMultErr: string;
105
105
  maxOpenOrdersErr: string;
106
106
  maxOrdersErr: string;
107
+ maxPlotErr: string;
107
108
  };
108
109
  export declare const WARNING_TIPS: {
109
110
  repeatVar: string;
@@ -1,4 +1,5 @@
1
- import { IKeyObjectValue } from "../../type";
1
+ import { IError, IKeyObjectValue } from "../../type";
2
+ import { VScriptType } from './enum';
2
3
  export default class ParseToJs {
3
4
  private _nameMap;
4
5
  private _argChangeMap;
@@ -29,14 +30,30 @@ export default class ParseToJs {
29
30
  private _hasRightVisibleBarTime;
30
31
  private _isExperssion;
31
32
  private _hasAlert;
32
- constructor(prefix: string);
33
+ private _libTitle?;
34
+ private _exportEles;
35
+ private _scriptType?;
36
+ constructor(prefix: string, scriptType?: VScriptType, libTitle?: string);
33
37
  preParser(values: IKeyObjectValue[]): string | undefined;
34
38
  parser(values: IKeyObjectValue[]): {
35
39
  code: string;
36
40
  hasLeftVisibleBarTime: boolean;
37
41
  hasRightVisibleBarTime: boolean;
38
42
  hasAlert: boolean;
43
+ errors: IError[] | undefined;
39
44
  } | undefined;
45
+ parserlib(values?: IKeyObjectValue[]): {
46
+ errors: IError[];
47
+ code?: undefined;
48
+ hasLeftVisibleBarTime?: undefined;
49
+ hasRightVisibleBarTime?: undefined;
50
+ } | {
51
+ code: string;
52
+ hasLeftVisibleBarTime: boolean;
53
+ hasRightVisibleBarTime: boolean;
54
+ errors: IError[];
55
+ } | undefined;
56
+ private _getExportCodes;
40
57
  private _parserStmt;
41
58
  private _parserEnumStatement;
42
59
  private _parserTypeStatement;
@@ -113,6 +113,7 @@ export declare const ERRORS_TIPS: {
113
113
  boolVarErr: string;
114
114
  naCompareErr: string;
115
115
  notConstConditionTypeErr: string;
116
+ exportVarErr: string;
116
117
  };
117
118
  export declare const WARNING_TIPS: {
118
119
  repeatVar: string;
@@ -1,4 +1,5 @@
1
- import { IKeyObjectValue } from "../../type";
1
+ import { IKeyObjectValue, IError } from "../../type";
2
+ import { VScriptType } from './enum';
2
3
  export default class ParseToJs {
3
4
  private _nameMap;
4
5
  private _argChangeMap;
@@ -27,14 +28,30 @@ export default class ParseToJs {
27
28
  private _hasRightVisibleBarTime;
28
29
  private _isExperssion;
29
30
  private _hasAlert;
30
- constructor(prefix: string);
31
+ private _libTitle?;
32
+ private _exportEles;
33
+ private _scriptType?;
34
+ constructor(prefix: string, scriptType?: VScriptType, libTitle?: string);
31
35
  preParser(values: IKeyObjectValue[]): string | undefined;
32
36
  parser(values: IKeyObjectValue[]): {
33
37
  code: string;
34
38
  hasLeftVisibleBarTime: boolean;
35
39
  hasRightVisibleBarTime: boolean;
36
40
  hasAlert: boolean;
41
+ errors: IError[] | undefined;
37
42
  } | undefined;
43
+ parserlib(values?: IKeyObjectValue[]): {
44
+ errors: IError[];
45
+ code?: undefined;
46
+ hasLeftVisibleBarTime?: undefined;
47
+ hasRightVisibleBarTime?: undefined;
48
+ } | {
49
+ code: string;
50
+ hasLeftVisibleBarTime: boolean;
51
+ hasRightVisibleBarTime: boolean;
52
+ errors: IError[];
53
+ } | undefined;
54
+ private _getExportCodes;
38
55
  private _parserStmt;
39
56
  private _parserEnumStatement;
40
57
  private _parserTypeStatement;
@@ -1,5 +1,5 @@
1
1
  import { IKeyObjectValue, IDocValue, IKeyValue } from '../../type';
2
- import { VRuleType } from './enum';
2
+ import { VRuleType, VScriptType } from './enum';
3
3
  import { ParserUtils } from './visitorUtils';
4
4
  import { IError, IRange, IPosition } from "./type";
5
5
  export default class ParserVisitor extends ParserUtils {
@@ -30,6 +30,7 @@ export default class ParserVisitor extends ParserUtils {
30
30
  private _exportMethods;
31
31
  private _exportTypes;
32
32
  private _exportEnums;
33
+ private _exportVars;
33
34
  private _exportPositions;
34
35
  private _description;
35
36
  private _endExport;
@@ -51,12 +52,13 @@ export default class ParserVisitor extends ParserUtils {
51
52
  get userMethods(): Map<string, IDocValue[]>;
52
53
  get hasUseDrawFunc(): boolean;
53
54
  get hasUseCreateOrderFunc(): boolean;
54
- get scriptType(): string | undefined;
55
+ get scriptType(): VScriptType | undefined;
55
56
  get exportLibs(): {
56
57
  functions: IDocValue[];
57
58
  methods: IDocValue[];
58
59
  types: IDocValue[];
59
60
  enums: IDocValue[];
61
+ variables: IDocValue[];
60
62
  };
61
63
  get description(): string;
62
64
  get exportPositions(): (IRange & {
@@ -89,6 +91,7 @@ export default class ParserVisitor extends ParserUtils {
89
91
  visitExpressionBlockSequence: (ctx: IKeyObjectValue) => IKeyObjectValue[];
90
92
  visitBlockSequence: (ctx: IKeyObjectValue) => IKeyObjectValue[];
91
93
  visitVariableDeclarationStmt: (ctx: IKeyObjectValue) => IKeyObjectValue[];
94
+ visitExportDeclareAssign: (ctx: IKeyObjectValue) => IKeyObjectValue;
92
95
  visitVarBlockStmt: (ctx: IKeyObjectValue) => IKeyObjectValue | {
93
96
  ruleType: VRuleType;
94
97
  name: IKeyObjectValue;
@@ -29,10 +29,13 @@ export declare function parseTcc(program: string, hasTranscoding: boolean, getIm
29
29
  export declare function parseLibraryCode(program: string, libTitle: string, getImportLibraryFunc: (obj: IKeyObjectValue) => Promise<IKeyObjectValue>, keyObjs: IKeyObjectValue): Promise<{
30
30
  description: string;
31
31
  codeStr: string;
32
+ hasLeftVisibleBarTime: boolean | undefined;
33
+ hasRightVisibleBarTime: boolean | undefined;
32
34
  functions: import("../type").IDocValue[];
33
35
  methods: import("../type").IDocValue[];
34
36
  types: import("../type").IDocValue[];
35
37
  enums: import("../type").IDocValue[];
38
+ variables: import("../type").IDocValue[];
36
39
  }>;
37
40
  export declare class ExprErrorListener extends ErrorListener {
38
41
  errors: any[];
@@ -9,6 +9,7 @@ import { FlowStmtContext } from "./tccScriptParser";
9
9
  import { BlockContext } from "./tccScriptParser";
10
10
  import { BlockLineContext } from "./tccScriptParser";
11
11
  import { VariableDeclarationStmtContext } from "./tccScriptParser";
12
+ import { ExportDeclareAssignContext } from "./tccScriptParser";
12
13
  import { DeclareAssignContext } from "./tccScriptParser";
13
14
  import { AgainAssignContext } from "./tccScriptParser";
14
15
  import { AgainAssignNameContext } from "./tccScriptParser";
@@ -130,6 +131,12 @@ export default class tccScriptParserVisitor<Result> extends ParseTreeVisitor<Res
130
131
  * @return the visitor result
131
132
  */
132
133
  visitVariableDeclarationStmt?: (ctx: VariableDeclarationStmtContext) => Result;
134
+ /**
135
+ * Visit a parse tree produced by `tccScriptParser.exportDeclareAssign`.
136
+ * @param ctx the parse tree
137
+ * @return the visitor result
138
+ */
139
+ visitExportDeclareAssign?: (ctx: ExportDeclareAssignContext) => Result;
133
140
  /**
134
141
  * Visit a parse tree produced by the `DeclareAssign`
135
142
  * labeled alternative in `tccScriptParser.variableDeclarationList`.
@@ -57,5 +57,7 @@ declare const _default: {
57
57
  statement: string;
58
58
  loop: string;
59
59
  '`click` on keyword for more help': string;
60
+ "new indicator": string;
61
+ "new strategy": string;
60
62
  };
61
63
  export default _default;
@@ -57,5 +57,7 @@ declare const _default: {
57
57
  statement: string;
58
58
  loop: string;
59
59
  '`click` on keyword for more help': string;
60
+ "new indicator": string;
61
+ "new strategy": string;
60
62
  };
61
63
  export default _default;