pinets 0.2.1 → 0.5.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.
Files changed (189) hide show
  1. package/README.md +38 -18
  2. package/dist/pinets.dev.browser.js +6029 -2997
  3. package/dist/pinets.dev.cjs +5982 -2783
  4. package/dist/pinets.dev.cjs.map +1 -1
  5. package/dist/pinets.dev.es.js +5368 -2186
  6. package/dist/pinets.dev.es.js.map +1 -1
  7. package/dist/pinets.min.browser.js +15 -12
  8. package/dist/pinets.min.cjs +15 -12
  9. package/dist/pinets.min.es.js +5 -2
  10. package/dist/types/Context.class.d.ts +73 -16
  11. package/dist/types/PineTS.class.d.ts +89 -5
  12. package/dist/types/Series.d.ts +10 -0
  13. package/dist/types/TimeSeries.class.d.ts +49 -0
  14. package/dist/types/TimeSeries.d.ts +15 -0
  15. package/dist/types/marketData/Mock/MockProvider.class.d.ts +77 -0
  16. package/dist/types/marketData/Provider.class.d.ts +6 -3
  17. package/dist/types/namespaces/Core.d.ts +1 -0
  18. package/dist/types/namespaces/array/PineArrayObject.d.ts +5 -0
  19. package/dist/types/namespaces/array/array.index.d.ts +135 -0
  20. package/dist/types/namespaces/array/methods/abs.d.ts +2 -0
  21. package/dist/types/namespaces/array/methods/avg.d.ts +2 -0
  22. package/dist/types/namespaces/array/methods/clear.d.ts +2 -0
  23. package/dist/types/namespaces/array/methods/concat.d.ts +2 -0
  24. package/dist/types/namespaces/array/methods/copy.d.ts +2 -0
  25. package/dist/types/namespaces/array/methods/covariance.d.ts +2 -0
  26. package/dist/types/namespaces/array/methods/every.d.ts +2 -0
  27. package/dist/types/namespaces/array/methods/fill.d.ts +2 -0
  28. package/dist/types/namespaces/array/methods/first.d.ts +2 -0
  29. package/dist/types/namespaces/array/methods/from.d.ts +2 -0
  30. package/dist/types/namespaces/array/methods/get.d.ts +2 -0
  31. package/dist/types/namespaces/array/methods/includes.d.ts +2 -0
  32. package/dist/types/namespaces/array/methods/indexof.d.ts +2 -0
  33. package/dist/types/namespaces/array/methods/insert.d.ts +2 -0
  34. package/dist/types/namespaces/array/methods/join.d.ts +2 -0
  35. package/dist/types/namespaces/array/methods/last.d.ts +2 -0
  36. package/dist/types/namespaces/array/methods/lastindexof.d.ts +2 -0
  37. package/dist/types/namespaces/array/methods/max.d.ts +2 -0
  38. package/dist/types/namespaces/array/methods/min.d.ts +2 -0
  39. package/dist/types/namespaces/array/methods/new.d.ts +2 -0
  40. package/dist/types/namespaces/array/methods/new_bool.d.ts +2 -0
  41. package/dist/types/namespaces/array/methods/new_float.d.ts +2 -0
  42. package/dist/types/namespaces/array/methods/new_int.d.ts +2 -0
  43. package/dist/types/namespaces/array/methods/new_string.d.ts +2 -0
  44. package/dist/types/namespaces/array/methods/param.d.ts +1 -0
  45. package/dist/types/namespaces/array/methods/pop.d.ts +2 -0
  46. package/dist/types/namespaces/array/methods/push.d.ts +2 -0
  47. package/dist/types/namespaces/array/methods/range.d.ts +2 -0
  48. package/dist/types/namespaces/array/methods/remove.d.ts +2 -0
  49. package/dist/types/namespaces/array/methods/reverse.d.ts +2 -0
  50. package/dist/types/namespaces/array/methods/set.d.ts +2 -0
  51. package/dist/types/namespaces/array/methods/shift.d.ts +2 -0
  52. package/dist/types/namespaces/array/methods/size.d.ts +2 -0
  53. package/dist/types/namespaces/array/methods/slice.d.ts +2 -0
  54. package/dist/types/namespaces/array/methods/some.d.ts +2 -0
  55. package/dist/types/namespaces/array/methods/sort.d.ts +2 -0
  56. package/dist/types/namespaces/array/methods/sort_indices.d.ts +2 -0
  57. package/dist/types/namespaces/array/methods/standardize.d.ts +2 -0
  58. package/dist/types/namespaces/array/methods/stdev.d.ts +2 -0
  59. package/dist/types/namespaces/array/methods/sum.d.ts +2 -0
  60. package/dist/types/namespaces/array/methods/unshift.d.ts +2 -0
  61. package/dist/types/namespaces/array/methods/variance.d.ts +2 -0
  62. package/dist/types/namespaces/input/input.index.d.ts +53 -0
  63. package/dist/types/namespaces/input/methods/any.d.ts +2 -0
  64. package/dist/types/namespaces/input/methods/bool.d.ts +2 -0
  65. package/dist/types/namespaces/input/methods/color.d.ts +2 -0
  66. package/dist/types/namespaces/input/methods/enum.d.ts +2 -0
  67. package/dist/types/namespaces/input/methods/float.d.ts +2 -0
  68. package/dist/types/namespaces/input/methods/int.d.ts +2 -0
  69. package/dist/types/namespaces/input/methods/param.d.ts +1 -0
  70. package/dist/types/namespaces/input/methods/price.d.ts +2 -0
  71. package/dist/types/namespaces/input/methods/session.d.ts +2 -0
  72. package/dist/types/namespaces/input/methods/source.d.ts +2 -0
  73. package/dist/types/namespaces/input/methods/string.d.ts +2 -0
  74. package/dist/types/namespaces/input/methods/symbol.d.ts +2 -0
  75. package/dist/types/namespaces/input/methods/text_area.d.ts +2 -0
  76. package/dist/types/namespaces/input/methods/time.d.ts +2 -0
  77. package/dist/types/namespaces/input/methods/timeframe.d.ts +2 -0
  78. package/dist/types/namespaces/input/types.d.ts +4 -0
  79. package/dist/types/namespaces/math/math.index.d.ts +77 -0
  80. package/dist/types/namespaces/math/methods/__eq.d.ts +1 -0
  81. package/dist/types/namespaces/math/methods/abs.d.ts +1 -0
  82. package/dist/types/namespaces/math/methods/acos.d.ts +1 -0
  83. package/dist/types/namespaces/math/methods/asin.d.ts +1 -0
  84. package/dist/types/namespaces/math/methods/atan.d.ts +1 -0
  85. package/dist/types/namespaces/math/methods/avg.d.ts +1 -0
  86. package/dist/types/namespaces/math/methods/ceil.d.ts +1 -0
  87. package/dist/types/namespaces/math/methods/cos.d.ts +1 -0
  88. package/dist/types/namespaces/math/methods/exp.d.ts +1 -0
  89. package/dist/types/namespaces/math/methods/floor.d.ts +1 -0
  90. package/dist/types/namespaces/math/methods/ln.d.ts +1 -0
  91. package/dist/types/namespaces/math/methods/log.d.ts +1 -0
  92. package/dist/types/namespaces/math/methods/log10.d.ts +1 -0
  93. package/dist/types/namespaces/math/methods/max.d.ts +1 -0
  94. package/dist/types/namespaces/math/methods/min.d.ts +1 -0
  95. package/dist/types/namespaces/math/methods/param.d.ts +1 -0
  96. package/dist/types/namespaces/math/methods/pow.d.ts +1 -0
  97. package/dist/types/namespaces/math/methods/random.d.ts +1 -0
  98. package/dist/types/namespaces/math/methods/round.d.ts +1 -0
  99. package/dist/types/namespaces/math/methods/sin.d.ts +1 -0
  100. package/dist/types/namespaces/math/methods/sqrt.d.ts +1 -0
  101. package/dist/types/namespaces/math/methods/sum.d.ts +1 -0
  102. package/dist/types/namespaces/math/methods/tan.d.ts +1 -0
  103. package/dist/types/namespaces/request/methods/param.d.ts +1 -0
  104. package/dist/types/namespaces/request/methods/security.d.ts +1 -0
  105. package/dist/types/namespaces/request/request.index.d.ts +14 -0
  106. package/dist/types/namespaces/request/types/barmerge.type.d.ts +7 -0
  107. package/dist/types/namespaces/request/utils/TIMEFRAMES.d.ts +1 -0
  108. package/dist/types/namespaces/request/utils/findLTFContextIdx.d.ts +1 -0
  109. package/dist/types/namespaces/request/utils/findSecContextIdx.d.ts +1 -0
  110. package/dist/types/namespaces/ta/getters/obv.d.ts +12 -0
  111. package/dist/types/namespaces/ta/getters/tr.d.ts +1 -0
  112. package/dist/types/namespaces/ta/methods/accdist.d.ts +7 -0
  113. package/dist/types/namespaces/ta/methods/alma.d.ts +18 -0
  114. package/dist/types/namespaces/ta/methods/atr.d.ts +1 -0
  115. package/dist/types/namespaces/ta/methods/barssince.d.ts +6 -0
  116. package/dist/types/namespaces/ta/methods/bb.d.ts +17 -0
  117. package/dist/types/namespaces/ta/methods/bbw.d.ts +9 -0
  118. package/dist/types/namespaces/ta/methods/cci.d.ts +20 -0
  119. package/dist/types/namespaces/ta/methods/change.d.ts +1 -0
  120. package/dist/types/namespaces/ta/methods/cmo.d.ts +17 -0
  121. package/dist/types/namespaces/ta/methods/cog.d.ts +18 -0
  122. package/dist/types/namespaces/ta/methods/correlation.d.ts +7 -0
  123. package/dist/types/namespaces/ta/methods/cross.d.ts +15 -0
  124. package/dist/types/namespaces/ta/methods/crossover.d.ts +1 -0
  125. package/dist/types/namespaces/ta/methods/crossunder.d.ts +1 -0
  126. package/dist/types/namespaces/ta/methods/cum.d.ts +14 -0
  127. package/dist/types/namespaces/ta/methods/dev.d.ts +1 -0
  128. package/dist/types/namespaces/ta/methods/dmi.d.ts +24 -0
  129. package/dist/types/namespaces/ta/methods/ema.d.ts +1 -0
  130. package/dist/types/namespaces/ta/methods/falling.d.ts +15 -0
  131. package/dist/types/namespaces/ta/methods/highest.d.ts +1 -0
  132. package/dist/types/namespaces/ta/methods/highestbars.d.ts +7 -0
  133. package/dist/types/namespaces/ta/methods/hma.d.ts +1 -0
  134. package/dist/types/namespaces/ta/methods/iii.d.ts +7 -0
  135. package/dist/types/namespaces/ta/methods/kc.d.ts +12 -0
  136. package/dist/types/namespaces/ta/methods/kcw.d.ts +11 -0
  137. package/dist/types/namespaces/ta/methods/linreg.d.ts +1 -0
  138. package/dist/types/namespaces/ta/methods/lowest.d.ts +1 -0
  139. package/dist/types/namespaces/ta/methods/lowestbars.d.ts +7 -0
  140. package/dist/types/namespaces/ta/methods/macd.d.ts +18 -0
  141. package/dist/types/namespaces/ta/methods/median.d.ts +1 -0
  142. package/dist/types/namespaces/ta/methods/mfi.d.ts +15 -0
  143. package/dist/types/namespaces/ta/methods/mode.d.ts +6 -0
  144. package/dist/types/namespaces/ta/methods/mom.d.ts +1 -0
  145. package/dist/types/namespaces/ta/methods/nvi.d.ts +10 -0
  146. package/dist/types/namespaces/ta/methods/obv.d.ts +12 -0
  147. package/dist/types/namespaces/ta/methods/param.d.ts +2 -0
  148. package/dist/types/namespaces/ta/methods/percentile_linear_interpolation.d.ts +6 -0
  149. package/dist/types/namespaces/ta/methods/percentile_nearest_rank.d.ts +7 -0
  150. package/dist/types/namespaces/ta/methods/percentrank.d.ts +6 -0
  151. package/dist/types/namespaces/ta/methods/pivothigh.d.ts +1 -0
  152. package/dist/types/namespaces/ta/methods/pivotlow.d.ts +1 -0
  153. package/dist/types/namespaces/ta/methods/pvi.d.ts +10 -0
  154. package/dist/types/namespaces/ta/methods/pvt.d.ts +12 -0
  155. package/dist/types/namespaces/ta/methods/range.d.ts +7 -0
  156. package/dist/types/namespaces/ta/methods/rising.d.ts +15 -0
  157. package/dist/types/namespaces/ta/methods/rma.d.ts +1 -0
  158. package/dist/types/namespaces/ta/methods/roc.d.ts +1 -0
  159. package/dist/types/namespaces/ta/methods/rsi.d.ts +1 -0
  160. package/dist/types/namespaces/ta/methods/sar.d.ts +12 -0
  161. package/dist/types/namespaces/ta/methods/sma.d.ts +1 -0
  162. package/dist/types/namespaces/ta/methods/stdev.d.ts +1 -0
  163. package/dist/types/namespaces/ta/methods/stoch.d.ts +21 -0
  164. package/dist/types/namespaces/ta/methods/supertrend.d.ts +24 -0
  165. package/dist/types/namespaces/ta/methods/swma.d.ts +14 -0
  166. package/dist/types/namespaces/ta/methods/tr.d.ts +1 -0
  167. package/dist/types/namespaces/ta/methods/tsi.d.ts +17 -0
  168. package/dist/types/namespaces/ta/methods/valuewhen.d.ts +6 -0
  169. package/dist/types/namespaces/ta/methods/variance.d.ts +1 -0
  170. package/dist/types/namespaces/ta/methods/vwap.d.ts +14 -0
  171. package/dist/types/namespaces/ta/methods/vwma.d.ts +1 -0
  172. package/dist/types/namespaces/ta/methods/wad.d.ts +11 -0
  173. package/dist/types/namespaces/ta/methods/wma.d.ts +1 -0
  174. package/dist/types/namespaces/ta/methods/wpr.d.ts +17 -0
  175. package/dist/types/namespaces/ta/methods/wvad.d.ts +7 -0
  176. package/dist/types/namespaces/ta/ta.index.d.ts +199 -0
  177. package/dist/types/namespaces/ta/utils/pivothigh.d.ts +1 -0
  178. package/dist/types/namespaces/ta/utils/pivotlow.d.ts +1 -0
  179. package/dist/types/transpiler/analysis/AnalysisPass.d.ts +5 -0
  180. package/dist/types/transpiler/analysis/ScopeManager.d.ts +47 -0
  181. package/dist/types/transpiler/index.d.ts +4 -1
  182. package/dist/types/transpiler/transformers/ExpressionTransformer.d.ts +7 -0
  183. package/dist/types/transpiler/transformers/InjectionTransformer.d.ts +6 -0
  184. package/dist/types/transpiler/transformers/MainTransformer.d.ts +6 -0
  185. package/dist/types/transpiler/transformers/NormalizationTransformer.d.ts +15 -0
  186. package/dist/types/transpiler/transformers/StatementTransformer.d.ts +9 -0
  187. package/dist/types/transpiler/transformers/WrapperTransformer.d.ts +9 -0
  188. package/dist/types/transpiler/utils/ASTFactory.d.ts +20 -0
  189. package/package.json +12 -3
