oakscriptjs 0.15.2 → 0.15.4

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 (178) hide show
  1. package/dist/cjs/check/format.d.ts.map +1 -1
  2. package/dist/cjs/check/format.js +5 -0
  3. package/dist/cjs/check/format.js.map +2 -2
  4. package/dist/cjs/check/harness.d.ts +24 -0
  5. package/dist/cjs/check/harness.d.ts.map +1 -1
  6. package/dist/cjs/check/harness.js +33 -0
  7. package/dist/cjs/check/harness.js.map +2 -2
  8. package/dist/cjs/check/index.d.ts +9 -0
  9. package/dist/cjs/check/index.d.ts.map +1 -1
  10. package/dist/cjs/check/index.js +7 -0
  11. package/dist/cjs/check/index.js.map +2 -2
  12. package/dist/cjs/color/index.d.ts.map +1 -1
  13. package/dist/cjs/color/index.js +19 -2
  14. package/dist/cjs/color/index.js.map +2 -2
  15. package/dist/cjs/color/parse.d.ts +8 -6
  16. package/dist/cjs/color/parse.d.ts.map +1 -1
  17. package/dist/cjs/color/parse.js +15 -2
  18. package/dist/cjs/color/parse.js.map +2 -2
  19. package/dist/cjs/drawing/registry.d.ts +32 -0
  20. package/dist/cjs/drawing/registry.d.ts.map +1 -1
  21. package/dist/cjs/drawing/registry.js +179 -45
  22. package/dist/cjs/drawing/registry.js.map +2 -2
  23. package/dist/cjs/index.d.ts +2 -1
  24. package/dist/cjs/index.d.ts.map +1 -1
  25. package/dist/cjs/index.js +3 -1
  26. package/dist/cjs/index.js.map +2 -2
  27. package/dist/cjs/runtime/series.d.ts +16 -0
  28. package/dist/cjs/runtime/series.d.ts.map +1 -1
  29. package/dist/cjs/runtime/series.js +19 -2
  30. package/dist/cjs/runtime/series.js.map +2 -2
  31. package/dist/cjs/script/closure-writes.d.ts +16 -0
  32. package/dist/cjs/script/closure-writes.d.ts.map +1 -0
  33. package/dist/cjs/script/closure-writes.js +435 -0
  34. package/dist/cjs/script/closure-writes.js.map +7 -0
  35. package/dist/cjs/script/globals.d.ts +2 -0
  36. package/dist/cjs/script/globals.d.ts.map +1 -1
  37. package/dist/cjs/script/globals.js.map +1 -1
  38. package/dist/cjs/script/incremental.d.ts +140 -0
  39. package/dist/cjs/script/incremental.d.ts.map +1 -0
  40. package/dist/cjs/script/incremental.js +142 -0
  41. package/dist/cjs/script/incremental.js.map +7 -0
  42. package/dist/cjs/script/index.d.ts +116 -31
  43. package/dist/cjs/script/index.d.ts.map +1 -1
  44. package/dist/cjs/script/index.js +471 -25
  45. package/dist/cjs/script/index.js.map +3 -3
  46. package/dist/cjs/session/bars.d.ts +3 -0
  47. package/dist/cjs/session/bars.d.ts.map +1 -1
  48. package/dist/cjs/session/bars.js +10 -3
  49. package/dist/cjs/session/bars.js.map +2 -2
  50. package/dist/cjs/session/calendar.d.ts +19 -6
  51. package/dist/cjs/session/calendar.d.ts.map +1 -1
  52. package/dist/cjs/session/calendar.js +57 -18
  53. package/dist/cjs/session/calendar.js.map +2 -2
  54. package/dist/cjs/session/context.d.ts.map +1 -1
  55. package/dist/cjs/session/context.js +25 -8
  56. package/dist/cjs/session/context.js.map +2 -2
  57. package/dist/cjs/str/numberformat.d.ts.map +1 -1
  58. package/dist/cjs/str/numberformat.js +23 -0
  59. package/dist/cjs/str/numberformat.js.map +2 -2
  60. package/dist/cjs/strategy/index.d.ts +8 -0
  61. package/dist/cjs/strategy/index.d.ts.map +1 -1
  62. package/dist/cjs/strategy/index.js.map +1 -1
  63. package/dist/cjs/ta/running-sum.d.ts.map +1 -1
  64. package/dist/cjs/ta/running-sum.js +72 -3
  65. package/dist/cjs/ta/running-sum.js.map +2 -2
  66. package/dist/cjs/ta/step.d.ts +476 -0
  67. package/dist/cjs/ta/step.d.ts.map +1 -0
  68. package/dist/cjs/ta/step.js +1000 -0
  69. package/dist/cjs/ta/step.js.map +7 -0
  70. package/dist/cjs/ta-series.d.ts +1 -1
  71. package/dist/cjs/ta-series.js +3 -3
  72. package/dist/cjs/ta-series.js.map +1 -1
  73. package/dist/cjs/time/timezone.d.ts +13 -1
  74. package/dist/cjs/time/timezone.d.ts.map +1 -1
  75. package/dist/cjs/time/timezone.js +52 -13
  76. package/dist/cjs/time/timezone.js.map +2 -2
  77. package/dist/esm/check/format.d.ts.map +1 -1
  78. package/dist/esm/check/format.js +5 -0
  79. package/dist/esm/check/format.js.map +1 -1
  80. package/dist/esm/check/harness.d.ts +24 -0
  81. package/dist/esm/check/harness.d.ts.map +1 -1
  82. package/dist/esm/check/harness.js +40 -6
  83. package/dist/esm/check/harness.js.map +1 -1
  84. package/dist/esm/check/index.d.ts +9 -0
  85. package/dist/esm/check/index.d.ts.map +1 -1
  86. package/dist/esm/check/index.js +11 -1
  87. package/dist/esm/check/index.js.map +1 -1
  88. package/dist/esm/color/index.d.ts.map +1 -1
  89. package/dist/esm/color/index.js +23 -3
  90. package/dist/esm/color/index.js.map +1 -1
  91. package/dist/esm/color/parse.d.ts +8 -6
  92. package/dist/esm/color/parse.d.ts.map +1 -1
  93. package/dist/esm/color/parse.js +19 -2
  94. package/dist/esm/color/parse.js.map +1 -1
  95. package/dist/esm/drawing/registry.d.ts +32 -0
  96. package/dist/esm/drawing/registry.d.ts.map +1 -1
  97. package/dist/esm/drawing/registry.js +214 -51
  98. package/dist/esm/drawing/registry.js.map +1 -1
  99. package/dist/esm/index.d.ts +2 -1
  100. package/dist/esm/index.d.ts.map +1 -1
  101. package/dist/esm/index.js +3 -1
  102. package/dist/esm/index.js.map +1 -1
  103. package/dist/esm/runtime/series.d.ts +16 -0
  104. package/dist/esm/runtime/series.d.ts.map +1 -1
  105. package/dist/esm/runtime/series.js +21 -1
  106. package/dist/esm/runtime/series.js.map +1 -1
  107. package/dist/esm/script/closure-writes.d.ts +16 -0
  108. package/dist/esm/script/closure-writes.d.ts.map +1 -0
  109. package/dist/esm/script/closure-writes.js +323 -0
  110. package/dist/esm/script/closure-writes.js.map +1 -0
  111. package/dist/esm/script/globals.d.ts +2 -0
  112. package/dist/esm/script/globals.d.ts.map +1 -1
  113. package/dist/esm/script/globals.js.map +1 -1
  114. package/dist/esm/script/incremental.d.ts +140 -0
  115. package/dist/esm/script/incremental.d.ts.map +1 -0
  116. package/dist/esm/script/incremental.js +173 -0
  117. package/dist/esm/script/incremental.js.map +1 -0
  118. package/dist/esm/script/index.d.ts +116 -31
  119. package/dist/esm/script/index.d.ts.map +1 -1
  120. package/dist/esm/script/index.js +561 -24
  121. package/dist/esm/script/index.js.map +1 -1
  122. package/dist/esm/session/bars.d.ts +3 -0
  123. package/dist/esm/session/bars.d.ts.map +1 -1
  124. package/dist/esm/session/bars.js +11 -3
  125. package/dist/esm/session/bars.js.map +1 -1
  126. package/dist/esm/session/calendar.d.ts +19 -6
  127. package/dist/esm/session/calendar.d.ts.map +1 -1
  128. package/dist/esm/session/calendar.js +74 -21
  129. package/dist/esm/session/calendar.js.map +1 -1
  130. package/dist/esm/session/context.d.ts.map +1 -1
  131. package/dist/esm/session/context.js +34 -9
  132. package/dist/esm/session/context.js.map +1 -1
  133. package/dist/esm/str/numberformat.d.ts.map +1 -1
  134. package/dist/esm/str/numberformat.js +30 -0
  135. package/dist/esm/str/numberformat.js.map +1 -1
  136. package/dist/esm/strategy/index.d.ts +8 -0
  137. package/dist/esm/strategy/index.d.ts.map +1 -1
  138. package/dist/esm/ta/running-sum.d.ts.map +1 -1
  139. package/dist/esm/ta/running-sum.js +79 -4
  140. package/dist/esm/ta/running-sum.js.map +1 -1
  141. package/dist/esm/ta/step.d.ts +476 -0
  142. package/dist/esm/ta/step.d.ts.map +1 -0
  143. package/dist/esm/ta/step.js +1089 -0
  144. package/dist/esm/ta/step.js.map +1 -0
  145. package/dist/esm/ta-series.d.ts +1 -1
  146. package/dist/esm/ta-series.js +4 -4
  147. package/dist/esm/time/timezone.d.ts +13 -1
  148. package/dist/esm/time/timezone.d.ts.map +1 -1
  149. package/dist/esm/time/timezone.js +78 -17
  150. package/dist/esm/time/timezone.js.map +1 -1
  151. package/package.json +1 -1
  152. package/skills/oakscript/SKILL.md +2 -2
  153. package/skills/oakscript/reference/check.md +5 -0
  154. package/skills/oakscript/reference/errors.md +0 -1
  155. package/skills/oakscript/reference/pine-differences.md +1 -2
  156. package/skills/oakscript/reference/plotting.md +5 -7
  157. package/skills/oakscript/reference/script-structure.md +6 -0
  158. package/src/check/format.ts +7 -0
  159. package/src/check/harness.ts +57 -0
  160. package/src/check/index.ts +16 -0
  161. package/src/color/index.ts +22 -3
  162. package/src/color/parse.ts +28 -3
  163. package/src/drawing/registry.ts +233 -50
  164. package/src/index.ts +4 -1
  165. package/src/runtime/series.ts +33 -1
  166. package/src/script/closure-writes.ts +279 -0
  167. package/src/script/globals.ts +2 -0
  168. package/src/script/incremental.ts +246 -0
  169. package/src/script/index.ts +695 -26
  170. package/src/session/bars.ts +11 -3
  171. package/src/session/calendar.ts +84 -21
  172. package/src/session/context.ts +36 -9
  173. package/src/str/numberformat.ts +29 -0
  174. package/src/strategy/index.ts +8 -0
  175. package/src/ta/running-sum.ts +78 -3
  176. package/src/ta/step.ts +1145 -0
  177. package/src/ta-series.ts +4 -4
  178. package/src/time/timezone.ts +76 -15
