@invinite-org/chartlang-core 1.1.1 → 1.3.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 (86) hide show
  1. package/CHANGELOG.md +282 -0
  2. package/README.md +2 -1
  3. package/dist/draw/buckets.d.ts.map +1 -1
  4. package/dist/draw/buckets.js +1 -0
  5. package/dist/draw/buckets.js.map +1 -1
  6. package/dist/draw/draw.d.ts +8 -1
  7. package/dist/draw/draw.d.ts.map +1 -1
  8. package/dist/draw/draw.js.map +1 -1
  9. package/dist/draw/drawingKind.d.ts +8 -8
  10. package/dist/draw/drawingKind.d.ts.map +1 -1
  11. package/dist/draw/drawingKind.js +5 -3
  12. package/dist/draw/drawingKind.js.map +1 -1
  13. package/dist/draw/drawingState.d.ts +27 -3
  14. package/dist/draw/drawingState.d.ts.map +1 -1
  15. package/dist/draw/drawingState.js.map +1 -1
  16. package/dist/draw/drawingStyle.d.ts +52 -9
  17. package/dist/draw/drawingStyle.d.ts.map +1 -1
  18. package/dist/draw/drawingStyle.js.map +1 -1
  19. package/dist/draw/index.d.ts +2 -2
  20. package/dist/draw/index.d.ts.map +1 -1
  21. package/dist/draw/index.js.map +1 -1
  22. package/dist/index.d.ts +11 -9
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +3 -2
  25. package/dist/index.js.map +1 -1
  26. package/dist/input/index.d.ts +1 -1
  27. package/dist/input/index.d.ts.map +1 -1
  28. package/dist/input/index.js.map +1 -1
  29. package/dist/input/input.d.ts +15 -1
  30. package/dist/input/input.d.ts.map +1 -1
  31. package/dist/input/input.js +14 -0
  32. package/dist/input/input.js.map +1 -1
  33. package/dist/input/inputDescriptor.d.ts +15 -2
  34. package/dist/input/inputDescriptor.d.ts.map +1 -1
  35. package/dist/input/inputDescriptor.js.map +1 -1
  36. package/dist/plot/plot.d.ts +75 -0
  37. package/dist/plot/plot.d.ts.map +1 -1
  38. package/dist/plot/plot.js +34 -0
  39. package/dist/plot/plot.js.map +1 -1
  40. package/dist/request/feedKey.d.ts +20 -0
  41. package/dist/request/feedKey.d.ts.map +1 -0
  42. package/dist/request/feedKey.js +29 -0
  43. package/dist/request/feedKey.js.map +1 -0
  44. package/dist/request/index.d.ts +3 -1
  45. package/dist/request/index.d.ts.map +1 -1
  46. package/dist/request/index.js +1 -0
  47. package/dist/request/index.js.map +1 -1
  48. package/dist/request/request.d.ts +107 -20
  49. package/dist/request/request.d.ts.map +1 -1
  50. package/dist/request/request.js +27 -26
  51. package/dist/request/request.js.map +1 -1
  52. package/dist/state/arraySlot.d.ts +38 -0
  53. package/dist/state/arraySlot.d.ts.map +1 -0
  54. package/dist/state/arraySlot.js +4 -0
  55. package/dist/state/arraySlot.js.map +1 -0
  56. package/dist/state/index.d.ts +1 -0
  57. package/dist/state/index.d.ts.map +1 -1
  58. package/dist/state/index.js.map +1 -1
  59. package/dist/state/state.d.ts +36 -0
  60. package/dist/state/state.d.ts.map +1 -1
  61. package/dist/state/state.js +38 -0
  62. package/dist/state/state.js.map +1 -1
  63. package/dist/statefulPrimitives.d.ts +9 -5
  64. package/dist/statefulPrimitives.d.ts.map +1 -1
  65. package/dist/statefulPrimitives.js +37 -5
  66. package/dist/statefulPrimitives.js.map +1 -1
  67. package/dist/ta/ta.d.ts +39 -8
  68. package/dist/ta/ta.d.ts.map +1 -1
  69. package/dist/ta/ta.js +6 -0
  70. package/dist/ta/ta.js.map +1 -1
  71. package/dist/time-accessors/index.d.ts +5 -0
  72. package/dist/time-accessors/index.d.ts.map +1 -0
  73. package/dist/time-accessors/index.js +5 -0
  74. package/dist/time-accessors/index.js.map +1 -0
  75. package/dist/time-accessors/sessionAccessors.d.ts +43 -0
  76. package/dist/time-accessors/sessionAccessors.d.ts.map +1 -0
  77. package/dist/time-accessors/sessionAccessors.js +38 -0
  78. package/dist/time-accessors/sessionAccessors.js.map +1 -0
  79. package/dist/time-accessors/timeAccessors.d.ts +132 -0
  80. package/dist/time-accessors/timeAccessors.d.ts.map +1 -0
  81. package/dist/time-accessors/timeAccessors.js +143 -0
  82. package/dist/time-accessors/timeAccessors.js.map +1 -0
  83. package/dist/types.d.ts +219 -1
  84. package/dist/types.d.ts.map +1 -1
  85. package/dist/types.js.map +1 -1
  86. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,287 @@
