pinets 0.6.1 → 0.7.1

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 (35) hide show
  1. package/README.md +146 -75
  2. package/dist/pinets.min.browser.es.js +117 -0
  3. package/dist/pinets.min.browser.es.js.map +1 -0
  4. package/dist/pinets.min.browser.js +96 -16
  5. package/dist/pinets.min.browser.js.map +1 -0
  6. package/dist/pinets.min.cjs +96 -15
  7. package/dist/pinets.min.cjs.map +1 -0
  8. package/dist/pinets.min.es.js +99 -5
  9. package/dist/pinets.min.es.js.map +1 -0
  10. package/dist/types/Context.class.d.ts +3 -25
  11. package/dist/types/namespaces/Core.d.ts +8 -3
  12. package/dist/types/namespaces/Plot.helper.d.ts +16 -0
  13. package/dist/types/namespaces/Plots.d.ts +16 -0
  14. package/dist/types/namespaces/Types.d.ts +1 -1
  15. package/dist/types/namespaces/input/utils.d.ts +2 -14
  16. package/dist/types/namespaces/ta/methods/pivothigh.d.ts +1 -1
  17. package/dist/types/namespaces/ta/methods/pivotlow.d.ts +1 -1
  18. package/dist/types/namespaces/utils.d.ts +12 -0
  19. package/dist/types/transpiler/index.d.ts +1 -1
  20. package/dist/types/transpiler/pineToJS/ast.d.ts +167 -0
  21. package/dist/types/transpiler/pineToJS/codegen.d.ts +53 -0
  22. package/dist/types/transpiler/pineToJS/lexer.d.ts +31 -0
  23. package/dist/types/transpiler/pineToJS/parser.d.ts +45 -0
  24. package/dist/types/transpiler/pineToJS/pineToJS.index.d.ts +32 -0
  25. package/dist/types/transpiler/pineToJS/tokens.d.ts +34 -0
  26. package/dist/types/transpiler/settings.d.ts +2 -0
  27. package/dist/types/transpiler/transformers/WrapperTransformer.d.ts +5 -3
  28. package/dist/types/transpiler/utils/ASTFactory.d.ts +1 -0
  29. package/dist/types/types/PineTypes.d.ts +19 -15
  30. package/package.json +24 -5
  31. package/dist/pinets.dev.browser.js +0 -16515
  32. package/dist/pinets.dev.cjs +0 -16765
  33. package/dist/pinets.dev.cjs.map +0 -1
  34. package/dist/pinets.dev.es.js +0 -9125
  35. package/dist/pinets.dev.es.js.map +0 -1
@@ -1,42 +1,19 @@
1
- import { IProvider, ISymbolInfo } from './marketData/IProvider';
1
+ import { IProvider } from './marketData/IProvider';
2
2
  import { PineArray } from './namespaces/array/array.index';
3
- import { PineMap } from './namespaces/map/map.index';
4
- import { PineMatrix } from './namespaces/matrix/matrix.index';
5
- import { Barstate } from './namespaces/Barstate';
6
3
  import { Input } from './namespaces/input/input.index';
7
4
  import PineMath from './namespaces/math/math.index';
8
5
  import { PineRequest } from './namespaces/request/request.index';
9
6
  import TechnicalAnalysis from './namespaces/ta/ta.index';
10
7
  import { Series } from './Series';
11
- import { Log } from './namespaces/Log';
12
- import { Str } from './namespaces/Str';
13
- import { Timeframe } from './namespaces/Timeframe';
14
8
  export declare class Context {
15
9
  data: any;
10
+ indicator: IndicatorOptions;
16
11
  cache: any;
17
12
  taState: any;
18
13
  isSecondaryContext: boolean;
19
14
  NA: any;
20
15
  lang: any;
21
16
  pine: {
22
- input: Input;
23
- ta: TechnicalAnalysis;
24
- math: PineMath;
25
- request: PineRequest;
26
- array: PineArray;
27
- map: PineMap;
28
- matrix: PineMatrix;
29
- na: () => any;
30
- plotchar: (...args: any[]) => any;
31
- color: any;
32
- plot: (...args: any[]) => any;
33
- nz: (...args: any[]) => any;
34
- bar_index: number;
35
- syminfo: ISymbolInfo;
36
- barstate: Barstate;
37
- log: Log;
38
- str: Str;
39
- timeframe: Timeframe;
40
17
  [key: string]: any;
41
18
  };
42
19
  private static _deprecationWarningsShown;
@@ -66,6 +43,7 @@ export declare class Context {
66
43
  eDate?: number;
67
44
  fullContext?: Context;
68
45
  });
