pinets 0.8.11 → 0.9.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.
- package/README.md +46 -35
- package/dist/pinets.min.browser.es.js +90 -78
- package/dist/pinets.min.browser.es.js.map +1 -1
- package/dist/pinets.min.browser.js +90 -78
- package/dist/pinets.min.browser.js.map +1 -1
- package/dist/pinets.min.cjs +83 -71
- package/dist/pinets.min.cjs.map +1 -1
- package/dist/pinets.min.es.js +90 -78
- package/dist/pinets.min.es.js.map +1 -1
- package/dist/types/Context.class.d.ts +1 -0
- package/dist/types/namespaces/Core.d.ts +3 -1
- package/dist/types/namespaces/Plots.d.ts +9 -1
- package/dist/types/namespaces/Str.d.ts +1 -1
- package/dist/types/namespaces/Types.d.ts +83 -29
- package/dist/types/namespaces/array/methods/new.d.ts +1 -1
- package/dist/types/namespaces/box/BoxHelper.d.ts +44 -0
- package/dist/types/namespaces/box/BoxObject.d.ts +27 -0
- package/dist/types/namespaces/label/LabelHelper.d.ts +8 -1
- package/dist/types/namespaces/label/LabelObject.d.ts +1 -0
- package/dist/types/namespaces/line/LineHelper.d.ts +48 -0
- package/dist/types/namespaces/line/LineObject.d.ts +19 -0
- package/dist/types/namespaces/linefill/LinefillHelper.d.ts +21 -0
- package/dist/types/namespaces/linefill/LinefillObject.d.ts +11 -0
- package/dist/types/namespaces/polyline/PolylineHelper.d.ts +21 -0
- package/dist/types/namespaces/polyline/PolylineObject.d.ts +17 -0
- package/dist/types/namespaces/table/TableHelper.d.ts +35 -0
- package/dist/types/namespaces/table/TableObject.d.ts +42 -0
- package/dist/types/namespaces/utils.d.ts +7 -0
- package/dist/types/transpiler/analysis/ScopeManager.d.ts +14 -0
- package/dist/types/transpiler/pineToJS/codegen.d.ts +2 -0
- package/dist/types/transpiler/pineToJS/parser.d.ts +4 -0
- package/dist/types/transpiler/settings.d.ts +1 -0
- package/dist/types/types/PineTypes.d.ts +20 -11
- package/package.json +5 -3
|
@@ -5,6 +5,7 @@ import PineMath from './namespaces/math/math.index';
|
|
|
5
5
|
import { PineRequest } from './namespaces/request/request.index';
|
|
6
6
|
import TechnicalAnalysis from './namespaces/ta/ta.index';
|
|
7
7
|
import { Series } from './Series';
|
|
8
|
+
import type { IndicatorOptions } from './types/PineTypes';
|
|
8
9
|
export declare class Context {
|
|
9
10
|
data: any;
|
|
10
11
|
indicator: IndicatorOptions;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PineTypeObject } from './PineTypeObject';
|
|
2
|
+
import type { IndicatorOptions } from '../types/PineTypes';
|
|
2
3
|
export declare function parseIndicatorOptions(args: any[]): Partial<IndicatorOptions>;
|
|
3
4
|
/**
|
|
4
5
|
* NAHelper implements the dual-use `na` identifier.
|
|
@@ -15,7 +16,8 @@ export declare class Core {
|
|
|
15
16
|
color: {
|
|
16
17
|
param: (source: any, index?: number) => any;
|
|
17
18
|
rgb: (r: number, g: number, b: number, a?: number) => string;
|
|
18
|
-
new: (color:
|
|
19
|
+
new: (color: any, a?: number) => any;
|
|
20
|
+
from_gradient: (value: any, bottom_value: any, top_value: any, bottom_color: any, top_color: any) => string;
|
|
19
21
|
aqua: "#00BCD4";
|
|
20
22
|
black: "#363A45";
|
|
21
23
|
blue: "#2196F3";
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export declare class PlotHelper {
|
|
2
2
|
private context;
|
|
3
3
|
constructor(context: any);
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the key to use in context.plots.
|
|
6
|
+
* Uses title by default for backward compatibility.
|
|
7
|
+
* On title collision (two different call sites producing the same title),
|
|
8
|
+
* appends the transpiler-generated callsite suffix: "title#N".
|
|
9
|
+
* The callsite ID is generated by ScopeManager as "#0", "#1", etc.
|
|
10
|
+
*/
|
|
11
|
+
private _resolvePlotKey;
|
|
4
12
|
private extractPlotOptions;
|
|
5
13
|
get linestyle_dashed(): string;
|
|
6
14
|
get linestyle_dotted(): string;
|
|
@@ -33,7 +41,7 @@ export declare class HlineHelper {
|
|
|
33
41
|
get style_solid(): string;
|
|
34
42
|
get style_dotted(): string;
|
|
35
43
|
param(source: any, index?: number, name?: string): any;
|
|
36
|
-
any(
|
|
44
|
+
any(...args: any[]): any;
|
|
37
45
|
}
|
|
38
46
|
export declare class FillHelper {
|
|
39
47
|
private context;
|
|
@@ -3,7 +3,7 @@ export declare class Str {
|
|
|
3
3
|
private context;
|
|
4
4
|
constructor(context: Context);
|
|
5
5
|
param(source: any, index?: number, name?: string): any;
|
|
6
|
-
tostring(value: any): string;
|
|
6
|
+
tostring(value: any, formatStr?: string): string;
|
|
7
7
|
tonumber(value: any): number;
|
|
8
8
|
lower(value: string): string;
|
|
9
9
|
upper(value: string): string;
|
|
@@ -78,25 +78,25 @@ export declare enum display {
|
|
|
78
78
|
status_line = "status_line"
|
|
79
79
|
}
|
|
80
80
|
export declare enum shape {
|
|
81
|
-
flag = "
|
|
82
|
-
arrowdown = "
|
|
83
|
-
arrowup = "
|
|
84
|
-
circle = "
|
|
85
|
-
cross = "
|
|
86
|
-
diamond = "
|
|
87
|
-
labeldown = "
|
|
88
|
-
labelup = "
|
|
89
|
-
square = "
|
|
90
|
-
triangledown = "
|
|
91
|
-
triangleup = "
|
|
92
|
-
xcross = "
|
|
81
|
+
flag = "shape_flag",
|
|
82
|
+
arrowdown = "shape_arrow_down",
|
|
83
|
+
arrowup = "shape_arrow_up",
|
|
84
|
+
circle = "shape_circle",
|
|
85
|
+
cross = "shape_cross",
|
|
86
|
+
diamond = "shape_diamond",
|
|
87
|
+
labeldown = "shape_label_down",
|
|
88
|
+
labelup = "shape_label_up",
|
|
89
|
+
square = "shape_square",
|
|
90
|
+
triangledown = "shape_triangle_down",
|
|
91
|
+
triangleup = "shape_triangle_up",
|
|
92
|
+
xcross = "shape_xcross"
|
|
93
93
|
}
|
|
94
94
|
export declare enum location {
|
|
95
|
-
abovebar = "
|
|
96
|
-
belowbar = "
|
|
97
|
-
absolute = "
|
|
98
|
-
bottom = "
|
|
99
|
-
top = "
|
|
95
|
+
abovebar = "AboveBar",
|
|
96
|
+
belowbar = "BelowBar",
|
|
97
|
+
absolute = "Absolute",
|
|
98
|
+
bottom = "Bottom",
|
|
99
|
+
top = "Top"
|
|
100
100
|
}
|
|
101
101
|
export declare enum size {
|
|
102
102
|
auto = "auto",
|
|
@@ -136,24 +136,71 @@ export declare enum barmerge {
|
|
|
136
136
|
lookahead_off = "lookahead_off"
|
|
137
137
|
}
|
|
138
138
|
export declare enum xloc {
|
|
139
|
-
bar_index = "
|
|
140
|
-
bar_time = "
|
|
139
|
+
bar_index = "bi",
|
|
140
|
+
bar_time = "bt"
|
|
141
141
|
}
|
|
142
142
|
export declare enum yloc {
|
|
143
|
-
price = "
|
|
144
|
-
abovebar = "
|
|
145
|
-
belowbar = "
|
|
143
|
+
price = "pr",
|
|
144
|
+
abovebar = "ab",
|
|
145
|
+
belowbar = "bl"
|
|
146
|
+
}
|
|
147
|
+
export declare enum extend {
|
|
148
|
+
left = "l",
|
|
149
|
+
right = "r",
|
|
150
|
+
both = "b",
|
|
151
|
+
none = "n"
|
|
146
152
|
}
|
|
147
153
|
export declare enum text {
|
|
148
|
-
align_left = "
|
|
149
|
-
align_center = "
|
|
150
|
-
align_right = "
|
|
151
|
-
wrap_auto = "
|
|
152
|
-
wrap_none = "
|
|
154
|
+
align_left = "left",
|
|
155
|
+
align_center = "center",
|
|
156
|
+
align_right = "right",
|
|
157
|
+
wrap_auto = "auto",
|
|
158
|
+
wrap_none = "none"
|
|
153
159
|
}
|
|
154
160
|
export declare enum font {
|
|
155
|
-
family_default = "
|
|
156
|
-
family_monospace = "
|
|
161
|
+
family_default = "default",
|
|
162
|
+
family_monospace = "monospace"
|
|
163
|
+
}
|
|
164
|
+
export declare enum adjustment {
|
|
165
|
+
none = "none",
|
|
166
|
+
splits = "splits",
|
|
167
|
+
dividends = "dividends"
|
|
168
|
+
}
|
|
169
|
+
export declare enum backadjustment {
|
|
170
|
+
inherit = "inherit",
|
|
171
|
+
off = "off",
|
|
172
|
+
on = "on"
|
|
173
|
+
}
|
|
174
|
+
export declare enum earnings {
|
|
175
|
+
actual = "earnings_actual",
|
|
176
|
+
estimate = "earnings_estimate",
|
|
177
|
+
standardized = "earnings_standardized",
|
|
178
|
+
future_eps = "earnings_future_eps",
|
|
179
|
+
future_period_end_time = "earnings_future_period_end_time",
|
|
180
|
+
future_revenue = "earnings_future_revenue",
|
|
181
|
+
future_time = "earnings_future_time"
|
|
182
|
+
}
|
|
183
|
+
export declare enum dividends {
|
|
184
|
+
gross = "dividends_gross",
|
|
185
|
+
net = "dividends_net",
|
|
186
|
+
future_amount = "dividends_future_amount",
|
|
187
|
+
future_ex_date = "dividends_future_ex_date",
|
|
188
|
+
future_pay_date = "dividends_future_pay_date"
|
|
189
|
+
}
|
|
190
|
+
export declare enum splits {
|
|
191
|
+
denominator = "splits_denominator",
|
|
192
|
+
numerator = "splits_numerator"
|
|
193
|
+
}
|
|
194
|
+
export declare enum position {
|
|
195
|
+
top_left = "top_left",
|
|
196
|
+
top_center = "top_center",
|
|
197
|
+
top_right = "top_right",
|
|
198
|
+
middle_left = "middle_left",
|
|
199
|
+
middle_center = "middle_center",
|
|
200
|
+
middle_right = "middle_right",
|
|
201
|
+
bottom_left = "bottom_left",
|
|
202
|
+
bottom_center = "bottom_center",
|
|
203
|
+
bottom_right = "bottom_right"
|
|
157
204
|
}
|
|
158
205
|
declare const types: {
|
|
159
206
|
order: typeof order;
|
|
@@ -167,7 +214,14 @@ declare const types: {
|
|
|
167
214
|
barmerge: typeof barmerge;
|
|
168
215
|
xloc: typeof xloc;
|
|
169
216
|
yloc: typeof yloc;
|
|
217
|
+
extend: typeof extend;
|
|
170
218
|
text: typeof text;
|
|
171
219
|
font: typeof font;
|
|
220
|
+
adjustment: typeof adjustment;
|
|
221
|
+
backadjustment: typeof backadjustment;
|
|
222
|
+
earnings: typeof earnings;
|
|
223
|
+
dividends: typeof dividends;
|
|
224
|
+
splits: typeof splits;
|
|
225
|
+
position: typeof position;
|
|
172
226
|
};
|
|
173
227
|
export default types;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PineArrayObject } from '../PineArrayObject';
|
|
2
2
|
import { Context } from '../../../Context.class';
|
|
3
|
-
export declare function new_fn(context: Context): <T>(size
|
|
3
|
+
export declare function new_fn(context: Context): <T>(size?: number, initial_value?: T) => PineArrayObject;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BoxObject } from './BoxObject';
|
|
2
|
+
import { ChartPointObject } from '../chart/ChartPointObject';
|
|
3
|
+
export declare class BoxHelper {
|
|
4
|
+
private context;
|
|
5
|
+
private _boxes;
|
|
6
|
+
constructor(context: any);
|
|
7
|
+
param(source: any, index?: number, name?: string): any;
|
|
8
|
+
private _ensurePlotsEntry;
|
|
9
|
+
private _syncToPlot;
|
|
10
|
+
private _resolvePoint;
|
|
11
|
+
private _resolve;
|
|
12
|
+
private _createBox;
|
|
13
|
+
new(...args: any[]): BoxObject;
|
|
14
|
+
any(...args: any[]): BoxObject;
|
|
15
|
+
set_left(id: BoxObject, left: number): void;
|
|
16
|
+
set_right(id: BoxObject, right: number): void;
|
|
17
|
+
set_top(id: BoxObject, top: number): void;
|
|
18
|
+
set_bottom(id: BoxObject, bottom: number): void;
|
|
19
|
+
set_lefttop(id: BoxObject, left: number, top: number): void;
|
|
20
|
+
set_rightbottom(id: BoxObject, right: number, bottom: number): void;
|
|
21
|
+
set_top_left_point(id: BoxObject, point: ChartPointObject): void;
|
|
22
|
+
set_bottom_right_point(id: BoxObject, point: ChartPointObject): void;
|
|
23
|
+
set_xloc(id: BoxObject, left: number, right: number, xloc: string): void;
|
|
24
|
+
set_bgcolor(id: BoxObject, color: string): void;
|
|
25
|
+
set_border_color(id: BoxObject, color: string): void;
|
|
26
|
+
set_border_width(id: BoxObject, width: number): void;
|
|
27
|
+
set_border_style(id: BoxObject, style: string): void;
|
|
28
|
+
set_extend(id: BoxObject, extend: string): void;
|
|
29
|
+
set_text(id: BoxObject, text: string): void;
|
|
30
|
+
set_text_color(id: BoxObject, color: string): void;
|
|
31
|
+
set_text_size(id: BoxObject, size: string): void;
|
|
32
|
+
set_text_halign(id: BoxObject, align: string): void;
|
|
33
|
+
set_text_valign(id: BoxObject, align: string): void;
|
|
34
|
+
set_text_wrap(id: BoxObject, wrap: string): void;
|
|
35
|
+
set_text_font_family(id: BoxObject, family: string): void;
|
|
36
|
+
set_text_formatting(id: BoxObject, formatting: string): void;
|
|
37
|
+
get_left(id: BoxObject): number;
|
|
38
|
+
get_right(id: BoxObject): number;
|
|
39
|
+
get_top(id: BoxObject): number;
|
|
40
|
+
get_bottom(id: BoxObject): number;
|
|
41
|
+
copy(id: BoxObject): BoxObject | undefined;
|
|
42
|
+
delete(id: BoxObject): void;
|
|
43
|
+
get all(): BoxObject[];
|
|
44
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare function resetBoxIdCounter(): void;
|
|
2
|
+
export declare class BoxObject {
|
|
3
|
+
id: number;
|
|
4
|
+
left: number;
|
|
5
|
+
top: number;
|
|
6
|
+
right: number;
|
|
7
|
+
bottom: number;
|
|
8
|
+
xloc: string;
|
|
9
|
+
extend: string;
|
|
10
|
+
border_color: string;
|
|
11
|
+
border_style: string;
|
|
12
|
+
border_width: number;
|
|
13
|
+
bgcolor: string;
|
|
14
|
+
text: string;
|
|
15
|
+
text_color: string;
|
|
16
|
+
text_size: string;
|
|
17
|
+
text_halign: string;
|
|
18
|
+
text_valign: string;
|
|
19
|
+
text_wrap: string;
|
|
20
|
+
text_font_family: string;
|
|
21
|
+
text_formatting: string;
|
|
22
|
+
force_overlay: boolean;
|
|
23
|
+
_deleted: boolean;
|
|
24
|
+
constructor(left: number, top: number, right: number, bottom: number, xloc?: string, extend?: string, border_color?: string, border_style?: string, border_width?: number, bgcolor?: string, text?: string, text_color?: string, text_size?: string, text_halign?: string, text_valign?: string, text_wrap?: string, text_font_family?: string, text_formatting?: string, force_overlay?: boolean);
|
|
25
|
+
delete(): void;
|
|
26
|
+
copy(): BoxObject;
|
|
27
|
+
}
|
|
@@ -6,7 +6,14 @@ export declare class LabelHelper {
|
|
|
6
6
|
constructor(context: any);
|
|
7
7
|
param(source: any, index?: number, name?: string): any;
|
|
8
8
|
private _ensurePlotsEntry;
|
|
9
|
-
private
|
|
9
|
+
private _syncToPlot;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a value that may be a Series, a bound function, or a plain scalar.
|
|
12
|
+
* Pine Script variables (inputs, chart properties) can be stored as Series
|
|
13
|
+
* objects or bound methods in the PineTS runtime. This ensures the resolved
|
|
14
|
+
* scalar value is used for label properties.
|
|
15
|
+
*/
|
|
16
|
+
private _resolve;
|
|
10
17
|
private _createLabel;
|
|
11
18
|
new(...args: any[]): LabelObject;
|
|
12
19
|
any(...args: any[]): LabelObject;
|
|
@@ -16,6 +16,7 @@ export declare class LabelObject {
|
|
|
16
16
|
force_overlay: boolean;
|
|
17
17
|
_deleted: boolean;
|
|
18
18
|
constructor(x: number, y: number, text?: string, xloc?: string, yloc?: string, color?: string, style?: string, textcolor?: string, size?: string, textalign?: string, tooltip?: string, text_font_family?: string, force_overlay?: boolean);
|
|
19
|
+
delete(): void;
|
|
19
20
|
copy(): LabelObject;
|
|
20
21
|
toPlotData(): any;
|
|
21
22
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { LineObject } from './LineObject';
|
|
2
|
+
import { ChartPointObject } from '../chart/ChartPointObject';
|
|
3
|
+
export declare class LineHelper {
|
|
4
|
+
private context;
|
|
5
|
+
private _lines;
|
|
6
|
+
constructor(context: any);
|
|
7
|
+
param(source: any, index?: number, name?: string): any;
|
|
8
|
+
private _ensurePlotsEntry;
|
|
9
|
+
private _syncToPlot;
|
|
10
|
+
private _resolvePoint;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve a value that may be a Series, a bound function, or a plain scalar.
|
|
13
|
+
* Pine Script variables (inputs, chart properties) can be stored as Series
|
|
14
|
+
* objects or bound methods in the PineTS runtime. This ensures the resolved
|
|
15
|
+
* scalar value is used for line properties.
|
|
16
|
+
*/
|
|
17
|
+
private _resolve;
|
|
18
|
+
private _createLine;
|
|
19
|
+
new(...args: any[]): LineObject;
|
|
20
|
+
any(...args: any[]): LineObject;
|
|
21
|
+
set_x1(id: LineObject, x: number): void;
|
|
22
|
+
set_y1(id: LineObject, y: number): void;
|
|
23
|
+
set_x2(id: LineObject, x: number): void;
|
|
24
|
+
set_y2(id: LineObject, y: number): void;
|
|
25
|
+
set_xy1(id: LineObject, x: number, y: number): void;
|
|
26
|
+
set_xy2(id: LineObject, x: number, y: number): void;
|
|
27
|
+
set_color(id: LineObject, color: string): void;
|
|
28
|
+
set_width(id: LineObject, width: number): void;
|
|
29
|
+
set_style(id: LineObject, style: string): void;
|
|
30
|
+
set_extend(id: LineObject, extend: string): void;
|
|
31
|
+
set_xloc(id: LineObject, x1: number, x2: number, xloc: string): void;
|
|
32
|
+
set_first_point(id: LineObject, point: ChartPointObject): void;
|
|
33
|
+
set_second_point(id: LineObject, point: ChartPointObject): void;
|
|
34
|
+
get_x1(id: LineObject): number;
|
|
35
|
+
get_y1(id: LineObject): number;
|
|
36
|
+
get_x2(id: LineObject): number;
|
|
37
|
+
get_y2(id: LineObject): number;
|
|
38
|
+
get_price(id: LineObject, x: number): number;
|
|
39
|
+
copy(id: LineObject): LineObject | undefined;
|
|
40
|
+
delete(id: LineObject): void;
|
|
41
|
+
get all(): LineObject[];
|
|
42
|
+
get style_solid(): string;
|
|
43
|
+
get style_dotted(): string;
|
|
44
|
+
get style_dashed(): string;
|
|
45
|
+
get style_arrow_left(): string;
|
|
46
|
+
get style_arrow_right(): string;
|
|
47
|
+
get style_arrow_both(): string;
|
|
48
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function resetLineIdCounter(): void;
|
|
2
|
+
export declare class LineObject {
|
|
3
|
+
id: number;
|
|
4
|
+
x1: number;
|
|
5
|
+
y1: number;
|
|
6
|
+
x2: number;
|
|
7
|
+
y2: number;
|
|
8
|
+
xloc: string;
|
|
9
|
+
extend: string;
|
|
10
|
+
color: string;
|
|
11
|
+
style: string;
|
|
12
|
+
width: number;
|
|
13
|
+
force_overlay: boolean;
|
|
14
|
+
_deleted: boolean;
|
|
15
|
+
constructor(x1: number, y1: number, x2: number, y2: number, xloc?: string, extend?: string, color?: string, style?: string, width?: number, force_overlay?: boolean);
|
|
16
|
+
delete(): void;
|
|
17
|
+
copy(): LineObject;
|
|
18
|
+
toPlotData(): any;
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LineObject } from '../line/LineObject';
|
|
2
|
+
import { LinefillObject } from './LinefillObject';
|
|
3
|
+
export declare class LinefillHelper {
|
|
4
|
+
private context;
|
|
5
|
+
private _linefills;
|
|
6
|
+
constructor(context: any);
|
|
7
|
+
param(source: any, index?: number, name?: string): any;
|
|
8
|
+
private _ensurePlotsEntry;
|
|
9
|
+
private _syncToPlot;
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a value that may be a Series, a bound function, or a plain scalar.
|
|
12
|
+
*/
|
|
13
|
+
private _resolve;
|
|
14
|
+
new(line1: LineObject, line2: LineObject, color: any): LinefillObject;
|
|
15
|
+
any(...args: any[]): LinefillObject;
|
|
16
|
+
set_color(id: LinefillObject, color: any): void;
|
|
17
|
+
get_line1(id: LinefillObject): LineObject | undefined;
|
|
18
|
+
get_line2(id: LinefillObject): LineObject | undefined;
|
|
19
|
+
delete(id: LinefillObject): void;
|
|
20
|
+
get all(): LinefillObject[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LineObject } from '../line/LineObject';
|
|
2
|
+
export declare function resetLinefillIdCounter(): void;
|
|
3
|
+
export declare class LinefillObject {
|
|
4
|
+
id: number;
|
|
5
|
+
line1: LineObject;
|
|
6
|
+
line2: LineObject;
|
|
7
|
+
color: string;
|
|
8
|
+
_deleted: boolean;
|
|
9
|
+
constructor(line1: LineObject, line2: LineObject, color: string);
|
|
10
|
+
delete(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PolylineObject } from './PolylineObject';
|
|
2
|
+
export declare class PolylineHelper {
|
|
3
|
+
private context;
|
|
4
|
+
private _polylines;
|
|
5
|
+
constructor(context: any);
|
|
6
|
+
param(source: any, index?: number, name?: string): any;
|
|
7
|
+
private _ensurePlotsEntry;
|
|
8
|
+
private _syncToPlot;
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a value that may be a Series, a bound function, or a plain scalar.
|
|
11
|
+
*/
|
|
12
|
+
private _resolve;
|
|
13
|
+
/**
|
|
14
|
+
* Extract raw ChartPointObject array from a PineArrayObject or plain array.
|
|
15
|
+
*/
|
|
16
|
+
private _extractPoints;
|
|
17
|
+
new(...args: any[]): PolylineObject;
|
|
18
|
+
any(...args: any[]): PolylineObject;
|
|
19
|
+
delete(id: PolylineObject): void;
|
|
20
|
+
get all(): PolylineObject[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChartPointObject } from '../chart/ChartPointObject';
|
|
2
|
+
export declare function resetPolylineIdCounter(): void;
|
|
3
|
+
export declare class PolylineObject {
|
|
4
|
+
id: number;
|
|
5
|
+
points: ChartPointObject[];
|
|
6
|
+
curved: boolean;
|
|
7
|
+
closed: boolean;
|
|
8
|
+
xloc: string;
|
|
9
|
+
line_color: string;
|
|
10
|
+
fill_color: string;
|
|
11
|
+
line_style: string;
|
|
12
|
+
line_width: number;
|
|
13
|
+
force_overlay: boolean;
|
|
14
|
+
_deleted: boolean;
|
|
15
|
+
constructor(points: ChartPointObject[], curved?: boolean, closed?: boolean, xloc?: string, line_color?: string, fill_color?: string, line_style?: string, line_width?: number, force_overlay?: boolean);
|
|
16
|
+
delete(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TableObject } from './TableObject';
|
|
2
|
+
export declare class TableHelper {
|
|
3
|
+
private context;
|
|
4
|
+
private _tables;
|
|
5
|
+
constructor(context: any);
|
|
6
|
+
param(source: any, index?: number, name?: string): any;
|
|
7
|
+
private _ensurePlotsEntry;
|
|
8
|
+
private _syncToPlot;
|
|
9
|
+
private _resolve;
|
|
10
|
+
new(...args: any[]): TableObject;
|
|
11
|
+
any(...args: any[]): TableObject;
|
|
12
|
+
cell(...args: any[]): void;
|
|
13
|
+
delete(id: TableObject): void;
|
|
14
|
+
clear(...args: any[]): void;
|
|
15
|
+
merge_cells(...args: any[]): void;
|
|
16
|
+
cell_set_text(table_id: any, column: any, row: any, text: any): void;
|
|
17
|
+
cell_set_bgcolor(table_id: any, column: any, row: any, bgcolor: any): void;
|
|
18
|
+
cell_set_text_color(table_id: any, column: any, row: any, text_color: any): void;
|
|
19
|
+
cell_set_text_size(table_id: any, column: any, row: any, text_size: any): void;
|
|
20
|
+
cell_set_height(table_id: any, column: any, row: any, height: any): void;
|
|
21
|
+
cell_set_width(table_id: any, column: any, row: any, width: any): void;
|
|
22
|
+
cell_set_tooltip(table_id: any, column: any, row: any, tooltip: any): void;
|
|
23
|
+
cell_set_text_halign(table_id: any, column: any, row: any, text_halign: any): void;
|
|
24
|
+
cell_set_text_valign(table_id: any, column: any, row: any, text_valign: any): void;
|
|
25
|
+
cell_set_text_font_family(table_id: any, column: any, row: any, text_font_family: any): void;
|
|
26
|
+
set_position(table_id: any, position: any): void;
|
|
27
|
+
set_bgcolor(table_id: any, bgcolor: any): void;
|
|
28
|
+
set_border_color(table_id: any, border_color: any): void;
|
|
29
|
+
set_border_width(table_id: any, border_width: any): void;
|
|
30
|
+
set_frame_color(table_id: any, frame_color: any): void;
|
|
31
|
+
set_frame_width(table_id: any, frame_width: any): void;
|
|
32
|
+
get all(): TableObject[];
|
|
33
|
+
private _setCellProp;
|
|
34
|
+
private _resolveText;
|
|
35
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare function resetTableIdCounter(): void;
|
|
2
|
+
export interface TableCell {
|
|
3
|
+
text: string;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
text_color: string;
|
|
7
|
+
text_halign: string;
|
|
8
|
+
text_valign: string;
|
|
9
|
+
text_size: string | number;
|
|
10
|
+
bgcolor: string;
|
|
11
|
+
tooltip: string;
|
|
12
|
+
text_font_family: string;
|
|
13
|
+
_merged: boolean;
|
|
14
|
+
_merge_parent: [number, number] | null;
|
|
15
|
+
}
|
|
16
|
+
export interface MergeRegion {
|
|
17
|
+
startCol: number;
|
|
18
|
+
startRow: number;
|
|
19
|
+
endCol: number;
|
|
20
|
+
endRow: number;
|
|
21
|
+
}
|
|
22
|
+
export declare class TableObject {
|
|
23
|
+
id: number;
|
|
24
|
+
position: string;
|
|
25
|
+
columns: number;
|
|
26
|
+
rows: number;
|
|
27
|
+
bgcolor: string;
|
|
28
|
+
frame_color: string;
|
|
29
|
+
frame_width: number;
|
|
30
|
+
border_color: string;
|
|
31
|
+
border_width: number;
|
|
32
|
+
force_overlay: boolean;
|
|
33
|
+
_deleted: boolean;
|
|
34
|
+
cells: (TableCell | null)[][];
|
|
35
|
+
merges: MergeRegion[];
|
|
36
|
+
constructor(position?: string, columns?: number, rows?: number, bgcolor?: string, frame_color?: string, frame_width?: number, border_color?: string, border_width?: number, force_overlay?: boolean);
|
|
37
|
+
delete(): void;
|
|
38
|
+
setCell(column: number, row: number, props: Partial<TableCell>): void;
|
|
39
|
+
getCell(column: number, row: number): TableCell | null;
|
|
40
|
+
clearCell(column: number, row: number): void;
|
|
41
|
+
private _defaultCell;
|
|
42
|
+
}
|
|
@@ -2,6 +2,13 @@ import { Series } from '../Series';
|
|
|
2
2
|
export type PineTypeMap<T> = {
|
|
3
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
4
|
};
|
|
5
|
+
/**
|
|
6
|
+
* Extract a transpiler-injected callsite ID from the end of an arguments array.
|
|
7
|
+
* The transpiler appends { __callsiteId: "_pN" } as the last argument for
|
|
8
|
+
* plot/hline/fill calls to uniquely identify each call-site.
|
|
9
|
+
* Returns the ID string and removes the sentinel object from the array.
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractCallsiteId(args: any[]): string | undefined;
|
|
5
12
|
/**
|
|
6
13
|
* This function is used to parse the arguments for a Pine params.
|
|
7
14
|
* @param args - The arguments to parse.
|
|
@@ -14,6 +14,7 @@ export declare class ScopeManager {
|
|
|
14
14
|
private tempVarCounter;
|
|
15
15
|
private taCallIdCounter;
|
|
16
16
|
private userCallIdCounter;
|
|
17
|
+
private plotCallIdCounter;
|
|
17
18
|
private hoistingStack;
|
|
18
19
|
private suppressHoisting;
|
|
19
20
|
private reservedNames;
|
|
@@ -22,6 +23,7 @@ export declare class ScopeManager {
|
|
|
22
23
|
get nextCacheIdArg(): any;
|
|
23
24
|
getNextTACallId(): any;
|
|
24
25
|
getNextUserCallId(): any;
|
|
26
|
+
getNextPlotCallId(): any;
|
|
25
27
|
constructor();
|
|
26
28
|
pushScope(type: string): void;
|
|
27
29
|
popScope(): void;
|
|
@@ -48,6 +50,18 @@ export declare class ScopeManager {
|
|
|
48
50
|
enterHoistingScope(): void;
|
|
49
51
|
exitHoistingScope(): any[];
|
|
50
52
|
addHoistedStatement(stmt: any): void;
|
|
53
|
+
/**
|
|
54
|
+
* Hoist a statement to the script body scope (inside the async IIFE).
|
|
55
|
+
* Used for TA built-in variable auto-calls (e.g. ta.obv) that must run
|
|
56
|
+
* every bar, even when referenced inside conditional blocks.
|
|
57
|
+
*
|
|
58
|
+
* hoistingStack layout for PineTS:
|
|
59
|
+
* [0] = Program level (outside IIFE — variables not in scope)
|
|
60
|
+
* [1] = IIFE body level (script's top-level — correct target)
|
|
61
|
+
* [2+] = inner scopes (if-blocks, loops, etc.)
|
|
62
|
+
*/
|
|
63
|
+
addOuterHoistedStatement(stmt: any): void;
|
|
64
|
+
getCurrentHoistingScope(): any[] | null;
|
|
51
65
|
setSuppressHoisting(suppress: boolean): void;
|
|
52
66
|
shouldSuppressHoisting(): boolean;
|
|
53
67
|
hasVariableInScope(name: string): boolean;
|
|
@@ -48,7 +48,9 @@ export declare class CodeGenerator {
|
|
|
48
48
|
generateArrayExpression(node: any): void;
|
|
49
49
|
generateObjectExpression(node: any): void;
|
|
50
50
|
generateSwitchExpression(node: any): void;
|
|
51
|
+
generateSwitchAsIfElseIIFE(node: any): void;
|
|
51
52
|
generateSwitchAsIfElse(node: any): void;
|
|
53
|
+
generateLoopAsExpression(node: any, loopType: any): void;
|
|
52
54
|
generateSequenceExpression(node: any): void;
|
|
53
55
|
getPrecedence(node: any): 0 | 10 | 1 | 2 | 3 | 4 | 5 | 9 | 12 | 13 | 15 | 20 | 19;
|
|
54
56
|
}
|
|
@@ -10,11 +10,13 @@ export declare class Parser {
|
|
|
10
10
|
match(type: any, value?: any): boolean;
|
|
11
11
|
expect(type: any, value?: any): Token;
|
|
12
12
|
matchEx(type: any, value?: any, allowLineContinuation?: boolean): boolean;
|
|
13
|
+
peekOperatorEx(validOps: string[]): any;
|
|
13
14
|
skipNewlines(allowIndent?: boolean): void;
|
|
14
15
|
parse(): Program;
|
|
15
16
|
parseStatement(handleCommas?: boolean): any;
|
|
16
17
|
isFunctionDeclaration(): boolean;
|
|
17
18
|
parseTypeExpression(): any;
|
|
19
|
+
parseEnumDefinition(): VariableDeclaration;
|
|
18
20
|
parseTypeDefinition(): TypeDefinition;
|
|
19
21
|
parseVarDeclaration(): VariableDeclaration;
|
|
20
22
|
isTypedVarDeclaration(): boolean;
|
|
@@ -45,5 +47,7 @@ export declare class Parser {
|
|
|
45
47
|
parseIfExpression(): any;
|
|
46
48
|
needsIIFE(consequentStmts: any, alternateStmts: any): any;
|
|
47
49
|
parseSwitchExpression(): SwitchExpression;
|
|
50
|
+
parseForExpression(): ForStatement;
|
|
51
|
+
parseWhileExpression(): WhileStatement;
|
|
48
52
|
getBlockValue(statements: any): any;
|
|
49
53
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const KNOWN_NAMESPACES: string[];
|
|
2
2
|
export declare const NAMESPACES_LIKE: string[];
|
|
3
3
|
export declare const ASYNC_METHODS: string[];
|
|
4
|
+
export declare const FACTORY_METHODS: string[];
|
|
4
5
|
export declare const CONTEXT_DATA_VARS: string[];
|
|
5
6
|
export declare const CONTEXT_PINE_VARS: string[];
|
|
6
7
|
export declare const CONTEXT_CORE_VARS: string[];
|