1
1
  # @invinite-org/chartlang-core
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e620ba8: Add `bgcolor(color, opts?)` and `barcolor(color, opts?)` — Pine-ergonomic
8
+ top-level aliases for the `bg-color` / `bar-color` plot styles. One call
9
+ (`bgcolor(close > open ? "#16a34a" : "#dc2626", { transp: 80 })`) replaces
10
+ the verbose `plot(NaN, { style: { kind: "bg-color", … } })`. Surfaced in the
11
+ generated primitive reference and taught in the chartlang-coding skill.
12
+
13
+ Deliverable 2 (per-bar dynamic color): `PlotEmission` gains an optional
14
+ `colorValue: Color | null` channel; the runtime resolves the `bgcolor` /
15
+ `barcolor` per-bar color into it (omitted on the static `plot` path → wire
16
+ byte-identical, every pinned `plot-hash` untouched), validates it
17
+ (non-empty color string or `null`), and dedups it last-write-wins per
18
+ `(slotId, bar)` like `value`. Adapters prefer `colorValue` over the static
19
+ `style.color` at render time — this precedence is now the normative
20
+ adapter-kit contract (`PlotEmission.colorValue` JSDoc) and is implemented in
21
+ the canvas2d reference renderer (`null` ⇒ paint-nothing gap; omitted ⇒ static
22
+ fallback). The Pine converter emits the real per-bar dynamic color
23
+ (`bgcolor(close > open ? "#16a34a" : "#dc2626")`) instead of a static
24
+ `plot(NaN, …)`, so `bgcolor`/`barcolor` round-trip with per-bar semantics
25
+ intact.
26
+
27
+ - 08cba38: Add `time.*` calendar accessors (`time.year/month/dayofmonth/dayofweek/hour/
28
+ minute/second/timestamp`), a `time.timeClose(t, tz?)` bar-close accessor
29
+ (Pine's `time_close()` = bar start + interval), a `session.isOpen(t, spec, tz?)`
30
+ helper, and an `input.session` kind. Calendar fields are derived from a `Time`
31
+ epoch via the host (authors stay sandboxed — `Date`/`Intl` remain banned). v1
32
+ is UTC + fixed-offset only; exchange-tz/DST is a scoped follow-up. The Pine
33
+ converter lowers `dayofweek` / `time()` / `time_close()` / `input.session`.
34
+ - 1efb49c: Add multi-symbol support to `request.security`. `request.security({ symbol,
35
+ interval })` now reads a **different instrument** (not just a higher
36
+ timeframe), e.g. `request.security({ symbol: "AMEX:SPY", interval: "1D" })`.
37
+ `symbol` is optional (defaults to the chart symbol) and must be a compile-time
38
+ literal (`input.symbol` / `input.enum` resolved). A new `multiSymbol` adapter
39
+ capability gates non-chart-symbol requests: a different-symbol request against
40
+ an adapter declaring `multiSymbol: false` degrades to an all-NaN
41
+ bar/series with a single deduped `multi-symbol-not-supported` diagnostic,
42
+ mirroring `multi-timeframe-not-supported` (the symbol gate precedes the
43
+ timeframe gate, so a both-different request emits only the symbol diagnostic).
44
+ The Pine converter now lowers `request.security("OTHER", tf, expr)`, and the
45
+ `chartlang scaffold-adapter` template advertises `multiSymbol`.
46
+ - 1efb49c: Add `state.array<T>(capacity)` — a persistent, bounded FIFO collection. Push
47
+ many values across bars (`a.push(v)`) into a fixed-capacity ring and read
48
+ them back by element (`a.get(0)` = newest, `a.last()`, `a.size`,
49
+ `a.capacity`, `a.clear()`). Bounded literal capacity keeps it
50
+ serialization-clean. The Pine converter lowers a bounded numeric
51
+ `var array<…>` Camp B ring to it.
52
+
53
+ The compiler guards the capacity: it must be a compile-time numeric literal
54
+ (a `const` numeric binding is accepted) that is a positive integer within
55
+ `MAX_STATE_ARRAY_CAPACITY` (100_000). A non-literal capacity errors
56
+ `state-array-capacity-not-literal`; an out-of-range / non-integer literal
57
+ errors `state-array-capacity-exceeds-max`.
58
+
59
+ ## 1.2.0
60
+
61
+ ### Minor Changes
62
+
63
+ - 850ae21: Add `bar.point(offset, price)` — index authoring sugar for anchoring drawings
64
+ by bar offset instead of an absolute timestamp.
65
+
66
+ `bar.point` resolves the offset to the existing time-based `WorldPoint`
67
+ (`{ time, price }`) at compute time, so it composes directly with every
68
+ `draw.*` anchor argument and introduces no new wire format or anchor union:
69
+
70
+ - `bar.point(0, price)` — the current bar.
71
+ - `bar.point(-n, price)` — `n` bars back, using the real historical timestamp
72
+ from the runtime's time ring buffer (`NaN` time past retained history; never
73
+ throws).
74
+ - `bar.point(n, price)` — a future bar, with the time extrapolated from the
75
+ median recent bar spacing (falling back to the parsed bar interval when
76
+ fewer than two bars are retained).
77
+
78
+ The compiler's max-lookback analysis now counts a negative integer-literal
79
+ `bar.point(-n, …)` offset toward `maxLookback` exactly like a `series[n]`
80
+ lookback, so the runtime sizes the time buffer deeply enough; positive (future)
81
+ offsets and dynamic offsets contribute no extra depth. The recogniser peels
82
+ parentheses, so the converter's emitted form `bar.point(-(n), …)` is sized
83
+ identically to a hand-written `bar.point(-n, …)` (without it, a converted
84
+ historical tracking line sized its buffer to 0 and resolved to a NaN anchor).
85
+
86
+ The Pine v6 converter now lowers `bar_index` drawing anchors to
87
+ `bar.point(<signed offset>, <price>)` and drops the dead `__BAR_INTERVAL_MS`
88
+ sentinel and its `bar.time ± (N * __BAR_INTERVAL_MS)` arithmetic — future
89
+ anchors resolve at runtime instead of needing a host-supplied bar interval.
90
+
91
+ - ca19e20: Bidirectional plot `offset` — negative offsets shift a plotted series left.
92
+
93
+ `offset` becomes a presentation-only **display shift** in bars with the
94
+ fixed sign convention `+n` = right (future), `−n` = left (past); the
95
+ numeric series value is unshifted. This replaces the old value-read model
96
+ (where a positive offset made `series.current` read the value N bars ago
97
+ and a negative offset resolved to `NaN`). The `*Opts` `offset` JSDoc (and
98
+ ALMA's `barShift`) now describe both directions and drop the old
99
+ "negative ⇒ NaN" wording (`AlmaOpts.offset`, the Gaussian-centre
100
+ position, is unchanged).
101
+
102
+ `PlotEmission` gains an optional presentation field `xShift?: number`
103
+ (signed integer bars; omitted/`0` ≡ no shift, so a no-shift emission is
104
+ byte-identical to today). `validateEmission` rejects a non-integer
105
+ `xShift`. The compiler no longer counts `offset` toward `maxLookback`
106
+ (the value is no longer read from a deeper slot). The runtime threads the
107
+ declared offset onto the emission as `xShift` (reading a
108
+ `WeakMap<Series, number>` offset tag set by `makeShiftedSeriesView`; ALMA
109
+ tags `opts.barShift`) and stops the old value-read shift so
110
+ `series.current` is unshifted; the reference adapter renders it by
111
+ projecting `xShift` onto the x-axis (extending the viewport for
112
+ future-shifted points).
113
+
114
+ The Pine converter now maps `plot(<ta.* call>, offset=N)` onto the
115
+ emitted `ta.*` call's `offset` opt (signed, both directions); a plot
116
+ whose value is not a direct `ta.*` call drops the offset and emits the
117
+ new `plot-offset-needs-ta-call` warning, and a plot-level offset
118
+ replacing the ta call's own `offset=` emits `plot-offset-overrides-ta-offset`.
119
+
120
+ The conformance harness's `plot-field` assertion gains an `xShift` field,
121
+ and a new scenario pins both shift directions plus the unshifted value
122
+ series.
123
+
124
+ - 6235ad7: Make the compute bar's OHLCV + derived fields directly indexable as a series.
125
+
126
+ `bar.close`, `bar.open`, `bar.high`, `bar.low`, `bar.volume`, and the derived
127
+ `bar.hl2` / `bar.hlc3` / `bar.ohlc4` / `bar.hlcc4` are now `PriceSeries` /
128
+ `VolumeSeries` (`number & Series<number>`) on the bar passed to `compute`
129
+ (`ComputeContext.bar`, typed as the new `BarSeries`). Each field is **both** a
130
+ scalar — `bar.close * 2`, `plot(bar.close)`, `ta.ema(bar.close, 20)` keep
131
+ working unchanged — **and** an indexable series, so a script can read prior
132
+ bars directly:
133
+
134
+ ```ts
135
+ const sma5 =
136
+ (bar.close[0] + bar.close[1] + bar.close[2] + bar.close[3] + bar.close[4]) /
137
+ 5;
138
+ ```
139
+
140
+ This removes the `ta.ema(bar.close, 1)` identity-trick that scripts previously
141
+ needed to "republish" a scalar price as an indexable `Series`.
142
+
143
+ The adapter-supplied candle type `Bar` (and `request.lowerTf` intrabar bars) is
144
+ unchanged — it stays scalar OHLCV; only the streaming `compute` bar gains the
145
+ series shape. `request.security`'s higher-timeframe bar remains the separate
146
+ `SecurityBar`.
147
+
148
+ Migration note: because the field is now an object, `Number.isFinite(bar.close)`
149
+ is always `false` (it does not coerce) and `bar.close === 42` is `false` (object
150
+ vs number). Use `bar.close.current` or `+bar.close` in those raw-number
151
+ contexts. `bar.point(0, bar.close)` continues to work — the runtime coerces the
152
+ anchor price to a scalar.
153
+
154
+ - 3bf391a: Add the `draw.fillBetween(edgeA, edgeB, opts?)` drawing primitive — a
155
+ native filled ribbon between two edges (the closed polygon `edgeA`
156
+ forward then `edgeB` reversed). It is the chartlang equivalent of Pine's
157
+ `linefill.new(line1, line2, color)` / `fill(plot1, plot2)`. The
158
+ pine-converter now lowers static two-line `linefill.new` to it instead of
159
+ approximating with `draw.rotatedRectangle`, retiring the
160
+ `linefill-rotatedrect-approximated` diagnostic.
161
+ - 8086003: Add an optional presentation-only `z` (render-order / z-index) option to
162
+ `plot()` and every `draw.*` primitive. Default `0`; higher renders on
163
+ top, ties fall back to the existing group + declaration order. Finite
164
+ numbers only. Affects stacking only — values, alerts, and `state.*` are
165
+ unchanged.
166
+
167
+ Adapter kit: `PlotEmission` and `DrawingEmission` gain the matching
168
+ presentation-only `z?: number` wire field, validated by
169
+ `validateEmission` as a finite number (NaN / ±Infinity rejected;
170
+ fractional and negative allowed). Omitted/`0` stays byte-identical to a
171
+ pre-feature emission, so existing goldens and conformance hashes are
172
+ untouched.
173
+
174
+ Runtime: `plotImpl` reads `opts.z`, and the drawing-emit path
175
+ (`createDrawingHandle`) lifts `z` out of `state.style` — into a shallow
176
+ clone with `z` removed, where the per-kind `draw.*` impls fold the opts
177
+ bag — and threads it onto the top-level `PlotEmission.z` /
178
+ `DrawingEmission.z` with the same omit-when-`0` conditional spread used
179
+ for `xShift`. `z` is persisted **beside** the drawing slot's `state`
180
+ (never inside `DrawingState`), so an `update` retains the last value. A
181
+ no-`z` plot or drawing emits no `z` key — byte-identical to the
182
+ pre-feature baseline. `draw.table` / `draw.group` do not carry `z` in
183
+ v1.
184
+
185
+ Pine converter: `explicit_plot_zorder` is now a recognized no-op instead
186
+ of an unmapped warning. chartlang already layers marks by declaration
187
+ order within their group (the normative ordering contract), which is
188
+ exactly what Pine's `explicit_plot_zorder=true` makes authoritative — so
189
+ the flag is satisfied by default and needs no chartlang option.
190
+ `mapDeclarationArgs` no longer raises `indicator-arg-not-mapped` for it;
191
+ instead it emits a single `explicit-plot-zorder-default` info note
192
+ (covering both `explicit_plot_zorder=true` and the Pine-default
193
+ `=false`). The converter still never _emits_ a numeric `z` — Pine has no
194
+ per-element z source construct. Other unmapped `indicator(...)` args
195
+ (`timeframe`, etc.) keep warning.
196
+
197
+ Compiler: the ambient `@invinite-org/chartlang-core` `.d.ts` shim gains a
198
+ `ZOrdered { z?: number }` mixin intersected into `PlotOpts` and every
199
+ `draw.*` option type (mirroring core's `drawingStyle.ts`), so a compiled
200
+ script's `plot(value, { z })` **and** `draw.*(…, { z })` type-check (the
201
+ shim stays in lockstep with core).
202
+
203
+ Conformance: a new `z-order` scenario pins the plot `z` →
204
+ `PlotEmission.z` wire contract — a `plot(value, { z: -1 })` emits
205
+ `z: -1`, a no-`z` plot omits the field (omit-when-`0` byte-identity), and
206
+ a value-hash proves `z` never transforms the series. The `plot-field`
207
+ assertion's `field` union widens to also accept `"z"`.
208
+
209
+ - 073f41b: Add the higher-timeframe expression/callback overload to `request.security`.
210
+ Alongside the existing data form `request.security({ interval })` →
211
+ `SecurityBar`, scripts can now write `request.security({ interval }, (bar) =>
212
+ …)` → `Series<number>`, where the callback runs on the **higher-timeframe
213
+ clock** — `request.security({ interval: "1W" }, (bar) => ta.ema(bar.close, 20))`
214
+ is a true weekly EMA(20) (20 weekly bars), not 20 main bars of a weekly-stepped
215
+ series. The result is aligned no-lookahead down to the main timeline.
216
+
217
+ - **core** — the `SecurityExpr` callback type (re-exported from the package
218
+ root), the second `security` overload, and the shared `statefulPrimitives`
219
+ entry annotated as covering both arities.
220
+ - **compiler** — records one `SecurityExpressionDescriptor { slotId, interval,
221
+ paramName }` per expression callsite in `manifest.securityExpressions`
222
+ (sorted by `slotId`, omitted for the data-only form), and validates each
223
+ callback against the allowed subset — its `bar` parameter and body locals,
224
+ the ambient `ta` / `inputs`, safe `Math.*` globals, and literals — rejecting
225
+ any captured outer binding with the new
226
+ `request-security-expr-captures-local` diagnostic.
227
+ - **runtime** — mounts one `SecurityExprRunner` per manifest entry: the
228
+ callback is captured lazily on the first main compute, driven once per HTF bar
229
+ close through a dedicated fold `StreamState` so `ta.*` accumulate on the HTF
230
+ clock, and one sampled value per HTF bar feeds a per-slot output buffer that
231
+ `request.security(opts, expr)` returns aligned no-lookahead to the main
232
+ timeline. Capability / interval / stream fallbacks return an all-NaN series
233
+ with a deduped diagnostic.
234
+ - **host-worker / host-quickjs** — boot the expression form unchanged; the
235
+ `__manifest` sidecar already carries `securityExpressions`.
236
+ - **pine-converter** — Pine's `request.security(sym, "D", ta.ema(close, 9))`
237
+ now lowers to the chartlang callback form
238
+ `request.security({ interval: "1d" }, (bar) => ta.ema(bar.close, 9))` (a bare
239
+ OHLCV third arg keeps lowering to the data form).
240
+ - **conformance** — new scenarios prove the weekly expression value differs
241
+ from a same-length main-timeframe EMA, plus the `multiTimeframe: false` NaN
242
+ fallback.
243
+
244
+ - 5a9c24d: Add `state.series(init)` — a writable, indexable user series. Store an
245
+ arbitrary value each bar (`s.value = expr`) and read its history N bars
246
+ back (`s[1]`). Number-coercible (`+s`, `s.current`) and usable as a `ta.*`
247
+ source. The Pine converter lowers a history-indexed `var` to it.
248
+ - 08c536c: Add the `ta.highestbars` / `ta.lowestbars` primitives plus the cross-package
249
+ wiring that makes them usable as drawing anchors and Pine-converter targets.
250
+
251
+ - **core / runtime:** `ta.highestbars(source, length, opts?)` and
252
+ `ta.lowestbars(source, length, opts?)` return the bar OFFSET (≤ 0) to the
253
+ highest / lowest `source` value over the trailing `length` bars (window
254
+ INCLUDES the current bar). `0` → current bar is the extreme; `-k` → the
255
+ extreme occurred `k` bars ago. Ties resolve to the most recent bar; NaN
256
+ inputs are skipped; warmup is `length − 1` bars; tick-mode replays the
257
+ in-progress head as the offset-0 candidate. Registered in
258
+ `STATEFUL_PRIMITIVES` (now 174 entries) and `TA_REGISTRY` (now 96 entries).
259
+ - **compiler:** a literal-length `ta.highestbars` / `ta.lowestbars` call
260
+ contributes `length − 1` toward `maxLookback`, so the runtime sizes the time
261
+ ring buffer deep enough for a `bar.point(<that offset>, …)` anchor to resolve.
262
+ A non-literal length contributes 0.
263
+ - **pine-converter:** `ta.highestbars` / `ta.lowestbars` now map to the real
264
+ chartlang primitives (previously lossy passthroughs to `ta.highest` /
265
+ `ta.lowest`). **Behavior change:** a DYNAMIC `bar_index + <non-literal>`
266
+ drawing-x anchor no longer raises the hard `requires-bar-interval` error —
267
+ the offset is resolved by `bar.point` at runtime sign-agnostically (a
268
+ negative runtime offset, e.g. what `ta.highestbars` returns, resolves to the
269
+ historical timestamp via the time buffer). Only the literal `bar_index + N`
270
+ future case still requires a bar interval.
271
+ - **conformance:** new `TA_HIGHEST_LOWEST_BARS_SCENARIO` export pins both
272
+ primitives end-to-end through the compiler + runtime over the bundled
273
+ `goldenBars.json` fixture, and is added to `ALL_SCENARIOS`.
274
+
275
+ ### Patch Changes
276
+
277
+ - 850ae21: Expand the `request.security` / `request.lowerTf` JSDoc into narrative
278
+ descriptions with realistic examples (higher-timeframe `SecurityBar` reads
279
+ and lower-timeframe contained-bar arrays), and cross-link both generated
280
+ primitive pages to the multi-timeframe guide via their `seeAlso` entry in
281
+ `genPhase4Docs.ts`. The auto-generated `docs/primitives/request/*.md` pages
282
+ and the hover registry were regenerated from the new JSDoc — no runtime
283
+ behaviour change.
284
+
3
285
  ## 1.1.1
4
286
 
5
287
  ### Patch Changes
package/README.md CHANGED
@@ -19,7 +19,8 @@ pnpm add @invinite-org/chartlang-core
19
19
  - Stateful slots: `state.float`, `int`, `bool`, `string`, plus
20
20
  `state.tick.*` for tick-persistent `varip` semantics.
21
21
  - Views: `barstate`, `syminfo`, `timeframe`.
22
- - Secondary stream: `request.security({ interval })` typed surface.
22
+ - Secondary stream: `request.security({ interval })` (data) and
23
+ `request.security({ interval }, (bar) => …)` (HTF expression) typed surface.
23
24
  - Emissions: `plot`, `hline`, `alert`, and the 61-kind `draw.*` namespace.
24
25
  - Registry: `STATEFUL_PRIMITIVES` for compiler slot-id injection.
25
26
  - Indicator composition (Phase 7): `CompiledScriptObject.output(title)` /
@@ -1 +1 @@
1
- {"version":3,"file":"buckets.d.ts","sourceRoot":"","sources":["../../src/draw/buckets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE,aAAa,CAkE9D,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa,CAM1D"}
1
+ {"version":3,"file":"buckets.d.ts","sourceRoot":"","sources":["../../src/draw/buckets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE,aAAa,CAmE9D,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa,CAM1D"}
@@ -35,6 +35,7 @@ export const KIND_BUCKET = new Map([
35
35
  ["circle", "boxes"],
36
36
  ["ellipse", "boxes"],
37
37
  ["path", "polylines"],
38
+ ["fill-between", "polylines"],
38
39
  ["marker", "labels"],
39
40
  ["arc", "polylines"],
40
41
  ["curve", "polylines"],
@@ -1 +1 @@
1
- {"version":3,"file":"buckets.js","sourceRoot":"","sources":["../../src/draw/buckets.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAsB/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,WAAW,GAA4C,IAAI,GAAG,CAGzE;IACE,CAAC,MAAM,EAAE,OAAO,CAAC;IACjB,CAAC,iBAAiB,EAAE,OAAO,CAAC;IAC5B,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAC3B,CAAC,eAAe,EAAE,OAAO,CAAC;IAC1B,CAAC,YAAY,EAAE,OAAO,CAAC;IACvB,CAAC,aAAa,EAAE,OAAO,CAAC;IACxB,CAAC,WAAW,EAAE,OAAO,CAAC;IACtB,CAAC,mBAAmB,EAAE,OAAO,CAAC;IAC9B,CAAC,UAAU,EAAE,OAAO,CAAC;IACrB,CAAC,UAAU,EAAE,WAAW,CAAC;IACzB,CAAC,QAAQ,EAAE,OAAO,CAAC;IACnB,CAAC,SAAS,EAAE,OAAO,CAAC;IACpB,CAAC,MAAM,EAAE,WAAW,CAAC;IACrB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,KAAK,EAAE,WAAW,CAAC;IACpB,CAAC,OAAO,EAAE,WAAW,CAAC;IACtB,CAAC,cAAc,EAAE,WAAW,CAAC;IAC7B,CAAC,KAAK,EAAE,WAAW,CAAC;IACpB,CAAC,aAAa,EAAE,WAAW,CAAC;IAC5B,CAAC,OAAO,EAAE,WAAW,CAAC;IACtB,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnB,CAAC,cAAc,EAAE,QAAQ,CAAC;IAC1B,CAAC,eAAe,EAAE,QAAQ,CAAC;IAC3B,CAAC,iBAAiB,EAAE,QA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,aAAa,EAAE,OAAO,CAAC;IACxB,CAAC,WAAW,EAAE,OAAO,CAAC;IACtB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,SAAS,CAAC,IAAiB;IACvC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,GAAG,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { DrawingKind } from \"./drawingKind.js\";\n\n/**\n * Canonical bucket name a {@link DrawingKind} maps to under the\n * `DrawingCounts` 5-bag budget (`{ lines, labels, boxes, polylines,\n * other }`). The adapter-kit `Capabilities.maxDrawingsPerScript` and\n * the script-side `ScriptManifest.maxDrawings?` both pin the same five\n * bucket names. The runtime budget enforcer counts emissions per\n * bucket and drops the overflow with `drawing-budget-exceeded`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * const b: DrawingBucket = \"lines\";\n * void b;\n */\nexport type DrawingBucket = \"lines\" | \"labels\" | \"boxes\" | \"polylines\" | \"other\";\n\n/**\n * Per-kind bucket assignment. Pinned table; every entry of\n * {@link DrawingKind} appears exactly once (asserted by\n * `buckets.test.ts`).\n *\n * Mapping rationale (Phase-3 task README §\"Architecture Decisions\"):\n * lines/rays/horizontalLine/verticalLine/crossLine/trendAngle → `lines`;\n * rectangle/rotatedRectangle/triangle/circle/ellipse → `boxes`;\n * path/polyline/curves/freehand/channels/pitchforks/patterns/elliott →\n * `polylines`; text/arrow/arrowMarker/arrowMarkUp/arrowMarkDown +\n * marker → `labels`; fib / gann / cycles / containers / table → `other`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { KIND_BUCKET } from \"@invinite-org/chartlang-core\";\n * const b = KIND_BUCKET.get(\"fib-retracement\"); // \"other\"\n * void b;\n */\nexport const KIND_BUCKET: ReadonlyMap<DrawingKind, DrawingBucket> = new Map<\n DrawingKind,\n DrawingBucket\n>([\n [\"line\", \"lines\"],\n [\"horizontal-line\", \"lines\"],\n [\"horizontal-ray\", \"lines\"],\n [\"vertical-line\", \"lines\"],\n [\"cross-line\", \"lines\"],\n [\"trend-angle\", \"lines\"],\n [\"rectangle\", \"boxes\"],\n [\"rotated-rectangle\", \"boxes\"],\n [\"triangle\", \"boxes\"],\n [\"polyline\", \"polylines\"],\n [\"circle\", \"boxes\"],\n [\"ellipse\", \"boxes\"],\n [\"path\", \"polylines\"],\n [\"marker\", \"labels\"],\n [\"arc\", \"polylines\"],\n [\"curve\", \"polylines\"],\n [\"double-curve\", \"polylines\"],\n [\"pen\", \"polylines\"],\n [\"highlighter\", \"polylines\"],\n [\"brush\", \"polylines\"],\n [\"text\", \"labels\"],\n [\"arrow\", \"labels\"],\n [\"arrow-marker\", \"labels\"],\n [\"arrow-mark-up\", \"labels\"],\n [\"arrow-mark-down\", \"labels\"],\n [\"trend-channel\", \"polylines\"],\n [\"flat-top-bottom\", \"polylines\"],\n [\"disjoint-channel\", \"polylines\"],\n [\"regression-trend\", \"polylines\"],\n [\"fib-retracement\", \"other\"],\n [\"fib-trend-extension\", \"other\"],\n [\"fib-channel\", \"other\"],\n [\"fib-time-zone\", \"other\"],\n [\"fib-wedge\", \"other\"],\n [\"fib-speed-fan\", \"other\"],\n [\"fib-speed-arcs\", \"other\"],\n [\"fib-spiral\", \"other\"],\n [\"fib-circles\", \"other\"],\n [\"fib-trend-time\", \"other\"],\n [\"gann-box\", \"other\"],\n [\"gann-square-fixed\", \"other\"],\n [\"gann-square\", \"other\"],\n [\"gann-fan\", \"other\"],\n [\"pitchfork\", \"polylines\"],\n [\"pitchfan\", \"polylines\"],\n [\"xabcd-pattern\", \"polylines\"],\n [\"cypher-pattern\", \"polylines\"],\n [\"head-and-shoulders\", \"polylines\"],\n [\"abcd-pattern\", \"polylines\"],\n [\"triangle-pattern\", \"polylines\"],\n [\"three-drives-pattern\", \"polylines\"],\n [\"elliott-impulse-wave\", \"polylines\"],\n [\"elliott-correction-wave\", \"polylines\"],\n [\"elliott-triangle-wave\", \"polylines\"],\n [\"elliott-double-combo\", \"polylines\"],\n [\"elliott-triple-combo\", \"polylines\"],\n [\"cyclic-lines\", \"other\"],\n [\"time-cycles\", \"other\"],\n [\"sine-line\", \"other\"],\n [\"group\", \"other\"],\n [\"frame\", \"other\"],\n [\"table\", \"other\"],\n]);\n\n/**\n * Return the {@link DrawingBucket} for a given {@link DrawingKind}.\n * Throws if the kind is not in the map — covers the defensive branch\n * for callers that pass an unverified string (e.g. a future kind\n * round-tripped from the wire before its bucket entry lands).\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { bucketFor } from \"@invinite-org/chartlang-core\";\n * const bucket = bucketFor(\"rectangle\"); // \"boxes\"\n * void bucket;\n */\nexport function bucketFor(kind: DrawingKind): DrawingBucket {\n const bucket = KIND_BUCKET.get(kind);\n if (bucket === undefined) {\n throw new Error(`No bucket assigned for drawing kind '${kind}'`);\n }\n return bucket;\n}\n"]}
1
+ {"version":3,"file":"buckets.js","sourceRoot":"","sources":["../../src/draw/buckets.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAsB/D;;;;;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;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,SAAS,CAAC,IAAiB;IACvC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,GAAG,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { DrawingKind } from \"./drawingKind.js\";\n\n/**\n * Canonical bucket name a {@link DrawingKind} maps to under the\n * `DrawingCounts` 5-bag budget (`{ lines, labels, boxes, polylines,\n * other }`). The adapter-kit `Capabilities.maxDrawingsPerScript` and\n * the script-side `ScriptManifest.maxDrawings?` both pin the same five\n * bucket names. The runtime budget enforcer counts emissions per\n * bucket and drops the overflow with `drawing-budget-exceeded`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * const b: DrawingBucket = \"lines\";\n * void b;\n */\nexport type DrawingBucket = \"lines\" | \"labels\" | \"boxes\" | \"polylines\" | \"other\";\n\n/**\n * Per-kind bucket assignment. Pinned table; every entry of\n * {@link DrawingKind} appears exactly once (asserted by\n * `buckets.test.ts`).\n *\n * Mapping rationale (Phase-3 task README §\"Architecture Decisions\"):\n * lines/rays/horizontalLine/verticalLine/crossLine/trendAngle → `lines`;\n * rectangle/rotatedRectangle/triangle/circle/ellipse → `boxes`;\n * path/polyline/curves/freehand/channels/pitchforks/patterns/elliott →\n * `polylines`; text/arrow/arrowMarker/arrowMarkUp/arrowMarkDown +\n * marker → `labels`; fib / gann / cycles / containers / table → `other`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { KIND_BUCKET } from \"@invinite-org/chartlang-core\";\n * const b = KIND_BUCKET.get(\"fib-retracement\"); // \"other\"\n * void b;\n */\nexport const KIND_BUCKET: ReadonlyMap<DrawingKind, DrawingBucket> = new Map<\n DrawingKind,\n DrawingBucket\n>([\n [\"line\", \"lines\"],\n [\"horizontal-line\", \"lines\"],\n [\"horizontal-ray\", \"lines\"],\n [\"vertical-line\", \"lines\"],\n [\"cross-line\", \"lines\"],\n [\"trend-angle\", \"lines\"],\n [\"rectangle\", \"boxes\"],\n [\"rotated-rectangle\", \"boxes\"],\n [\"triangle\", \"boxes\"],\n [\"polyline\", \"polylines\"],\n [\"circle\", \"boxes\"],\n [\"ellipse\", \"boxes\"],\n [\"path\", \"polylines\"],\n [\"fill-between\", \"polylines\"],\n [\"marker\", \"labels\"],\n [\"arc\", \"polylines\"],\n [\"curve\", \"polylines\"],\n [\"double-curve\", \"polylines\"],\n [\"pen\", \"polylines\"],\n [\"highlighter\", \"polylines\"],\n [\"brush\", \"polylines\"],\n [\"text\", \"labels\"],\n [\"arrow\", \"labels\"],\n [\"arrow-marker\", \"labels\"],\n [\"arrow-mark-up\", \"labels\"],\n [\"arrow-mark-down\", \"labels\"],\n [\"trend-channel\", \"polylines\"],\n [\"flat-top-bottom\", \"polylines\"],\n [\"disjoint-channel\", \"polylines\"],\n [\"regression-trend\", \"polylines\"],\n [\"fib-retracement\", \"other\"],\n [\"fib-trend-extension\", \"other\"],\n [\"fib-channel\", \"other\"],\n [\"fib-time-zone\", \"other\"],\n [\"fib-wedge\", \"other\"],\n [\"fib-speed-fan\", \"other\"],\n [\"fib-speed-arcs\", \"other\"],\n [\"fib-spiral\", \"other\"],\n [\"fib-circles\", \"other\"],\n [\"fib-trend-time\", \"other\"],\n [\"gann-box\", \"other\"],\n [\"gann-square-fixed\", \"other\"],\n [\"gann-square\", \"other\"],\n [\"gann-fan\", \"other\"],\n [\"pitchfork\", \"polylines\"],\n [\"pitchfan\", \"polylines\"],\n [\"xabcd-pattern\", \"polylines\"],\n [\"cypher-pattern\", \"polylines\"],\n [\"head-and-shoulders\", \"polylines\"],\n [\"abcd-pattern\", \"polylines\"],\n [\"triangle-pattern\", \"polylines\"],\n [\"three-drives-pattern\", \"polylines\"],\n [\"elliott-impulse-wave\", \"polylines\"],\n [\"elliott-correction-wave\", \"polylines\"],\n [\"elliott-triangle-wave\", \"polylines\"],\n [\"elliott-double-combo\", \"polylines\"],\n [\"elliott-triple-combo\", \"polylines\"],\n [\"cyclic-lines\", \"other\"],\n [\"time-cycles\", \"other\"],\n [\"sine-line\", \"other\"],\n [\"group\", \"other\"],\n [\"frame\", \"other\"],\n [\"table\", \"other\"],\n]);\n\n/**\n * Return the {@link DrawingBucket} for a given {@link DrawingKind}.\n * Throws if the kind is not in the map — covers the defensive branch\n * for callers that pass an unverified string (e.g. a future kind\n * round-tripped from the wire before its bucket entry lands).\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { bucketFor } from \"@invinite-org/chartlang-core\";\n * const bucket = bucketFor(\"rectangle\"); // \"boxes\"\n * void bucket;\n */\nexport function bucketFor(kind: DrawingKind): DrawingBucket {\n const bucket = KIND_BUCKET.get(kind);\n if (bucket === undefined) {\n throw new Error(`No bucket assigned for drawing kind '${kind}'`);\n }\n return bucket;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { Price, Time } from "../types.js";
2
- import type { ArrowMarkerOpts, ArrowOpts, BrushStyle, FibOpts, FrameOpts, HighlighterStyle, LineDrawStyle, PathOpts, RegressionTrendOpts, ShapeStyle, TextOpts } from "./drawingStyle.js";
2
+ import type { ArrowMarkerOpts, ArrowOpts, BrushStyle, FibOpts, FillBetweenStyle, FrameOpts, HighlighterStyle, LineDrawStyle, PathOpts, RegressionTrendOpts, ShapeStyle, TextOpts } from "./drawingStyle.js";
3
3
  import type { DrawingHandle } from "./handle.js";
4
4
  import type { TableOpts } from "./table.js";
5
5
  import type { AnchorHept, AnchorQuad, AnchorQuint, AnchorTriple, WorldPoint } from "./worldPoint.js";
@@ -47,6 +47,13 @@ export type DrawNamespace = {
47
47
  circle(centre: WorldPoint, radiusAnchor: WorldPoint, opts?: ShapeStyle): DrawingHandle;
48
48
  ellipse(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;
49
49
  path(anchors: ReadonlyArray<WorldPoint>, opts?: PathOpts): DrawingHandle;
50
+ /**
51
+ * Fill the ribbon between two edges. Each edge is a list of world
52
+ * anchors; the filled region is the closed polygon `edgeA` forward
53
+ * then `edgeB` reversed. The native equivalent of Pine
54
+ * `linefill.new(line1, line2, color)` / `fill(plot1, plot2)`.
55
+ */
56
+ fillBetween(edgeA: ReadonlyArray<WorldPoint>, edgeB: ReadonlyArray<WorldPoint>, opts?: FillBetweenStyle): DrawingHandle;
50
57
  marker(anchor: WorldPoint, opts?: TextOpts & {
51
58
  readonly text?: string;
52
59
  readonly value?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../src/draw/draw.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EACR,eAAe,EACf,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACb,MAAM,iBAAiB,CAAC;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F,OAAO,IAAI,KAAK,CAAC,EAAmB,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB;IACrC,OAAO,GAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,kCAAkC,CAAC,CAAC;IACpE,CAAC,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { Price, Time } from \"../types.js\";\nimport type {\n ArrowMarkerOpts,\n ArrowOpts,\n BrushStyle,\n FibOpts,\n FrameOpts,\n HighlighterStyle,\n LineDrawStyle,\n PathOpts,\n RegressionTrendOpts,\n ShapeStyle,\n TextOpts,\n} from \"./drawingStyle.js\";\nimport type { DrawingHandle } from \"./handle.js\";\nimport type { TableOpts } from \"./table.js\";\nimport type {\n AnchorHept,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n WorldPoint,\n} from \"./worldPoint.js\";\n\n/**\n * The script-facing `draw.*` namespace. Each method is stateful across\n * calls — the compiler injects a callsite slot id so the runtime can\n * track the per-handle `DrawingState` across bars — and returns a\n * {@link DrawingHandle}. Adapters that omit a kind degrade silently\n * with `unsupported-drawing-kind`; excess emissions\n * drop with `drawing-budget-exceeded` once the per-script bucket is\n * full.\n *\n * Every kind lives as a FLAT method directly on `DrawNamespace` —\n * script authors call `draw.fibRetracement(a, b)` /\n * `draw.gannBox(a, b)` / `draw.elliottImpulseWave(anchors)` /\n * `draw.xabcdPattern(anchors)`, matching the flat camelCase names in\n * `STATEFUL_PRIMITIVES` and Pine + invinite parity. The wire format\n * keeps the kebab-case `DrawingKind`.\n *\n * Phase-3 implementations live in `@invinite-org/chartlang-runtime`;\n * this file ships the script-author type plus a throwing-stub `draw`\n * value (mirrors `plot/plot.ts:plot`). Tasks 5–18 land the runtime\n * impl per category.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import type { DrawNamespace } from \"@invinite-org/chartlang-core\";\n * const _ns: DrawNamespace | null = null;\n * void _ns;\n */\nexport type DrawNamespace = {\n // Lines / Rays (Task 5)\n line(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n horizontalLine(price: Price, opts?: LineDrawStyle): DrawingHandle;\n horizontalRay(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n verticalLine(time: Time, opts?: LineDrawStyle): DrawingHandle;\n crossLine(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n trendAngle(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Boxes A (Task 6)\n rectangle(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n rotatedRectangle(anchors: AnchorQuad, opts?: ShapeStyle): DrawingHandle;\n triangle(anchors: AnchorTriple, opts?: ShapeStyle): DrawingHandle;\n polyline(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n // Boxes B (Task 7)\n circle(centre: WorldPoint, radiusAnchor: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n ellipse(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n path(anchors: ReadonlyArray<WorldPoint>, opts?: PathOpts): DrawingHandle;\n marker(\n anchor: WorldPoint,\n opts?: TextOpts & { readonly text?: string; readonly value?: number },\n ): DrawingHandle;\n // Curves (Task 8)\n arc(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n curve(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n doubleCurve(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n // Freehand (Task 8)\n pen(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n highlighter(anchors: ReadonlyArray<WorldPoint>, opts: HighlighterStyle): DrawingHandle;\n brush(anchors: ReadonlyArray<WorldPoint>, opts: BrushStyle): DrawingHandle;\n // Annotations (Task 9)\n text(anchor: WorldPoint, body: string, opts?: TextOpts): DrawingHandle;\n arrow(a: WorldPoint, b: WorldPoint, opts?: ArrowOpts): DrawingHandle;\n arrowMarker(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkUp(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkDown(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n // Channels (Task 10)\n trendChannel(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n flatTopBottom(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n disjointChannel(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n regressionTrend(a: WorldPoint, b: WorldPoint, opts?: RegressionTrendOpts): DrawingHandle;\n // Fibonacci A (Task 11)\n fibRetracement(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendExtension(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibChannel(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibTimeZone(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibWedge(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Fibonacci B (Task 12)\n fibSpeedFan(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpeedArcs(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpiral(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibCircles(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendTime(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Gann (Task 13)\n gannBox(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquareFixed(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquare(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannFan(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Pitchforks (Task 14)\n pitchfork(\n anchors: AnchorTriple,\n opts?: LineDrawStyle & {\n readonly variant?: \"standard\" | \"schiff\" | \"modifiedSchiff\" | \"inside\";\n },\n ): DrawingHandle;\n pitchfan(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n // Harmonic Patterns (Task 15)\n xabcdPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n cypherPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n headAndShoulders(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n abcdPattern(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n trianglePattern(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n threeDrivesPattern(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Elliott Waves (Task 16)\n elliottImpulseWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottCorrectionWave(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n elliottTriangleWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottDoubleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n elliottTripleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Cycles (Task 17)\n cyclicLines(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n timeCycles(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n sineLine(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Containers (Task 18)\n group(childHandleIds: ReadonlyArray<string>): DrawingHandle;\n frame(a: WorldPoint, b: WorldPoint, opts?: FrameOpts): DrawingHandle;\n // Viewport overlays (Phase 5)\n table(opts: TableOpts): DrawingHandle;\n};\n\n/**\n * Compile-time callable hole for the `draw.*` namespace. Every `get`\n * on the proxy returns a function that throws the\n * `\"draw.<method> called outside compiled runtime\"` sentinel — same\n * convention as the `plot` / `hline` / `alert` stubs in\n * `plot/plot.ts:plot` / `alert/alert.ts:alert`. The runtime swaps this\n * stub for the real namespace at boot per the\n * `@invinite-org/chartlang-runtime` `primitives.ts` seam.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import { draw } from \"@invinite-org/chartlang-core\";\n * try {\n * draw.horizontalLine(0);\n * } catch {\n * // expected: \"draw.horizontalLine called outside compiled runtime\"\n * }\n */\nexport const draw: DrawNamespace = createDrawStub();\n\nfunction createDrawStub(): DrawNamespace {\n const handler: ProxyHandler<DrawNamespace> = {\n get(_target, property): unknown {\n const name = String(property);\n return throwingMethod(`draw.${name}`);\n },\n };\n return new Proxy({} as DrawNamespace, handler);\n}\n\nfunction throwingMethod(qualified: string): () => never {\n return (): never => {\n throw new Error(`${qualified} called outside compiled runtime`);\n };\n}\n"]}
1
+ {"version":3,"file":"draw.js","sourceRoot":"","sources":["../../src/draw/draw.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA6J/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB,cAAc,EAAE,CAAC;AAEpD,SAAS,cAAc;IACnB,MAAM,OAAO,GAAgC;QACzC,GAAG,CAAC,OAAO,EAAE,QAAQ;YACjB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,OAAO,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QAC1C,CAAC;KACJ,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,EAAmB,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB;IACrC,OAAO,GAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,kCAAkC,CAAC,CAAC;IACpE,CAAC,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { Price, Time } from \"../types.js\";\nimport type {\n ArrowMarkerOpts,\n ArrowOpts,\n BrushStyle,\n FibOpts,\n FillBetweenStyle,\n FrameOpts,\n HighlighterStyle,\n LineDrawStyle,\n PathOpts,\n RegressionTrendOpts,\n ShapeStyle,\n TextOpts,\n} from \"./drawingStyle.js\";\nimport type { DrawingHandle } from \"./handle.js\";\nimport type { TableOpts } from \"./table.js\";\nimport type {\n AnchorHept,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n WorldPoint,\n} from \"./worldPoint.js\";\n\n/**\n * The script-facing `draw.*` namespace. Each method is stateful across\n * calls — the compiler injects a callsite slot id so the runtime can\n * track the per-handle `DrawingState` across bars — and returns a\n * {@link DrawingHandle}. Adapters that omit a kind degrade silently\n * with `unsupported-drawing-kind`; excess emissions\n * drop with `drawing-budget-exceeded` once the per-script bucket is\n * full.\n *\n * Every kind lives as a FLAT method directly on `DrawNamespace` —\n * script authors call `draw.fibRetracement(a, b)` /\n * `draw.gannBox(a, b)` / `draw.elliottImpulseWave(anchors)` /\n * `draw.xabcdPattern(anchors)`, matching the flat camelCase names in\n * `STATEFUL_PRIMITIVES` and Pine + invinite parity. The wire format\n * keeps the kebab-case `DrawingKind`.\n *\n * Phase-3 implementations live in `@invinite-org/chartlang-runtime`;\n * this file ships the script-author type plus a throwing-stub `draw`\n * value (mirrors `plot/plot.ts:plot`). Tasks 5–18 land the runtime\n * impl per category.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import type { DrawNamespace } from \"@invinite-org/chartlang-core\";\n * const _ns: DrawNamespace | null = null;\n * void _ns;\n */\nexport type DrawNamespace = {\n // Lines / Rays (Task 5)\n line(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n horizontalLine(price: Price, opts?: LineDrawStyle): DrawingHandle;\n horizontalRay(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n verticalLine(time: Time, opts?: LineDrawStyle): DrawingHandle;\n crossLine(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n trendAngle(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Boxes A (Task 6)\n rectangle(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n rotatedRectangle(anchors: AnchorQuad, opts?: ShapeStyle): DrawingHandle;\n triangle(anchors: AnchorTriple, opts?: ShapeStyle): DrawingHandle;\n polyline(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n // Boxes B (Task 7)\n circle(centre: WorldPoint, radiusAnchor: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n ellipse(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n path(anchors: ReadonlyArray<WorldPoint>, opts?: PathOpts): DrawingHandle;\n /**\n * Fill the ribbon between two edges. Each edge is a list of world\n * anchors; the filled region is the closed polygon `edgeA` forward\n * then `edgeB` reversed. The native equivalent of Pine\n * `linefill.new(line1, line2, color)` / `fill(plot1, plot2)`.\n */\n fillBetween(\n edgeA: ReadonlyArray<WorldPoint>,\n edgeB: ReadonlyArray<WorldPoint>,\n opts?: FillBetweenStyle,\n ): DrawingHandle;\n marker(\n anchor: WorldPoint,\n opts?: TextOpts & { readonly text?: string; readonly value?: number },\n ): DrawingHandle;\n // Curves (Task 8)\n arc(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n curve(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n doubleCurve(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n // Freehand (Task 8)\n pen(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n highlighter(anchors: ReadonlyArray<WorldPoint>, opts: HighlighterStyle): DrawingHandle;\n brush(anchors: ReadonlyArray<WorldPoint>, opts: BrushStyle): DrawingHandle;\n // Annotations (Task 9)\n text(anchor: WorldPoint, body: string, opts?: TextOpts): DrawingHandle;\n arrow(a: WorldPoint, b: WorldPoint, opts?: ArrowOpts): DrawingHandle;\n arrowMarker(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkUp(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkDown(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n // Channels (Task 10)\n trendChannel(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n flatTopBottom(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n disjointChannel(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n regressionTrend(a: WorldPoint, b: WorldPoint, opts?: RegressionTrendOpts): DrawingHandle;\n // Fibonacci A (Task 11)\n fibRetracement(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendExtension(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibChannel(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibTimeZone(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibWedge(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Fibonacci B (Task 12)\n fibSpeedFan(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpeedArcs(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpiral(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibCircles(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendTime(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Gann (Task 13)\n gannBox(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquareFixed(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquare(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannFan(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Pitchforks (Task 14)\n pitchfork(\n anchors: AnchorTriple,\n opts?: LineDrawStyle & {\n readonly variant?: \"standard\" | \"schiff\" | \"modifiedSchiff\" | \"inside\";\n },\n ): DrawingHandle;\n pitchfan(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n // Harmonic Patterns (Task 15)\n xabcdPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n cypherPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n headAndShoulders(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n abcdPattern(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n trianglePattern(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n threeDrivesPattern(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Elliott Waves (Task 16)\n elliottImpulseWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottCorrectionWave(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n elliottTriangleWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottDoubleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n elliottTripleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Cycles (Task 17)\n cyclicLines(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n timeCycles(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n sineLine(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Containers (Task 18)\n group(childHandleIds: ReadonlyArray<string>): DrawingHandle;\n frame(a: WorldPoint, b: WorldPoint, opts?: FrameOpts): DrawingHandle;\n // Viewport overlays (Phase 5)\n table(opts: TableOpts): DrawingHandle;\n};\n\n/**\n * Compile-time callable hole for the `draw.*` namespace. Every `get`\n * on the proxy returns a function that throws the\n * `\"draw.<method> called outside compiled runtime\"` sentinel — same\n * convention as the `plot` / `hline` / `alert` stubs in\n * `plot/plot.ts:plot` / `alert/alert.ts:alert`. The runtime swaps this\n * stub for the real namespace at boot per the\n * `@invinite-org/chartlang-runtime` `primitives.ts` seam.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import { draw } from \"@invinite-org/chartlang-core\";\n * try {\n * draw.horizontalLine(0);\n * } catch {\n * // expected: \"draw.horizontalLine called outside compiled runtime\"\n * }\n */\nexport const draw: DrawNamespace = createDrawStub();\n\nfunction createDrawStub(): DrawNamespace {\n const handler: ProxyHandler<DrawNamespace> = {\n get(_target, property): unknown {\n const name = String(property);\n return throwingMethod(`draw.${name}`);\n },\n };\n return new Proxy({} as DrawNamespace, handler);\n}\n\nfunction throwingMethod(qualified: string): () => never {\n return (): never => {\n throw new Error(`${qualified} called outside compiled runtime`);\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The full set of 62 drawing kinds chartlang supports through `draw.*`.
2
+ * The full set of 63 drawing kinds chartlang supports through `draw.*`.
3
3
  * The wire format is kebab-case; the TypeScript script surface is
4
4
  * camelCase (`draw.horizontalLine(...)`). See {@link KIND_CAMELCASE} for
5
5
  * the canonical bijection.
@@ -14,28 +14,28 @@
14
14
  * - `cypher-pattern` has no standalone tool — emittable only through
15
15
  * `defineDrawing` (Task 20).
16
16
  *
17
- * Order pinned: lines (6) → boxes (8) → curves (3) → freehand (3) →
17
+ * Order pinned: lines (6) → boxes (9) → curves (3) → freehand (3) →
18
18
  * annotations (5) → channels (4) → fib (10) → gann (4) → pitchforks (2)
19
19
  * → patterns (6) → elliott (5) → cycles (3) → containers (2) → viewport
20
- * overlays (1) = 62. The order is wire-stable — downstream consumers iterate
20
+ * overlays (1) = 63. The order is wire-stable — downstream consumers iterate
21
21
  * {@link DRAWING_KINDS} in this order for diagnostic readability.
22
22
  *
23
23
  * @formula N/A — discriminator constant set
24
- * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}
24
+ * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
25
25
  * @since 0.3
26
26
  * @stable
27
27
  * @example
28
28
  * const k: DrawingKind = "fib-retracement";
29
29
  * void k;
30
30
  */
31
- export type DrawingKind = "line" | "horizontal-line" | "horizontal-ray" | "vertical-line" | "cross-line" | "trend-angle" | "rectangle" | "rotated-rectangle" | "triangle" | "polyline" | "circle" | "ellipse" | "path" | "marker" | "arc" | "curve" | "double-curve" | "pen" | "highlighter" | "brush" | "text" | "arrow" | "arrow-marker" | "arrow-mark-up" | "arrow-mark-down" | "trend-channel" | "flat-top-bottom" | "disjoint-channel" | "regression-trend" | "fib-retracement" | "fib-trend-extension" | "fib-channel" | "fib-time-zone" | "fib-wedge" | "fib-speed-fan" | "fib-speed-arcs" | "fib-spiral" | "fib-circles" | "fib-trend-time" | "gann-box" | "gann-square-fixed" | "gann-square" | "gann-fan" | "pitchfork" | "pitchfan" | "xabcd-pattern" | "cypher-pattern" | "head-and-shoulders" | "abcd-pattern" | "triangle-pattern" | "three-drives-pattern" | "elliott-impulse-wave" | "elliott-correction-wave" | "elliott-triangle-wave" | "elliott-double-combo" | "elliott-triple-combo" | "cyclic-lines" | "time-cycles" | "sine-line" | "group" | "frame" | "table";
31
+ export type DrawingKind = "line" | "horizontal-line" | "horizontal-ray" | "vertical-line" | "cross-line" | "trend-angle" | "rectangle" | "rotated-rectangle" | "triangle" | "polyline" | "circle" | "ellipse" | "path" | "fill-between" | "marker" | "arc" | "curve" | "double-curve" | "pen" | "highlighter" | "brush" | "text" | "arrow" | "arrow-marker" | "arrow-mark-up" | "arrow-mark-down" | "trend-channel" | "flat-top-bottom" | "disjoint-channel" | "regression-trend" | "fib-retracement" | "fib-trend-extension" | "fib-channel" | "fib-time-zone" | "fib-wedge" | "fib-speed-fan" | "fib-speed-arcs" | "fib-spiral" | "fib-circles" | "fib-trend-time" | "gann-box" | "gann-square-fixed" | "gann-square" | "gann-fan" | "pitchfork" | "pitchfan" | "xabcd-pattern" | "cypher-pattern" | "head-and-shoulders" | "abcd-pattern" | "triangle-pattern" | "three-drives-pattern" | "elliott-impulse-wave" | "elliott-correction-wave" | "elliott-triangle-wave" | "elliott-double-combo" | "elliott-triple-combo" | "cyclic-lines" | "time-cycles" | "sine-line" | "group" | "frame" | "table";
32
32
  /**
33
33
  * Iterable form of {@link DrawingKind}. Order matches the type
34
34
  * declaration so docs / validators / dispatchers can walk the set in a
35
35
  * single canonical order. Frozen.
36
36
  *
37
37
  * @formula N/A — discriminator constant set
38
- * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}
38
+ * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
39
39
  * @since 0.3
40
40
  * @stable
41
41
  * @example
@@ -53,7 +53,7 @@ export declare const DRAWING_KINDS: ReadonlyArray<DrawingKind>;
53
53
  * {@link KIND_KEBABCASE}.
54
54
  *
55
55
  * @formula N/A — discriminator constant set
56
- * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}
56
+ * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
57
57
  * @since 0.3
58
58
  * @stable
59
59
  * @example
@@ -68,7 +68,7 @@ export declare const KIND_CAMELCASE: ReadonlyMap<DrawingKind, string>;
68
68
  * two maps cannot drift.
69
69
  *
70
70
  * @formula N/A — discriminator constant set
71
- * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}
71
+ * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
72
72
  * @since 0.3
73
73
  * @stable
74
74
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"drawingKind.d.ts","sourceRoot":"","sources":["../../src/draw/drawingKind.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,WAAW,GAEjB,MAAM,GACN,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,YAAY,GACZ,aAAa,GAEb,WAAW,GACX,mBAAmB,GACnB,UAAU,GACV,UAAU,GACV,QAAQ,GACR,SAAS,GACT,MAAM,GACN,QAAQ,GAER,KAAK,GACL,OAAO,GACP,cAAc,GAEd,KAAK,GACL,aAAa,GACb,OAAO,GAEP,MAAM,GACN,OAAO,GACP,cAAc,GACd,eAAe,GACf,iBAAiB,GAEjB,eAAe,GACf,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAElB,iBAAiB,GACjB,qBAAqB,GACrB,aAAa,GACb,eAAe,GACf,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,YAAY,GACZ,aAAa,GACb,gBAAgB,GAEhB,UAAU,GACV,mBAAmB,GACnB,aAAa,GACb,UAAU,GAEV,WAAW,GACX,UAAU,GAEV,eAAe,GACf,gBAAgB,GAChB,oBAAoB,GACpB,cAAc,GACd,kBAAkB,GAClB,sBAAsB,GAEtB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,sBAAsB,GAEtB,cAAc,GACd,aAAa,GACb,WAAW,GAEX,OAAO,GACP,OAAO,GAEP,OAAO,CAAC;AAEd;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,WAAW,CA+DL,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,WAAW,EAAE,MAAM,CA+D1D,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAE3D,CAAC"}
1
+ {"version":3,"file":"drawingKind.d.ts","sourceRoot":"","sources":["../../src/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@formula N/A — discriminator constant set
9
- * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}
9
+ * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
10
10
  * @since 0.3
11
11
  * @stable
12
12
  * @example
@@ -29,6 +29,7 @@ export const DRAWING_KINDS = Object.freeze([
29
29
  "circle",
30
30
  "ellipse",
31
31
  "path",
32
+ "fill-between",
32
33
  "marker",
33
34
  "arc",
34
35
  "curve",
@@ -87,7 +88,7 @@ export const DRAWING_KINDS = Object.freeze([
87
88
  * {@link KIND_KEBABCASE}.
88
89
  *
89
90
  * @formula N/A — discriminator constant set
90
- * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}
91
+ * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
91
92
  * @since 0.3
92
93
  * @stable
93
94
  * @example
@@ -109,6 +110,7 @@ export const KIND_CAMELCASE = new Map([
109
110
  ["circle", "circle"],
110
111
  ["ellipse", "ellipse"],
111
112
  ["path", "path"],
113
+ ["fill-between", "fillBetween"],
112
114
  ["marker", "marker"],
113
115
  ["arc", "arc"],
114
116
  ["curve", "curve"],
@@ -165,7 +167,7 @@ export const KIND_CAMELCASE = new Map([
165
167
  * two maps cannot drift.
166
168
  *
167
169
  * @formula N/A — discriminator constant set
168
- * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}
170
+ * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
169
171
  * @since 0.3
170
172
  * @stable
171
173
  * @example