46
+ private bindContextObject;
69
47
  /**
70
48
  * this function is used to initialize the target variable with the source array
71
49
  * this array will represent a time series and its values will be shifted at runtime in order to mimic Pine script behavior
@@ -1,3 +1,4 @@
1
+ export declare function parseIndicatorOptions(args: any[]): Partial<IndicatorOptions>;
1
2
  export declare class Core {
2
3
  private context;
3
4
  color: {
@@ -30,10 +31,14 @@ export declare class Core {
30
31
  };
31
32
  constructor(context: any);
32
33
  private extractPlotOptions;
33
- indicator(title: string, shorttitle?: string, options?: IndicatorOptions): void;
34
- plotchar(series: number[], title: string, options: PlotCharOptions): void;
35
- plot(series: any, title: string, options: PlotOptions): void;
34
+ indicator(...args: any[]): any;
36
35
  get bar_index(): any;
37
36
  na(series: any): boolean;
38
37
  nz(series: any, replacement?: number): any;
38
+ fixnan(series: any): any;
39
+ alertcondition(condition: any, title: any, message: any): void;
40
+ bool(series: any): boolean;
41
+ int(series: any): number;
42
+ float(series: any): number;
43
+ string(series: any): any;
39
44
  }
@@ -0,0 +1,16 @@
1
+ export declare class PlotHelper {
2
+ private context;
3
+ constructor(context: any);
4
+ private extractPlotOptions;
5
+ plotchar(series: number[], title: string, options: PlotCharOptions): void;
6
+ plot(...args: any[]): void;
7
+ }
8
+ export declare class HlineHelper {
9
+ private context;
10
+ constructor(context: any);
11
+ get style_dashed(): string;
12
+ get style_solid(): string;
13
+ get style_dotted(): string;
14
+ param(source: any, index?: number, name?: string): any;
15
+ any(price: any, title: any, color: any, linestyle: any, linewidth: any, editable: any, display: any): any;
16
+ }
@@ -0,0 +1,16 @@
1
+ export declare class PlotHelper {
2
+ private context;
3
+ constructor(context: any);
4
+ private extractPlotOptions;
5
+ plotchar(series: number[], title: string, options: PlotCharOptions): void;
6
+ plot(...args: any[]): void;
7
+ }
8
+ export declare class HlineHelper {
9
+ private context;
10
+ constructor(context: any);
11
+ get style_dashed(): string;
12
+ get style_solid(): string;
13
+ get style_dotted(): string;
14
+ param(source: any, index?: number, name?: string): any;
15
+ any(price: any, title: any, color: any, linestyle: any, linewidth: any, editable: any, display: any): any;
16
+ }
@@ -74,7 +74,6 @@ export declare enum display {
74
74
  data_window = "data_window",
75
75
  none = "none",
76
76
  pane = "pane",
77
- pine_screener = "pine_screener",
78
77
  price_scale = "price_scale",
79
78
  status_line = "status_line"
80
79
  }
@@ -82,5 +81,6 @@ declare const types: {
82
81
  order: typeof order;
83
82
  currency: typeof currency;
84
83
  dayofweek: typeof dayofweek;
84
+ display: typeof display;
85
85
  };
86
86
  export default types;
@@ -1,14 +1,2 @@
1
- export declare function parseInputOptions(args: any[]): {
2
- defval?: any;
3
- title?: string;
4
- options?: any[];
5
- tooltip?: string;
6
- minval?: number;
7
- maxval?: number;
8
- step?: number;
9
- inline?: string;
10
- group?: string;
11
- confirm?: boolean;
12
- display?: string;
13
- active?: boolean;
14
- };
1
+ import { InputOptions } from './types';
2
+ export declare function parseInputOptions(args: any[]): Partial<InputOptions>;
@@ -1 +1 @@
1
- export declare function pivothigh(context: any): (source: any, _leftbars: any, _rightbars: any) => any;
1
+ export declare function pivothigh(context: any): (source: any, _leftbars: any, _rightbars: any, _callId?: string) => any;
@@ -1 +1 @@
1
- export declare function pivotlow(context: any): (source: any, _leftbars: any, _rightbars: any) => any;
1
+ export declare function pivotlow(context: any): (source: any, _leftbars: any, _rightbars: any, _callId?: string) => any;
@@ -0,0 +1,12 @@
1
+ import { Series } from '../Series';
2
+ export type PineTypeMap<T> = {
3
+ [K in keyof T]-?: T[K] extends number ? 'number' : T[K] extends string ? 'string' : T[K] extends boolean ? 'boolean' : T[K] extends Series ? 'series' : T[K] extends Array<any> ? 'array' : never;
4
+ };
5
+ /**
6
+ * This function is used to parse the arguments for a Pine params.
7
+ * @param args - The arguments to parse.
8
+ * @param signatures - The signatures to parse, each signature is an array of argument names.
9
+ * @param types - The types to parse, each type is a string representing the type of the argument.
10
+ * @returns The parsed arguments, the arguments are parsed according to the signatures and types.
11
+ */
12
+ export declare function parseArgsForPineParams<T>(args: any[], signatures: any[], types: Record<string, string>): Partial<T> & T;
@@ -1,4 +1,4 @@
1
- export declare function transpile(fn: string | Function, options?: {
1
+ export declare function transpile(source: string | Function, options?: {
2
2
  debug: boolean;
3
3
  ln?: boolean;
4
4
  }): Function;
@@ -0,0 +1,167 @@
1
+ export declare class ASTNode {
2
+ type: string;
3
+ constructor(type: string);
4
+ }
5
+ export declare class Program extends ASTNode {
6
+ body: any[];
7
+ constructor(body: any[]);
8
+ }
9
+ export declare class ExpressionStatement extends ASTNode {
10
+ expression: any;
11
+ constructor(expression: any);
12
+ }
13
+ export declare enum VariableDeclarationKind {
14
+ VAR = "var",
15
+ LET = "let",
16
+ CONST = "const"
17
+ }
18
+ export declare class VariableDeclaration extends ASTNode {
19
+ declarations: any[];
20
+ kind: VariableDeclarationKind;
21
+ constructor(declarations: any[], kind?: VariableDeclarationKind);
22
+ }
23
+ export declare class VariableDeclarator extends ASTNode {
24
+ id: any;
25
+ init: any;
26
+ varType: any;
27
+ constructor(id: any, init: any, varType?: any);
28
+ }
29
+ export declare class FunctionDeclaration extends ASTNode {
30
+ id: any;
31
+ params: any[];
32
+ body: any;
33
+ returnType: any;
34
+ constructor(id: any, params: any[], body: any, returnType?: any);
35
+ }
36
+ export declare class TypeDefinition extends ASTNode {
37
+ name: string;
38
+ fields: any[];
39
+ constructor(name: string, fields: any[]);
40
+ }
41
+ export declare class IfStatement extends ASTNode {
42
+ test: any;
43
+ consequent: any;
44
+ alternate: any | null;
45
+ _line: number;
46
+ constructor(test: any, consequent: any, alternate?: any | null);
47
+ }
48
+ export declare class ForStatement extends ASTNode {
49
+ init: any;
50
+ test: any;
51
+ update: any;
52
+ body: any;
53
+ isForIn: boolean;
54
+ constructor(init: any, test: any, update: any, body: any);
55
+ }
56
+ export declare class WhileStatement extends ASTNode {
57
+ test: any;
58
+ body: any;
59
+ constructor(test: any, body: any);
60
+ }
61
+ export declare class BlockStatement extends ASTNode {
62
+ body: any[];
63
+ constructor(body: any[]);
64
+ }
65
+ export declare class ReturnStatement extends ASTNode {
66
+ argument: any;
67
+ constructor(argument: any);
68
+ }
69
+ export declare class Identifier extends ASTNode {
70
+ name: string;
71
+ varType: string;
72
+ returnType: any;
73
+ isMethod: boolean;
74
+ constructor(name: string);
75
+ }
76
+ export declare class Literal extends ASTNode {
77
+ value: any;
78
+ raw: string;
79
+ constructor(value: any, raw?: string);
80
+ }
81
+ export declare class BinaryExpression extends ASTNode {
82
+ operator: string;
83
+ left: any;
84
+ right: any;
85
+ constructor(operator: string, left: any, right: any);
86
+ }
87
+ export declare class UnaryExpression extends ASTNode {
88
+ operator: string;
89
+ argument: any;
90
+ prefix: boolean;
91
+ constructor(operator: string, argument: any, prefix?: boolean);
92
+ }
93
+ export declare class AssignmentExpression extends ASTNode {
94
+ operator: string;
95
+ left: any;
96
+ right: any;
97
+ constructor(operator: string, left: any, right: any);
98
+ }
99
+ export declare class UpdateExpression extends ASTNode {
100
+ operator: string;
101
+ argument: any;
102
+ prefix: boolean;
103
+ constructor(operator: string, argument: any, prefix?: boolean);
104
+ }
105
+ export declare class CallExpression extends ASTNode {
106
+ callee: any;
107
+ args: any[];
108
+ arguments: any[];
109
+ constructor(callee: any, args: any[]);
110
+ }
111
+ export declare class MemberExpression extends ASTNode {
112
+ object: any;
113
+ property: any;
114
+ computed: boolean;
115
+ constructor(object: any, property: any, computed?: boolean);
116
+ }
117
+ export declare class ConditionalExpression extends ASTNode {
118
+ test: any;
119
+ consequent: any;
120
+ alternate: any;
121
+ needsIIFE: boolean;
122
+ consequentStmts: any[];
123
+ alternateStmts: any[];
124
+ constructor(test: any, consequent: any, alternate: any);
125
+ }
126
+ export declare class ArrayExpression extends ASTNode {
127
+ elements: any[];
128
+ constructor(elements: any[]);
129
+ }
130
+ export declare class ObjectExpression extends ASTNode {
131
+ properties: any[];
132
+ constructor(properties: any[]);
133
+ }
134
+ export declare class Property extends ASTNode {
135
+ key: any;
136
+ value: any;
137
+ kind: string;
138
+ method: boolean;
139
+ shorthand: boolean;
140
+ computed: boolean;
141
+ constructor(key: any, value: any);
142
+ }
143
+ export declare class ArrayPattern extends ASTNode {
144
+ elements: any[];
145
+ constructor(elements: any[]);
146
+ }
147
+ export declare class AssignmentPattern extends ASTNode {
148
+ left: any;
149
+ right: any;
150
+ constructor(left: any, right: any);
151
+ }
152
+ export declare class ArrowFunctionExpression extends ASTNode {
153
+ params: any[];
154
+ body: any;
155
+ expression: boolean;
156
+ constructor(params: any[], body: any, expression?: boolean);
157
+ }
158
+ export declare class SwitchExpression extends ASTNode {
159
+ discriminant: any;
160
+ cases: any[];
161
+ constructor(discriminant: any, cases: any[]);
162
+ }
163
+ export declare class SwitchCase extends ASTNode {
164
+ test: any;
165
+ consequent: any;
166
+ constructor(test: any, consequent: any);
167
+ }
@@ -0,0 +1,53 @@
1
+ export declare class CodeGenerator {
2
+ private indent;
3
+ private indentStr;
4
+ private output;
5
+ private sourceCode;
6
+ private sourceLines;
7
+ private lastCommentedLine;
8
+ private includeSourceComments;
9
+ constructor(options?: {
10
+ indentStr?: string;
11
+ sourceCode?: string;
12
+ includeSourceComments?: boolean;
13
+ });
14
+ generate(ast: any): string;
15
+ writeSourceComment(startLine: any, endLine?: any): void;
16
+ write(str: any): void;
17
+ writeLine(str?: string): void;
18
+ increaseIndent(): void;
19
+ decreaseIndent(): void;
20
+ generateProgram(node: any): void;
21
+ generateStatement(node: any): void;
22
+ generateTypeDefinition(node: any): void;
23
+ generateFunctionDeclaration(node: any): void;
24
+ generateVariableDeclaration(node: any): void;
25
+ generateExpressionStatement(node: any): void;
26
+ generateIfStatement(node: any): void;
27
+ generateIfStatementWithAssignment(condExpr: any, varName: any): void;
28
+ generateNestedIfWithAssignments(node: any, varName: any): void;
29
+ generateNestedIfAlternatesWithAssignments(alternate: any, varName: any): void;
30
+ generateForStatement(node: any): void;
31
+ generateWhileStatement(node: any): void;
32
+ generateReturnStatement(node: any): void;
33
+ generateBlockStatement(node: any, addIndent?: boolean): void;
34
+ generateExpression(node: any): void;
35
+ generateLiteral(node: any): void;
36
+ generateBinaryExpression(node: any): void;
37
+ generateUnaryExpression(node: any): void;
38
+ generateAssignmentExpression(node: any): void;
39
+ generateUpdateExpression(node: any): void;
40
+ generateCallExpression(node: any): void;
41
+ generateMemberExpression(node: any): void;
42
+ generateConditionalExpression(node: any): void;
43
+ generateIIFEConditional(node: any): void;
44
+ generateIIFEIfBlock(node: any): void;
45
+ generateNestedIfWithReturns(node: any): void;
46
+ generateNestedIfAlternates(alternate: any): void;
47
+ generateNestedIfAsExpression(node: any): void;
48
+ generateArrayExpression(node: any): void;
49
+ generateObjectExpression(node: any): void;
50
+ generateSwitchExpression(node: any): void;
51
+ generateSequenceExpression(node: any): void;
52
+ needsParentheses(node: any): boolean;
53
+ }
@@ -0,0 +1,31 @@
1
+ import { Token } from './tokens';
2
+ export declare class Lexer {
3
+ private source;
4
+ private pos;
5
+ private line;
6
+ private column;
7
+ private tokens;
8
+ private indentStack;
9
+ private atLineStart;
10
+ private parenDepth;
11
+ private bracketDepth;
12
+ private braceDepth;
13
+ constructor(source: string);
14
+ tokenize(): Token[];
15
+ handleNewline(): void;
16
+ handleIndentation(): void;
17
+ readComment(): void;
18
+ readString(): void;
19
+ readColorLiteral(): void;
20
+ readNumber(): void;
21
+ readIdentifier(): void;
22
+ readOperatorOrPunctuation(): boolean;
23
+ peek(offset?: number): string;
24
+ advance(): string;
25
+ skipWhitespaceInline(): void;
26
+ isDigit(ch: any): boolean;
27
+ isIdentifierStart(ch: any): boolean;
28
+ isIdentifierChar(ch: any): boolean;
29
+ getCurrentIndent(): number;
30
+ addToken(type: any, value: any, indent?: any): void;
31
+ }
@@ -0,0 +1,45 @@
1
+ import { Token } from './tokens';
2
+ import { Program, VariableDeclaration, FunctionDeclaration, TypeDefinition, IfStatement, ForStatement, WhileStatement, BlockStatement, CallExpression, ArrayExpression, SwitchExpression } from './ast';
3
+ export declare class Parser {
4
+ private tokens;
5
+ private pos;
6
+ constructor(tokens: Token[]);
7
+ peek(offset?: number): Token;
8
+ advance(): Token;
9
+ match(type: any, value?: any): boolean;
10
+ expect(type: any, value?: any): Token;
11
+ skipNewlines(): void;
12
+ parse(): Program;
13
+ parseStatement(): any;
14
+ isFunctionDeclaration(): boolean;
15
+ parseTypeDefinition(): TypeDefinition;
16
+ parseVarDeclaration(): VariableDeclaration;
17
+ parseTypedVarDeclaration(): VariableDeclaration;
18
+ parseFunctionDeclaration(): FunctionDeclaration;
19
+ parseMethodDeclaration(): FunctionDeclaration;
20
+ parseFunctionBody(): BlockStatement;
21
+ parseStatementOrSequence(): any;
22
+ parseIfStatement(): IfStatement;
23
+ parseForStatement(): ForStatement;
24
+ parseWhileStatement(): WhileStatement;
25
+ parseBlock(): BlockStatement;
26
+ isTupleDestructuring(): boolean;
27
+ parseTupleDestructuring(): VariableDeclaration;
28
+ parseExpression(): any;
29
+ parseTernary(): any;
30
+ parseLogicalOr(): any;
31
+ parseLogicalAnd(): any;
32
+ parseEquality(): any;
33
+ parseComparison(): any;
34
+ parseAdditive(): any;
35
+ parseMultiplicative(): any;
36
+ parseUnary(): any;
37
+ parsePostfix(): any;
38
+ parseCallExpression(callee: any): CallExpression;
39
+ parsePrimary(): any;
40
+ parseArrayLiteral(): ArrayExpression;
41
+ parseIfExpression(): any;
42
+ needsIIFE(consequentStmts: any, alternateStmts: any): any;
43
+ parseSwitchExpression(): SwitchExpression;
44
+ getBlockValue(statements: any): any;
45
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Extract Pine Script version from source code
3
+ * Looks for //@version=X comment on its own line (can be anywhere in the file)
4
+ * The line must start with // and contain only @version=X (with optional whitespace)
5
+ * Returns the version number or null if not found
6
+ */
7
+ export declare function extractPineScriptVersion(sourceCode: string): number | null;
8
+ export declare function pineToJS(sourceCode: string, options?: any): {
9
+ success: boolean;
10
+ version: number;
11
+ error: string;
12
+ code?: undefined;
13
+ ast?: undefined;
14
+ tokens?: undefined;
15
+ stack?: undefined;
16
+ } | {
17
+ success: boolean;
18
+ version: number;
19
+ code: string;
20
+ ast: import("./ast").Program;
21
+ tokens: import("./tokens").Token[];
22
+ error?: undefined;
23
+ stack?: undefined;
24
+ } | {
25
+ success: boolean;
26
+ version: number;
27
+ error: any;
28
+ stack: any;
29
+ code?: undefined;
30
+ ast?: undefined;
31
+ tokens?: undefined;
32
+ };
@@ -0,0 +1,34 @@
1
+ export declare const TokenType: {
2
+ NUMBER: string;
3
+ STRING: string;
4
+ BOOLEAN: string;
5
+ IDENTIFIER: string;
6
+ KEYWORD: string;
7
+ OPERATOR: string;
8
+ LPAREN: string;
9
+ RPAREN: string;
10
+ LBRACKET: string;
11
+ RBRACKET: string;
12
+ LBRACE: string;
13
+ RBRACE: string;
14
+ COMMA: string;
15
+ DOT: string;
16
+ COLON: string;
17
+ SEMICOLON: string;
18
+ INDENT: string;
19
+ DEDENT: string;
20
+ NEWLINE: string;
21
+ COMMENT: string;
22
+ EOF: string;
23
+ };
24
+ export declare const Keywords: Set<string>;
25
+ export declare const MultiCharOperators: string[];
26
+ export declare class Token {
27
+ type: string;
28
+ value: any;
29
+ line: number;
30
+ column: number;
31
+ indent: number;
32
+ constructor(type: string, value: any, line: number, column: number, indent?: number);
33
+ toString(): string;
34
+ }
@@ -1,4 +1,6 @@
1
1
  export declare const KNOWN_NAMESPACES: string[];
2
+ export declare const NAMESPACES_LIKE: string[];
3
+ export declare const ASYNC_METHODS: string[];
2
4
  export declare const CONTEXT_DATA_VARS: string[];
3
5
  export declare const CONTEXT_PINE_VARS: string[];
4
6
  export declare const CONTEXT_CORE_VARS: string[];
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * Wraps unwrapped code in a context arrow function.
3
- * If the code is already wrapped in a function, returns it as-is.
4
- * Otherwise, wraps it in: (context) => { ... }
3
+ * If the code is already wrapped in a function:
4
+ * - If async, returns it as-is
5
+ * - If not async, converts it to async
6
+ * Otherwise, wraps it in: async (context) => { ... }
5
7
  *
6
8
  * @param code The input code string
7
- * @returns The wrapped code string
9
+ * @returns The wrapped code string (always async)
8
10
  */
9
11
  export declare function wrapInContextFunction(code: string): string;
@@ -17,4 +17,5 @@ export declare const ASTFactory: {
17
17
  createMathEqCall(left: any, right: any): any;
18
18
  createWrapperFunction(body: any): any;
19
19
  createVariableDeclaration(name: string, init: any): any;
20
+ createAwaitExpression(argument: any): any;
20
21
  };
@@ -15,6 +15,8 @@ type PlotCharOptions = {
15
15
  force_overlay?: boolean;
16
16
  };
17
17
  type PlotOptions = {
18
+ series?: number;
19
+ title?: string;
18
20
  color?: string;
19
21
  linewidth?: number;
20
22
  style?: string;
@@ -30,21 +32,23 @@ type PlotOptions = {
30
32
  force_overlay?: boolean;
31
33
  };
32
34
  type IndicatorOptions = {
33
- overlay?: boolean;
34
- format?: string;
35
- precision?: number;
36
- scale?: number;
37
- max_bars_back?: number;
38
- timeframe?: string;
39
- timeframe_gaps?: boolean;
40
- explicit_plot_zorder?: number;
41
- max_lines_count?: number;
42
- max_labels_count?: number;
43
- max_boxes_count?: number;
44
- calc_bars_count?: number;
45
- max_polylines_count?: number;
46
- dynamic_requests?: boolean;
47
- behind_chart?: boolean;
35
+ title: string;
36
+ shorttitle: string;
37
+ overlay: boolean;
38
+ format: string;
39
+ precision: number;
40
+ scale: string;
41
+ max_bars_back: number;
42
+ timeframe: string;
43
+ timeframe_gaps: boolean;
44
+ explicit_plot_zorder: boolean;
45
+ max_lines_count: number;
46
+ max_labels_count: number;
47
+ max_boxes_count: number;
48
+ calc_bars_count: number;
49
+ max_polylines_count: number;
50
+ dynamic_requests: boolean;
51
+ behind_chart: boolean;
48
52
  };
49
53
  type TSessionInfo = {
50
54
  isfirstbar: boolean;
package/package.json CHANGED
@@ -1,11 +1,28 @@
1
1
  {
2
2
  "name": "pinets",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "description": "",
5
- "main": "dist/pinets.dev.es.js",
5
+ "main": "dist/pinets.min.cjs",
6
+ "module": "dist/pinets.min.es.js",
7
+ "browser": "dist/pinets.min.browser.es.js",
6
8
  "types": "dist/types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types/index.d.ts",
12
+ "node": {
13
+ "import": "./dist/pinets.min.es.js",
14
+ "require": "./dist/pinets.min.cjs"
15
+ },
16
+ "browser": {
17
+ "import": "./dist/pinets.min.browser.es.js",
18
+ "default": "./dist/pinets.min.browser.js"
19
+ },
20
+ "default": "./dist/pinets.min.es.js"
21
+ }
22
+ },
7
23
  "files": [
8
- "dist"
24
+ "dist/*.min.*",
25
+ "dist/types"
9
26
  ],
10
27
  "type": "module",
11
28
  "scripts": {
@@ -20,13 +37,15 @@
20
37
  "generate:request-index": "node scripts/generate-request-index.js",
21
38
  "generate:map-index": "node scripts/generate-map-index.js",
22
39
  "generate:matrix-index": "node scripts/generate-matrix-index.js",
23
- "build:dev:all": "npm run generate:ta-index && npm run generate:math-index && npm run generate:array-index && npm run generate:input-index && npm run generate:request-index && npm run generate:map-index && npm run generate:matrix-index && npm run build:dev:browser && npm run build:dev:cjs && npm run build:dev:es && tsc --emitDeclarationOnly --declaration --outDir dist/types -p tsconfig.dts.json",
40
+ "build:dev:all": "npm run generate:ta-index && npm run generate:math-index && npm run generate:array-index && npm run generate:input-index && npm run generate:request-index && npm run generate:map-index && npm run generate:matrix-index && npm run build:dev:browser && npm run build:dev:cjs && npm run build:dev:es && npm run build:dev:browser-es && tsc --emitDeclarationOnly --declaration --outDir dist/types -p tsconfig.dts.json",
24
41
  "build:dev:cjs": "cross-env BUILD=dev FORMAT=cjs rollup -c ./rollup.config.js",
25
42
  "build:dev:browser": "cross-env BUILD=dev FORMAT=browser rollup -c ./rollup.config.js",
43
+ "build:dev:browser-es": "cross-env BUILD=dev FORMAT=browser-es rollup -c ./rollup.config.js",
26
44
  "build:dev:es": "cross-env BUILD=dev rollup -c ./rollup.config.js",
27
- "build:prod:all": "npm run generate:ta-index && npm run generate:math-index && npm run generate:array-index && npm run generate:input-index && npm run generate:request-index && npm run generate:map-index && npm run generate:matrix-index && npm run build:prod:browser && npm run build:prod:cjs && npm run build:prod:es && tsc --emitDeclarationOnly --declaration --outDir dist/types -p tsconfig.dts.json",
45
+ "build:prod:all": "npm run generate:ta-index && npm run generate:math-index && npm run generate:array-index && npm run generate:input-index && npm run generate:request-index && npm run generate:map-index && npm run generate:matrix-index && npm run build:prod:browser && npm run build:prod:cjs && npm run build:prod:es && npm run build:prod:browser-es && tsc --emitDeclarationOnly --declaration --outDir dist/types -p tsconfig.dts.json",
28
46
  "build:prod:cjs": "cross-env BUILD=prod FORMAT=cjs rollup -c ./rollup.config.js",
29
47
  "build:prod:browser": "cross-env BUILD=prod FORMAT=browser rollup -c ./rollup.config.js",
48
+ "build:prod:browser-es": "cross-env BUILD=prod FORMAT=browser-es rollup -c ./rollup.config.js",
30
49
  "build:prod:es": "cross-env BUILD=prod rollup -c ./rollup.config.js",
31
50
  "knip": "knip"
32
51
  },