oakscriptjs 0.19.0 → 0.21.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 (107) hide show
  1. package/dist/cjs/box/index.d.ts +3 -3
  2. package/dist/cjs/box/index.d.ts.map +1 -1
  3. package/dist/cjs/box/index.js.map +2 -2
  4. package/dist/cjs/check/harness.d.ts.map +1 -1
  5. package/dist/cjs/check/harness.js +35 -1
  6. package/dist/cjs/check/harness.js.map +2 -2
  7. package/dist/cjs/drawing/output.d.ts +2 -1
  8. package/dist/cjs/drawing/output.d.ts.map +1 -1
  9. package/dist/cjs/drawing/output.js +5 -4
  10. package/dist/cjs/drawing/output.js.map +2 -2
  11. package/dist/cjs/index.d.ts +1 -1
  12. package/dist/cjs/index.js +1 -1
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/cjs/label/index.d.ts +2 -2
  15. package/dist/cjs/label/index.d.ts.map +1 -1
  16. package/dist/cjs/label/index.js.map +2 -2
  17. package/dist/cjs/line/index.d.ts +4 -4
  18. package/dist/cjs/line/index.d.ts.map +1 -1
  19. package/dist/cjs/line/index.js +1 -1
  20. package/dist/cjs/line/index.js.map +2 -2
  21. package/dist/cjs/polyline/index.d.ts +2 -2
  22. package/dist/cjs/polyline/index.d.ts.map +1 -1
  23. package/dist/cjs/polyline/index.js.map +2 -2
  24. package/dist/cjs/script/constants.d.ts +6 -1
  25. package/dist/cjs/script/constants.d.ts.map +1 -1
  26. package/dist/cjs/script/constants.js +2 -1
  27. package/dist/cjs/script/constants.js.map +2 -2
  28. package/dist/cjs/script/globals.d.ts +3 -0
  29. package/dist/cjs/script/globals.d.ts.map +1 -1
  30. package/dist/cjs/script/globals.js.map +1 -1
  31. package/dist/cjs/script/index.d.ts +255 -28
  32. package/dist/cjs/script/index.d.ts.map +1 -1
  33. package/dist/cjs/script/index.js +349 -34
  34. package/dist/cjs/script/index.js.map +3 -3
  35. package/dist/cjs/security/events.d.ts +16 -0
  36. package/dist/cjs/security/events.d.ts.map +1 -0
  37. package/dist/cjs/security/events.js +84 -0
  38. package/dist/cjs/security/events.js.map +7 -0
  39. package/dist/cjs/types/index.d.ts +13 -11
  40. package/dist/cjs/types/index.d.ts.map +1 -1
  41. package/dist/cjs/types/index.js +3 -1
  42. package/dist/cjs/types/index.js.map +2 -2
  43. package/dist/cjs/types/metadata.d.ts +12 -8
  44. package/dist/cjs/types/metadata.d.ts.map +1 -1
  45. package/dist/cjs/types/metadata.js.map +1 -1
  46. package/dist/esm/box/index.d.ts +3 -3
  47. package/dist/esm/box/index.d.ts.map +1 -1
  48. package/dist/esm/box/index.js +1 -1
  49. package/dist/esm/box/index.js.map +1 -1
  50. package/dist/esm/check/harness.d.ts.map +1 -1
  51. package/dist/esm/check/harness.js +25 -0
  52. package/dist/esm/check/harness.js.map +1 -1
  53. package/dist/esm/drawing/output.d.ts +2 -1
  54. package/dist/esm/drawing/output.d.ts.map +1 -1
  55. package/dist/esm/drawing/output.js +9 -7
  56. package/dist/esm/drawing/output.js.map +1 -1
  57. package/dist/esm/index.d.ts +1 -1
  58. package/dist/esm/index.js +1 -1
  59. package/dist/esm/label/index.d.ts +2 -2
  60. package/dist/esm/label/index.d.ts.map +1 -1
  61. package/dist/esm/label/index.js.map +1 -1
  62. package/dist/esm/line/index.d.ts +4 -4
  63. package/dist/esm/line/index.d.ts.map +1 -1
  64. package/dist/esm/line/index.js +3 -3
  65. package/dist/esm/line/index.js.map +1 -1
  66. package/dist/esm/polyline/index.d.ts +2 -2
  67. package/dist/esm/polyline/index.d.ts.map +1 -1
  68. package/dist/esm/polyline/index.js +1 -1
  69. package/dist/esm/polyline/index.js.map +1 -1
  70. package/dist/esm/script/constants.d.ts +6 -1
  71. package/dist/esm/script/constants.d.ts.map +1 -1
  72. package/dist/esm/script/constants.js +6 -1
  73. package/dist/esm/script/constants.js.map +1 -1
  74. package/dist/esm/script/globals.d.ts +3 -0
  75. package/dist/esm/script/globals.d.ts.map +1 -1
  76. package/dist/esm/script/globals.js.map +1 -1
  77. package/dist/esm/script/index.d.ts +255 -28
  78. package/dist/esm/script/index.d.ts.map +1 -1
  79. package/dist/esm/script/index.js +370 -38
  80. package/dist/esm/script/index.js.map +1 -1
  81. package/dist/esm/security/events.d.ts +16 -0
  82. package/dist/esm/security/events.d.ts.map +1 -0
  83. package/dist/esm/security/events.js +78 -0
  84. package/dist/esm/security/events.js.map +1 -0
  85. package/dist/esm/types/index.d.ts +13 -11
  86. package/dist/esm/types/index.d.ts.map +1 -1
  87. package/dist/esm/types/index.js +3 -1
  88. package/dist/esm/types/index.js.map +1 -1
  89. package/dist/esm/types/metadata.d.ts +12 -8
  90. package/dist/esm/types/metadata.d.ts.map +1 -1
  91. package/package.json +1 -1
  92. package/skills/oakscript/reference/pine-differences.md +2 -0
  93. package/skills/oakscript/reference/plotting.md +24 -1
  94. package/skills/oakscript/reference/timeframes-symbols.md +27 -0
  95. package/src/box/index.ts +4 -4
  96. package/src/check/harness.ts +27 -0
  97. package/src/drawing/output.ts +12 -8
  98. package/src/index.ts +1 -1
  99. package/src/label/index.ts +3 -3
  100. package/src/line/index.ts +6 -6
  101. package/src/polyline/index.ts +2 -2
  102. package/src/script/constants.ts +6 -1
  103. package/src/script/globals.ts +3 -0
  104. package/src/script/index.ts +580 -50
  105. package/src/security/events.ts +85 -0
  106. package/src/types/index.ts +13 -11
  107. package/src/types/metadata.ts +12 -8
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/label/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAElE,KAAK,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAC1C,KAAK,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;AACnD,KAAK,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAA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ACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,KAAK,CAK7D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,CAIxE;AAGD,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,CAAC;AAC5B,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/label/index.ts"],
4
- "sourcesContent": ["/**\n * Label namespace\n * Functions for creating and manipulating label drawing objects.\n *\n * @remarks\n * Labels are primarily used for annotations and marking points on the chart.\n * They have limited computational value compared to lines and boxes, but getters\n * allow retrieving position and text for conditional logic.\n *\n * @version 6\n */\n\nimport { all as allDrawings, checkBarIndex, isDeleted, register, remove } from '../drawing/registry.js';\nimport type { ChartPoint, Label, color } from '../types/index.js';\n\ntype LabelXloc = 'bar_index' | 'bar_time';\ntype LabelYloc = 'price' | 'abovebar' | 'belowbar';\ntype LabelStyle = NonNullable<Label['style']>;\n\n/**\n * Creates a new label (PineScript `label.new`), with a chart point or with coordinates:\n *\n * - `label.new(point, text?, xloc?, yloc?, color?, style?, textcolor?, size?, textalign?, tooltip?,\n * text_font_family?, force_overlay?, text_formatting?)`\n * - `label.new(x, y, text?, xloc?, yloc?, color?, style?, textcolor?, size?, textalign?, tooltip?,\n * text_font_family?, force_overlay?, text_formatting?)`\n *\n * With a chart point, x is `point.index` for `bar_index` labels and `point.time` for `bar_time` labels.\n *\n * @example\n * ```typescript\n * const signal = label.new(10, 105.5, 'BUY');\n * const atPoint = label.new(chartPoint.from_index(10, 105.5), 'BUY');\n * ```\n */\nexport function new_label(\n point: ChartPoint,\n text?: string,\n xloc?: LabelXloc,\n yloc?: LabelYloc,\n labelColor?: color,\n style?: LabelStyle,\n textcolor?: color,\n size?: string | number,\n textalign?: 'left' | 'center' | 'right',\n tooltip?: string,\n text_font_family?: 'default' | 'monospace',\n force_overlay?: boolean,\n text_formatting?: number\n): Label;\nexport function new_label(\n x: number,\n y: number,\n text?: string,\n xloc?: LabelXloc,\n yloc?: LabelYloc,\n labelColor?: color,\n style?: LabelStyle,\n textcolor?: color,\n size?: string | number,\n textalign?: 'left' | 'center' | 'right',\n tooltip?: string,\n text_font_family?: 'default' | 'monospace',\n force_overlay?: boolean,\n text_formatting?: number\n): Label;\nexport function new_label(...args: unknown[]): Label {\n let x: number, y: number, rest: unknown[];\n if (typeof args[0] === 'object' && args[0] !== null) {\n const point = args[0] as ChartPoint;\n rest = args.slice(1);\n x = pointX(point, (rest[1] as LabelXloc | undefined) ?? 'bar_index');\n y = point.price;\n } else {\n [x, y] = args as [number, number];\n rest = args.slice(2);\n }\n const [text, xloc, yloc, labelColor, style, textcolor, size, textalign, tooltip, text_font_family,\n force_overlay, text_formatting] = rest as [\n string?, LabelXloc?, LabelYloc?, color?, LabelStyle?, color?, (string | number)?,\n ('left' | 'center' | 'right')?, string?, ('default' | 'monospace')?, boolean?, number?,\n ];\n x = checkBarIndex('label.new', 'x', x, xloc);\n return register('label', {\n x,\n y,\n xloc: xloc ?? 'bar_index',\n yloc: yloc ?? 'price',\n // PineScript: a label without text has the text \"\" (label.get_text gives \"\")\n text: text ?? '',\n tooltip,\n color: labelColor,\n style,\n textcolor,\n size,\n textalign,\n text_font_family,\n force_overlay: force_overlay ?? false,\n text_formatting,\n });\n}\n\n/**\n * Returns the x coordinate.\n *\n * @param id - Label object\n * @returns X coordinate (bar index or timestamp)\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * const x = label.get_x(label); // Returns 50\n * ```\n */\nexport function get_x(id: Label): number {\n return id.x;\n}\n\n/**\n * Returns the y coordinate (price level).\n *\n * @param id - Label object\n * @returns Y coordinate (price)\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * const y = label.get_y(label); // Returns 155.5\n * ```\n */\nexport function get_y(id: Label): number {\n return id.y;\n}\n\n/**\n * Returns the label text content.\n *\n * @param id - Label object\n * @returns Text content (or undefined if no text)\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot High');\n * const text = label.get_text(label); // Returns 'Pivot High'\n * ```\n */\nexport function get_text(id: Label): string | undefined {\n return id.text;\n}\n\n/**\n * Creates a copy of the label object.\n *\n * @param id - Label object to copy\n * @returns New label object with same properties\n *\n * @remarks\n * Creates a shallow copy of the label. Modifications to the copy won't affect the original.\n *\n * @example\n * ```typescript\n * const original = label.new(50, 155.5, 'Pivot');\n * const copied = label.copy(original);\n *\n * // Modify copy without affecting original\n * copied.text = 'New Text';\n * ```\n */\nexport function copy(id: Label): Label {\n return register('label', { ...id });\n}\n\n// =============================================================================\n// POSITION SETTERS\n// =============================================================================\n\n/**\n * Sets the x coordinate.\n *\n * @param id - Label object to modify\n * @param x - New x coordinate\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_x(label, 55); // Move to bar 55\n * ```\n */\nexport function set_x(id: Label, x: number): Label {\n if (isDeleted(id)) return id;\n x = checkBarIndex('label.set_x', 'x', x, id.xloc);\n id.x = x;\n return id;\n}\n\n/**\n * Sets the y coordinate (price level).\n *\n * @param id - Label object to modify\n * @param y - New y coordinate\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_y(label, 160); // Move to price 160\n * ```\n */\nexport function set_y(id: Label, y: number): Label {\n if (isDeleted(id)) return id;\n id.y = y;\n return id;\n}\n\n/**\n * Sets both x and y coordinates.\n *\n * @param id - Label object to modify\n * @param x - New x coordinate\n * @param y - New y coordinate\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_xy(label, 60, 160); // Move to (60, 160)\n * ```\n */\nexport function set_xy(id: Label, x: number, y: number): Label {\n if (isDeleted(id)) return id;\n x = checkBarIndex('label.set_x', 'x', x, id.xloc);\n id.x = x;\n id.y = y;\n return id;\n}\n\n/**\n * Sets the x-axis coordinate system.\n *\n * @param id - Label object to modify\n * @param x - New x coordinate\n * @param xloc - New coordinate system\n * @returns Modified label object\n *\n * @remarks\n * When changing xloc, you must provide an appropriate x coordinate for the new system.\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_xloc(label, 1609459200000, 'bar_time'); // Change to timestamp\n * ```\n */\nexport function set_xloc(id: Label, x: number, xloc: 'bar_index' | 'bar_time'): Label {\n if (isDeleted(id)) return id;\n id.x = x;\n id.xloc = xloc;\n return id;\n}\n\n/**\n * Sets the y-location mode of the label (PineScript `label.set_yloc(id, yloc)`): `price` uses the\n * label's y, `abovebar` / `belowbar` place it above / below the bar.\n */\nexport function set_yloc(id: Label, yloc: 'price' | 'abovebar' | 'belowbar'): Label {\n if (isDeleted(id)) return id;\n id.yloc = yloc;\n return id;\n}\n\n// =============================================================================\n// CONTENT SETTERS\n// =============================================================================\n\n/**\n * Sets the text content.\n *\n * @param id - Label object to modify\n * @param text - New text content\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_text(label, 'Updated Text');\n * ```\n */\nexport function set_text(id: Label, text: string): Label {\n if (isDeleted(id)) return id;\n id.text = text;\n return id;\n}\n\n/**\n * Sets the tooltip text.\n *\n * @param id - Label object to modify\n * @param tooltip - New tooltip text\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_tooltip(label, 'Resistance level formed at 155.5');\n * ```\n */\nexport function set_tooltip(id: Label, tooltip: string): Label {\n if (isDeleted(id)) return id;\n id.tooltip = tooltip;\n return id;\n}\n\n// =============================================================================\n// STYLING SETTERS\n// =============================================================================\n\n/**\n * Sets the label color (border and arrow).\n *\n * @param id - Label object to modify\n * @param labelColor - New color\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_color(label, '#FF0000'); // Red label\n * ```\n */\nexport function set_color(id: Label, labelColor: color): Label {\n if (isDeleted(id)) return id;\n id.color = labelColor;\n return id;\n}\n\n/**\n * Sets the text color.\n *\n * @param id - Label object to modify\n * @param textColor - New text color\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_textcolor(label, '#FFFFFF'); // White text\n * ```\n */\nexport function set_textcolor(id: Label, textColor: color): Label {\n if (isDeleted(id)) return id;\n id.textcolor = textColor;\n return id;\n}\n\n/**\n * Sets the label style.\n *\n * @param id - Label object to modify\n * @param style - New label style\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_style(label, 'label_down'); // Arrow pointing down\n * ```\n */\nexport function set_style(\n id: Label,\n style: 'none' | 'xcross' | 'cross' | 'triangleup' | 'triangledown' | 'flag' | 'circle' |\n 'arrowup' | 'arrowdown' | 'label_up' | 'label_down' | 'label_left' | 'label_right' |\n 'label_lower_left' | 'label_lower_right' | 'label_upper_left' | 'label_upper_right' |\n 'label_center' | 'square' | 'diamond' | 'text_outline'\n): Label {\n if (isDeleted(id)) return id;\n id.style = style;\n return id;\n}\n\n/**\n * Sets the label size.\n *\n * @param id - Label object to modify\n * @param size - New size\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_size(label, 'large'); // Larger label\n * ```\n */\nexport function set_size(id: Label, size: string | number): Label {\n if (isDeleted(id)) return id;\n id.size = size;\n return id;\n}\n\n/**\n * Sets the text alignment.\n *\n * @param id - Label object to modify\n * @param align - New text alignment\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_textalign(label, 'center'); // Center-aligned text\n * ```\n */\nexport function set_textalign(id: Label, align: 'left' | 'center' | 'right'): Label {\n if (isDeleted(id)) return id;\n id.textalign = align;\n return id;\n}\n\n/**\n * Sets the text font family.\n *\n * @param id - Label object to modify\n * @param font - New font family\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_text_font_family(label, 'monospace');\n * ```\n */\nexport function set_text_font_family(id: Label, font: 'default' | 'monospace'): Label {\n if (isDeleted(id)) return id;\n id.text_font_family = font;\n return id;\n}\n\n/**\n * Deletes the label object.\n *\n * @param id - Label object to delete\n *\n * @remarks\n * Removes the label from `label.all()`. As in PineScript, the deleted label is `na`: its getters\n * return NaN and its setters do nothing. Deleting it twice has no effect.\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.delete(label);\n * // label.all() no longer contains it\n * ```\n */\nexport function delete_label(id: Label): void {\n remove('label', id);\n}\n\n/** x coordinate of a chart point for an object's xloc (`na` when the point has no such coordinate). */\nfunction pointX(point: ChartPoint, xloc: 'bar_index' | 'bar_time'): number {\n const x = xloc === 'bar_time' ? point.time : point.index;\n return x ?? NaN;\n}\n\n/**\n * All live labels, in creation order (PineScript `label.all`). A new array.\n */\nexport function all(): Label[] {\n return allDrawings('label');\n}\n\n/**\n * Sets the label position from a chart point: `point.index` for `bar_index` labels, `point.time`\n * for `bar_time` labels, and `point.price`.\n */\nexport function set_point(id: Label, point: ChartPoint): Label {\n if (isDeleted(id)) return id;\n id.x = pointX(point, id.xloc);\n id.y = point.price;\n return id;\n}\n\n/**\n * Sets the text formatting: `text.format_none`, `text.format_bold`, `text.format_italic`,\n * or `text.format_bold + text.format_italic`.\n */\nexport function set_text_formatting(id: Label, formatting: number): Label {\n if (isDeleted(id)) return id;\n id.text_formatting = formatting;\n return id;\n}\n\n// Alias to match PineScript API\nexport { new_label as new };\nexport { delete_label as delete };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AE,EAAG,QAAO;AAC1B,KAAG,YAAY;AACf,SAAO;AACT;AAeO,SAAS,qBAAqB,IAAW,MAAsC;AACpF,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,mBAAmB;AACtB,SAAO;AACT;AAkBO,SAAS,aAAa,IAAiB;AAC5C,8BAAO,SAAS,EAAE;AACpB;AAGA,SAAS,OAAO,OAAmB,MAAwC;AACzE,QAAM,IAAI,SAAS,aAAa,MAAM,OAAO,MAAM;AACnD,SAAO,KAAK;AACd;AAKO,SAAS,MAAe;AAC7B,aAAO,gBAAAA,KAAY,OAAO;AAC5B;AAMO,SAAS,UAAU,IAAW,OAA0B;AAC7D,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,IAAI,OAAO,OAAO,GAAG,IAAI;AAC5B,KAAG,IAAI,MAAM;AACb,SAAO;AACT;AAMO,SAAS,oBAAoB,IAAW,YAA2B;AACxE,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,kBAAkB;AACrB,SAAO;AACT;",
4
+ "sourcesContent": ["/**\n * Label namespace\n * Functions for creating and manipulating label drawing objects.\n *\n * @remarks\n * Labels are primarily used for annotations and marking points on the chart.\n * They have limited computational value compared to lines and boxes, but getters\n * allow retrieving position and text for conditional logic.\n *\n * @version 6\n */\n\nimport { all as allDrawings, checkBarIndex, isDeleted, register, remove } from '../drawing/registry.js';\nimport type { ChartPoint, Label, color } from '../types/index.js';\n\ntype LabelXloc = 'bar_index' | 'bar_time' | 'pane';\ntype LabelYloc = 'price' | 'abovebar' | 'belowbar';\ntype LabelStyle = NonNullable<Label['style']>;\n\n/**\n * Creates a new label (PineScript `label.new`), with a chart point or with coordinates:\n *\n * - `label.new(point, text?, xloc?, yloc?, color?, style?, textcolor?, size?, textalign?, tooltip?,\n * text_font_family?, force_overlay?, text_formatting?)`\n * - `label.new(x, y, text?, xloc?, yloc?, color?, style?, textcolor?, size?, textalign?, tooltip?,\n * text_font_family?, force_overlay?, text_formatting?)`\n *\n * With a chart point, x is `point.index` for `bar_index` labels and `point.time` for `bar_time` labels.\n *\n * @example\n * ```typescript\n * const signal = label.new(10, 105.5, 'BUY');\n * const atPoint = label.new(chartPoint.from_index(10, 105.5), 'BUY');\n * ```\n */\nexport function new_label(\n point: ChartPoint,\n text?: string,\n xloc?: LabelXloc,\n yloc?: LabelYloc,\n labelColor?: color,\n style?: LabelStyle,\n textcolor?: color,\n size?: string | number,\n textalign?: 'left' | 'center' | 'right',\n tooltip?: string,\n text_font_family?: 'default' | 'monospace',\n force_overlay?: boolean,\n text_formatting?: number\n): Label;\nexport function new_label(\n x: number,\n y: number,\n text?: string,\n xloc?: LabelXloc,\n yloc?: LabelYloc,\n labelColor?: color,\n style?: LabelStyle,\n textcolor?: color,\n size?: string | number,\n textalign?: 'left' | 'center' | 'right',\n tooltip?: string,\n text_font_family?: 'default' | 'monospace',\n force_overlay?: boolean,\n text_formatting?: number\n): Label;\nexport function new_label(...args: unknown[]): Label {\n let x: number, y: number, rest: unknown[];\n if (typeof args[0] === 'object' && args[0] !== null) {\n const point = args[0] as ChartPoint;\n rest = args.slice(1);\n x = pointX(point, (rest[1] as LabelXloc | undefined) ?? 'bar_index');\n y = point.price;\n } else {\n [x, y] = args as [number, number];\n rest = args.slice(2);\n }\n const [text, xloc, yloc, labelColor, style, textcolor, size, textalign, tooltip, text_font_family,\n force_overlay, text_formatting] = rest as [\n string?, LabelXloc?, LabelYloc?, color?, LabelStyle?, color?, (string | number)?,\n ('left' | 'center' | 'right')?, string?, ('default' | 'monospace')?, boolean?, number?,\n ];\n x = checkBarIndex('label.new', 'x', x, xloc);\n return register('label', {\n x,\n y,\n xloc: xloc ?? 'bar_index',\n yloc: yloc ?? 'price',\n // PineScript: a label without text has the text \"\" (label.get_text gives \"\")\n text: text ?? '',\n tooltip,\n color: labelColor,\n style,\n textcolor,\n size,\n textalign,\n text_font_family,\n force_overlay: force_overlay ?? false,\n text_formatting,\n });\n}\n\n/**\n * Returns the x coordinate.\n *\n * @param id - Label object\n * @returns X coordinate (bar index or timestamp)\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * const x = label.get_x(label); // Returns 50\n * ```\n */\nexport function get_x(id: Label): number {\n return id.x;\n}\n\n/**\n * Returns the y coordinate (price level).\n *\n * @param id - Label object\n * @returns Y coordinate (price)\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * const y = label.get_y(label); // Returns 155.5\n * ```\n */\nexport function get_y(id: Label): number {\n return id.y;\n}\n\n/**\n * Returns the label text content.\n *\n * @param id - Label object\n * @returns Text content (or undefined if no text)\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot High');\n * const text = label.get_text(label); // Returns 'Pivot High'\n * ```\n */\nexport function get_text(id: Label): string | undefined {\n return id.text;\n}\n\n/**\n * Creates a copy of the label object.\n *\n * @param id - Label object to copy\n * @returns New label object with same properties\n *\n * @remarks\n * Creates a shallow copy of the label. Modifications to the copy won't affect the original.\n *\n * @example\n * ```typescript\n * const original = label.new(50, 155.5, 'Pivot');\n * const copied = label.copy(original);\n *\n * // Modify copy without affecting original\n * copied.text = 'New Text';\n * ```\n */\nexport function copy(id: Label): Label {\n return register('label', { ...id });\n}\n\n// =============================================================================\n// POSITION SETTERS\n// =============================================================================\n\n/**\n * Sets the x coordinate.\n *\n * @param id - Label object to modify\n * @param x - New x coordinate\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_x(label, 55); // Move to bar 55\n * ```\n */\nexport function set_x(id: Label, x: number): Label {\n if (isDeleted(id)) return id;\n x = checkBarIndex('label.set_x', 'x', x, id.xloc);\n id.x = x;\n return id;\n}\n\n/**\n * Sets the y coordinate (price level).\n *\n * @param id - Label object to modify\n * @param y - New y coordinate\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_y(label, 160); // Move to price 160\n * ```\n */\nexport function set_y(id: Label, y: number): Label {\n if (isDeleted(id)) return id;\n id.y = y;\n return id;\n}\n\n/**\n * Sets both x and y coordinates.\n *\n * @param id - Label object to modify\n * @param x - New x coordinate\n * @param y - New y coordinate\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_xy(label, 60, 160); // Move to (60, 160)\n * ```\n */\nexport function set_xy(id: Label, x: number, y: number): Label {\n if (isDeleted(id)) return id;\n x = checkBarIndex('label.set_x', 'x', x, id.xloc);\n id.x = x;\n id.y = y;\n return id;\n}\n\n/**\n * Sets the x-axis coordinate system.\n *\n * @param id - Label object to modify\n * @param x - New x coordinate\n * @param xloc - New coordinate system\n * @returns Modified label object\n *\n * @remarks\n * When changing xloc, you must provide an appropriate x coordinate for the new system.\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_xloc(label, 1609459200000, 'bar_time'); // Change to timestamp\n * ```\n */\nexport function set_xloc(id: Label, x: number, xloc: 'bar_index' | 'bar_time' | 'pane'): Label {\n if (isDeleted(id)) return id;\n id.x = x;\n id.xloc = xloc;\n return id;\n}\n\n/**\n * Sets the y-location mode of the label (PineScript `label.set_yloc(id, yloc)`): `price` uses the\n * label's y, `abovebar` / `belowbar` place it above / below the bar.\n */\nexport function set_yloc(id: Label, yloc: 'price' | 'abovebar' | 'belowbar'): Label {\n if (isDeleted(id)) return id;\n id.yloc = yloc;\n return id;\n}\n\n// =============================================================================\n// CONTENT SETTERS\n// =============================================================================\n\n/**\n * Sets the text content.\n *\n * @param id - Label object to modify\n * @param text - New text content\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_text(label, 'Updated Text');\n * ```\n */\nexport function set_text(id: Label, text: string): Label {\n if (isDeleted(id)) return id;\n id.text = text;\n return id;\n}\n\n/**\n * Sets the tooltip text.\n *\n * @param id - Label object to modify\n * @param tooltip - New tooltip text\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_tooltip(label, 'Resistance level formed at 155.5');\n * ```\n */\nexport function set_tooltip(id: Label, tooltip: string): Label {\n if (isDeleted(id)) return id;\n id.tooltip = tooltip;\n return id;\n}\n\n// =============================================================================\n// STYLING SETTERS\n// =============================================================================\n\n/**\n * Sets the label color (border and arrow).\n *\n * @param id - Label object to modify\n * @param labelColor - New color\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_color(label, '#FF0000'); // Red label\n * ```\n */\nexport function set_color(id: Label, labelColor: color): Label {\n if (isDeleted(id)) return id;\n id.color = labelColor;\n return id;\n}\n\n/**\n * Sets the text color.\n *\n * @param id - Label object to modify\n * @param textColor - New text color\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_textcolor(label, '#FFFFFF'); // White text\n * ```\n */\nexport function set_textcolor(id: Label, textColor: color): Label {\n if (isDeleted(id)) return id;\n id.textcolor = textColor;\n return id;\n}\n\n/**\n * Sets the label style.\n *\n * @param id - Label object to modify\n * @param style - New label style\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_style(label, 'label_down'); // Arrow pointing down\n * ```\n */\nexport function set_style(\n id: Label,\n style: 'none' | 'xcross' | 'cross' | 'triangleup' | 'triangledown' | 'flag' | 'circle' |\n 'arrowup' | 'arrowdown' | 'label_up' | 'label_down' | 'label_left' | 'label_right' |\n 'label_lower_left' | 'label_lower_right' | 'label_upper_left' | 'label_upper_right' |\n 'label_center' | 'square' | 'diamond' | 'text_outline'\n): Label {\n if (isDeleted(id)) return id;\n id.style = style;\n return id;\n}\n\n/**\n * Sets the label size.\n *\n * @param id - Label object to modify\n * @param size - New size\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_size(label, 'large'); // Larger label\n * ```\n */\nexport function set_size(id: Label, size: string | number): Label {\n if (isDeleted(id)) return id;\n id.size = size;\n return id;\n}\n\n/**\n * Sets the text alignment.\n *\n * @param id - Label object to modify\n * @param align - New text alignment\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_textalign(label, 'center'); // Center-aligned text\n * ```\n */\nexport function set_textalign(id: Label, align: 'left' | 'center' | 'right'): Label {\n if (isDeleted(id)) return id;\n id.textalign = align;\n return id;\n}\n\n/**\n * Sets the text font family.\n *\n * @param id - Label object to modify\n * @param font - New font family\n * @returns Modified label object\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.set_text_font_family(label, 'monospace');\n * ```\n */\nexport function set_text_font_family(id: Label, font: 'default' | 'monospace'): Label {\n if (isDeleted(id)) return id;\n id.text_font_family = font;\n return id;\n}\n\n/**\n * Deletes the label object.\n *\n * @param id - Label object to delete\n *\n * @remarks\n * Removes the label from `label.all()`. As in PineScript, the deleted label is `na`: its getters\n * return NaN and its setters do nothing. Deleting it twice has no effect.\n *\n * @example\n * ```typescript\n * const label = label.new(50, 155.5, 'Pivot');\n * label.delete(label);\n * // label.all() no longer contains it\n * ```\n */\nexport function delete_label(id: Label): void {\n remove('label', id);\n}\n\n/** x coordinate of a chart point for an object's xloc (`na` when the point has no such coordinate). */\nfunction pointX(point: ChartPoint, xloc: 'bar_index' | 'bar_time' | 'pane'): number {\n const x = xloc === 'bar_time' ? point.time : point.index;\n return x ?? NaN;\n}\n\n/**\n * All live labels, in creation order (PineScript `label.all`). A new array.\n */\nexport function all(): Label[] {\n return allDrawings('label');\n}\n\n/**\n * Sets the label position from a chart point: `point.index` for `bar_index` labels, `point.time`\n * for `bar_time` labels, and `point.price`.\n */\nexport function set_point(id: Label, point: ChartPoint): Label {\n if (isDeleted(id)) return id;\n id.x = pointX(point, id.xloc);\n id.y = point.price;\n return id;\n}\n\n/**\n * Sets the text formatting: `text.format_none`, `text.format_bold`, `text.format_italic`,\n * or `text.format_bold + text.format_italic`.\n */\nexport function set_text_formatting(id: Label, formatting: number): Label {\n if (isDeleted(id)) return id;\n id.text_formatting = formatting;\n return id;\n}\n\n// Alias to match PineScript API\nexport { new_label as new };\nexport { delete_label as delete };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,sBAA+E;AAsDxE,SAAS,aAAa,MAAwB;AACnD,MAAI,GAAW,GAAW;AAC1B,MAAI,OAAO,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,MAAM,MAAM;AACnD,UAAM,QAAQ,KAAK,CAAC;AACpB,WAAO,KAAK,MAAM,CAAC;AACnB,QAAI,OAAO,OAAQ,KAAK,CAAC,KAA+B,WAAW;AACnE,QAAI,MAAM;AAAA,EACZ,OAAO;AACL,KAAC,GAAG,CAAC,IAAI;AACT,WAAO,KAAK,MAAM,CAAC;AAAA,EACrB;AACA,QAAM;AAAA,IAAC;AAAA,IAAM;AAAA,IAAM;AAAA,IAAM;AAAA,IAAY;AAAA,IAAO;AAAA,IAAW;AAAA,IAAM;AAAA,IAAW;AAAA,IAAS;AAAA,IAC/E;AAAA,IAAe;AAAA,EAAe,IAAI;AAIpC,UAAI,+BAAc,aAAa,KAAK,GAAG,IAAI;AAC3C,aAAO,0BAAS,SAAS;AAAA,IACvB;AAAA,IACA;AAAA,IACA,MAAM,QAAQ;AAAA,IACd,MAAM,QAAQ;AAAA;AAAA,IAEd,MAAM,QAAQ;AAAA,IACd;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe,iBAAiB;AAAA,IAChC;AAAA,EACF,CAAC;AACH;AAcO,SAAS,MAAM,IAAmB;AACv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AU,EAAE,EAAG,QAAO;AAC1B,KAAG,YAAY;AACf,SAAO;AACT;AAeO,SAAS,UACd,IACA,OAIO;AACP,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,QAAQ;AACX,SAAO;AACT;AAeO,SAAS,SAAS,IAAW,MAA8B;AAChE,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,OAAO;AACV,SAAO;AACT;AAeO,SAAS,cAAc,IAAW,OAA2C;AAClF,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,YAAY;AACf,SAAO;AACT;AAeO,SAAS,qBAAqB,IAAW,MAAsC;AACpF,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,mBAAmB;AACtB,SAAO;AACT;AAkBO,SAAS,aAAa,IAAiB;AAC5C,8BAAO,SAAS,EAAE;AACpB;AAGA,SAAS,OAAO,OAAmB,MAAiD;AAClF,QAAM,IAAI,SAAS,aAAa,MAAM,OAAO,MAAM;AACnD,SAAO,KAAK;AACd;AAKO,SAAS,MAAe;AAC7B,aAAO,gBAAAA,KAAY,OAAO;AAC5B;AAMO,SAAS,UAAU,IAAW,OAA0B;AAC7D,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,IAAI,OAAO,OAAO,GAAG,IAAI;AAC5B,KAAG,IAAI,MAAM;AACb,SAAO;AACT;AAMO,SAAS,oBAAoB,IAAW,YAA2B;AACxE,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,kBAAkB;AACrB,SAAO;AACT;",
6
6
  "names": ["allDrawings"]
7
7
  }
@@ -10,7 +10,7 @@
10
10
  * @version 6
11
11
  */
12
12
  import type { ChartPoint, Line, color } from '../types/index.js';
13
- type LineXloc = 'bar_index' | 'bar_time';
13
+ type LineXloc = 'bar_index' | 'bar_time' | 'pane';
14
14
  type LineExtend = 'none' | 'left' | 'right' | 'both';
15
15
  type LineStyle = 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';
16
16
  /**
@@ -44,7 +44,7 @@ export declare function new_line(x1: number, y1: number, x2: number, y2: number,
44
44
  * As in PineScript (#174):
45
45
  * - the line is read as extended on both sides whatever its `extend`: a point before x1 or after x2 has a price
46
46
  * - the price is `y1 + (y2 - y1) * (x - x1) / (x2 - x1)`, in that order (bit for bit)
47
- * - a line placed with `xloc.bar_time` throws "'line.get_price' must be used with lines created using
47
+ * - a line placed with `xloc.bar_time` (or `xloc.pane`) throws "'line.get_price' must be used with lines created using
48
48
  * 'xloc=xloc.bar_index'." (runtime error RE10119)
49
49
  *
50
50
  * @example
@@ -220,7 +220,7 @@ export declare function set_xy2(id: Line, x: number, y: number): Line;
220
220
  * @param id - Line object to modify
221
221
  * @param x1 - New first point x coordinate
222
222
  * @param x2 - New second point x coordinate
223
- * @param xloc - New coordinate system ('bar_index' or 'bar_time')
223
+ * @param xloc - New coordinate system ('bar_index', 'bar_time' or 'pane')
224
224
  * @returns Modified line object
225
225
  *
226
226
  * @remarks
@@ -233,7 +233,7 @@ export declare function set_xy2(id: Line, x: number, y: number): Line;
233
233
  * line.set_xloc(line, 1609459200000, 1609545600000, 'bar_time');
234
234
  * ```
235
235
  */
236
- export declare function set_xloc(id: Line, x1: number, x2: number, xloc: 'bar_index' | 'bar_time'): Line;
236
+ export declare function set_xloc(id: Line, x1: number, x2: number, xloc: 'bar_index' | 'bar_time' | 'pane'): Line;
237
237
  /**
238
238
  * Sets the extension mode of the line.
239
239
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/line/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEjE,KAAK,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AACzC,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AACrD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AG,IAAI,CAIvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,IAAI,GAAG,IAAI,CAE1C;AAQD;;GAEG;AACH,wBAAgB,GAAG,IAAI,IAAI,EAAE,CAE5B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAKjE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAKlE;AAGD,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,CAAC;AAC3B,OAAO,EAAE,WAAW,IAAI,MAAM,EAAE,CAAC"}
@@ -73,7 +73,7 @@ function new_line(...args) {
73
73
  }
74
74
  function get_price(id, x) {
75
75
  const { x1, y1, x2, y2, xloc } = id;
76
- if (xloc === "bar_time") {
76
+ if (xloc !== "bar_index") {
77
77
  throw new Error("'line.get_price' must be used with lines created using 'xloc=xloc.bar_index'.");
78
78
  }
79
79
  if (x2 === x1) return NaN;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/line/index.ts"],
4
- "sourcesContent": ["/**\n * Line namespace\n * Functions for creating and manipulating line drawing objects.\n *\n * @remarks\n * While lines are primarily visual in PineScript, the line.get_price() function provides\n * computational value for algorithmic trading - calculating trend line breakouts,\n * support/resistance levels, and pattern recognition.\n *\n * @version 6\n */\n\nimport { all as allDrawings, checkBarIndex, isDeleted, register, remove } from '../drawing/registry.js';\nimport type { ChartPoint, Line, color } from '../types/index.js';\n\ntype LineXloc = 'bar_index' | 'bar_time';\ntype LineExtend = 'none' | 'left' | 'right' | 'both';\ntype LineStyle = 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';\n\n/**\n * Creates a new line (PineScript `line.new`), with two chart points or with coordinates:\n *\n * - `line.new(first_point, second_point, xloc?, extend?, color?, style?, width?, force_overlay?)`\n * - `line.new(x1, y1, x2, y2, xloc?, extend?, color?, style?, width?, force_overlay?)`\n *\n * With chart points, x is `point.index` for `bar_index` lines and `point.time` for `bar_time` lines.\n *\n * @example\n * ```typescript\n * // Create a trend line from bar 0 (price 100) to bar 50 (price 150)\n * const trendLine = line.new(0, 100, 50, 150, 'bar_index', 'right');\n * const fromPoints = line.new(chartPoint.from_index(0, 100), chartPoint.from_index(50, 150));\n *\n * // Calculate price at bar 75 (extrapolated)\n * const price = line.get_price(trendLine, 75); // Returns 175\n * ```\n */\nexport function new_line(\n first_point: ChartPoint,\n second_point: ChartPoint,\n xloc?: LineXloc,\n extend?: LineExtend,\n lineColor?: color,\n style?: LineStyle,\n width?: number,\n force_overlay?: boolean\n): Line;\nexport function new_line(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n xloc?: LineXloc,\n extend?: LineExtend,\n lineColor?: color,\n style?: LineStyle,\n width?: number,\n force_overlay?: boolean\n): Line;\nexport function new_line(...args: unknown[]): Line {\n let x1: number, y1: number, x2: number, y2: number, rest: unknown[];\n if (typeof args[0] === 'object' && args[0] !== null) {\n const [p1, p2, ...others] = args as [ChartPoint, ChartPoint, ...unknown[]];\n const xloc = (others[0] as LineXloc | undefined) ?? 'bar_index';\n [x1, y1, x2, y2, rest] = [pointX(p1, xloc), p1.price, pointX(p2, xloc), p2.price, others];\n } else {\n [x1, y1, x2, y2] = args as [number, number, number, number];\n rest = args.slice(4);\n }\n const [xloc, extend, lineColor, style, width, force_overlay] = rest as [\n LineXloc?, LineExtend?, color?, LineStyle?, number?, boolean?,\n ];\n x1 = checkBarIndex('line.new', 'x1', x1, xloc);\n x2 = checkBarIndex('line.new', 'x2', x2, xloc);\n return register('line', {\n x1,\n y1,\n x2,\n y2,\n xloc: xloc ?? 'bar_index',\n extend: extend ?? 'none',\n color: lineColor,\n style: style || 'solid',\n width: width ?? 1,\n force_overlay: force_overlay ?? false,\n });\n}\n\n/**\n * Returns the price level of a line at a given bar index (PineScript `line.get_price`).\n *\n * @param id - Line object\n * @param x - Bar index to calculate price at\n * @returns Price level at the given bar index; NaN for a vertical line (x1 == x2) or a deleted line\n *\n * @remarks\n * As in PineScript (#174):\n * - the line is read as extended on both sides whatever its `extend`: a point before x1 or after x2 has a price\n * - the price is `y1 + (y2 - y1) * (x - x1) / (x2 - x1)`, in that order (bit for bit)\n * - a line placed with `xloc.bar_time` throws \"'line.get_price' must be used with lines created using\n * 'xloc=xloc.bar_index'.\" (runtime error RE10119)\n *\n * @example\n * ```typescript\n * const trendLine = line.new(0, 100, 50, 150, 'bar_index', 'right');\n *\n * line.get_price(trendLine, 25); // 125\n * line.get_price(trendLine, 100); // 200\n * line.get_price(trendLine, -10); // 90: extended to the left too\n * ```\n */\nexport function get_price(id: Line, x: number): number {\n const { x1, y1, x2, y2, xloc } = id;\n if (xloc === 'bar_time') {\n throw new Error(\"'line.get_price' must be used with lines created using 'xloc=xloc.bar_index'.\");\n }\n if (x2 === x1) return NaN;\n return y1 + ((y2 - y1) * (x - x1)) / (x2 - x1);\n}\n\n/**\n * Returns the first point's x coordinate.\n *\n * @param id - Line object\n * @returns X coordinate of the first point\n *\n * @example\n * ```typescript\n * const line = line.new(10, 100, 50, 150);\n * const x1 = line.get_x1(line); // Returns 10\n * ```\n */\nexport function get_x1(id: Line): number {\n return id.x1;\n}\n\n/**\n * Returns the second point's x coordinate.\n *\n * @param id - Line object\n * @returns X coordinate of the second point\n *\n * @example\n * ```typescript\n * const line = line.new(10, 100, 50, 150);\n * const x2 = line.get_x2(line); // Returns 50\n * ```\n */\nexport function get_x2(id: Line): number {\n return id.x2;\n}\n\n/**\n * Returns the first point's y coordinate (price level).\n *\n * @param id - Line object\n * @returns Y coordinate (price) of the first point\n *\n * @example\n * ```typescript\n * const line = line.new(10, 100, 50, 150);\n * const y1 = line.get_y1(line); // Returns 100\n * ```\n */\nexport function get_y1(id: Line): number {\n return id.y1;\n}\n\n/**\n * Returns the second point's y coordinate (price level).\n *\n * @param id - Line object\n * @returns Y coordinate (price) of the second point\n *\n * @example\n * ```typescript\n * const line = line.new(10, 100, 50, 150);\n * const y2 = line.get_y2(line); // Returns 150\n * ```\n */\nexport function get_y2(id: Line): number {\n return id.y2;\n}\n\n/**\n * Creates a copy of the line object.\n *\n * @param id - Line object to copy\n * @returns New line object with same properties\n *\n * @remarks\n * Creates a shallow copy of the line. Modifications to the copy won't affect the original.\n *\n * @example\n * ```typescript\n * const originalLine = line.new(0, 100, 50, 150);\n * const copiedLine = line.copy(originalLine);\n *\n * // Modify copy without affecting original\n * copiedLine.y2 = 200;\n * ```\n */\nexport function copy(id: Line): Line {\n return register('line', { ...id });\n}\n\n/**\n * Sets the first point's x coordinate.\n *\n * @param id - Line object to modify\n * @param x - New x coordinate (bar index or timestamp)\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_x1(line, 10); // Move first point to bar 10\n * ```\n */\nexport function set_x1(id: Line, x: number): Line {\n if (isDeleted(id)) return id;\n x = checkBarIndex('line.set_x***', 'x1', x, id.xloc);\n id.x1 = x;\n return id;\n}\n\n/**\n * Sets the second point's x coordinate.\n *\n * @param id - Line object to modify\n * @param x - New x coordinate (bar index or timestamp)\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_x2(line, 60); // Move second point to bar 60\n * ```\n */\nexport function set_x2(id: Line, x: number): Line {\n if (isDeleted(id)) return id;\n x = checkBarIndex('line.set_x***', 'x2', x, id.xloc);\n id.x2 = x;\n return id;\n}\n\n/**\n * Sets the first point's y coordinate (price level).\n *\n * @param id - Line object to modify\n * @param y - New y coordinate (price)\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_y1(line, 110); // Move first point to price 110\n * ```\n */\nexport function set_y1(id: Line, y: number): Line {\n if (isDeleted(id)) return id;\n id.y1 = y;\n return id;\n}\n\n/**\n * Sets the second point's y coordinate (price level).\n *\n * @param id - Line object to modify\n * @param y - New y coordinate (price)\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_y2(line, 160); // Move second point to price 160\n * ```\n */\nexport function set_y2(id: Line, y: number): Line {\n if (isDeleted(id)) return id;\n id.y2 = y;\n return id;\n}\n\n/**\n * Sets both coordinates of the first point.\n *\n * @param id - Line object to modify\n * @param x - New x coordinate\n * @param y - New y coordinate\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_xy1(line, 5, 105); // Move first point to (5, 105)\n * ```\n */\nexport function set_xy1(id: Line, x: number, y: number): Line {\n if (isDeleted(id)) return id;\n x = checkBarIndex('line.set_x***', 'x1', x, id.xloc);\n id.x1 = x;\n id.y1 = y;\n return id;\n}\n\n/**\n * Sets both coordinates of the second point.\n *\n * @param id - Line object to modify\n * @param x - New x coordinate\n * @param y - New y coordinate\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_xy2(line, 60, 160); // Move second point to (60, 160)\n * ```\n */\nexport function set_xy2(id: Line, x: number, y: number): Line {\n if (isDeleted(id)) return id;\n x = checkBarIndex('line.set_x***', 'x2', x, id.xloc);\n id.x2 = x;\n id.y2 = y;\n return id;\n}\n\n/**\n * Sets the coordinate system for the line.\n *\n * @param id - Line object to modify\n * @param x1 - New first point x coordinate\n * @param x2 - New second point x coordinate\n * @param xloc - New coordinate system ('bar_index' or 'bar_time')\n * @returns Modified line object\n *\n * @remarks\n * When changing xloc, you must provide appropriate x coordinates for the new system.\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * // Change to timestamp-based coordinates\n * line.set_xloc(line, 1609459200000, 1609545600000, 'bar_time');\n * ```\n */\nexport function set_xloc(id: Line, x1: number, x2: number, xloc: 'bar_index' | 'bar_time'): Line {\n if (isDeleted(id)) return id;\n id.x1 = x1;\n id.x2 = x2;\n id.xloc = xloc;\n return id;\n}\n\n/**\n * Sets the extension mode of the line.\n *\n * @param id - Line object to modify\n * @param extend - New extension mode\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_extend(line, 'right'); // Extend line to the right\n * ```\n */\nexport function set_extend(id: Line, extend: 'none' | 'left' | 'right' | 'both'): Line {\n if (isDeleted(id)) return id;\n id.extend = extend;\n return id;\n}\n\n/**\n * Sets the line color.\n *\n * @param id - Line object to modify\n * @param color - New line color\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_color(line, '#FF0000'); // Change to red\n * ```\n */\nexport function set_color(id: Line, lineColor: color): Line {\n if (isDeleted(id)) return id;\n id.color = lineColor;\n return id;\n}\n\n/**\n * Sets the line style.\n *\n * @param id - Line object to modify\n * @param style - New line style\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_style(line, 'dashed'); // Change to dashed line\n * ```\n */\nexport function set_style(id: Line, style: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both'): Line {\n if (isDeleted(id)) return id;\n id.style = style;\n return id;\n}\n\n/**\n * Sets the line width.\n *\n * @param id - Line object to modify\n * @param width - New line width in pixels\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_width(line, 3); // Make line thicker\n * ```\n */\nexport function set_width(id: Line, width: number): Line {\n if (isDeleted(id)) return id;\n id.width = width;\n return id;\n}\n\n/**\n * Deletes the line object.\n *\n * @param id - Line object to delete\n *\n * @remarks\n * Removes the line from `line.all()`. As in PineScript, the deleted line is `na`: its getters\n * return NaN and its setters do nothing. Deleting it twice has no effect. Deleting a line also deletes the linefills that use it.\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.delete(line);\n * // line.all() no longer contains it\n * ```\n */\nexport function delete_line(id: Line): void {\n remove('line', id);\n}\n\n/** x coordinate of a chart point for an object's xloc (`na` when the point has no such coordinate). */\nfunction pointX(point: ChartPoint, xloc: 'bar_index' | 'bar_time'): number {\n const x = xloc === 'bar_time' ? point.time : point.index;\n return x ?? NaN;\n}\n\n/**\n * All live lines, in creation order (PineScript `line.all`). A new array: later changes do not affect it.\n */\nexport function all(): Line[] {\n return allDrawings('line');\n}\n\n/**\n * Sets the first point of the line from a chart point: `point.index` for `bar_index` lines,\n * `point.time` for `bar_time` lines (`na` when the point does not have it), and `point.price`.\n */\nexport function set_first_point(id: Line, point: ChartPoint): Line {\n if (isDeleted(id)) return id;\n id.x1 = pointX(point, id.xloc);\n id.y1 = point.price;\n return id;\n}\n\n/**\n * Sets the second point of the line from a chart point (see {@link set_first_point}).\n */\nexport function set_second_point(id: Line, point: ChartPoint): Line {\n if (isDeleted(id)) return id;\n id.x2 = pointX(point, id.xloc);\n id.y2 = point.price;\n return id;\n}\n\n// Alias to match PineScript API\nexport { new_line as new };\nexport { delete_line as delete };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,sBAA+E;AA+CxE,SAAS,YAAY,MAAuB;AACjD,MAAI,IAAY,IAAY,IAAY,IAAY;AACpD,MAAI,OAAO,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,MAAM,MAAM;AACnD,UAAM,CAAC,IAAI,IAAI,GAAG,MAAM,IAAI;AAC5B,UAAMA,QAAQ,OAAO,CAAC,KAA8B;AACpD,KAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,IAAIA,KAAI,GAAG,GAAG,OAAO,OAAO,IAAIA,KAAI,GAAG,GAAG,OAAO,MAAM;AAAA,EAC1F,OAAO;AACL,KAAC,IAAI,IAAI,IAAI,EAA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ACnB;AAGA,SAAS,OAAO,OAAmB,MAAwC;AACzE,QAAM,IAAI,SAAS,aAAa,MAAM,OAAO,MAAM;AACnD,SAAO,KAAK;AACd;AAKO,SAAS,MAAc;AAC5B,aAAO,gBAAAC,KAAY,MAAM;AAC3B;AAMO,SAAS,gBAAgB,IAAU,OAAyB;AACjE,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,KAAK,OAAO,OAAO,GAAG,IAAI;AAC7B,KAAG,KAAK,MAAM;AACd,SAAO;AACT;AAKO,SAAS,iBAAiB,IAAU,OAAyB;AAClE,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,KAAK,OAAO,OAAO,GAAG,IAAI;AAC7B,KAAG,KAAK,MAAM;AACd,SAAO;AACT;",
4
+ "sourcesContent": ["/**\n * Line namespace\n * Functions for creating and manipulating line drawing objects.\n *\n * @remarks\n * While lines are primarily visual in PineScript, the line.get_price() function provides\n * computational value for algorithmic trading - calculating trend line breakouts,\n * support/resistance levels, and pattern recognition.\n *\n * @version 6\n */\n\nimport { all as allDrawings, checkBarIndex, isDeleted, register, remove } from '../drawing/registry.js';\nimport type { ChartPoint, Line, color } from '../types/index.js';\n\ntype LineXloc = 'bar_index' | 'bar_time' | 'pane';\ntype LineExtend = 'none' | 'left' | 'right' | 'both';\ntype LineStyle = 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';\n\n/**\n * Creates a new line (PineScript `line.new`), with two chart points or with coordinates:\n *\n * - `line.new(first_point, second_point, xloc?, extend?, color?, style?, width?, force_overlay?)`\n * - `line.new(x1, y1, x2, y2, xloc?, extend?, color?, style?, width?, force_overlay?)`\n *\n * With chart points, x is `point.index` for `bar_index` lines and `point.time` for `bar_time` lines.\n *\n * @example\n * ```typescript\n * // Create a trend line from bar 0 (price 100) to bar 50 (price 150)\n * const trendLine = line.new(0, 100, 50, 150, 'bar_index', 'right');\n * const fromPoints = line.new(chartPoint.from_index(0, 100), chartPoint.from_index(50, 150));\n *\n * // Calculate price at bar 75 (extrapolated)\n * const price = line.get_price(trendLine, 75); // Returns 175\n * ```\n */\nexport function new_line(\n first_point: ChartPoint,\n second_point: ChartPoint,\n xloc?: LineXloc,\n extend?: LineExtend,\n lineColor?: color,\n style?: LineStyle,\n width?: number,\n force_overlay?: boolean\n): Line;\nexport function new_line(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n xloc?: LineXloc,\n extend?: LineExtend,\n lineColor?: color,\n style?: LineStyle,\n width?: number,\n force_overlay?: boolean\n): Line;\nexport function new_line(...args: unknown[]): Line {\n let x1: number, y1: number, x2: number, y2: number, rest: unknown[];\n if (typeof args[0] === 'object' && args[0] !== null) {\n const [p1, p2, ...others] = args as [ChartPoint, ChartPoint, ...unknown[]];\n const xloc = (others[0] as LineXloc | undefined) ?? 'bar_index';\n [x1, y1, x2, y2, rest] = [pointX(p1, xloc), p1.price, pointX(p2, xloc), p2.price, others];\n } else {\n [x1, y1, x2, y2] = args as [number, number, number, number];\n rest = args.slice(4);\n }\n const [xloc, extend, lineColor, style, width, force_overlay] = rest as [\n LineXloc?, LineExtend?, color?, LineStyle?, number?, boolean?,\n ];\n x1 = checkBarIndex('line.new', 'x1', x1, xloc);\n x2 = checkBarIndex('line.new', 'x2', x2, xloc);\n return register('line', {\n x1,\n y1,\n x2,\n y2,\n xloc: xloc ?? 'bar_index',\n extend: extend ?? 'none',\n color: lineColor,\n style: style || 'solid',\n width: width ?? 1,\n force_overlay: force_overlay ?? false,\n });\n}\n\n/**\n * Returns the price level of a line at a given bar index (PineScript `line.get_price`).\n *\n * @param id - Line object\n * @param x - Bar index to calculate price at\n * @returns Price level at the given bar index; NaN for a vertical line (x1 == x2) or a deleted line\n *\n * @remarks\n * As in PineScript (#174):\n * - the line is read as extended on both sides whatever its `extend`: a point before x1 or after x2 has a price\n * - the price is `y1 + (y2 - y1) * (x - x1) / (x2 - x1)`, in that order (bit for bit)\n * - a line placed with `xloc.bar_time` (or `xloc.pane`) throws \"'line.get_price' must be used with lines created using\n * 'xloc=xloc.bar_index'.\" (runtime error RE10119)\n *\n * @example\n * ```typescript\n * const trendLine = line.new(0, 100, 50, 150, 'bar_index', 'right');\n *\n * line.get_price(trendLine, 25); // 125\n * line.get_price(trendLine, 100); // 200\n * line.get_price(trendLine, -10); // 90: extended to the left too\n * ```\n */\nexport function get_price(id: Line, x: number): number {\n const { x1, y1, x2, y2, xloc } = id;\n if (xloc !== 'bar_index') {\n throw new Error(\"'line.get_price' must be used with lines created using 'xloc=xloc.bar_index'.\");\n }\n if (x2 === x1) return NaN;\n return y1 + ((y2 - y1) * (x - x1)) / (x2 - x1);\n}\n\n/**\n * Returns the first point's x coordinate.\n *\n * @param id - Line object\n * @returns X coordinate of the first point\n *\n * @example\n * ```typescript\n * const line = line.new(10, 100, 50, 150);\n * const x1 = line.get_x1(line); // Returns 10\n * ```\n */\nexport function get_x1(id: Line): number {\n return id.x1;\n}\n\n/**\n * Returns the second point's x coordinate.\n *\n * @param id - Line object\n * @returns X coordinate of the second point\n *\n * @example\n * ```typescript\n * const line = line.new(10, 100, 50, 150);\n * const x2 = line.get_x2(line); // Returns 50\n * ```\n */\nexport function get_x2(id: Line): number {\n return id.x2;\n}\n\n/**\n * Returns the first point's y coordinate (price level).\n *\n * @param id - Line object\n * @returns Y coordinate (price) of the first point\n *\n * @example\n * ```typescript\n * const line = line.new(10, 100, 50, 150);\n * const y1 = line.get_y1(line); // Returns 100\n * ```\n */\nexport function get_y1(id: Line): number {\n return id.y1;\n}\n\n/**\n * Returns the second point's y coordinate (price level).\n *\n * @param id - Line object\n * @returns Y coordinate (price) of the second point\n *\n * @example\n * ```typescript\n * const line = line.new(10, 100, 50, 150);\n * const y2 = line.get_y2(line); // Returns 150\n * ```\n */\nexport function get_y2(id: Line): number {\n return id.y2;\n}\n\n/**\n * Creates a copy of the line object.\n *\n * @param id - Line object to copy\n * @returns New line object with same properties\n *\n * @remarks\n * Creates a shallow copy of the line. Modifications to the copy won't affect the original.\n *\n * @example\n * ```typescript\n * const originalLine = line.new(0, 100, 50, 150);\n * const copiedLine = line.copy(originalLine);\n *\n * // Modify copy without affecting original\n * copiedLine.y2 = 200;\n * ```\n */\nexport function copy(id: Line): Line {\n return register('line', { ...id });\n}\n\n/**\n * Sets the first point's x coordinate.\n *\n * @param id - Line object to modify\n * @param x - New x coordinate (bar index or timestamp)\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_x1(line, 10); // Move first point to bar 10\n * ```\n */\nexport function set_x1(id: Line, x: number): Line {\n if (isDeleted(id)) return id;\n x = checkBarIndex('line.set_x***', 'x1', x, id.xloc);\n id.x1 = x;\n return id;\n}\n\n/**\n * Sets the second point's x coordinate.\n *\n * @param id - Line object to modify\n * @param x - New x coordinate (bar index or timestamp)\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_x2(line, 60); // Move second point to bar 60\n * ```\n */\nexport function set_x2(id: Line, x: number): Line {\n if (isDeleted(id)) return id;\n x = checkBarIndex('line.set_x***', 'x2', x, id.xloc);\n id.x2 = x;\n return id;\n}\n\n/**\n * Sets the first point's y coordinate (price level).\n *\n * @param id - Line object to modify\n * @param y - New y coordinate (price)\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_y1(line, 110); // Move first point to price 110\n * ```\n */\nexport function set_y1(id: Line, y: number): Line {\n if (isDeleted(id)) return id;\n id.y1 = y;\n return id;\n}\n\n/**\n * Sets the second point's y coordinate (price level).\n *\n * @param id - Line object to modify\n * @param y - New y coordinate (price)\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_y2(line, 160); // Move second point to price 160\n * ```\n */\nexport function set_y2(id: Line, y: number): Line {\n if (isDeleted(id)) return id;\n id.y2 = y;\n return id;\n}\n\n/**\n * Sets both coordinates of the first point.\n *\n * @param id - Line object to modify\n * @param x - New x coordinate\n * @param y - New y coordinate\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_xy1(line, 5, 105); // Move first point to (5, 105)\n * ```\n */\nexport function set_xy1(id: Line, x: number, y: number): Line {\n if (isDeleted(id)) return id;\n x = checkBarIndex('line.set_x***', 'x1', x, id.xloc);\n id.x1 = x;\n id.y1 = y;\n return id;\n}\n\n/**\n * Sets both coordinates of the second point.\n *\n * @param id - Line object to modify\n * @param x - New x coordinate\n * @param y - New y coordinate\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_xy2(line, 60, 160); // Move second point to (60, 160)\n * ```\n */\nexport function set_xy2(id: Line, x: number, y: number): Line {\n if (isDeleted(id)) return id;\n x = checkBarIndex('line.set_x***', 'x2', x, id.xloc);\n id.x2 = x;\n id.y2 = y;\n return id;\n}\n\n/**\n * Sets the coordinate system for the line.\n *\n * @param id - Line object to modify\n * @param x1 - New first point x coordinate\n * @param x2 - New second point x coordinate\n * @param xloc - New coordinate system ('bar_index', 'bar_time' or 'pane')\n * @returns Modified line object\n *\n * @remarks\n * When changing xloc, you must provide appropriate x coordinates for the new system.\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * // Change to timestamp-based coordinates\n * line.set_xloc(line, 1609459200000, 1609545600000, 'bar_time');\n * ```\n */\nexport function set_xloc(id: Line, x1: number, x2: number, xloc: 'bar_index' | 'bar_time' | 'pane'): Line {\n if (isDeleted(id)) return id;\n id.x1 = x1;\n id.x2 = x2;\n id.xloc = xloc;\n return id;\n}\n\n/**\n * Sets the extension mode of the line.\n *\n * @param id - Line object to modify\n * @param extend - New extension mode\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_extend(line, 'right'); // Extend line to the right\n * ```\n */\nexport function set_extend(id: Line, extend: 'none' | 'left' | 'right' | 'both'): Line {\n if (isDeleted(id)) return id;\n id.extend = extend;\n return id;\n}\n\n/**\n * Sets the line color.\n *\n * @param id - Line object to modify\n * @param color - New line color\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_color(line, '#FF0000'); // Change to red\n * ```\n */\nexport function set_color(id: Line, lineColor: color): Line {\n if (isDeleted(id)) return id;\n id.color = lineColor;\n return id;\n}\n\n/**\n * Sets the line style.\n *\n * @param id - Line object to modify\n * @param style - New line style\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_style(line, 'dashed'); // Change to dashed line\n * ```\n */\nexport function set_style(id: Line, style: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both'): Line {\n if (isDeleted(id)) return id;\n id.style = style;\n return id;\n}\n\n/**\n * Sets the line width.\n *\n * @param id - Line object to modify\n * @param width - New line width in pixels\n * @returns Modified line object\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.set_width(line, 3); // Make line thicker\n * ```\n */\nexport function set_width(id: Line, width: number): Line {\n if (isDeleted(id)) return id;\n id.width = width;\n return id;\n}\n\n/**\n * Deletes the line object.\n *\n * @param id - Line object to delete\n *\n * @remarks\n * Removes the line from `line.all()`. As in PineScript, the deleted line is `na`: its getters\n * return NaN and its setters do nothing. Deleting it twice has no effect. Deleting a line also deletes the linefills that use it.\n *\n * @example\n * ```typescript\n * const line = line.new(0, 100, 50, 150);\n * line.delete(line);\n * // line.all() no longer contains it\n * ```\n */\nexport function delete_line(id: Line): void {\n remove('line', id);\n}\n\n/** x coordinate of a chart point for an object's xloc (`na` when the point has no such coordinate). */\nfunction pointX(point: ChartPoint, xloc: 'bar_index' | 'bar_time' | 'pane'): number {\n const x = xloc === 'bar_time' ? point.time : point.index;\n return x ?? NaN;\n}\n\n/**\n * All live lines, in creation order (PineScript `line.all`). A new array: later changes do not affect it.\n */\nexport function all(): Line[] {\n return allDrawings('line');\n}\n\n/**\n * Sets the first point of the line from a chart point: `point.index` for `bar_index` lines,\n * `point.time` for `bar_time` lines (`na` when the point does not have it), and `point.price`.\n */\nexport function set_first_point(id: Line, point: ChartPoint): Line {\n if (isDeleted(id)) return id;\n id.x1 = pointX(point, id.xloc);\n id.y1 = point.price;\n return id;\n}\n\n/**\n * Sets the second point of the line from a chart point (see {@link set_first_point}).\n */\nexport function set_second_point(id: Line, point: ChartPoint): Line {\n if (isDeleted(id)) return id;\n id.x2 = pointX(point, id.xloc);\n id.y2 = point.price;\n return id;\n}\n\n// Alias to match PineScript API\nexport { new_line as new };\nexport { delete_line as delete };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,sBAA+E;AA+CxE,SAAS,YAAY,MAAuB;AACjD,MAAI,IAAY,IAAY,IAAY,IAAY;AACpD,MAAI,OAAO,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,MAAM,MAAM;AACnD,UAAM,CAAC,IAAI,IAAI,GAAG,MAAM,IAAI;AAC5B,UAAMA,QAAQ,OAAO,CAAC,KAA8B;AACpD,KAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,OAAO,IAAIA,KAAI,GAAG,GAAG,OAAO,OAAO,IAAIA,KAAI,GAAG,GAAG,OAAO,MAAM;AAAA,EAC1F,OAAO;AACL,KAAC,IAAI,IAAI,IAAI,EAAE,IAAI;AACnB,WAAO,KAAK,MAAM,CAAC;AAAA,EACrB;AACA,QAAM,CAAC,MAAM,QAAQ,WAAW,OAAO,OAAO,aAAa,IAAI;AAG/D,WAAK,+BAAc,YAAY,MAAM,IAAI,IAAI;AAC7C,WAAK,+BAAc,YAAY,MAAM,IAAI,IAAI;AAC7C,aAAO,0BAAS,QAAQ;AAAA,I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O;AAC1B,KAAG,KAAK,OAAO,OAAO,GAAG,IAAI;AAC7B,KAAG,KAAK,MAAM;AACd,SAAO;AACT;AAKO,SAAS,iBAAiB,IAAU,OAAyB;AAClE,UAAI,2BAAU,EAAE,EAAG,QAAO;AAC1B,KAAG,KAAK,OAAO,OAAO,GAAG,IAAI;AAC7B,KAAG,KAAK,MAAM;AACd,SAAO;AACT;",
6
6
  "names": ["xloc", "allDrawings"]
7
7
  }
@@ -17,7 +17,7 @@ export type { Polyline };
17
17
  * @param points - Array of chart.point objects to connect
18
18
  * @param curved - If true, use curved line segments (default: false)
19
19
  * @param closed - If true, connect first point to last point (default: false)
20
- * @param xloc - X-coordinate mode: 'bar_index' or 'bar_time' (default: 'bar_index')
20
+ * @param xloc - X-coordinate mode: 'bar_index', 'bar_time' or 'pane' (the index of a point is its percent of the pane's width); default: 'bar_index'
21
21
  * @param line_color - Color of line segments (default: '#2196F3' - blue)
22
22
  * @param fill_color - Fill color for closed polylines (default: null)
23
23
  * @param line_style - Line style (default: 'solid')
@@ -54,7 +54,7 @@ export type { Polyline };
54
54
  * );
55
55
  * ```
56
56
  */
57
- export declare function new_polyline(points: ChartPoint[], curved?: boolean, closed?: boolean, xloc?: 'bar_index' | 'bar_time', line_color?: color, fill_color?: color | null, line_style?: 'solid' | 'dotted' | 'dashed', line_width?: number, force_overlay?: boolean): Polyline;
57
+ export declare function new_polyline(points: ChartPoint[], curved?: boolean, closed?: boolean, xloc?: 'bar_index' | 'bar_time' | 'pane', line_color?: color, fill_color?: color | null, line_style?: 'solid' | 'dotted' | 'dashed', line_width?: number, force_overlay?: boolean): Polyline;
58
58
  /**
59
59
  * Deletes a polyline.
60
60
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/polyline/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC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AAE,OAAe,EACvB,IAAI,GAAE,WAAW,GAAG,UAAU,GAAG,MAAoB,EACrD,UAAU,GAAE,KAAiB,EAC7B,UAAU,GAAE,KAAK,GAAG,IAAW,EAC/B,UAAU,GAAE,OAAO,GAAG,QAAQ,GAAG,QAAkB,EACnD,UAAU,GAAE,MAAU,EACtB,aAAa,GAAE,OAAe,GAC7B,QAAQ,CAuBV;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAElD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,IAAI,SAAS,QAAQ,EAAE,CAE7C;AAED;;GAEG;AACH,wBAAgB,GAAG,IAAI,QAAQ,EAAE,CAEhC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAGD,OAAO,EAAE,YAAY,IAAI,GAAG,EAAE,CAAC;AAC/B,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/polyline/index.ts"],
4
- "sourcesContent": ["/**\n * Polyline namespace\n * Functions for creating and manipulating polyline drawing objects.\n *\n * @remarks\n * Polylines allow connecting multiple points with line segments, enabling complex chart drawings\n * like trend channels, patterns, and custom shapes. The `curved` flag goes to the renderer\n * (`result.polylines` of the script API), which draws the curve.\n *\n * @version 6\n */\n\nimport type { ChartPoint, Polyline, color } from '../types/index.js';\nimport { all as allDrawings, checkBarIndex, register, remove } from '../drawing/registry.js';\n\n// Re-export the Polyline type for convenience\nexport type { Polyline };\n\n// Internal counter for generating unique IDs\nlet polylineIdCounter = 0;\n\n/**\n * Generates a unique ID for a polyline\n */\nfunction generateId(): string {\n return `polyline_${++polylineIdCounter}`;\n}\n\n/**\n * Creates a new polyline connecting all points.\n *\n * @param points - Array of chart.point objects to connect\n * @param curved - If true, use curved line segments (default: false)\n * @param closed - If true, connect first point to last point (default: false)\n * @param xloc - X-coordinate mode: 'bar_index' or 'bar_time' (default: 'bar_index')\n * @param line_color - Color of line segments (default: '#2196F3' - blue)\n * @param fill_color - Fill color for closed polylines (default: null)\n * @param line_style - Line style (default: 'solid')\n * @param line_width - Line width in pixels (default: 1)\n * @param force_overlay - Force display on main pane (default: false)\n * @returns New Polyline object\n *\n * @remarks\n * - For meaningful polylines, provide at least 2 points.\n * - Closed polylines can be filled with a color by setting fill_color.\n *\n * @example\n * ```typescript\n * import { chartPoint, polyline } from 'oakscriptjs';\n *\n * // Create points\n * const points = [\n * chartPoint.from_index(0, 100),\n * chartPoint.from_index(10, 120),\n * chartPoint.from_index(20, 110)\n * ];\n *\n * // Create a basic polyline\n * const myPolyline = polyline.new(points);\n *\n * // Create a closed polygon with fill\n * const polygon = polyline.new(\n * points,\n * false, // curved\n * true, // closed\n * 'bar_index', // xloc\n * '#FF5722', // line_color\n * 'rgba(255, 87, 34, 0.3)' // fill_color\n * );\n * ```\n */\nexport function new_polyline(\n points: ChartPoint[],\n curved: boolean = false,\n closed: boolean = false,\n xloc: 'bar_index' | 'bar_time' = 'bar_index',\n line_color: color = '#2196F3',\n fill_color: color | null = null,\n line_style: 'solid' | 'dotted' | 'dashed' = 'solid',\n line_width: number = 1,\n force_overlay: boolean = false\n): Polyline {\n // Validate line_width is positive\n if (line_width < 1) {\n console.warn('polyline.new(): line_width must be at least 1. Using 1.');\n line_width = 1;\n }\n\n if (xloc === 'bar_index') for (const point of points) if (point.index !== null) checkBarIndex('polyline.new', 'points', point.index, xloc);\n\n const polyline: Polyline = {\n id: generateId(),\n points: [...points], // Create a copy of the points array\n curved,\n closed,\n xloc,\n line_color,\n fill_color,\n line_style,\n line_width,\n force_overlay,\n };\n\n return register('polyline', polyline);\n}\n\n/**\n * Deletes a polyline.\n *\n * @param id - Polyline object to delete\n *\n * @remarks\n * Removes the polyline from `polyline.all()` (the drawing registry, see drawing/registry).\n *\n * @example\n * ```typescript\n * const myPolyline = polyline.new(points);\n * polyline.delete(myPolyline);\n * ```\n */\nexport function delete_polyline(id: Polyline): void {\n remove('polyline', id);\n}\n\n/**\n * Gets all active polylines.\n *\n * @returns Array of all active polylines\n *\n * @remarks\n * Returns a copy of the internal polylines array to prevent external modification.\n *\n * @example\n * ```typescript\n * console.log('Total polylines:', polyline.all.length);\n *\n * for (const p of polyline.all) {\n * console.log('Polyline ID:', p.id, 'Points:', p.points.length);\n * }\n * ```\n */\nexport function get_all(): readonly Polyline[] {\n return allDrawings('polyline');\n}\n\n/**\n * All live polylines, in creation order (PineScript `polyline.all`). A new array.\n */\nexport function all(): Polyline[] {\n return allDrawings('polyline');\n}\n\n/**\n * Deletes all polylines.\n *\n * @remarks\n * This is useful for resetting state, especially in tests.\n * Not part of the PineScript API.\n */\nexport function clear_all(): void {\n for (const p of allDrawings('polyline')) remove('polyline', p);\n}\n\n/**\n * Resets the polyline ID counter.\n *\n * @remarks\n * This is useful for resetting state, especially in tests.\n * Not part of the PineScript API.\n */\nexport function reset_id_counter(): void {\n polylineIdCounter = 0;\n}\n\n// Aliases to match PineScript API\nexport { new_polyline as new };\nexport { delete_polyline as delete };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,sBAAoE;AAMpE,IAAI,oBAAoB;AAKxB,SAAS,aAAqB;AAC5B,SAAO,YAAY,EAAE,iBAAiB;AACxC;AA6CO,SAAS,aACd,QACA,SAAkB,OAClB,SAAkB,OAClB,OAAiC,aACjC,aAAoB,WACpB,aAA2B,MAC3B,aAA4C,SAC5C,aAAqB,GACrB,gBAAyB,OACf;AAEV,MAAI,aAAa,GAAG;AAClB,YAAQ,KAAK,yDAAyD;AACtE,iBAAa;AAAA,EACf;AAEA,MAAI,SAAS;AAAa,eAAW,SAAS,OAAQ,KAAI,MAAM,UAAU,KAAM,oCAAc,gBAAgB,UAAU,MAAM,OAAO,IAAI;AAAA;AAEzI,QAAM,WAAqB;AAAA,IACzB,IAAI,WAAW;AAAA,IACf,QAAQ,CAAC,GAAG,MAAM;AAAA;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,aAAO,0BAAS,YAAY,QAAQ;AACtC;AAgBO,SAAS,gBAAgB,IAAoB;AAClD,8BAAO,YAAY,EAAE;AACvB;AAmBO,SAAS,UAA+B;AAC7C,aAAO,gBAAAA,KAAY,UAAU;AAC/B;AAKO,SAAS,MAAkB;AAChC,aAAO,gBAAAA,KAAY,UAAU;AAC/B;AASO,SAAS,YAAkB;AAChC,aAAW,SAAK,gBAAAA,KAAY,UAAU,EAAG,6BAAO,YAAY,CAAC;AAC/D;AASO,SAAS,mBAAyB;AACvC,sBAAoB;AACtB;",
4
+ "sourcesContent": ["/**\n * Polyline namespace\n * Functions for creating and manipulating polyline drawing objects.\n *\n * @remarks\n * Polylines allow connecting multiple points with line segments, enabling complex chart drawings\n * like trend channels, patterns, and custom shapes. The `curved` flag goes to the renderer\n * (`result.polylines` of the script API), which draws the curve.\n *\n * @version 6\n */\n\nimport type { ChartPoint, Polyline, color } from '../types/index.js';\nimport { all as allDrawings, checkBarIndex, register, remove } from '../drawing/registry.js';\n\n// Re-export the Polyline type for convenience\nexport type { Polyline };\n\n// Internal counter for generating unique IDs\nlet polylineIdCounter = 0;\n\n/**\n * Generates a unique ID for a polyline\n */\nfunction generateId(): string {\n return `polyline_${++polylineIdCounter}`;\n}\n\n/**\n * Creates a new polyline connecting all points.\n *\n * @param points - Array of chart.point objects to connect\n * @param curved - If true, use curved line segments (default: false)\n * @param closed - If true, connect first point to last point (default: false)\n * @param xloc - X-coordinate mode: 'bar_index', 'bar_time' or 'pane' (the index of a point is its percent of the pane's width); default: 'bar_index'\n * @param line_color - Color of line segments (default: '#2196F3' - blue)\n * @param fill_color - Fill color for closed polylines (default: null)\n * @param line_style - Line style (default: 'solid')\n * @param line_width - Line width in pixels (default: 1)\n * @param force_overlay - Force display on main pane (default: false)\n * @returns New Polyline object\n *\n * @remarks\n * - For meaningful polylines, provide at least 2 points.\n * - Closed polylines can be filled with a color by setting fill_color.\n *\n * @example\n * ```typescript\n * import { chartPoint, polyline } from 'oakscriptjs';\n *\n * // Create points\n * const points = [\n * chartPoint.from_index(0, 100),\n * chartPoint.from_index(10, 120),\n * chartPoint.from_index(20, 110)\n * ];\n *\n * // Create a basic polyline\n * const myPolyline = polyline.new(points);\n *\n * // Create a closed polygon with fill\n * const polygon = polyline.new(\n * points,\n * false, // curved\n * true, // closed\n * 'bar_index', // xloc\n * '#FF5722', // line_color\n * 'rgba(255, 87, 34, 0.3)' // fill_color\n * );\n * ```\n */\nexport function new_polyline(\n points: ChartPoint[],\n curved: boolean = false,\n closed: boolean = false,\n xloc: 'bar_index' | 'bar_time' | 'pane' = 'bar_index',\n line_color: color = '#2196F3',\n fill_color: color | null = null,\n line_style: 'solid' | 'dotted' | 'dashed' = 'solid',\n line_width: number = 1,\n force_overlay: boolean = false\n): Polyline {\n // Validate line_width is positive\n if (line_width < 1) {\n console.warn('polyline.new(): line_width must be at least 1. Using 1.');\n line_width = 1;\n }\n\n if (xloc === 'bar_index') for (const point of points) if (point.index !== null) checkBarIndex('polyline.new', 'points', point.index, xloc);\n\n const polyline: Polyline = {\n id: generateId(),\n points: [...points], // Create a copy of the points array\n curved,\n closed,\n xloc,\n line_color,\n fill_color,\n line_style,\n line_width,\n force_overlay,\n };\n\n return register('polyline', polyline);\n}\n\n/**\n * Deletes a polyline.\n *\n * @param id - Polyline object to delete\n *\n * @remarks\n * Removes the polyline from `polyline.all()` (the drawing registry, see drawing/registry).\n *\n * @example\n * ```typescript\n * const myPolyline = polyline.new(points);\n * polyline.delete(myPolyline);\n * ```\n */\nexport function delete_polyline(id: Polyline): void {\n remove('polyline', id);\n}\n\n/**\n * Gets all active polylines.\n *\n * @returns Array of all active polylines\n *\n * @remarks\n * Returns a copy of the internal polylines array to prevent external modification.\n *\n * @example\n * ```typescript\n * console.log('Total polylines:', polyline.all.length);\n *\n * for (const p of polyline.all) {\n * console.log('Polyline ID:', p.id, 'Points:', p.points.length);\n * }\n * ```\n */\nexport function get_all(): readonly Polyline[] {\n return allDrawings('polyline');\n}\n\n/**\n * All live polylines, in creation order (PineScript `polyline.all`). A new array.\n */\nexport function all(): Polyline[] {\n return allDrawings('polyline');\n}\n\n/**\n * Deletes all polylines.\n *\n * @remarks\n * This is useful for resetting state, especially in tests.\n * Not part of the PineScript API.\n */\nexport function clear_all(): void {\n for (const p of allDrawings('polyline')) remove('polyline', p);\n}\n\n/**\n * Resets the polyline ID counter.\n *\n * @remarks\n * This is useful for resetting state, especially in tests.\n * Not part of the PineScript API.\n */\nexport function reset_id_counter(): void {\n polylineIdCounter = 0;\n}\n\n// Aliases to match PineScript API\nexport { new_polyline as new };\nexport { delete_polyline as delete };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,sBAAoE;AAMpE,IAAI,oBAAoB;AAKxB,SAAS,aAAqB;AAC5B,SAAO,YAAY,EAAE,iBAAiB;AACxC;AA6CO,SAAS,aACd,QACA,SAAkB,OAClB,SAAkB,OAClB,OAA0C,aAC1C,aAAoB,WACpB,aAA2B,MAC3B,aAA4C,SAC5C,aAAqB,GACrB,gBAAyB,OACf;AAEV,MAAI,aAAa,GAAG;AAClB,YAAQ,KAAK,yDAAyD;AACtE,iBAAa;AAAA,EACf;AAEA,MAAI,SAAS;AAAa,eAAW,SAAS,OAAQ,KAAI,MAAM,UAAU,KAAM,oCAAc,gBAAgB,UAAU,MAAM,OAAO,IAAI;AAAA;AAEzI,QAAM,WAAqB;AAAA,IACzB,IAAI,WAAW;AAAA,IACf,QAAQ,CAAC,GAAG,MAAM;AAAA;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,aAAO,0BAAS,YAAY,QAAQ;AACtC;AAgBO,SAAS,gBAAgB,IAAoB;AAClD,8BAAO,YAAY,EAAE;AACvB;AAmBO,SAAS,UAA+B;AAC7C,aAAO,gBAAAA,KAAY,UAAU;AAC/B;AAKO,SAAS,MAAkB;AAChC,aAAO,gBAAAA,KAAY,UAAU;AAC/B;AASO,SAAS,YAAkB;AAChC,aAAW,SAAK,gBAAAA,KAAY,UAAU,EAAG,6BAAO,YAAY,CAAC;AAC/D;AASO,SAAS,mBAAyB;AACvC,sBAAoB;AACtB;",
6
6
  "names": ["allDrawings"]
7
7
  }
@@ -38,10 +38,15 @@ export declare const size: {
38
38
  readonly large: "large";
39
39
  readonly huge: "huge";
40
40
  };
41
- /** PineScript `xloc.*`: the x coordinate of drawings (bar index or UNIX time in ms). */
41
+ /**
42
+ * PineScript `xloc.*`: the x coordinate of drawings (bar index or UNIX time in ms). `xloc.pane` is not a Pine value: the x
43
+ * coordinates are percents of the pane's width (0 left edge, 100 right edge), so the drawing stays in place while the
44
+ * user scrolls and zooms.
45
+ */
42
46
  export declare const xloc: {
43
47
  readonly bar_index: "bar_index";
44
48
  readonly bar_time: "bar_time";
49
+ readonly pane: "pane";
45
50
  };
46
51
  /** PineScript `yloc.*`: the y position of labels. */
47
52
  export declare const yloc: {
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/script/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,uDAAuD;AACvD,eAAO,MAAM,KAAK;;;;;;;;;;;;;CAaR,CAAC;AAEX,oEAAoE;AACpE,eAAO,MAAM,QAAQ;;;;;;CAMX,CAAC;AAEX,gFAAgF;AAChF,eAAO,MAAM,IAAI;;;;;;;CAOP,CAAC;AAEX,wFAAwF;AACxF,eAAO,MAAM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8D;AAC9D,eAAO,MAAM,OAAO;;;;;;CAMV,CAAC;AAEX,kFAAkF;AAClF,eAAO,MAAM,MAAM;;;;;;CAMT,CAAC;AAEX,2EAA2E;AAC3E,eAAO,MAAM,IAAI;;;CAGP,CAAC;AAEX,6EAA6E;AAC7E,eAAO,MAAM,KAAK;;;;CAIR,CAAC;AAEX,+FAA+F;AAC/F,eAAO,MAAM,KAAK;;;CAGR,CAAC;AAEX,+DAA+D;AAC/D,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AAWX,0HAA0H;AAC1H,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGX,CAAC;AAEX,kCAAkC;AAClC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;CAsBd,CAAC;AAEX,2DAA2D;AAC3D,eAAO,MAAM,UAAU;;;;;;;CAOb,CAAC;AAEX,yFAAyF;AACzF,eAAO,MAAM,UAAU;;;;;;;;CAQb,CAAC"}
@@ -67,7 +67,8 @@ const size = {
67
67
  };
68
68
  const xloc = {
69
69
  bar_index: "bar_index",
70
- bar_time: "bar_time"
70
+ bar_time: "bar_time",
71
+ pane: "pane"
71
72
  };
72
73
  const yloc = {
73
74
  price: "price",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/script/constants.ts"],
4
- "sourcesContent": ["/**\n * @fileoverview PineScript constant namespaces of the script API: `shape.*`, `location.*`, `size.*`, `xloc.*`,\n * `yloc.*`, `extend.*`, `display.*`, `format.*`, `font.*`, `scale.*`, `order.*`, `currency.*`, `adjustment.*`, and the\n * `label.style_*`, `line.style_*`, `dayofweek.*` members. Each constant is the string (or number) the functions take,\n * so `plotshape(cond, \"Buy\", { style: shape.triangleup })` and `{ style: \"triangleup\" }` are the same.\n *\n * @module script/constants\n */\n\n/** PineScript `shape.*`: the shapes of plotshape(). */\nexport const shape = {\n xcross: 'xcross',\n cross: 'cross',\n triangleup: 'triangleup',\n triangledown: 'triangledown',\n flag: 'flag',\n circle: 'circle',\n arrowup: 'arrowup',\n arrowdown: 'arrowdown',\n labelup: 'labelup',\n labeldown: 'labeldown',\n square: 'square',\n diamond: 'diamond',\n} as const;\n\n/** PineScript `location.*`: where plotshape() / plotchar() draw. */\nexport const location = {\n abovebar: 'abovebar',\n belowbar: 'belowbar',\n top: 'top',\n bottom: 'bottom',\n absolute: 'absolute',\n} as const;\n\n/** PineScript `size.*`: sizes of shapes, characters, labels and table texts. */\nexport const size = {\n auto: 'auto',\n tiny: 'tiny',\n small: 'small',\n normal: 'normal',\n large: 'large',\n huge: 'huge',\n} as const;\n\n/** PineScript `xloc.*`: the x coordinate of drawings (bar index or UNIX time in ms). */\nexport const xloc = {\n bar_index: 'bar_index',\n bar_time: 'bar_time',\n} as const;\n\n/** PineScript `yloc.*`: the y position of labels. */\nexport const yloc = {\n price: 'price',\n abovebar: 'abovebar',\n belowbar: 'belowbar',\n} as const;\n\n/** PineScript `extend.*`: line extension. */\nexport const extend = {\n none: 'none',\n left: 'left',\n right: 'right',\n both: 'both',\n} as const;\n\n/** PineScript `display.*`: where a plot or input is shown. */\nexport const display = {\n none: 'none',\n all: 'all',\n data_window: 'data_window',\n status_line: 'status_line',\n pane: 'pane',\n} as const;\n\n/** PineScript `format.*`: the number format of indicator() and str.tostring(). */\nexport const format = {\n inherit: 'inherit',\n price: 'price',\n volume: 'volume',\n percent: 'percent',\n mintick: 'mintick',\n} as const;\n\n/** PineScript `font.*`: font families of labels, boxes and table cells. */\nexport const font = {\n family_default: 'default',\n family_monospace: 'monospace',\n} as const;\n\n/** PineScript `scale.*`: the price scale of indicator() (`scale` option). */\nexport const scale = {\n right: 'right',\n left: 'left',\n none: 'none',\n} as const;\n\n/** PineScript `order.*`: sort order of array.sort() / array.sort_indices() / matrix.sort(). */\nexport const order = {\n ascending: 'ascending',\n descending: 'descending',\n} as const;\n\n/** PineScript `adjustment.*`: price adjustment of a ticker. */\nexport const adjustment = {\n none: 'none',\n splits: 'splits',\n dividends: 'dividends',\n} as const;\n\nconst CURRENCIES = [\n 'AED', 'ARS', 'AUD', 'BDT', 'BHD', 'BRL', 'BTC', 'CAD', 'CHF', 'CLP', 'CNY', 'COP', 'CZK', 'DKK', 'EGP', 'ETH',\n 'EUR', 'GBP', 'GEL', 'HKD', 'HUF', 'IDR', 'ILS', 'INR', 'ISK', 'JPY', 'KES', 'KRW', 'KWD', 'LKR', 'MAD', 'MXN',\n 'MYR', 'NGN', 'NOK', 'NZD', 'PEN', 'PHP', 'PKR', 'PLN', 'QAR', 'RON', 'RSD', 'RUB', 'SAR', 'SEK', 'SGD', 'THB',\n 'TND', 'TRY', 'TWD', 'USD', 'USDT', 'VES', 'VND', 'ZAR',\n] as const;\n\ntype CurrencyCode = (typeof CURRENCIES)[number];\n\n/** PineScript `currency.*`: currency codes (`strategy(..., { currency })`, `syminfo.currency`); `currency.NONE` is na. */\nexport const currency = {\n ...(Object.fromEntries(CURRENCIES.map((c) => [c, c])) as { readonly [K in CurrencyCode]: K }),\n NONE: 'NONE',\n} as const;\n\n/** PineScript `label.style_*`. */\nexport const labelStyles = {\n style_none: 'none',\n style_xcross: 'xcross',\n style_cross: 'cross',\n style_triangleup: 'triangleup',\n style_triangledown: 'triangledown',\n style_flag: 'flag',\n style_circle: 'circle',\n style_arrowup: 'arrowup',\n style_arrowdown: 'arrowdown',\n style_label_up: 'label_up',\n style_label_down: 'label_down',\n style_label_left: 'label_left',\n style_label_right: 'label_right',\n style_label_lower_left: 'label_lower_left',\n style_label_lower_right: 'label_lower_right',\n style_label_upper_left: 'label_upper_left',\n style_label_upper_right: 'label_upper_right',\n style_label_center: 'label_center',\n style_square: 'square',\n style_diamond: 'diamond',\n style_text_outline: 'text_outline',\n} as const;\n\n/** PineScript `line.style_*` (lines, boxes, polylines). */\nexport const lineStyles = {\n style_solid: 'solid',\n style_dotted: 'dotted',\n style_dashed: 'dashed',\n style_arrow_left: 'arrow_left',\n style_arrow_right: 'arrow_right',\n style_arrow_both: 'arrow_both',\n} as const;\n\n/** PineScript `dayofweek.*`: the values of `dayofweek` (1 = Sunday ... 7 = Saturday). */\nexport const daysOfWeek = {\n sunday: 1,\n monday: 2,\n tuesday: 3,\n wednesday: 4,\n thursday: 5,\n friday: 6,\n saturday: 7,\n} as const;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,MAAM,QAAQ;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AACX;AAGO,MAAM,WAAW;AAAA,EACtB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,UAAU;AACZ;AAGO,MAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AACR;AAGO,MAAM,OAAO;AAAA,EAClB,WAAW;AAAA,EACX,UAAU;AACZ;AAGO,MAAM,OAAO;AAAA,EAClB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;AAGO,MAAM,SAAS;AAAA,EACpB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AACR;AAGO,MAAM,UAAU;AAAA,EACrB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,aAAa;AAAA,EACb,aAAa;AAAA,EACb,MAAM;AACR;AAGO,MAAM,SAAS;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,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kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,oBAAoB;AACtB;AAGO,MAAM,aAAa;AAAA,EACxB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,kBAAkB;AACpB;AAGO,MAAM,aAAa;AAAA,EACxB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AACZ;",
4
+ "sourcesContent": ["/**\n * @fileoverview PineScript constant namespaces of the script API: `shape.*`, `location.*`, `size.*`, `xloc.*`,\n * `yloc.*`, `extend.*`, `display.*`, `format.*`, `font.*`, `scale.*`, `order.*`, `currency.*`, `adjustment.*`, and the\n * `label.style_*`, `line.style_*`, `dayofweek.*` members. Each constant is the string (or number) the functions take,\n * so `plotshape(cond, \"Buy\", { style: shape.triangleup })` and `{ style: \"triangleup\" }` are the same.\n *\n * @module script/constants\n */\n\n/** PineScript `shape.*`: the shapes of plotshape(). */\nexport const shape = {\n xcross: 'xcross',\n cross: 'cross',\n triangleup: 'triangleup',\n triangledown: 'triangledown',\n flag: 'flag',\n circle: 'circle',\n arrowup: 'arrowup',\n arrowdown: 'arrowdown',\n labelup: 'labelup',\n labeldown: 'labeldown',\n square: 'square',\n diamond: 'diamond',\n} as const;\n\n/** PineScript `location.*`: where plotshape() / plotchar() draw. */\nexport const location = {\n abovebar: 'abovebar',\n belowbar: 'belowbar',\n top: 'top',\n bottom: 'bottom',\n absolute: 'absolute',\n} as const;\n\n/** PineScript `size.*`: sizes of shapes, characters, labels and table texts. */\nexport const size = {\n auto: 'auto',\n tiny: 'tiny',\n small: 'small',\n normal: 'normal',\n large: 'large',\n huge: 'huge',\n} as const;\n\n/**\n * PineScript `xloc.*`: the x coordinate of drawings (bar index or UNIX time in ms). `xloc.pane` is not a Pine value: the x\n * coordinates are percents of the pane's width (0 left edge, 100 right edge), so the drawing stays in place while the\n * user scrolls and zooms.\n */\nexport const xloc = {\n bar_index: 'bar_index',\n bar_time: 'bar_time',\n pane: 'pane',\n} as const;\n\n/** PineScript `yloc.*`: the y position of labels. */\nexport const yloc = {\n price: 'price',\n abovebar: 'abovebar',\n belowbar: 'belowbar',\n} as const;\n\n/** PineScript `extend.*`: line extension. */\nexport const extend = {\n none: 'none',\n left: 'left',\n right: 'right',\n both: 'both',\n} as const;\n\n/** PineScript `display.*`: where a plot or input is shown. */\nexport const display = {\n none: 'none',\n all: 'all',\n data_window: 'data_window',\n status_line: 'status_line',\n pane: 'pane',\n} as const;\n\n/** PineScript `format.*`: the number format of indicator() and str.tostring(). */\nexport const format = {\n inherit: 'inherit',\n price: 'price',\n volume: 'volume',\n percent: 'percent',\n mintick: 'mintick',\n} as const;\n\n/** PineScript `font.*`: font families of labels, boxes and table cells. */\nexport const font = {\n family_default: 'default',\n family_monospace: 'monospace',\n} as const;\n\n/** PineScript `scale.*`: the price scale of indicator() (`scale` option). */\nexport const scale = {\n right: 'right',\n left: 'left',\n none: 'none',\n} as const;\n\n/** PineScript `order.*`: sort order of array.sort() / array.sort_indices() / matrix.sort(). */\nexport const order = {\n ascending: 'ascending',\n descending: 'descending',\n} as const;\n\n/** PineScript `adjustment.*`: price adjustment of a ticker. */\nexport const adjustment = {\n none: 'none',\n splits: 'splits',\n dividends: 'dividends',\n} as const;\n\nconst CURRENCIES = [\n 'AED', 'ARS', 'AUD', 'BDT', 'BHD', 'BRL', 'BTC', 'CAD', 'CHF', 'CLP', 'CNY', 'COP', 'CZK', 'DKK', 'EGP', 'ETH',\n 'EUR', 'GBP', 'GEL', 'HKD', 'HUF', 'IDR', 'ILS', 'INR', 'ISK', 'JPY', 'KES', 'KRW', 'KWD', 'LKR', 'MAD', 'MXN',\n 'MYR', 'NGN', 'NOK', 'NZD', 'PEN', 'PHP', 'PKR', 'PLN', 'QAR', 'RON', 'RSD', 'RUB', 'SAR', 'SEK', 'SGD', 'THB',\n 'TND', 'TRY', 'TWD', 'USD', 'USDT', 'VES', 'VND', 'ZAR',\n] as const;\n\ntype CurrencyCode = (typeof CURRENCIES)[number];\n\n/** PineScript `currency.*`: currency codes (`strategy(..., { currency })`, `syminfo.currency`); `currency.NONE` is na. */\nexport const currency = {\n ...(Object.fromEntries(CURRENCIES.map((c) => [c, c])) as { readonly [K in CurrencyCode]: K }),\n NONE: 'NONE',\n} as const;\n\n/** PineScript `label.style_*`. */\nexport const labelStyles = {\n style_none: 'none',\n style_xcross: 'xcross',\n style_cross: 'cross',\n style_triangleup: 'triangleup',\n style_triangledown: 'triangledown',\n style_flag: 'flag',\n style_circle: 'circle',\n style_arrowup: 'arrowup',\n style_arrowdown: 'arrowdown',\n style_label_up: 'label_up',\n style_label_down: 'label_down',\n style_label_left: 'label_left',\n style_label_right: 'label_right',\n style_label_lower_left: 'label_lower_left',\n style_label_lower_right: 'label_lower_right',\n style_label_upper_left: 'label_upper_left',\n style_label_upper_right: 'label_upper_right',\n style_label_center: 'label_center',\n style_square: 'square',\n style_diamond: 'diamond',\n style_text_outline: 'text_outline',\n} as const;\n\n/** PineScript `line.style_*` (lines, boxes, polylines). */\nexport const lineStyles = {\n style_solid: 'solid',\n style_dotted: 'dotted',\n style_dashed: 'dashed',\n style_arrow_left: 'arrow_left',\n style_arrow_right: 'arrow_right',\n style_arrow_both: 'arrow_both',\n} as const;\n\n/** PineScript `dayofweek.*`: the values of `dayofweek` (1 = Sunday ... 7 = Saturday). */\nexport const daysOfWeek = {\n sunday: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gB;AAAA,EAChB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,oBAAoB;AACtB;AAGO,MAAM,aAAa;AAAA,EACxB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,kBAAkB;AACpB;AAGO,MAAM,aAAa;AAAA,EACxB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AACZ;",
6
6
  "names": []
7
7
  }
@@ -85,6 +85,9 @@ declare global {
85
85
  const barstate: typeof S.barstate;
86
86
  const session: typeof S.session;
87
87
  const barmerge: typeof S.barmerge;
88
+ const dividends: typeof S.dividends;
89
+ const splits: typeof S.splits;
90
+ const earnings: typeof S.earnings;
88
91
  const ticker: typeof S.ticker;
89
92
  const request: typeof S.request;
90
93
  const line: typeof S.line;
@@ -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,MAAM,CAAC;IACb,MAAM,eAAe,EAAE,OAAO,CAAC,CAAC,eAAe,CAAC;IAChD,MAAM,eAAe,EAAE,OAAO,CAAC,CAAC,eAAe,CAAC;IAChD,MAAM,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC;IAC5B,MAAM,OAAO,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;IAChC,MAAM,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC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C;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 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 log: typeof S.log;\n const MAX_LOG_ENTRIES: typeof S.MAX_LOG_ENTRIES;\n const setLogLineResolver: typeof S.setLogLineResolver;\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 dividends: typeof S.dividends;\n const splits: typeof S.splits;\n const earnings: typeof S.earnings;\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 log: typeof S.log;\n const MAX_LOG_ENTRIES: typeof S.MAX_LOG_ENTRIES;\n const setLogLineResolver: typeof S.setLogLineResolver;\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
  }