@@ -0,0 +1,10 @@
1
+ export declare class Series {
2
+ data: any[];
3
+ offset: number;
4
+ constructor(data: any[], offset?: number);
5
+ get(index: number): any;
6
+ set(index: number, value: any): void;
7
+ get length(): number;
8
+ toArray(): any[];
9
+ static from(source: any): Series;
10
+ }
@@ -0,0 +1,49 @@
1
+ import Context from '../Context.class';
2
+ /**
3
+ * A lightweight wrapper around arrays to provide Pine Script-like "series" access behavior.
4
+ * Pine Script series are indexed relative to the current bar:
5
+ * - series[0] is the current value
6
+ * - series[1] is the previous value
7
+ *
8
+ * This class maps this reversed, relative indexing to the underlying chronological array
9
+ * using the Context's current index.
10
+ */
11
+ export declare class TimeSeries<T = any> {
12
+ private readonly _data;
13
+ private readonly _ctx;
14
+ constructor(_data: T[], _ctx: Context);
15
+ /**
16
+ * Get the value at the specified offset from the current bar.
17
+ * @param offset The lookback offset (0 = current, 1 = previous, etc.)
18
+ */
19
+ get(offset: number): T;
20
+ /**
21
+ * Set the value at the specified offset from the current bar.
22
+ * Usually used for setting current value (offset 0).
23
+ */
24
+ set(offset: number, value: T): T;
25
+ /**
26
+ * Get the length of the series *so far* (up to current index)
27
+ * Note: This mimics the behavior where future data isn't "visible" yet
28
+ */
29
+ get length(): number;
30
+ /**
31
+ * Returns the underlying raw data array.
32
+ * Useful for performance-critical bulk operations that understand the indexing.
33
+ */
34
+ get data(): T[];
35
+ /**
36
+ * Creates a copy of the visible series as a reversed array (Pine Script standard format for bulk ops).
37
+ * Warning: This is O(N) and should be used sparingly.
38
+ */
39
+ toArray(): T[];
40
+ /**
41
+ * Push a value to the underlying array.
42
+ * Used when constructing user-defined series dynamically.
43
+ */
44
+ push(value: T): number;
45
+ /**
46
+ * Update the underlying array reference (e.g. for re-assignment)
47
+ */
48
+ replaceData(newData: T[]): void;
49
+ }
@@ -0,0 +1,15 @@
1
+ export interface IContext {
2
+ idx: number;
3
+ NA: any;
4
+ }
5
+ export declare class TimeSeries<T = any> {
6
+ private _data;
7
+ private context;
8
+ constructor(context: IContext, data?: T[]);
9
+ get(offset: number): T;
10
+ set(value: T, offset?: number): void;
11
+ push(value: T): void;
12
+ pop(): T | undefined;
13
+ get data(): T[];
14
+ get length(): number;
15
+ }
@@ -0,0 +1,77 @@
1
+ import { IProvider } from '@pinets/marketData/IProvider';
2
+ interface Kline {
3
+ openTime: number;
4
+ open: number;
5
+ high: number;
6
+ low: number;
7
+ close: number;
8
+ volume: number;
9
+ closeTime: number;
10
+ quoteAssetVolume: number;
11
+ numberOfTrades: number;
12
+ takerBuyBaseAssetVolume: number;
13
+ takerBuyQuoteAssetVolume: number;
14
+ ignore: number | string;
15
+ }
16
+ /**
17
+ * Mock Market Data Provider for Unit Tests
18
+ *
19
+ * This provider reads market data from pre-fetched JSON files instead of making API calls.
20
+ * It's designed to be used in unit tests to provide consistent, offline test data.
21
+ *
22
+ * Usage:
23
+ * ```typescript
24
+ * const mockProvider = new MockProvider();
25
+ * const data = await mockProvider.getMarketData('BTCUSDC', '1h', 100, startTime, endTime);
26
+ * ```
27
+ *
28
+ * The provider looks for JSON files in the tests/compatibility/_data directory
29
+ * with the naming pattern: {SYMBOL}-{TIMEFRAME}-{START_TIME}-{END_TIME}.json
30
+ *
31
+ * Example: BTCUSDC-1h-1704067200000-1763683199000.json
32
+ */
33
+ export declare class MockProvider implements IProvider {
34
+ private dataCache;
35
+ private readonly dataDirectory;
36
+ constructor(dataDirectory?: string);
37
+ /**
38
+ * Generates a cache key for the data file
39
+ */
40
+ private getDataFileName;
41
+ /**
42
+ * Loads data from JSON file
43
+ */
44
+ private loadDataFromFile;
45
+ /**
46
+ * Finds the best matching data file for the given parameters
47
+ */
48
+ private findDataFile;
49
+ /**
50
+ * Filters data based on date range and limit
51
+ */
52
+ private filterData;
53
+ /**
54
+ * Normalizes timeframe to match file naming convention
55
+ */
56
+ private normalizeTimeframe;
57
+ /**
58
+ * Implements IProvider.getMarketData
59
+ *
60
+ * @param tickerId - Symbol (e.g., 'BTCUSDC')
61
+ * @param timeframe - Timeframe (e.g., '1h', '60', 'D')
62
+ * @param limit - Optional limit on number of candles to return
63
+ * @param sDate - Optional start date (timestamp in milliseconds)
64
+ * @param eDate - Optional end date (timestamp in milliseconds)
65
+ * @returns Promise<Kline[]> - Array of candle data
66
+ */
67
+ getMarketData(tickerId: string, timeframe: string, limit?: number, sDate?: number, eDate?: number): Promise<Kline[]>;
68
+ /**
69
+ * Clears the data cache
70
+ */
71
+ clearCache(): void;
72
+ /**
73
+ * Sets a custom data directory
74
+ */
75
+ setDataDirectory(directory: string): void;
76
+ }
77
+ export {};
@@ -1,4 +1,7 @@
1
- import { BinanceProvider } from './Binance/BinanceProvider.class';
2
- export declare const Provider: {
3
- Binance: BinanceProvider;
1
+ import { IProvider } from './IProvider';
2
+ type TProvider = {
3
+ [key: string]: IProvider;
4
4
  };
5
+ export declare const Provider: TProvider;
6
+ export declare function registerProvider(name: string, provider: IProvider): void;
7
+ export {};
@@ -18,6 +18,7 @@ export declare class Core {
18
18
  indicator(title: string, shorttitle?: string, options?: IndicatorOptions): void;
19
19
  plotchar(series: number[], title: string, options: PlotCharOptions): void;
20
20
  plot(series: any, title: string, options: PlotOptions): void;
21
+ get bar_index(): any;
21
22
  na(series: any): boolean;
22
23
  nz(series: any, replacement?: number): any;
23
24
  }
@@ -0,0 +1,5 @@
1
+ export declare class PineArrayObject {
2
+ array: any;
3
+ constructor(array: any);
4
+ toString(): string;
5
+ }
@@ -0,0 +1,135 @@
1
+ export { PineArrayObject } from './PineArrayObject';
2
+ import { abs } from './methods/abs';
3
+ import { avg } from './methods/avg';
4
+ import { clear } from './methods/clear';
5
+ import { concat } from './methods/concat';
6
+ import { copy } from './methods/copy';
7
+ import { covariance } from './methods/covariance';
8
+ import { every } from './methods/every';
9
+ import { fill } from './methods/fill';
10
+ import { first } from './methods/first';
11
+ import { from } from './methods/from';
12
+ import { get } from './methods/get';
13
+ import { includes } from './methods/includes';
14
+ import { indexof } from './methods/indexof';
15
+ import { insert } from './methods/insert';
16
+ import { join } from './methods/join';
17
+ import { last } from './methods/last';
18
+ import { lastindexof } from './methods/lastindexof';
19
+ import { max } from './methods/max';
20
+ import { min } from './methods/min';
21
+ import { new_fn } from './methods/new';
22
+ import { new_bool } from './methods/new_bool';
23
+ import { new_float } from './methods/new_float';
24
+ import { new_int } from './methods/new_int';
25
+ import { new_string } from './methods/new_string';
26
+ import { param } from './methods/param';
27
+ import { pop } from './methods/pop';
28
+ import { push } from './methods/push';
29
+ import { range } from './methods/range';
30
+ import { remove } from './methods/remove';
31
+ import { reverse } from './methods/reverse';
32
+ import { set } from './methods/set';
33
+ import { shift } from './methods/shift';
34
+ import { size } from './methods/size';
35
+ import { slice } from './methods/slice';
36
+ import { some } from './methods/some';
37
+ import { sort } from './methods/sort';
38
+ import { sort_indices } from './methods/sort_indices';
39
+ import { standardize } from './methods/standardize';
40
+ import { stdev } from './methods/stdev';
41
+ import { sum } from './methods/sum';
42
+ import { unshift } from './methods/unshift';
43
+ import { variance } from './methods/variance';
44
+ declare const methods: {
45
+ abs: typeof abs;
46
+ avg: typeof avg;
47
+ clear: typeof clear;
48
+ concat: typeof concat;
49
+ copy: typeof copy;
50
+ covariance: typeof covariance;
51
+ every: typeof every;
52
+ fill: typeof fill;
53
+ first: typeof first;
54
+ from: typeof from;
55
+ get: typeof get;
56
+ includes: typeof includes;
57
+ indexof: typeof indexof;
58
+ insert: typeof insert;
59
+ join: typeof join;
60
+ last: typeof last;
61
+ lastindexof: typeof lastindexof;
62
+ max: typeof max;
63
+ min: typeof min;
64
+ new: typeof new_fn;
65
+ new_bool: typeof new_bool;
66
+ new_float: typeof new_float;
67
+ new_int: typeof new_int;
68
+ new_string: typeof new_string;
69
+ param: typeof param;
70
+ pop: typeof pop;
71
+ push: typeof push;
72
+ range: typeof range;
73
+ remove: typeof remove;
74
+ reverse: typeof reverse;
75
+ set: typeof set;
76
+ shift: typeof shift;
77
+ size: typeof size;
78
+ slice: typeof slice;
79
+ some: typeof some;
80
+ sort: typeof sort;
81
+ sort_indices: typeof sort_indices;
82
+ standardize: typeof standardize;
83
+ stdev: typeof stdev;
84
+ sum: typeof sum;
85
+ unshift: typeof unshift;
86
+ variance: typeof variance;
87
+ };
88
+ export declare class PineArray {
89
+ private context;
90
+ private _cache;
91
+ abs: ReturnType<typeof methods.abs>;
92
+ avg: ReturnType<typeof methods.avg>;
93
+ clear: ReturnType<typeof methods.clear>;
94
+ concat: ReturnType<typeof methods.concat>;
95
+ copy: ReturnType<typeof methods.copy>;
96
+ covariance: ReturnType<typeof methods.covariance>;
97
+ every: ReturnType<typeof methods.every>;
98
+ fill: ReturnType<typeof methods.fill>;
99
+ first: ReturnType<typeof methods.first>;
100
+ from: ReturnType<typeof methods.from>;
101
+ get: ReturnType<typeof methods.get>;
102
+ includes: ReturnType<typeof methods.includes>;
103
+ indexof: ReturnType<typeof methods.indexof>;
104
+ insert: ReturnType<typeof methods.insert>;
105
+ join: ReturnType<typeof methods.join>;
106
+ last: ReturnType<typeof methods.last>;
107
+ lastindexof: ReturnType<typeof methods.lastindexof>;
108
+ max: ReturnType<typeof methods.max>;
109
+ min: ReturnType<typeof methods.min>;
110
+ new: ReturnType<typeof methods.new>;
111
+ new_bool: ReturnType<typeof methods.new_bool>;
112
+ new_float: ReturnType<typeof methods.new_float>;
113
+ new_int: ReturnType<typeof methods.new_int>;
114
+ new_string: ReturnType<typeof methods.new_string>;
115
+ param: ReturnType<typeof methods.param>;
116
+ pop: ReturnType<typeof methods.pop>;
117
+ push: ReturnType<typeof methods.push>;
118
+ range: ReturnType<typeof methods.range>;
119
+ remove: ReturnType<typeof methods.remove>;
120
+ reverse: ReturnType<typeof methods.reverse>;
121
+ set: ReturnType<typeof methods.set>;
122
+ shift: ReturnType<typeof methods.shift>;
123
+ size: ReturnType<typeof methods.size>;
124
+ slice: ReturnType<typeof methods.slice>;
125
+ some: ReturnType<typeof methods.some>;
126
+ sort: ReturnType<typeof methods.sort>;
127
+ sort_indices: ReturnType<typeof methods.sort_indices>;
128
+ standardize: ReturnType<typeof methods.standardize>;
129
+ stdev: ReturnType<typeof methods.stdev>;
130
+ sum: ReturnType<typeof methods.sum>;
131
+ unshift: ReturnType<typeof methods.unshift>;
132
+ variance: ReturnType<typeof methods.variance>;
133
+ constructor(context: any);
134
+ }
135
+ export default PineArray;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function abs(context: any): (id: PineArrayObject) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function avg(context: any): (id: PineArrayObject) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function clear(context: any): (id: PineArrayObject) => void;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function concat(context: any): (id: PineArrayObject, other: PineArrayObject) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function copy(context: any): (id: PineArrayObject) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function covariance(context: any): (arr1: PineArrayObject, arr2: PineArrayObject, biased?: boolean) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function every(context: any): (id: PineArrayObject, callback: (val: any) => boolean) => boolean;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function fill(context: any): (id: PineArrayObject, value: any, start?: number, end?: number) => void;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function first(context: any): (id: PineArrayObject) => any;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function from(context: any): (...values: any[]) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function get(context: any): (id: PineArrayObject, index: number) => any;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function includes(context: any): (id: PineArrayObject, value: any) => boolean;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function indexof(context: any): (id: PineArrayObject, value: any) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function insert(context: any): (id: PineArrayObject, index: number, value: any) => void;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function join(context: any): (id: PineArrayObject, separator?: string) => string;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function last(context: any): (id: PineArrayObject) => any;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function lastindexof(context: any): (id: PineArrayObject, value: any) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function max(context: any): (id: PineArrayObject, nth?: number) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function min(context: any): (id: PineArrayObject, nth?: number) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function new_fn(context: any): <T>(size: number, initial_value: T) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function new_bool(context: any): (size: number, initial_value?: boolean) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function new_float(context: any): (size: number, initial_value?: number) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function new_int(context: any): (size: number, initial_value?: number) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function new_string(context: any): (size: number, initial_value?: string) => PineArrayObject;
@@ -0,0 +1 @@
1
+ export declare function param(context: any): (source: any, index?: number) => any;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function pop(context: any): (id: PineArrayObject) => any;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function push(context: any): (id: PineArrayObject, value: any) => void;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function range(context: any): (id: PineArrayObject) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function remove(context: any): (id: PineArrayObject, index: number) => any;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function reverse(context: any): (id: PineArrayObject) => void;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function set(context: any): (id: PineArrayObject, index: number, value: any) => void;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function shift(context: any): (id: PineArrayObject) => any;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function size(context: any): (id: PineArrayObject) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function slice(context: any): (id: PineArrayObject, start: number, end?: number) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function some(context: any): (id: PineArrayObject, callback: (val: any) => boolean) => boolean;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function sort(context: any): (id: PineArrayObject, order?: "asc" | "desc") => void;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function sort_indices(context: any): (id: PineArrayObject, comparator?: (a: any, b: any) => number) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function standardize(context: any): (id: PineArrayObject) => PineArrayObject;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function stdev(context: any): (id: PineArrayObject, biased?: boolean) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function sum(context: any): (id: PineArrayObject) => number;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function unshift(context: any): (id: PineArrayObject, value: any) => void;
@@ -0,0 +1,2 @@
1
+ import { PineArrayObject } from '../PineArrayObject';
2
+ export declare function variance(context: any): (id: PineArrayObject, biased?: boolean) => number;
@@ -0,0 +1,53 @@
1
+ export type { InputOptions } from './types';
2
+ import { any } from './methods/any';
3
+ import { bool } from './methods/bool';
4
+ import { color } from './methods/color';
5
+ import { enum_fn } from './methods/enum';
6
+ import { float } from './methods/float';
7
+ import { int } from './methods/int';
8
+ import { param } from './methods/param';
9
+ import { price } from './methods/price';
10
+ import { session } from './methods/session';
11
+ import { source } from './methods/source';
12
+ import { string } from './methods/string';
13
+ import { symbol } from './methods/symbol';
14
+ import { text_area } from './methods/text_area';
15
+ import { time } from './methods/time';
16
+ import { timeframe } from './methods/timeframe';
17
+ declare const methods: {
18
+ any: typeof any;
19
+ bool: typeof bool;
20
+ color: typeof color;
21
+ enum: typeof enum_fn;
22
+ float: typeof float;
23
+ int: typeof int;
24
+ param: typeof param;
25
+ price: typeof price;
26
+ session: typeof session;
27
+ source: typeof source;
28
+ string: typeof string;
29
+ symbol: typeof symbol;
30
+ text_area: typeof text_area;
31
+ time: typeof time;
32
+ timeframe: typeof timeframe;
33
+ };
34
+ export declare class Input {
35
+ private context;
36
+ any: ReturnType<typeof methods.any>;
37
+ bool: ReturnType<typeof methods.bool>;
38
+ color: ReturnType<typeof methods.color>;
39
+ enum: ReturnType<typeof methods.enum>;
40
+ float: ReturnType<typeof methods.float>;
41
+ int: ReturnType<typeof methods.int>;
42
+ param: ReturnType<typeof methods.param>;
43
+ price: ReturnType<typeof methods.price>;
44
+ session: ReturnType<typeof methods.session>;
45
+ source: ReturnType<typeof methods.source>;
46
+ string: ReturnType<typeof methods.string>;
47
+ symbol: ReturnType<typeof methods.symbol>;
48
+ text_area: ReturnType<typeof methods.text_area>;
49
+ time: ReturnType<typeof methods.time>;
50
+ timeframe: ReturnType<typeof methods.timeframe>;
51
+ constructor(context: any);
52
+ }
53
+ export default Input;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function any(context: any): (value: any, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function bool(context: any): (value: boolean, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function color(context: any): (value: string, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function enum_fn(context: any): (value: string, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function float(context: any): (value: number, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function int(context: any): (value: number, { title, group }?: InputOptions) => any;
@@ -0,0 +1 @@
1
+ export declare function param(context: any): (source: any, index?: number) => any[];
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function price(context: any): (value: number, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function session(context: any): (value: string, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function source(context: any): (value: any, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function string(context: any): (value: string, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function symbol(context: any): (value: string, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function text_area(context: any): (value: string, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function time(context: any): (value: number, { title, group }?: InputOptions) => any;
@@ -0,0 +1,2 @@
1
+ import { InputOptions } from '../types';
2
+ export declare function timeframe(context: any): (value: string, { title, group }?: InputOptions) => any;
@@ -0,0 +1,4 @@
1
+ export type InputOptions = {
2
+ title?: string;
3
+ group?: string;
4
+ } | any;