@@ -0,0 +1,435 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var closure_writes_exports = {};
20
+ __export(closure_writes_exports, {
21
+ outerWrites: () => outerWrites
22
+ });
23
+ module.exports = __toCommonJS(closure_writes_exports);
24
+ const MUTATORS = /* @__PURE__ */ new Set([
25
+ "push",
26
+ "pop",
27
+ "shift",
28
+ "unshift",
29
+ "splice",
30
+ "sort",
31
+ "reverse",
32
+ "fill",
33
+ "copyWithin",
34
+ "set",
35
+ "delete",
36
+ "clear",
37
+ "add"
38
+ ]);
39
+ const KEYWORDS = /* @__PURE__ */ new Set([
40
+ "break",
41
+ "case",
42
+ "catch",
43
+ "class",
44
+ "const",
45
+ "continue",
46
+ "debugger",
47
+ "default",
48
+ "delete",
49
+ "do",
50
+ "else",
51
+ "export",
52
+ "extends",
53
+ "finally",
54
+ "for",
55
+ "function",
56
+ "if",
57
+ "import",
58
+ "in",
59
+ "instanceof",
60
+ "let",
61
+ "new",
62
+ "return",
63
+ "super",
64
+ "switch",
65
+ "this",
66
+ "throw",
67
+ "try",
68
+ "typeof",
69
+ "var",
70
+ "void",
71
+ "while",
72
+ "with",
73
+ "yield",
74
+ "await",
75
+ "of",
76
+ "true",
77
+ "false",
78
+ "null",
79
+ "undefined",
80
+ "async",
81
+ "static",
82
+ "get"
83
+ ]);
84
+ function tokenize(src) {
85
+ const out = [];
86
+ let i = 0;
87
+ const n = src.length;
88
+ const regexAllowed = () => {
89
+ const last = out[out.length - 1];
90
+ if (!last) return true;
91
+ if (last.kind === "num" || last.kind === "str") return false;
92
+ if (last.kind === "id") return KEYWORDS.has(last.text) && !["this", "super", "true", "false", "null", "undefined"].includes(last.text);
93
+ return ![")", "]", "}"].includes(last.text);
94
+ };
95
+ while (i < n) {
96
+ const ch = src[i];
97
+ if (/\s/.test(ch)) {
98
+ i++;
99
+ } else if (ch === "/" && src[i + 1] === "/") {
100
+ while (i < n && src[i] !== "\n") i++;
101
+ } else if (ch === "/" && src[i + 1] === "*") {
102
+ i = src.indexOf("*/", i + 2);
103
+ i = i < 0 ? n : i + 2;
104
+ } else if (ch === '"' || ch === "'") {
105
+ i++;
106
+ while (i < n && src[i] !== ch) i += src[i] === "\\" ? 2 : 1;
107
+ i++;
108
+ out.push({ kind: "str", text: "" });
109
+ } else if (ch === "`") {
110
+ i++;
111
+ let depth = 0;
112
+ const inner = [];
113
+ let part = "";
114
+ while (i < n) {
115
+ if (depth === 0 && src[i] === "\\") {
116
+ i += 2;
117
+ continue;
118
+ }
119
+ if (depth === 0 && src[i] === "`") break;
120
+ if (depth === 0 && src[i] === "$" && src[i + 1] === "{") {
121
+ depth = 1;
122
+ i += 2;
123
+ continue;
124
+ }
125
+ if (depth > 0) {
126
+ if (src[i] === "{") depth++;
127
+ if (src[i] === "}" && --depth === 0) {
128
+ inner.push(part);
129
+ part = "";
130
+ i++;
131
+ continue;
132
+ }
133
+ part += src[i];
134
+ }
135
+ i++;
136
+ }
137
+ i++;
138
+ out.push({ kind: "str", text: "" });
139
+ for (const code of inner) {
140
+ out.push({ kind: "punct", text: "(" });
141
+ out.push(...tokenize(code));
142
+ out.push({ kind: "punct", text: ")" });
143
+ }
144
+ } else if (ch === "/" && regexAllowed()) {
145
+ i++;
146
+ let inClass = false;
147
+ while (i < n && (src[i] !== "/" || inClass)) {
148
+ if (src[i] === "\\") i++;
149
+ else if (src[i] === "[") inClass = true;
150
+ else if (src[i] === "]") inClass = false;
151
+ i++;
152
+ }
153
+ i++;
154
+ while (i < n && /[a-z]/i.test(src[i])) i++;
155
+ out.push({ kind: "str", text: "" });
156
+ } else if (/[A-Za-z_$]/.test(ch)) {
157
+ let j = i + 1;
158
+ while (j < n && /[\w$]/.test(src[j])) j++;
159
+ out.push({ kind: "id", text: src.slice(i, j) });
160
+ i = j;
161
+ } else if (/[0-9]/.test(ch) || ch === "." && /[0-9]/.test(src[i + 1] ?? "")) {
162
+ let j = i + 1;
163
+ while (j < n && /[\w.]/.test(src[j])) j++;
164
+ out.push({ kind: "num", text: src.slice(i, j) });
165
+ i = j;
166
+ } else {
167
+ const three = src.slice(i, i + 4);
168
+ const op = [
169
+ ">>>=",
170
+ "...",
171
+ "===",
172
+ "!==",
173
+ "**=",
174
+ "<<=",
175
+ ">>=",
176
+ "&&=",
177
+ "||=",
178
+ "??=",
179
+ ">>>",
180
+ "=>",
181
+ "==",
182
+ "!=",
183
+ "<=",
184
+ ">=",
185
+ "&&",
186
+ "||",
187
+ "??",
188
+ "?.",
189
+ "++",
190
+ "--",
191
+ "+=",
192
+ "-=",
193
+ "*=",
194
+ "/=",
195
+ "%=",
196
+ "&=",
197
+ "|=",
198
+ "^=",
199
+ "**",
200
+ "<<",
201
+ ">>"
202
+ ].find((o) => three.startsWith(o));
203
+ const text = op ?? ch;
204
+ out.push({ kind: "punct", text });
205
+ i += text.length;
206
+ }
207
+ }
208
+ return out;
209
+ }
210
+ const ASSIGN = /* @__PURE__ */ new Set(["=", "+=", "-=", "*=", "/=", "%=", "**=", "<<=", ">>=", ">>>=", "&=", "|=", "^=", "&&=", "||=", "??="]);
211
+ function declaredNames(t) {
212
+ const names = /* @__PURE__ */ new Set();
213
+ const addUntil = (start, stop) => {
214
+ let depth = 0;
215
+ for (let k = start; k < t.length; k++) {
216
+ const tok = t[k];
217
+ if (tok.kind === "punct" && ["(", "[", "{"].includes(tok.text)) depth++;
218
+ if (tok.kind === "punct" && [")", "]", "}"].includes(tok.text)) {
219
+ if (depth === 0) return;
220
+ depth--;
221
+ }
222
+ if (stop(tok, depth)) return;
223
+ if (tok.kind === "id" && !KEYWORDS.has(tok.text) && t[k - 1]?.text !== "." && t[k + 1]?.text !== ":") names.add(tok.text);
224
+ }
225
+ };
226
+ for (let k = 0; k < t.length; k++) {
227
+ const tok = t[k];
228
+ if (tok.kind !== "id") continue;
229
+ if (tok.text === "let" || tok.text === "const" || tok.text === "var") {
230
+ let depth = 0;
231
+ let naming = true;
232
+ for (let j = k + 1; j < t.length; j++) {
233
+ const x = t[j];
234
+ if (x.kind === "punct" && ["(", "[", "{"].includes(x.text)) depth++;
235
+ else if (x.kind === "punct" && [")", "]", "}"].includes(x.text)) {
236
+ if (depth === 0) break;
237
+ depth--;
238
+ } else if (depth === 0 && x.text === ";") break;
239
+ else if (depth === 0 && x.text === "=") naming = false;
240
+ else if (depth === 0 && x.text === ",") naming = true;
241
+ else if (depth === 0 && (x.text === "of" || x.text === "in")) break;
242
+ if (naming && x.kind === "id" && !KEYWORDS.has(x.text) && t[j + 1]?.text !== ":") names.add(x.text);
243
+ if (!naming && depth === 0 && x.kind === "punct" && x.text === "=>") break;
244
+ }
245
+ } else if ((tok.text === "function" || tok.text === "class") && t[k + 1]?.kind === "id") {
246
+ names.add(t[k + 1].text);
247
+ } else if (tok.text === "catch" && t[k + 1]?.text === "(") {
248
+ addUntil(k + 2, () => false);
249
+ }
250
+ }
251
+ for (let k = 0; k < t.length; k++) {
252
+ const tok = t[k];
253
+ if (tok.text === "=>" && t[k - 1]?.kind === "id") names.add(t[k - 1].text);
254
+ if (tok.text === "=>" && t[k - 1]?.text === ")") {
255
+ let depth = 0;
256
+ let j = k - 1;
257
+ for (; j >= 0; j--) {
258
+ if (t[j].text === ")") depth++;
259
+ else if (t[j].text === "(" && --depth === 0) break;
260
+ }
261
+ addUntil(j + 1, () => false);
262
+ }
263
+ if (tok.text === "function") {
264
+ let j = k + 1;
265
+ if (t[j]?.kind === "id") j++;
266
+ if (t[j]?.text === "(") addUntil(j + 1, () => false);
267
+ }
268
+ }
269
+ return names;
270
+ }
271
+ function outerWrites(src) {
272
+ const t = tokenize(src);
273
+ const inside = declaredNames(t);
274
+ const found = /* @__PURE__ */ new Set();
275
+ for (let k = 0; k < t.length; k++) {
276
+ const tok = t[k];
277
+ if (tok.kind !== "id" || KEYWORDS.has(tok.text) || inside.has(tok.text)) continue;
278
+ const before = t[k - 1];
279
+ if (before && (before.text === "." || before.text === "?.")) continue;
280
+ if (t[k + 1]?.text === ":" && (before?.text === "{" || before?.text === ",")) continue;
281
+ let j = k + 1;
282
+ let members = 0;
283
+ let firstMember = "";
284
+ let lastMember = "";
285
+ const memberList = [];
286
+ while (j < t.length) {
287
+ if ((t[j].text === "." || t[j].text === "?.") && t[j + 1]?.kind === "id") {
288
+ lastMember = t[j + 1].text;
289
+ memberList.push(lastMember);
290
+ if (members === 0) firstMember = lastMember;
291
+ j += 2;
292
+ members++;
293
+ } else if (t[j].text === "[") {
294
+ if (members === 0) firstMember = "[]";
295
+ let depth = 0;
296
+ for (; j < t.length; j++) {
297
+ if (t[j].text === "[") depth++;
298
+ else if (t[j].text === "]" && --depth === 0) break;
299
+ }
300
+ j++;
301
+ members++;
302
+ lastMember = "[]";
303
+ memberList.push("[]");
304
+ } else break;
305
+ }
306
+ const next = t[j];
307
+ const ns = members === 1 ? tok.text : members >= 2 ? memberList[members - 2] : "";
308
+ if (next?.text === "(" && PINE_NAMESPACES.has(ns) && (members === 1 || members >= 2)) {
309
+ if (NAMESPACES.has(ns) && !READS.has(lastMember)) {
310
+ const arg = t[j + 1];
311
+ if (arg?.kind === "id" && !inside.has(arg.text) && !KEYWORDS.has(arg.text)) {
312
+ const box = t[j + 2]?.text === "." && t[j + 3]?.text === "value";
313
+ if (!box) found.add(arg.text);
314
+ }
315
+ }
316
+ continue;
317
+ }
318
+ if (firstMember === "value") continue;
319
+ const written = next && ASSIGN.has(next.text) || next && (next.text === "++" || next.text === "--") || before?.text === "++" || before?.text === "--" || members > 0 && MUTATORS.has(lastMember) && next?.text === "(";
320
+ if (written) found.add(tok.text);
321
+ }
322
+ return [...found];
323
+ }
324
+ const PINE_NAMESPACES = /* @__PURE__ */ new Set([
325
+ "array",
326
+ "matrix",
327
+ "map",
328
+ "label",
329
+ "line",
330
+ "box",
331
+ "table",
332
+ "polyline",
333
+ "linefill",
334
+ "chart",
335
+ "str",
336
+ "math",
337
+ "ta",
338
+ "color",
339
+ "request",
340
+ "strategy",
341
+ "input",
342
+ "timeframe",
343
+ "syminfo",
344
+ "barstate",
345
+ "session",
346
+ "callsite",
347
+ "taCore",
348
+ "taStep",
349
+ "compare",
350
+ "plot",
351
+ "time",
352
+ "text",
353
+ "ticker",
354
+ "runtime",
355
+ "log",
356
+ "alert",
357
+ "chartPoint"
358
+ ]);
359
+ const NAMESPACES = /* @__PURE__ */ new Set(["array", "matrix", "map"]);
360
+ const READS = /* @__PURE__ */ new Set([
361
+ "get",
362
+ "size",
363
+ "includes",
364
+ "indexof",
365
+ "lastindexof",
366
+ "sum",
367
+ "avg",
368
+ "max",
369
+ "min",
370
+ "median",
371
+ "mode",
372
+ "stdev",
373
+ "variance",
374
+ "range",
375
+ "first",
376
+ "last",
377
+ "slice",
378
+ "copy",
379
+ "join",
380
+ "every",
381
+ "some",
382
+ "abs",
383
+ "binary_search",
384
+ "binary_search_leftmost",
385
+ "binary_search_rightmost",
386
+ "covariance",
387
+ "percentile_linear_interpolation",
388
+ "percentile_nearest_rank",
389
+ "percentrank",
390
+ "standardize",
391
+ "sort_indices",
392
+ "from",
393
+ "new",
394
+ "new_float",
395
+ "new_int",
396
+ "new_bool",
397
+ "new_string",
398
+ "new_color",
399
+ "new_line",
400
+ "new_label",
401
+ "new_box",
402
+ "new_table",
403
+ "new_linefill",
404
+ "contains",
405
+ "keys",
406
+ "values",
407
+ "rows",
408
+ "columns",
409
+ "elements_count",
410
+ "row",
411
+ "col",
412
+ "det",
413
+ "inv",
414
+ "pinv",
415
+ "rank",
416
+ "trace",
417
+ "transpose",
418
+ "mult",
419
+ "diff",
420
+ "pow",
421
+ "eigenvalues",
422
+ "eigenvectors",
423
+ "kron",
424
+ "is_square",
425
+ "is_zero",
426
+ "is_binary",
427
+ "is_symmetric",
428
+ "is_antisymmetric",
429
+ "is_diagonal",
430
+ "is_antidiagonal",
431
+ "is_identity",
432
+ "is_triangular",
433
+ "is_stochastic"
434
+ ]);
435
+ //# sourceMappingURL=closure-writes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/script/closure-writes.ts"],
4
+ "sourcesContent": ["/**\n * The variables of the script that an eachBar() callback changes outside itself (#196): an incremental run cannot put\n * them back to their value at the last confirmed bar, so a script with such a write is calculated in full.\n *\n * Read from the callback's source text (`fn.toString()`), with a tokenizer (strings, template literals, comments and\n * regular expressions skipped). A write is an assignment (`x = `, `x += `, `x++`...) or a change of a member\n * (`x.y = `, `x[i] = `, `x.push(...)` and the other mutating methods) whose root name is not declared inside the\n * callback. The `.value` of a persist() box (`dir.value = 1`) is not a write. Conservative: a name declared anywhere\n * inside the callback counts as its own (a shadowed outer write is missed); functions called by the callback are not\n * read.\n *\n * @internal\n */\n\nconst MUTATORS = new Set([\n 'push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse', 'fill', 'copyWithin',\n 'set', 'delete', 'clear', 'add',\n]);\n\nconst KEYWORDS = new Set([\n 'break', 'case', 'catch', 'class', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'export',\n 'extends', 'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'let', 'new', 'return', 'super',\n 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'yield', 'await', 'of', 'true', 'false',\n 'null', 'undefined', 'async', 'static', 'get',\n]);\n\ntype Token = { kind: 'id' | 'punct' | 'num' | 'str'; text: string };\n\n/** Tokens of a JavaScript source: names, numbers, punctuators; strings, template literals, comments and regexes skipped. */\nfunction tokenize(src: string): Token[] {\n const out: Token[] = [];\n let i = 0;\n const n = src.length;\n const regexAllowed = (): boolean => {\n const last = out[out.length - 1];\n if (!last) return true;\n if (last.kind === 'num' || last.kind === 'str') return false;\n if (last.kind === 'id') return KEYWORDS.has(last.text) && !['this', 'super', 'true', 'false', 'null', 'undefined'].includes(last.text);\n return ![')', ']', '}'].includes(last.text);\n };\n while (i < n) {\n const ch = src[i]!;\n if (/\\s/.test(ch)) {\n i++;\n } else if (ch === '/' && src[i + 1] === '/') {\n while (i < n && src[i] !== '\\n') i++;\n } else if (ch === '/' && src[i + 1] === '*') {\n i = src.indexOf('*/', i + 2);\n i = i < 0 ? n : i + 2;\n } else if (ch === '\"' || ch === \"'\") {\n i++;\n while (i < n && src[i] !== ch) i += src[i] === '\\\\' ? 2 : 1;\n i++;\n out.push({ kind: 'str', text: '' });\n } else if (ch === '`') {\n // a template literal: its ${...} parts are tokenized as code\n i++;\n let depth = 0;\n const inner: string[] = [];\n let part = '';\n while (i < n) {\n if (depth === 0 && src[i] === '\\\\') {\n i += 2;\n continue;\n }\n if (depth === 0 && src[i] === '`') break;\n if (depth === 0 && src[i] === '$' && src[i + 1] === '{') {\n depth = 1;\n i += 2;\n continue;\n }\n if (depth > 0) {\n if (src[i] === '{') depth++;\n if (src[i] === '}' && --depth === 0) {\n inner.push(part);\n part = '';\n i++;\n continue;\n }\n part += src[i];\n }\n i++;\n }\n i++;\n out.push({ kind: 'str', text: '' });\n for (const code of inner) {\n out.push({ kind: 'punct', text: '(' });\n out.push(...tokenize(code));\n out.push({ kind: 'punct', text: ')' });\n }\n } else if (ch === '/' && regexAllowed()) {\n i++;\n let inClass = false;\n while (i < n && (src[i] !== '/' || inClass)) {\n if (src[i] === '\\\\') i++;\n else if (src[i] === '[') inClass = true;\n else if (src[i] === ']') inClass = false;\n i++;\n }\n i++;\n while (i < n && /[a-z]/i.test(src[i]!)) i++;\n out.push({ kind: 'str', text: '' });\n } else if (/[A-Za-z_$]/.test(ch)) {\n let j = i + 1;\n while (j < n && /[\\w$]/.test(src[j]!)) j++;\n out.push({ kind: 'id', text: src.slice(i, j) });\n i = j;\n } else if (/[0-9]/.test(ch) || (ch === '.' && /[0-9]/.test(src[i + 1] ?? ''))) {\n let j = i + 1;\n while (j < n && /[\\w.]/.test(src[j]!)) j++;\n out.push({ kind: 'num', text: src.slice(i, j) });\n i = j;\n } else {\n const three = src.slice(i, i + 4);\n const op = ['>>>=', '...', '===', '!==', '**=', '<<=', '>>=', '&&=', '||=', '??=', '>>>', '=>', '==', '!=', '<=', '>=',\n '&&', '||', '??', '?.', '++', '--', '+=', '-=', '*=', '/=', '%=', '&=', '|=', '^=', '**', '<<', '>>']\n .find((o) => three.startsWith(o));\n const text = op ?? ch;\n out.push({ kind: 'punct', text });\n i += text.length;\n }\n }\n return out;\n}\n\nconst ASSIGN = new Set(['=', '+=', '-=', '*=', '/=', '%=', '**=', '<<=', '>>=', '>>>=', '&=', '|=', '^=', '&&=', '||=', '??=']);\n\n/** Names declared inside the tokens: let / const / var / function / class / catch, and parameters of functions. */\nfunction declaredNames(t: Token[]): Set<string> {\n const names = new Set<string>();\n const addUntil = (start: number, stop: (tok: Token, depth: number) => boolean): void => {\n let depth = 0;\n for (let k = start; k < t.length; k++) {\n const tok = t[k]!;\n if (tok.kind === 'punct' && ['(', '[', '{'].includes(tok.text)) depth++;\n if (tok.kind === 'punct' && [')', ']', '}'].includes(tok.text)) {\n if (depth === 0) return;\n depth--;\n }\n if (stop(tok, depth)) return;\n // a default value or a computed key is not a name: skip to the next , at this depth\n if (tok.kind === 'id' && !KEYWORDS.has(tok.text) && t[k - 1]?.text !== '.' && t[k + 1]?.text !== ':') names.add(tok.text);\n }\n };\n for (let k = 0; k < t.length; k++) {\n const tok = t[k]!;\n if (tok.kind !== 'id') continue;\n if (tok.text === 'let' || tok.text === 'const' || tok.text === 'var') {\n // up to the end of the declaration: an = at depth 0 ends a name, a , starts the next one\n let depth = 0;\n let naming = true;\n for (let j = k + 1; j < t.length; j++) {\n const x = t[j]!;\n if (x.kind === 'punct' && ['(', '[', '{'].includes(x.text)) depth++;\n else if (x.kind === 'punct' && [')', ']', '}'].includes(x.text)) {\n if (depth === 0) break;\n depth--;\n } else if (depth === 0 && x.text === ';') break;\n else if (depth === 0 && x.text === '=') naming = false;\n else if (depth === 0 && x.text === ',') naming = true;\n else if (depth === 0 && (x.text === 'of' || x.text === 'in')) break;\n if (naming && x.kind === 'id' && !KEYWORDS.has(x.text) && t[j + 1]?.text !== ':') names.add(x.text);\n if (!naming && depth === 0 && x.kind === 'punct' && x.text === '=>' ) break;\n }\n } else if ((tok.text === 'function' || tok.text === 'class') && t[k + 1]?.kind === 'id') {\n names.add(t[k + 1]!.text);\n } else if (tok.text === 'catch' && t[k + 1]?.text === '(') {\n addUntil(k + 2, () => false);\n }\n }\n // parameters: ( ... ) => or function name ( ... ), and a single name before =>\n for (let k = 0; k < t.length; k++) {\n const tok = t[k]!;\n if (tok.text === '=>' && t[k - 1]?.kind === 'id') names.add(t[k - 1]!.text);\n if (tok.text === '=>' && t[k - 1]?.text === ')') {\n let depth = 0;\n let j = k - 1;\n for (; j >= 0; j--) {\n if (t[j]!.text === ')') depth++;\n else if (t[j]!.text === '(' && --depth === 0) break;\n }\n addUntil(j + 1, () => false);\n }\n if (tok.text === 'function') {\n let j = k + 1;\n if (t[j]?.kind === 'id') j++;\n if (t[j]?.text === '(') addUntil(j + 1, () => false);\n }\n }\n return names;\n}\n\n/** The names outside the function source `src` that it assigns or changes (empty: none found). */\nexport function outerWrites(src: string): string[] {\n const t = tokenize(src);\n const inside = declaredNames(t);\n const found = new Set<string>();\n for (let k = 0; k < t.length; k++) {\n const tok = t[k]!;\n if (tok.kind !== 'id' || KEYWORDS.has(tok.text) || inside.has(tok.text)) continue;\n const before = t[k - 1];\n if (before && (before.text === '.' || before.text === '?.')) continue; // a member, not a root name\n if (t[k + 1]?.text === ':' && (before?.text === '{' || before?.text === ',')) continue; // an object key\n // the member chain after the name: .a.b / [x] / ?.a\n let j = k + 1;\n let members = 0;\n let firstMember = '';\n let lastMember = '';\n const memberList: string[] = [];\n while (j < t.length) {\n if ((t[j]!.text === '.' || t[j]!.text === '?.') && t[j + 1]?.kind === 'id') {\n lastMember = t[j + 1]!.text;\n memberList.push(lastMember);\n if (members === 0) firstMember = lastMember;\n j += 2;\n members++;\n } else if (t[j]!.text === '[') {\n if (members === 0) firstMember = '[]';\n let depth = 0;\n for (; j < t.length; j++) {\n if (t[j]!.text === '[') depth++;\n else if (t[j]!.text === ']' && --depth === 0) break;\n }\n j++;\n members++;\n lastMember = '[]';\n memberList.push('[]');\n } else break;\n }\n const next = t[j];\n // a call of a PineScript namespace (label.delete(l), array.push(zones, x); also through a module object of compiled\n // code, script_1.label.delete(l)): not a change of the namespace; array / map / matrix functions change their first\n // argument\n const ns = members === 1 ? tok.text : members >= 2 ? memberList[members - 2]! : '';\n if (next?.text === '(' && PINE_NAMESPACES.has(ns) && (members === 1 || members >= 2)) {\n if (NAMESPACES.has(ns) && !READS.has(lastMember)) {\n const arg = t[j + 1];\n if (arg?.kind === 'id' && !inside.has(arg.text) && !KEYWORDS.has(arg.text)) {\n const box = t[j + 2]?.text === '.' && t[j + 3]?.text === 'value';\n if (!box) found.add(arg.text);\n }\n }\n continue;\n }\n // the content of a persist() box (dir.value = 1, zones.value.push(x)) is put back by the runtime\n if (firstMember === 'value') continue;\n const written =\n (next && ASSIGN.has(next.text)) ||\n (next && (next.text === '++' || next.text === '--')) ||\n before?.text === '++' ||\n before?.text === '--' ||\n (members > 0 && MUTATORS.has(lastMember) && next?.text === '(');\n if (written) found.add(tok.text);\n }\n return [...found];\n}\n\n/** Namespaces of the PineScript API (their functions do not change the namespace object) */\nconst PINE_NAMESPACES = new Set([\n 'array', 'matrix', 'map', 'label', 'line', 'box', 'table', 'polyline', 'linefill', 'chart', 'str', 'math', 'ta', 'color',\n 'request', 'strategy', 'input', 'timeframe', 'syminfo', 'barstate', 'session', 'callsite', 'taCore', 'taStep',\n 'compare', 'plot', 'time', 'text', 'ticker', 'runtime', 'log', 'alert', 'chartPoint',\n]);\n\n/** PineScript namespaces whose functions change their first argument */\nconst NAMESPACES = new Set(['array', 'matrix', 'map']);\n\n/** Functions of those namespaces that only read their first argument */\nconst READS = new Set([\n 'get', 'size', 'includes', 'indexof', 'lastindexof', 'sum', 'avg', 'max', 'min', 'median', 'mode', 'stdev',\n 'variance', 'range', 'first', 'last', 'slice', 'copy', 'join', 'every', 'some', 'abs', 'binary_search',\n 'binary_search_leftmost', 'binary_search_rightmost', 'covariance', 'percentile_linear_interpolation',\n 'percentile_nearest_rank', 'percentrank', 'standardize', 'sort_indices', 'from', 'new', 'new_float', 'new_int',\n 'new_bool', 'new_string', 'new_color', 'new_line', 'new_label', 'new_box', 'new_table', 'new_linefill',\n 'contains', 'keys', 'values', 'rows', 'columns', 'elements_count', 'row', 'col', 'det', 'inv', 'pinv', 'rank',\n 'trace', 'transpose', 'mult', 'diff', 'pow', 'eigenvalues', 'eigenvectors', 'kron', 'is_square', 'is_zero',\n 'is_binary', 'is_symmetric', 'is_antisymmetric', 'is_diagonal', 'is_antidiagonal', 'is_identity', 'is_triangular',\n 'is_stochastic',\n]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcA,MAAM,WAAW,oBAAI,IAAI;AAAA,EACvB;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAS;AAAA,EAAW;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAW;AAAA,EAAQ;AAAA,EACxE;AAAA,EAAO;AAAA,EAAU;AAAA,EAAS;AAC5B,CAAC;AAED,MAAM,WAAW,oBAAI,IAAI;AAAA,EACvB;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAS;AAAA,EAAS;AAAA,EAAY;AAAA,EAAY;AAAA,EAAW;AAAA,EAAU;AAAA,EAAM;AAAA,EAAQ;AAAA,EACvG;AAAA,EAAW;AAAA,EAAW;AAAA,EAAO;AAAA,EAAY;AAAA,EAAM;AAAA,EAAU;AAAA,EAAM;AAAA,EAAc;AAAA,EAAO;AAAA,EAAO;AAAA,EAAU;AAAA,EACrG;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAO;AAAA,EAAU;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAS;AAAA,EAAM;AAAA,EAAQ;AAAA,EAC5G;AAAA,EAAQ;AAAA,EAAa;AAAA,EAAS;AAAA,EAAU;AAC1C,CAAC;AAKD,SAAS,SAAS,KAAsB;AACtC,QAAM,MAAe,CAAC;AACtB,MAAI,IAAI;AACR,QAAM,IAAI,IAAI;AACd,QAAM,eAAe,MAAe;AA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EAAU;AAAA,EAAQ;AAAA,EACnG;AAAA,EAAY;AAAA,EAAS;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAO;AAAA,EACvF;AAAA,EAA0B;AAAA,EAA2B;AAAA,EAAc;AAAA,EACnE;AAAA,EAA2B;AAAA,EAAe;AAAA,EAAe;AAAA,EAAgB;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAa;AAAA,EACrG;AAAA,EAAY;AAAA,EAAc;AAAA,EAAa;AAAA,EAAY;AAAA,EAAa;AAAA,EAAW;AAAA,EAAa;AAAA,EACxF;AAAA,EAAY;AAAA,EAAQ;AAAA,EAAU;AAAA,EAAQ;AAAA,EAAW;AAAA,EAAkB;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAQ;AAAA,EACvG;AAAA,EAAS;AAAA,EAAa;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAe;AAAA,EAAgB;AAAA,EAAQ;AAAA,EAAa;AAAA,EACjG;AAAA,EAAa;AAAA,EAAgB;AAAA,EAAoB;AAAA,EAAe;AAAA,EAAmB;AAAA,EAAe;AAAA,EAClG;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -27,7 +27,9 @@
27
27
  import type * as S from './index.js';
28
28
  declare global {
29
29
  const executeIntrabar: typeof S.executeIntrabar;
30
+ const createScriptRun: typeof S.createScriptRun;
30
31
  const varip: typeof S.varip;
32
+ const persist: typeof S.persist;
31
33
  const indicator: typeof S.indicator;
32
34
  const fixnan: typeof S.fixnan;
33
35
  const fill: typeof S.fill;
@@ -1 +1 @@
1
- {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../../src/script/globals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,KAAK,CAAC,MAAM,YAAY,CAAC;AAErC,OAAO,CAAC,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,CAAC;IAC5B,MAAM,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC;IAClC,MAAM,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;IAC1B,MAAM,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;IAC1B,MAAM,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;IAC1B,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC;IAC9B,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;IAChC,MAAM,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC;IAC9B,MAAM,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;IAC1B,MAAM,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC;IAC5B,MAAM,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC;IAC5B,MAAM,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC;IAClC,MAAM,UAAU,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC;IACtC,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;IAChC,MAAM,aAAa,EAAE,OAAO,CAAC,CAAC,aAAa,CAAC;IAC5C,oGAAoG;IACpG,KAAK,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACvB,kEAAkE;IAClE,KAAK,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC;CAChC;AAED,OAAO,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/script/globals.ts"],
4
- "sourcesContent": ["/**\n * @fileoverview Type declarations of the script globals, for type-checking a script source (plain JavaScript)\n * before it runs. A script body uses every value export of `oakscriptjs/script` but `executeScript` (the host\n * entry) as a global; these declarations give each global its type, so the TypeScript checker reports the\n * mistakes of a script with their line: `close - open` (operators on a Series), a misspelt name (`ta.smaa`), a\n * wrong argument or option, a bad shape or style string.\n *\n * In a project that runs scripts, a `tsconfig.json` next to the scripts, then `npx tsc -p .`:\n *\n * ```json\n * {\n * \"compilerOptions\": {\n * \"allowJs\": true, \"checkJs\": true, \"noEmit\": true, \"strict\": true, \"noImplicitAny\": false,\n * \"target\": \"ES2022\", \"module\": \"ESNext\", \"moduleResolution\": \"bundler\", \"moduleDetection\": \"force\",\n * \"lib\": [\"ES2022\"], \"types\": [\"oakscriptjs/script/globals\"]\n * },\n * \"include\": [\"*.js\"]\n * }\n * ```\n *\n * - `lib` leaves out `DOM`: its `open`, `close` and `alert` are other globals.\n * - `moduleDetection: \"force\"`: each script has its own top-level names (a script has no import or export).\n * - `noImplicitAny: false`: the parameters of a script's own functions have no types (plain JavaScript).\n *\n * @module script/globals\n */\n\nimport type * as S from './index.js';\n\ndeclare global {\n const executeIntrabar: typeof S.executeIntrabar;\n const varip: typeof S.varip;\n const indicator: typeof S.indicator;\n const fixnan: typeof S.fixnan;\n const fill: typeof S.fill;\n const plotshape: typeof S.plotshape;\n const plotchar: typeof S.plotchar;\n const plotarrow: typeof S.plotarrow;\n const bgcolor: typeof S.bgcolor;\n const barcolor: typeof S.barcolor;\n const plotcandle: typeof S.plotcandle;\n const plotbar: typeof S.plotbar;\n const eachBar: typeof S.eachBar;\n const timestamp: typeof S.timestamp;\n const inSession: typeof S.inSession;\n const seriesOf: typeof S.seriesOf;\n const alertcondition: typeof S.alertcondition;\n const holdDrawing: typeof S.holdDrawing;\n const releaseDrawing: typeof S.releaseDrawing;\n const varDrawing: typeof S.varDrawing;\n const StrategyRecorder: typeof S.StrategyRecorder;\n const input: typeof S.input;\n const open: typeof S.open;\n const high: typeof S.high;\n const low: typeof S.low;\n const close: typeof S.close;\n const volume: typeof S.volume;\n const hl2: typeof S.hl2;\n const hlc3: typeof S.hlc3;\n const ohlc4: typeof S.ohlc4;\n const hlcc4: typeof S.hlcc4;\n const ta: typeof S.ta;\n const color: typeof S.color;\n const DEFAULT_OUTPUT_TITLES: typeof S.DEFAULT_OUTPUT_TITLES;\n const plot: typeof S.plot;\n const hline: typeof S.hline;\n const DEFAULT_CANDLE_COLORS: typeof S.DEFAULT_CANDLE_COLORS;\n const strategy: typeof S.strategy;\n const MissingSymbolDataError: typeof S.MissingSymbolDataError;\n const timeframe: typeof S.timeframe;\n const syminfo: typeof S.syminfo;\n const year: typeof S.year;\n const month: typeof S.month;\n const weekofyear: typeof S.weekofyear;\n const dayofmonth: typeof S.dayofmonth;\n const dayofweek: typeof S.dayofweek;\n const hour: typeof S.hour;\n const minute: typeof S.minute;\n const second: typeof S.second;\n const str: typeof S.str;\n const timenow: typeof S.timenow;\n const time: typeof S.time;\n const time_close: typeof S.time_close;\n const time_tradingday: typeof S.time_tradingday;\n const barstate: typeof S.barstate;\n const session: typeof S.session;\n const barmerge: typeof S.barmerge;\n const ticker: typeof S.ticker;\n const request: typeof S.request;\n const line: typeof S.line;\n const label: typeof S.label;\n const box: typeof S.box;\n const linefill: typeof S.linefill;\n const polyline: typeof S.polyline;\n const table: typeof S.table;\n const position: typeof S.position;\n const text: typeof S.text;\n const chart: typeof S.chart;\n const alert: typeof S.alert;\n const Series: typeof S.Series;\n const BarData: typeof S.BarData;\n const na: typeof S.na;\n const nz: typeof S.nz;\n const STRATEGY_DEFAULTS: typeof S.STRATEGY_DEFAULTS;\n const math: typeof S.math;\n const bar_index: typeof S.bar_index;\n const last_bar_index: typeof S.last_bar_index;\n const shape: typeof S.shape;\n const location: typeof S.location;\n const size: typeof S.size;\n const xloc: typeof S.xloc;\n const yloc: typeof S.yloc;\n const extend: typeof S.extend;\n const display: typeof S.display;\n const format: typeof S.format;\n const font: typeof S.font;\n const scale: typeof S.scale;\n const order: typeof S.order;\n const currency: typeof S.currency;\n const adjustment: typeof S.adjustment;\n const compare: typeof S.compare;\n const isInputActive: typeof S.isInputActive;\n /** A Series of the script (`close`, the result of `ta.*`...), for JSDoc types: `@type {Series}`. */\n type Series = S.Series;\n /** The bar handed to an `eachBar()` callback, for JSDoc types. */\n type BarContext = S.BarContext;\n}\n\nexport {};\n"],
4
+ "sourcesContent": ["/**\n * @fileoverview Type declarations of the script globals, for type-checking a script source (plain JavaScript)\n * before it runs. A script body uses every value export of `oakscriptjs/script` but `executeScript` (the host\n * entry) as a global; these declarations give each global its type, so the TypeScript checker reports the\n * mistakes of a script with their line: `close - open` (operators on a Series), a misspelt name (`ta.smaa`), a\n * wrong argument or option, a bad shape or style string.\n *\n * In a project that runs scripts, a `tsconfig.json` next to the scripts, then `npx tsc -p .`:\n *\n * ```json\n * {\n * \"compilerOptions\": {\n * \"allowJs\": true, \"checkJs\": true, \"noEmit\": true, \"strict\": true, \"noImplicitAny\": false,\n * \"target\": \"ES2022\", \"module\": \"ESNext\", \"moduleResolution\": \"bundler\", \"moduleDetection\": \"force\",\n * \"lib\": [\"ES2022\"], \"types\": [\"oakscriptjs/script/globals\"]\n * },\n * \"include\": [\"*.js\"]\n * }\n * ```\n *\n * - `lib` leaves out `DOM`: its `open`, `close` and `alert` are other globals.\n * - `moduleDetection: \"force\"`: each script has its own top-level names (a script has no import or export).\n * - `noImplicitAny: false`: the parameters of a script's own functions have no types (plain JavaScript).\n *\n * @module script/globals\n */\n\nimport type * as S from './index.js';\n\ndeclare global {\n const executeIntrabar: typeof S.executeIntrabar;\n const createScriptRun: typeof S.createScriptRun;\n const varip: typeof S.varip;\n const persist: typeof S.persist;\n const indicator: typeof S.indicator;\n const fixnan: typeof S.fixnan;\n const fill: typeof S.fill;\n const plotshape: typeof S.plotshape;\n const plotchar: typeof S.plotchar;\n const plotarrow: typeof S.plotarrow;\n const bgcolor: typeof S.bgcolor;\n const barcolor: typeof S.barcolor;\n const plotcandle: typeof S.plotcandle;\n const plotbar: typeof S.plotbar;\n const eachBar: typeof S.eachBar;\n const timestamp: typeof S.timestamp;\n const inSession: typeof S.inSession;\n const seriesOf: typeof S.seriesOf;\n const alertcondition: typeof S.alertcondition;\n const holdDrawing: typeof S.holdDrawing;\n const releaseDrawing: typeof S.releaseDrawing;\n const varDrawing: typeof S.varDrawing;\n const StrategyRecorder: typeof S.StrategyRecorder;\n const input: typeof S.input;\n const open: typeof S.open;\n const high: typeof S.high;\n const low: typeof S.low;\n const close: typeof S.close;\n const volume: typeof S.volume;\n const hl2: typeof S.hl2;\n const hlc3: typeof S.hlc3;\n const ohlc4: typeof S.ohlc4;\n const hlcc4: typeof S.hlcc4;\n const ta: typeof S.ta;\n const color: typeof S.color;\n const DEFAULT_OUTPUT_TITLES: typeof S.DEFAULT_OUTPUT_TITLES;\n const plot: typeof S.plot;\n const hline: typeof S.hline;\n const DEFAULT_CANDLE_COLORS: typeof S.DEFAULT_CANDLE_COLORS;\n const strategy: typeof S.strategy;\n const MissingSymbolDataError: typeof S.MissingSymbolDataError;\n const timeframe: typeof S.timeframe;\n const syminfo: typeof S.syminfo;\n const year: typeof S.year;\n const month: typeof S.month;\n const weekofyear: typeof S.weekofyear;\n const dayofmonth: typeof S.dayofmonth;\n const dayofweek: typeof S.dayofweek;\n const hour: typeof S.hour;\n const minute: typeof S.minute;\n const second: typeof S.second;\n const str: typeof S.str;\n const timenow: typeof S.timenow;\n const time: typeof S.time;\n const time_close: typeof S.time_close;\n const time_tradingday: typeof S.time_tradingday;\n const barstate: typeof S.barstate;\n const session: typeof S.session;\n const barmerge: typeof S.barmerge;\n const ticker: typeof S.ticker;\n const request: typeof S.request;\n const line: typeof S.line;\n const label: typeof S.label;\n const box: typeof S.box;\n const linefill: typeof S.linefill;\n const polyline: typeof S.polyline;\n const table: typeof S.table;\n const position: typeof S.position;\n const text: typeof S.text;\n const chart: typeof S.chart;\n const alert: typeof S.alert;\n const Series: typeof S.Series;\n const BarData: typeof S.BarData;\n const na: typeof S.na;\n const nz: typeof S.nz;\n const STRATEGY_DEFAULTS: typeof S.STRATEGY_DEFAULTS;\n const math: typeof S.math;\n const bar_index: typeof S.bar_index;\n const last_bar_index: typeof S.last_bar_index;\n const shape: typeof S.shape;\n const location: typeof S.location;\n const size: typeof S.size;\n const xloc: typeof S.xloc;\n const yloc: typeof S.yloc;\n const extend: typeof S.extend;\n const display: typeof S.display;\n const format: typeof S.format;\n const font: typeof S.font;\n const scale: typeof S.scale;\n const order: typeof S.order;\n const currency: typeof S.currency;\n const adjustment: typeof S.adjustment;\n const compare: typeof S.compare;\n const isInputActive: typeof S.isInputActive;\n /** A Series of the script (`close`, the result of `ta.*`...), for JSDoc types: `@type {Series}`. */\n type Series = S.Series;\n /** The bar handed to an `eachBar()` callback, for JSDoc types. */\n type BarContext = S.BarContext;\n}\n\nexport {};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }