pinets 0.5.0 → 0.7.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 +150 -35
- package/dist/pinets.min.browser.es.js +117 -0
- package/dist/pinets.min.browser.es.js.map +1 -0
- package/dist/pinets.min.browser.js +96 -15
- package/dist/pinets.min.browser.js.map +1 -0
- package/dist/pinets.min.cjs +96 -14
- package/dist/pinets.min.cjs.map +1 -0
- package/dist/pinets.min.es.js +99 -4
- package/dist/pinets.min.es.js.map +1 -0
- package/dist/types/Context.class.d.ts +7 -13
- package/dist/types/PineTS.class.d.ts +2 -0
- package/dist/types/marketData/Binance/BinanceProvider.class.d.ts +2 -1
- package/dist/types/marketData/IProvider.d.ts +43 -0
- package/dist/types/marketData/Mock/MockProvider.class.d.ts +13 -1
- package/dist/types/namespaces/Barstate.d.ts +13 -0
- package/dist/types/namespaces/Core.d.ts +23 -3
- package/dist/types/namespaces/Log.d.ts +10 -0
- package/dist/types/namespaces/Plot.helper.d.ts +16 -0
- package/dist/types/namespaces/Plots.d.ts +16 -0
- package/dist/types/namespaces/Str.d.ts +23 -0
- package/dist/types/namespaces/Timeframe.d.ts +17 -0
- package/dist/types/namespaces/Types.d.ts +86 -0
- package/dist/types/namespaces/array/PineArrayObject.d.ts +102 -1
- package/dist/types/namespaces/array/array.index.d.ts +1 -129
- package/dist/types/namespaces/array/methods/avg.d.ts +2 -1
- package/dist/types/namespaces/array/methods/binary_search.d.ts +2 -0
- package/dist/types/namespaces/array/methods/binary_search_leftmost.d.ts +2 -0
- package/dist/types/namespaces/array/methods/binary_search_rightmost.d.ts +2 -0
- package/dist/types/namespaces/array/methods/covariance.d.ts +2 -1
- package/dist/types/namespaces/array/methods/every.d.ts +1 -1
- package/dist/types/namespaces/array/methods/fill.d.ts +2 -1
- package/dist/types/namespaces/array/methods/join.d.ts +5 -0
- package/dist/types/namespaces/array/methods/median.d.ts +2 -0
- package/dist/types/namespaces/array/methods/mode.d.ts +2 -0
- package/dist/types/namespaces/array/methods/new.d.ts +2 -1
- package/dist/types/namespaces/array/methods/new_float.d.ts +2 -1
- package/dist/types/namespaces/array/methods/new_int.d.ts +2 -1
- package/dist/types/namespaces/array/methods/percentile_linear_interpolation.d.ts +3 -0
- package/dist/types/namespaces/array/methods/percentile_nearest_rank.d.ts +2 -0
- package/dist/types/namespaces/array/methods/percentrank.d.ts +2 -0
- package/dist/types/namespaces/array/methods/push.d.ts +2 -1
- package/dist/types/namespaces/array/methods/range.d.ts +2 -1
- package/dist/types/namespaces/array/methods/set.d.ts +2 -1
- package/dist/types/namespaces/array/methods/some.d.ts +1 -1
- package/dist/types/namespaces/array/methods/sort.d.ts +2 -1
- package/dist/types/namespaces/array/methods/sort_indices.d.ts +2 -1
- package/dist/types/namespaces/array/methods/stdev.d.ts +2 -1
- package/dist/types/namespaces/array/methods/sum.d.ts +2 -1
- package/dist/types/namespaces/array/methods/unshift.d.ts +2 -1
- package/dist/types/namespaces/array/methods/variance.d.ts +2 -1
- package/dist/types/namespaces/array/utils.d.ts +5 -0
- package/dist/types/namespaces/input/methods/any.d.ts +1 -2
- package/dist/types/namespaces/input/methods/bool.d.ts +1 -2
- package/dist/types/namespaces/input/methods/color.d.ts +1 -2
- package/dist/types/namespaces/input/methods/enum.d.ts +1 -2
- package/dist/types/namespaces/input/methods/float.d.ts +1 -2
- package/dist/types/namespaces/input/methods/int.d.ts +1 -2
- package/dist/types/namespaces/input/methods/param.d.ts +1 -1
- package/dist/types/namespaces/input/methods/price.d.ts +1 -2
- package/dist/types/namespaces/input/methods/session.d.ts +1 -2
- package/dist/types/namespaces/input/methods/source.d.ts +1 -2
- package/dist/types/namespaces/input/methods/string.d.ts +1 -2
- package/dist/types/namespaces/input/methods/symbol.d.ts +1 -2
- package/dist/types/namespaces/input/methods/text_area.d.ts +1 -2
- package/dist/types/namespaces/input/methods/time.d.ts +1 -2
- package/dist/types/namespaces/input/methods/timeframe.d.ts +1 -2
- package/dist/types/namespaces/input/types.d.ts +12 -1
- package/dist/types/namespaces/input/utils.d.ts +2 -0
- package/dist/types/namespaces/map/PineMapObject.d.ts +26 -0
- package/dist/types/namespaces/map/map.index.d.ts +7 -0
- package/dist/types/namespaces/map/methods/clear.d.ts +3 -0
- package/dist/types/namespaces/map/methods/contains.d.ts +3 -0
- package/dist/types/namespaces/map/methods/copy.d.ts +3 -0
- package/dist/types/namespaces/map/methods/get.d.ts +3 -0
- package/dist/types/namespaces/map/methods/keys.d.ts +4 -0
- package/dist/types/namespaces/map/methods/new.d.ts +3 -0
- package/dist/types/namespaces/map/methods/param.d.ts +1 -0
- package/dist/types/namespaces/map/methods/put.d.ts +3 -0
- package/dist/types/namespaces/map/methods/put_all.d.ts +3 -0
- package/dist/types/namespaces/map/methods/remove.d.ts +3 -0
- package/dist/types/namespaces/map/methods/size.d.ts +3 -0
- package/dist/types/namespaces/map/methods/values.d.ts +4 -0
- package/dist/types/namespaces/math/math.index.d.ts +18 -0
- package/dist/types/namespaces/math/methods/abs.d.ts +2 -1
- package/dist/types/namespaces/math/methods/e.d.ts +5 -0
- package/dist/types/namespaces/math/methods/phi.d.ts +5 -0
- package/dist/types/namespaces/math/methods/pi.d.ts +5 -0
- package/dist/types/namespaces/math/methods/round_to_mintick.d.ts +2 -0
- package/dist/types/namespaces/math/methods/rphi.d.ts +5 -0
- package/dist/types/namespaces/math/methods/sign.d.ts +2 -0
- package/dist/types/namespaces/matrix/PineMatrixObject.d.ts +102 -0
- package/dist/types/namespaces/matrix/matrix.index.d.ts +7 -0
- package/dist/types/namespaces/matrix/methods/add_col.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/add_row.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/avg.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/col.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/columns.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/concat.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/copy.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/det.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/diff.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/eigenvalues.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/eigenvectors.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/elements_count.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/fill.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/get.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/inv.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_antidiagonal.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_antisymmetric.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_binary.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_diagonal.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_identity.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_square.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_stochastic.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_symmetric.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_triangular.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/is_zero.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/kron.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/max.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/median.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/min.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/mode.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/mult.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/new.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/param.d.ts +1 -0
- package/dist/types/namespaces/matrix/methods/pinv.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/pow.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/rank.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/remove_col.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/remove_row.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/reshape.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/reverse.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/row.d.ts +4 -0
- package/dist/types/namespaces/matrix/methods/rows.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/set.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/sort.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/submatrix.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/sum.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/swap_columns.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/swap_rows.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/trace.d.ts +3 -0
- package/dist/types/namespaces/matrix/methods/transpose.d.ts +3 -0
- package/dist/types/namespaces/request/methods/security_lower_tf.d.ts +9 -0
- package/dist/types/namespaces/request/request.index.d.ts +3 -0
- package/dist/types/namespaces/ta/methods/atr.d.ts +2 -1
- package/dist/types/namespaces/ta/methods/pivothigh.d.ts +1 -1
- package/dist/types/namespaces/ta/methods/pivotlow.d.ts +1 -1
- package/dist/types/namespaces/ta/methods/tr.d.ts +2 -1
- package/dist/types/namespaces/utils.d.ts +12 -0
- package/dist/types/transpiler/index.d.ts +1 -1
- package/dist/types/transpiler/pineToJS/ast.d.ts +167 -0
- package/dist/types/transpiler/pineToJS/codegen.d.ts +53 -0
- package/dist/types/transpiler/pineToJS/lexer.d.ts +31 -0
- package/dist/types/transpiler/pineToJS/parser.d.ts +45 -0
- package/dist/types/transpiler/pineToJS/pineToJS.index.d.ts +32 -0
- package/dist/types/transpiler/pineToJS/tokens.d.ts +34 -0
- package/dist/types/transpiler/settings.d.ts +6 -0
- package/dist/types/transpiler/transformers/WrapperTransformer.d.ts +5 -3
- package/dist/types/transpiler/utils/ASTFactory.d.ts +1 -0
- package/dist/types/types/PineTypes.d.ts +30 -15
- package/package.json +27 -6
- package/dist/pinets.dev.browser.js +0 -13887
- package/dist/pinets.dev.cjs +0 -14024
- package/dist/pinets.dev.cjs.map +0 -1
- package/dist/pinets.dev.es.js +0 -6375
- package/dist/pinets.dev.es.js.map +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const KNOWN_NAMESPACES: string[];
|
|
2
|
+
export declare const NAMESPACES_LIKE: string[];
|
|
3
|
+
export declare const ASYNC_METHODS: string[];
|
|
4
|
+
export declare const CONTEXT_DATA_VARS: string[];
|
|
5
|
+
export declare const CONTEXT_PINE_VARS: string[];
|
|
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
|
|
4
|
-
*
|
|
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;
|
|
@@ -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,19 +32,32 @@ type PlotOptions = {
|
|
|
30
32
|
force_overlay?: boolean;
|
|
31
33
|
};
|
|
32
34
|
type IndicatorOptions = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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;
|
|
52
|
+
};
|
|
53
|
+
type TSessionInfo = {
|
|
54
|
+
isfirstbar: boolean;
|
|
55
|
+
isfirstbar_regular: boolean;
|
|
56
|
+
islastbar: boolean;
|
|
57
|
+
islastbar_regular: boolean;
|
|
58
|
+
ismarket: boolean;
|
|
59
|
+
ispostmarket: boolean;
|
|
60
|
+
ispremarket: boolean;
|
|
61
|
+
extended: boolean;
|
|
62
|
+
regular: boolean;
|
|
48
63
|
};
|
package/package.json
CHANGED
|
@@ -1,30 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pinets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "dist/pinets.
|
|
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": {
|
|
12
29
|
"test": "cross-env TEST_ENV=true vitest --reporter verbose",
|
|
13
30
|
"test:coverage": "cross-env TEST_ENV=true vitest run --coverage",
|
|
14
31
|
"test:coverage:badge": "cross-env TEST_ENV=true vitest run --coverage --exclude tests/_local/**",
|
|
15
|
-
"
|
|
32
|
+
"generate:badges": "npm run test:coverage:badge && node scripts/generate-badges.js",
|
|
16
33
|
"generate:ta-index": "node scripts/generate-ta-index.js",
|
|
17
34
|
"generate:math-index": "node scripts/generate-math-index.js",
|
|
18
35
|
"generate:array-index": "node scripts/generate-array-index.js",
|
|
19
36
|
"generate:input-index": "node scripts/generate-input-index.js",
|
|
20
37
|
"generate:request-index": "node scripts/generate-request-index.js",
|
|
21
|
-
"
|
|
38
|
+
"generate:map-index": "node scripts/generate-map-index.js",
|
|
39
|
+
"generate:matrix-index": "node scripts/generate-matrix-index.js",
|
|
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",
|
|
22
41
|
"build:dev:cjs": "cross-env BUILD=dev FORMAT=cjs rollup -c ./rollup.config.js",
|
|
23
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",
|
|
24
44
|
"build:dev:es": "cross-env BUILD=dev rollup -c ./rollup.config.js",
|
|
25
|
-
"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 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",
|
|
26
46
|
"build:prod:cjs": "cross-env BUILD=prod FORMAT=cjs rollup -c ./rollup.config.js",
|
|
27
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",
|
|
28
49
|
"build:prod:es": "cross-env BUILD=prod rollup -c ./rollup.config.js",
|
|
29
50
|
"knip": "knip"
|
|
30
51
|
},
|