@invinite-org/chartlang-core 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +232 -0
- package/README.md +2 -1
- package/dist/alert/alert.d.ts +1 -1
- package/dist/alert/alert.js +1 -1
- package/dist/alert/alert.js.map +1 -1
- package/dist/alert/index.js.map +1 -1
- package/dist/color/colorHelpers.js.map +1 -1
- package/dist/color/index.js.map +1 -1
- package/dist/color/parseColor.js.map +1 -1
- package/dist/define/defineAlert.js.map +1 -1
- package/dist/define/defineAlertCondition.js.map +1 -1
- package/dist/define/defineDrawing.d.ts +2 -2
- package/dist/define/defineDrawing.js +2 -2
- package/dist/define/defineDrawing.js.map +1 -1
- package/dist/define/defineIndicator.js.map +1 -1
- package/dist/define/depAccessorSentinel.js.map +1 -1
- package/dist/define/dependency.js.map +1 -1
- package/dist/define/index.js.map +1 -1
- package/dist/define/overrides.js.map +1 -1
- package/dist/draw/buckets.d.ts.map +1 -1
- package/dist/draw/buckets.js +1 -0
- package/dist/draw/buckets.js.map +1 -1
- package/dist/draw/draw.d.ts +10 -4
- package/dist/draw/draw.d.ts.map +1 -1
- package/dist/draw/draw.js +1 -2
- package/dist/draw/draw.js.map +1 -1
- package/dist/draw/drawingKind.d.ts +9 -9
- package/dist/draw/drawingKind.d.ts.map +1 -1
- package/dist/draw/drawingKind.js +5 -3
- package/dist/draw/drawingKind.js.map +1 -1
- package/dist/draw/drawingState.d.ts +32 -8
- package/dist/draw/drawingState.d.ts.map +1 -1
- package/dist/draw/drawingState.js.map +1 -1
- package/dist/draw/drawingStyle.d.ts +53 -10
- package/dist/draw/drawingStyle.d.ts.map +1 -1
- package/dist/draw/drawingStyle.js.map +1 -1
- package/dist/draw/handle.js.map +1 -1
- package/dist/draw/index.d.ts +2 -2
- package/dist/draw/index.d.ts.map +1 -1
- package/dist/draw/index.js.map +1 -1
- package/dist/draw/table.d.ts +1 -1
- package/dist/draw/table.js.map +1 -1
- package/dist/draw/worldPoint.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/input/index.js.map +1 -1
- package/dist/input/input.js.map +1 -1
- package/dist/input/inputDescriptor.js.map +1 -1
- package/dist/interval/intervalToSeconds.js.map +1 -1
- package/dist/plot/index.js.map +1 -1
- package/dist/plot/plot.d.ts +16 -1
- package/dist/plot/plot.d.ts.map +1 -1
- package/dist/plot/plot.js +1 -1
- package/dist/plot/plot.js.map +1 -1
- package/dist/request/index.d.ts +1 -1
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js.map +1 -1
- package/dist/request/request.d.ts +82 -20
- package/dist/request/request.d.ts.map +1 -1
- package/dist/request/request.js +27 -26
- package/dist/request/request.js.map +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/state/index.js.map +1 -1
- package/dist/state/mutableSlot.js.map +1 -1
- package/dist/state/snapshot.d.ts +5 -5
- package/dist/state/snapshot.js.map +1 -1
- package/dist/state/state.d.ts +17 -0
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.js +18 -0
- package/dist/state/state.js.map +1 -1
- package/dist/statefulPrimitives.d.ts +10 -6
- package/dist/statefulPrimitives.d.ts.map +1 -1
- package/dist/statefulPrimitives.js +18 -6
- package/dist/statefulPrimitives.js.map +1 -1
- package/dist/ta/index.js.map +1 -1
- package/dist/ta/ta.d.ts +79 -48
- package/dist/ta/ta.d.ts.map +1 -1
- package/dist/ta/ta.js +6 -0
- package/dist/ta/ta.js.map +1 -1
- package/dist/time/_lib/dateTimeFormatCache.js.map +1 -1
- package/dist/time/index.js.map +1 -1
- package/dist/time/nyDayKey.js +2 -2
- package/dist/time/nyDayKey.js.map +1 -1
- package/dist/time/session.js.map +1 -1
- package/dist/time/sessionBoundaries.js +2 -2
- package/dist/time/sessionBoundaries.js.map +1 -1
- package/dist/time/types.js.map +1 -1
- package/dist/time/weekKey.js.map +1 -1
- package/dist/time/weekday.js.map +1 -1
- package/dist/types.d.ts +167 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/views/barstate.js.map +1 -1
- package/dist/views/index.js.map +1 -1
- package/dist/views/syminfo.js.map +1 -1
- package/dist/views/timeframe.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import type { Color, LineStyle } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Shared render-order mixin intersected into every `draw.*` option bag.
|
|
4
|
+
*
|
|
5
|
+
* Presentation-only render-order key (z-index). Default `0`. Higher
|
|
6
|
+
* renders on top. A drawing with negative `z` can render **below**
|
|
7
|
+
* plots (which default to a lower band than drawings). Finite numbers
|
|
8
|
+
* only; affects stacking only, never geometry or anchors.
|
|
9
|
+
*
|
|
10
|
+
* @formula N/A — render-order key, no math
|
|
11
|
+
* @anchors N/A — does not move any anchor
|
|
12
|
+
* @since 1.4
|
|
13
|
+
* @stable
|
|
14
|
+
* @example
|
|
15
|
+
* draw.line(a, b, { z: -1 }); // beneath the plots
|
|
16
|
+
*/
|
|
17
|
+
export interface ZOrdered {
|
|
18
|
+
readonly z?: number;
|
|
19
|
+
}
|
|
2
20
|
/**
|
|
3
21
|
* Line / ray / horizontal-line / vertical-line / channel-edge stroke
|
|
4
22
|
* style. `extendLeft` / `extendRight` collapse the invinite `ray` and
|
|
5
|
-
* `extended-line` tools into a single `line` kind
|
|
23
|
+
* `extended-line` tools into a single `line` kind.
|
|
6
24
|
*
|
|
7
25
|
* @formula N/A — style bag, no math
|
|
8
26
|
* @anchors N/A — style fields only
|
|
@@ -12,7 +30,7 @@ import type { Color, LineStyle } from "../types.js";
|
|
|
12
30
|
* const s: LineDrawStyle = { color: "#3b82f6", lineWidth: 2, lineStyle: "solid" };
|
|
13
31
|
* void s;
|
|
14
32
|
*/
|
|
15
|
-
export type LineDrawStyle = {
|
|
33
|
+
export type LineDrawStyle = ZOrdered & {
|
|
16
34
|
readonly color?: Color;
|
|
17
35
|
readonly lineWidth?: number;
|
|
18
36
|
readonly lineStyle?: LineStyle;
|
|
@@ -38,7 +56,7 @@ export type LineDrawStyle = {
|
|
|
38
56
|
* };
|
|
39
57
|
* void s;
|
|
40
58
|
*/
|
|
41
|
-
export type ShapeStyle = {
|
|
59
|
+
export type ShapeStyle = ZOrdered & {
|
|
42
60
|
readonly stroke?: Color;
|
|
43
61
|
readonly fill?: Color;
|
|
44
62
|
readonly lineWidth?: number;
|
|
@@ -57,7 +75,7 @@ export type ShapeStyle = {
|
|
|
57
75
|
* const s: HighlighterStyle = { color: "#facc15", alpha: 0.3 };
|
|
58
76
|
* void s;
|
|
59
77
|
*/
|
|
60
|
-
export type HighlighterStyle = {
|
|
78
|
+
export type HighlighterStyle = ZOrdered & {
|
|
61
79
|
readonly color: Color;
|
|
62
80
|
readonly alpha: number;
|
|
63
81
|
};
|
|
@@ -73,7 +91,7 @@ export type HighlighterStyle = {
|
|
|
73
91
|
* const s: BrushStyle = { stroke: "#000000", fill: "#ffffff" };
|
|
74
92
|
* void s;
|
|
75
93
|
*/
|
|
76
|
-
export type BrushStyle = {
|
|
94
|
+
export type BrushStyle = ZOrdered & {
|
|
77
95
|
readonly stroke: Color;
|
|
78
96
|
readonly fill: Color;
|
|
79
97
|
};
|
|
@@ -95,7 +113,7 @@ export type BrushStyle = {
|
|
|
95
113
|
* };
|
|
96
114
|
* void t;
|
|
97
115
|
*/
|
|
98
|
-
export type TextOpts = {
|
|
116
|
+
export type TextOpts = ZOrdered & {
|
|
99
117
|
readonly color?: Color;
|
|
100
118
|
readonly size?: "tiny" | "small" | "normal" | "large" | "huge";
|
|
101
119
|
readonly halign?: "left" | "center" | "right";
|
|
@@ -129,7 +147,7 @@ export type ArrowOpts = LineDrawStyle & {
|
|
|
129
147
|
* const m: ArrowMarkerOpts = { color: "#10b981", text: "Long" };
|
|
130
148
|
* void m;
|
|
131
149
|
*/
|
|
132
|
-
export type ArrowMarkerOpts = {
|
|
150
|
+
export type ArrowMarkerOpts = ZOrdered & {
|
|
133
151
|
readonly color?: Color;
|
|
134
152
|
readonly text?: string;
|
|
135
153
|
};
|
|
@@ -147,6 +165,31 @@ export type ArrowMarkerOpts = {
|
|
|
147
165
|
export type PathOpts = LineDrawStyle & {
|
|
148
166
|
readonly closed?: boolean;
|
|
149
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* Style for {@link draw.fillBetween} — a filled ribbon between two
|
|
170
|
+
* edges. Stroke fields are optional (the band may be fill-only);
|
|
171
|
+
* `fill` + `fillAlpha` reuse the {@link ShapeStyle} fill model.
|
|
172
|
+
*
|
|
173
|
+
* @formula N/A — style bag, no math
|
|
174
|
+
* @anchors N/A — style fields only
|
|
175
|
+
* @since 0.4
|
|
176
|
+
* @stable
|
|
177
|
+
* @example
|
|
178
|
+
* const s: FillBetweenStyle = { fill: "#3b82f6", fillAlpha: 0.2 };
|
|
179
|
+
* void s;
|
|
180
|
+
*/
|
|
181
|
+
export type FillBetweenStyle = ZOrdered & {
|
|
182
|
+
/** Optional outline colour drawn around the ribbon. */
|
|
183
|
+
readonly color?: Color;
|
|
184
|
+
/** Outline width in px (default 0 / no stroke when `color` unset). */
|
|
185
|
+
readonly lineWidth?: number;
|
|
186
|
+
/** Outline dash style. */
|
|
187
|
+
readonly lineStyle?: LineStyle;
|
|
188
|
+
/** Fill colour of the band. */
|
|
189
|
+
readonly fill?: Color;
|
|
190
|
+
/** Fill opacity 0..1 (`applyShapeStyle` currently defaults to 1). */
|
|
191
|
+
readonly fillAlpha?: number;
|
|
192
|
+
};
|
|
150
193
|
/**
|
|
151
194
|
* Fibonacci-family style. `levels` defaults to the canonical
|
|
152
195
|
* 0.236 / 0.382 / 0.5 / 0.618 / 0.786 / 1.0 / 1.272 / 1.618 / 2.618 /
|
|
@@ -167,7 +210,7 @@ export type PathOpts = LineDrawStyle & {
|
|
|
167
210
|
* };
|
|
168
211
|
* void f;
|
|
169
212
|
*/
|
|
170
|
-
export type FibOpts = {
|
|
213
|
+
export type FibOpts = ZOrdered & {
|
|
171
214
|
readonly levels?: ReadonlyArray<number>;
|
|
172
215
|
readonly showLabels?: boolean;
|
|
173
216
|
readonly color?: Color;
|
|
@@ -192,7 +235,7 @@ export type FibOpts = {
|
|
|
192
235
|
* };
|
|
193
236
|
* void r;
|
|
194
237
|
*/
|
|
195
|
-
export type RegressionTrendOpts = {
|
|
238
|
+
export type RegressionTrendOpts = ZOrdered & {
|
|
196
239
|
readonly source?: "close" | "open" | "high" | "low" | "hl2" | "hlc3" | "ohlc4" | "hlcc4";
|
|
197
240
|
readonly stdevMultiplier?: number;
|
|
198
241
|
readonly showUpperBand?: boolean;
|
|
@@ -212,7 +255,7 @@ export type RegressionTrendOpts = {
|
|
|
212
255
|
* const f: FrameOpts = { label: "Trade idea", bgColor: "#f1f5f9" };
|
|
213
256
|
* void f;
|
|
214
257
|
*/
|
|
215
|
-
export type FrameOpts = {
|
|
258
|
+
export type FrameOpts = ZOrdered & {
|
|
216
259
|
readonly label?: string;
|
|
217
260
|
readonly bgColor?: Color;
|
|
218
261
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawingStyle.d.ts","sourceRoot":"","sources":["../../src/draw/drawingStyle.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,GAAG;
|
|
1
|
+
{"version":3,"file":"drawingStyle.d.ts","sourceRoot":"","sources":["../../src/draw/drawingStyle.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM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AAK,CAAC,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IACzF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;CAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawingStyle.js","sourceRoot":"","sources":["../../src/draw/drawingStyle.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
|
|
1
|
+
{"version":3,"file":"drawingStyle.js","sourceRoot":"","sources":["../../src/draw/drawingStyle.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D","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 { Color, LineStyle } from \"../types.js\";\n\n/**\n * Shared render-order mixin intersected into every `draw.*` option bag.\n *\n * Presentation-only render-order key (z-index). Default `0`. Higher\n * renders on top. A drawing with negative `z` can render **below**\n * plots (which default to a lower band than drawings). Finite numbers\n * only; affects stacking only, never geometry or anchors.\n *\n * @formula N/A — render-order key, no math\n * @anchors N/A — does not move any anchor\n * @since 1.4\n * @stable\n * @example\n * draw.line(a, b, { z: -1 }); // beneath the plots\n */\nexport interface ZOrdered {\n readonly z?: number;\n}\n\n/**\n * Line / ray / horizontal-line / vertical-line / channel-edge stroke\n * style. `extendLeft` / `extendRight` collapse the invinite `ray` and\n * `extended-line` tools into a single `line` kind.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const s: LineDrawStyle = { color: \"#3b82f6\", lineWidth: 2, lineStyle: \"solid\" };\n * void s;\n */\nexport type LineDrawStyle = ZOrdered & {\n readonly color?: Color;\n readonly lineWidth?: number;\n readonly lineStyle?: LineStyle;\n readonly extendLeft?: boolean;\n readonly extendRight?: boolean;\n};\n\n/**\n * Filled-shape style — rectangles, triangles, ellipses, circles. `fill`\n * is paired with `fillAlpha` for the transparent overlay; `stroke` +\n * `lineStyle` paint the outline.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const s: ShapeStyle = {\n * stroke: \"#3b82f6\",\n * fill: \"#dbeafe\",\n * fillAlpha: 0.4,\n * lineWidth: 1,\n * lineStyle: \"solid\",\n * };\n * void s;\n */\nexport type ShapeStyle = ZOrdered & {\n readonly stroke?: Color;\n readonly fill?: Color;\n readonly lineWidth?: number;\n readonly lineStyle?: LineStyle;\n readonly fillAlpha?: number;\n};\n\n/**\n * Highlighter style — single colour with a fixed alpha. Used by the\n * `highlighter` freehand kind.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const s: HighlighterStyle = { color: \"#facc15\", alpha: 0.3 };\n * void s;\n */\nexport type HighlighterStyle = ZOrdered & {\n readonly color: Color;\n readonly alpha: number;\n};\n\n/**\n * Brush stroke style — stroke + fill pair. Used by the `brush`\n * freehand kind.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const s: BrushStyle = { stroke: \"#000000\", fill: \"#ffffff\" };\n * void s;\n */\nexport type BrushStyle = ZOrdered & {\n readonly stroke: Color;\n readonly fill: Color;\n};\n\n/**\n * Text annotation style. Used by the `text` annotation kind and as\n * the base for `marker` / `arrow-mark-up` / `arrow-mark-down` labels.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const t: TextOpts = {\n * color: \"#1e293b\",\n * size: \"normal\",\n * halign: \"center\",\n * valign: \"middle\",\n * bgColor: \"#fef3c7\",\n * };\n * void t;\n */\nexport type TextOpts = ZOrdered & {\n readonly color?: Color;\n readonly size?: \"tiny\" | \"small\" | \"normal\" | \"large\" | \"huge\";\n readonly halign?: \"left\" | \"center\" | \"right\";\n readonly valign?: \"top\" | \"middle\" | \"bottom\";\n readonly bgColor?: Color;\n};\n\n/**\n * Arrow annotation style — a `LineDrawStyle` plus an optional label.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const a: ArrowOpts = { color: \"#dc2626\", lineWidth: 2, label: \"Sell\" };\n * void a;\n */\nexport type ArrowOpts = LineDrawStyle & {\n readonly label?: string;\n};\n\n/**\n * Arrow-marker style — used by `arrow-marker` / `arrow-mark-up` /\n * `arrow-mark-down` annotations. Compact glyph + optional one-line\n * text.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const m: ArrowMarkerOpts = { color: \"#10b981\", text: \"Long\" };\n * void m;\n */\nexport type ArrowMarkerOpts = ZOrdered & {\n readonly color?: Color;\n readonly text?: string;\n};\n\n/**\n * Path style — open or closed polyline of arbitrary anchor count.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const p: PathOpts = { color: \"#3b82f6\", lineWidth: 1, closed: true };\n * void p;\n */\nexport type PathOpts = LineDrawStyle & {\n readonly closed?: boolean;\n};\n\n/**\n * Style for {@link draw.fillBetween} — a filled ribbon between two\n * edges. Stroke fields are optional (the band may be fill-only);\n * `fill` + `fillAlpha` reuse the {@link ShapeStyle} fill model.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.4\n * @stable\n * @example\n * const s: FillBetweenStyle = { fill: \"#3b82f6\", fillAlpha: 0.2 };\n * void s;\n */\nexport type FillBetweenStyle = ZOrdered & {\n /** Optional outline colour drawn around the ribbon. */\n readonly color?: Color;\n /** Outline width in px (default 0 / no stroke when `color` unset). */\n readonly lineWidth?: number;\n /** Outline dash style. */\n readonly lineStyle?: LineStyle;\n /** Fill colour of the band. */\n readonly fill?: Color;\n /** Fill opacity 0..1 (`applyShapeStyle` currently defaults to 1). */\n readonly fillAlpha?: number;\n};\n\n/**\n * Fibonacci-family style. `levels` defaults to the canonical\n * 0.236 / 0.382 / 0.5 / 0.618 / 0.786 / 1.0 / 1.272 / 1.618 / 2.618 /\n * 4.236 array when omitted; `showLabels` toggles per-level text.\n * `extendLeft` / `extendRight` apply to the level lines (mirrors the\n * `LineDrawStyle` collapse for parity).\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const f: FibOpts = {\n * levels: [0.382, 0.5, 0.618],\n * showLabels: true,\n * color: \"#facc15\",\n * extendRight: true,\n * };\n * void f;\n */\nexport type FibOpts = ZOrdered & {\n readonly levels?: ReadonlyArray<number>;\n readonly showLabels?: boolean;\n readonly color?: Color;\n readonly extendLeft?: boolean;\n readonly extendRight?: boolean;\n};\n\n/**\n * Regression-trend style — a least-squares fit through a price series\n * with optional ±N·σ bands. `source` picks the OHLC derived series.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const r: RegressionTrendOpts = {\n * source: \"close\",\n * stdevMultiplier: 2,\n * showUpperBand: true,\n * showLowerBand: true,\n * color: \"#3b82f6\",\n * };\n * void r;\n */\nexport type RegressionTrendOpts = ZOrdered & {\n readonly source?: \"close\" | \"open\" | \"high\" | \"low\" | \"hl2\" | \"hlc3\" | \"ohlc4\" | \"hlcc4\";\n readonly stdevMultiplier?: number;\n readonly showUpperBand?: boolean;\n readonly showLowerBand?: boolean;\n readonly color?: Color;\n};\n\n/**\n * Frame container style — the labelled rectangle that groups child\n * drawings visually. The label appears in the top-left of the frame\n * unless the adapter chooses otherwise.\n *\n * @formula N/A — style bag, no math\n * @anchors N/A — style fields only\n * @since 0.3\n * @stable\n * @example\n * const f: FrameOpts = { label: \"Trade idea\", bgColor: \"#f1f5f9\" };\n * void f;\n */\nexport type FrameOpts = ZOrdered & {\n readonly label?: string;\n readonly bgColor?: Color;\n};\n"]}
|
package/dist/draw/handle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle.js","sourceRoot":"","sources":["../../src/draw/handle.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
|
|
1
|
+
{"version":3,"file":"handle.js","sourceRoot":"","sources":["../../src/draw/handle.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D","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 { DrawingState } from \"./drawingState.js\";\n\n/**\n * Script-facing handle returned by every `draw.<kind>(...)` call. The\n * runtime keys handles by `slotId#subId` so a script's `for` loop\n * emitting N drawings gets N stable cross-bar handles — same loop\n * iteration across bars yields the same handle.\n *\n * `update(patch)` re-emits the FULL merged state under `op: \"update\"`\n * (the patch is merged with the handle's current `DrawingState` in the\n * runtime); `remove()` emits one final `op: \"remove\"` with the last\n * known state. The impl lives in\n * `@invinite-org/chartlang-runtime/emit/draw/handle.ts` (Task 3).\n *\n * @formula N/A — handle is an opaque script-facing object\n * @anchors id (slotId#subId), update(patch), remove()\n * @since 0.3\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // const h = draw.horizontalLine(supportLevel);\n * // h.update({ price: nextLevel });\n * // h.remove();\n * import type { DrawingHandle } from \"@invinite-org/chartlang-core\";\n * const _shape: DrawingHandle | null = null;\n * void _shape;\n */\nexport type DrawingHandle = {\n readonly id: string;\n update(patch: Partial<DrawingState>): void;\n remove(): void;\n};\n"]}
|
package/dist/draw/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export type { DrawingKind } from "./drawingKind.js";
|
|
|
3
3
|
export { bucketFor, KIND_BUCKET } from "./buckets.js";
|
|
4
4
|
export type { DrawingBucket } from "./buckets.js";
|
|
5
5
|
export type { AnchorHept, AnchorPair, AnchorQuad, AnchorQuint, AnchorTriple, WorldPoint, } from "./worldPoint.js";
|
|
6
|
-
export type { ArrowMarkerOpts, ArrowOpts, BrushStyle, FibOpts, FrameOpts, HighlighterStyle, LineDrawStyle, PathOpts, RegressionTrendOpts, ShapeStyle, TextOpts, } from "./drawingStyle.js";
|
|
7
|
-
export type { AbcdPatternState, ArcState, ArrowMarkDownState, ArrowMarkUpState, ArrowMarkerState, ArrowState, BrushState, CircleState, CrossLineState, CurveState, CyclicLinesState, CypherPatternState, DisjointChannelState, DoubleCurveState, DrawingMeta, DrawingState, ElliottCorrectionWaveState, ElliottDoubleComboState, ElliottImpulseWaveState, ElliottTripleComboState, ElliottTriangleWaveState, EllipseState, FibChannelState, FibCirclesState, FibRetracementState, FibSpeedArcsState, FibSpeedFanState, FibSpiralState, FibTimeZoneState, FibTrendExtensionState, FibTrendTimeState, FibWedgeState, FlatTopBottomState, FrameState, GannBoxState, GannFanState, GannSquareFixedState, GannSquareState, GroupState, HeadAndShouldersState, HighlighterState, HorizontalLineState, HorizontalRayState, LineState, MarkerState, PathState, PenState, PitchfanState, PitchforkState, PolylineState, RectangleState, RegressionTrendState, RotatedRectangleState, SineLineState, TableState, TextState, ThreeDrivesPatternState, TimeCyclesState, TrendAngleState, TrendChannelState, TriangleState, TrianglePatternState, VerticalLineState, XabcdPatternState, } from "./drawingState.js";
|
|
6
|
+
export type { ArrowMarkerOpts, ArrowOpts, BrushStyle, FibOpts, FillBetweenStyle, FrameOpts, HighlighterStyle, LineDrawStyle, PathOpts, RegressionTrendOpts, ShapeStyle, TextOpts, ZOrdered, } from "./drawingStyle.js";
|
|
7
|
+
export type { AbcdPatternState, ArcState, ArrowMarkDownState, ArrowMarkUpState, ArrowMarkerState, ArrowState, BrushState, CircleState, CrossLineState, CurveState, CyclicLinesState, CypherPatternState, DisjointChannelState, DoubleCurveState, DrawingMeta, DrawingState, ElliottCorrectionWaveState, ElliottDoubleComboState, ElliottImpulseWaveState, ElliottTripleComboState, ElliottTriangleWaveState, EllipseState, FibChannelState, FibCirclesState, FibRetracementState, FibSpeedArcsState, FibSpeedFanState, FibSpiralState, FibTimeZoneState, FibTrendExtensionState, FibTrendTimeState, FibWedgeState, FillBetweenState, FlatTopBottomState, FrameState, GannBoxState, GannFanState, GannSquareFixedState, GannSquareState, GroupState, HeadAndShouldersState, HighlighterState, HorizontalLineState, HorizontalRayState, LineState, MarkerState, PathState, PenState, PitchfanState, PitchforkState, PolylineState, RectangleState, RegressionTrendState, RotatedRectangleState, SineLineState, TableState, TextState, ThreeDrivesPatternState, TimeCyclesState, TrendAngleState, TrendChannelState, TriangleState, TrianglePatternState, VerticalLineState, XabcdPatternState, } from "./drawingState.js";
|
|
8
8
|
export type { DrawingHandle } from "./handle.js";
|
|
9
9
|
export { table } from "./table.js";
|
|
10
10
|
export type { TableCell, TableOpts, TablePosition } from "./table.js";
|
package/dist/draw/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjF,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,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E,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjF,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,GACb,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACR,eAAe,EACf,SAAS,EACT,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,QAAQ,GACX,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACR,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/draw/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA6FtD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,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\nexport { DRAWING_KINDS, KIND_CAMELCASE, KIND_KEBABCASE } from \"./drawingKind.js\";\nexport type { DrawingKind } from \"./drawingKind.js\";\nexport { bucketFor, KIND_BUCKET } from \"./buckets.js\";\nexport type { DrawingBucket } from \"./buckets.js\";\nexport type {\n AnchorHept,\n AnchorPair,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n WorldPoint,\n} from \"./worldPoint.js\";\nexport 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 ZOrdered,\n} from \"./drawingStyle.js\";\nexport type {\n AbcdPatternState,\n ArcState,\n ArrowMarkDownState,\n ArrowMarkUpState,\n ArrowMarkerState,\n ArrowState,\n BrushState,\n CircleState,\n CrossLineState,\n CurveState,\n CyclicLinesState,\n CypherPatternState,\n DisjointChannelState,\n DoubleCurveState,\n DrawingMeta,\n DrawingState,\n ElliottCorrectionWaveState,\n ElliottDoubleComboState,\n ElliottImpulseWaveState,\n ElliottTripleComboState,\n ElliottTriangleWaveState,\n EllipseState,\n FibChannelState,\n FibCirclesState,\n FibRetracementState,\n FibSpeedArcsState,\n FibSpeedFanState,\n FibSpiralState,\n FibTimeZoneState,\n FibTrendExtensionState,\n FibTrendTimeState,\n FibWedgeState,\n FillBetweenState,\n FlatTopBottomState,\n FrameState,\n GannBoxState,\n GannFanState,\n GannSquareFixedState,\n GannSquareState,\n GroupState,\n HeadAndShouldersState,\n HighlighterState,\n HorizontalLineState,\n HorizontalRayState,\n LineState,\n MarkerState,\n PathState,\n PenState,\n PitchfanState,\n PitchforkState,\n PolylineState,\n RectangleState,\n RegressionTrendState,\n RotatedRectangleState,\n SineLineState,\n TableState,\n TextState,\n ThreeDrivesPatternState,\n TimeCyclesState,\n TrendAngleState,\n TrendChannelState,\n TriangleState,\n TrianglePatternState,\n VerticalLineState,\n XabcdPatternState,\n} from \"./drawingState.js\";\nexport type { DrawingHandle } from \"./handle.js\";\nexport { table } from \"./table.js\";\nexport type { TableCell, TableOpts, TablePosition } from \"./table.js\";\nexport { draw } from \"./draw.js\";\nexport type { DrawNamespace } from \"./draw.js\";\n"]}
|
package/dist/draw/table.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { DrawingHandle } from "./handle.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* CSS-pixel viewport anchor used by `draw.table`. Tables are status
|
|
5
5
|
* panels, not world-space drawings, so the position resolves against
|
|
6
|
-
* the adapter viewport
|
|
6
|
+
* the adapter viewport.
|
|
7
7
|
*
|
|
8
8
|
* @formula N/A — viewport anchor enum
|
|
9
9
|
* @anchors CSS viewport edge/corner/center
|
package/dist/draw/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/draw/table.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8E/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,KAAK,CAAC,KAAgB;IAClC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAClE,CAAC"}
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/draw/table.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8E/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,KAAK,CAAC,KAAgB;IAClC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAClE,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 { Color } from \"../types.js\";\nimport type { DrawingHandle } from \"./handle.js\";\n\n/**\n * CSS-pixel viewport anchor used by `draw.table`. Tables are status\n * panels, not world-space drawings, so the position resolves against\n * the adapter viewport.\n *\n * @formula N/A — viewport anchor enum\n * @anchors CSS viewport edge/corner/center\n * @since 0.5\n * @stable\n * @example\n * const position: TablePosition = \"top-right\";\n * void position;\n */\nexport type TablePosition =\n | \"top-left\"\n | \"top-center\"\n | \"top-right\"\n | \"middle-left\"\n | \"middle-center\"\n | \"middle-right\"\n | \"bottom-left\"\n | \"bottom-center\"\n | \"bottom-right\";\n\n/**\n * One cell in a `draw.table` dashboard. Text is required; styling\n * fields are optional and interpreted by the target adapter.\n *\n * @formula N/A — viewport table cell payload\n * @anchors table grid cell\n * @since 0.5\n * @stable\n * @example\n * const cell: TableCell = {\n * text: \"P&L\",\n * textColor: \"#16a34a\",\n * textHalign: \"right\",\n * };\n * void cell;\n */\nexport type TableCell = Readonly<{\n text: string;\n bgColor?: Color;\n textColor?: Color;\n textHalign?: \"left\" | \"center\" | \"right\";\n textValign?: \"top\" | \"middle\" | \"bottom\";\n textSize?: \"tiny\" | \"small\" | \"normal\" | \"large\" | \"huge\";\n}>;\n\n/**\n * Options accepted by `draw.table`.\n *\n * @formula N/A — viewport table payload\n * @anchors position: CSS viewport anchor; cells: 2D table grid\n * @since 0.5\n * @stable\n * @example\n * const opts: TableOpts = {\n * position: \"top-right\",\n * cells: [[{ text: \"P&L\" }, { text: \"+12.5%\", textColor: \"#16a34a\" }]],\n * borderColor: \"#94a3b8\",\n * borderWidth: 1,\n * };\n * void opts;\n */\nexport type TableOpts = Readonly<{\n position: TablePosition;\n cells: ReadonlyArray<ReadonlyArray<TableCell>>;\n borderColor?: Color;\n borderWidth?: number;\n frame?: Readonly<{ color: Color; width: number }>;\n}>;\n\n/**\n * Compile-time callable hole. The runtime swaps this for the slot-id\n * aware implementation, and the compiler injects the callsite id into\n * every script-side `draw.table(opts)` call.\n *\n * @formula N/A — compiler/runtime primitive seam\n * @anchors position + cells, viewport anchored\n * @since 0.5\n * @stable\n * @example\n * // Inside compute:\n * // const h = draw.table({\n * // position: \"top-right\",\n * // cells: [[{ text: \"P&L\" }, { text: \"+12.5%\", textColor: \"#16a34a\" }]],\n * // });\n */\nexport function table(_opts: TableOpts): DrawingHandle {\n throw new Error(\"draw.table called outside compiled runtime\");\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worldPoint.js","sourceRoot":"","sources":["../../src/draw/worldPoint.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
|
|
1
|
+
{"version":3,"file":"worldPoint.js","sourceRoot":"","sources":["../../src/draw/worldPoint.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D","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\";\n\n/**\n * World coordinate — `(time, price)` is the only persisted frame for\n * drawings. The adapter projects to its own pixel space when rendering.\n *\n * @formula identity — no transform; world-space (time, price) tuple\n * @anchors time, price\n * @since 0.3\n * @stable\n * @example\n * const anchor: WorldPoint = { time: 1_700_000_000_000, price: 42.31 };\n * void anchor;\n */\nexport type WorldPoint = {\n readonly time: Time;\n readonly price: Price;\n};\n\n/**\n * Two anchor points — e.g. the two endpoints of a line, the two corners\n * of an axis-aligned rectangle.\n *\n * @formula identity — readonly tuple of two `WorldPoint`s\n * @anchors [WorldPoint, WorldPoint]\n * @since 0.3\n * @stable\n * @example\n * const segment: AnchorPair = [\n * { time: 1_700_000_000_000, price: 100 },\n * { time: 1_700_086_400_000, price: 110 },\n * ];\n * void segment;\n */\nexport type AnchorPair = readonly [WorldPoint, WorldPoint];\n\n/**\n * Three anchor points — e.g. triangle vertices, pitchfork pivot + two\n * extreme highs/lows.\n *\n * @formula identity — readonly tuple of three `WorldPoint`s\n * @anchors [WorldPoint, WorldPoint, WorldPoint]\n * @since 0.3\n * @stable\n * @example\n * const tri: AnchorTriple = [\n * { time: 1, price: 1 },\n * { time: 2, price: 2 },\n * { time: 3, price: 1 },\n * ];\n * void tri;\n */\nexport type AnchorTriple = readonly [WorldPoint, WorldPoint, WorldPoint];\n\n/**\n * Four anchor points — e.g. ABCD harmonic pattern legs, rotated\n * rectangle corners.\n *\n * @formula identity — readonly tuple of four `WorldPoint`s\n * @anchors [WorldPoint × 4]\n * @since 0.3\n * @stable\n * @example\n * const abcd: AnchorQuad = [\n * { time: 1, price: 1 },\n * { time: 2, price: 2 },\n * { time: 3, price: 1.5 },\n * { time: 4, price: 3 },\n * ];\n * void abcd;\n */\nexport type AnchorQuad = readonly [WorldPoint, WorldPoint, WorldPoint, WorldPoint];\n\n/**\n * Five anchor points — e.g. XABCD harmonic pattern legs,\n * head-and-shoulders pivots, Elliott impulse waves.\n *\n * @formula identity — readonly tuple of five `WorldPoint`s\n * @anchors [WorldPoint × 5]\n * @since 0.3\n * @stable\n * @example\n * const xabcd: AnchorQuint = [\n * { time: 1, price: 1 },\n * { time: 2, price: 2 },\n * { time: 3, price: 1.5 },\n * { time: 4, price: 3 },\n * { time: 5, price: 2 },\n * ];\n * void xabcd;\n */\nexport type AnchorQuint = readonly [WorldPoint, WorldPoint, WorldPoint, WorldPoint, WorldPoint];\n\n/**\n * Seven anchor points — e.g. Elliott triple-combo legs, double-curve\n * control points.\n *\n * @formula identity — readonly tuple of seven `WorldPoint`s\n * @anchors [WorldPoint × 7]\n * @since 0.3\n * @stable\n * @example\n * const triple: AnchorHept = [\n * { time: 1, price: 1 }, { time: 2, price: 2 },\n * { time: 3, price: 1.5 }, { time: 4, price: 3 },\n * { time: 5, price: 2 }, { time: 6, price: 4 },\n * { time: 7, price: 3 },\n * ];\n * void triple;\n */\nexport type AnchorHept = readonly [\n WorldPoint,\n WorldPoint,\n WorldPoint,\n WorldPoint,\n WorldPoint,\n WorldPoint,\n WorldPoint,\n];\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export type { AlertSeverity, AlertConditionDefinition, AlertConditionDescriptor, Bar, BarViewport, CapabilityId, Color, CompiledScriptBundle, CompiledScriptObject, ComputeContext, ComputeFn, DrawingCounts, InputSchema, IntervalDescriptor, JsonValue, LineStyle, PlotLineStyle, PlotOverride, PlotSlotDescriptor, Price, ScriptManifest, Series, Time, Volume, } from "./types.js";
|
|
1
|
+
export type { AlertSeverity, AlertConditionDefinition, AlertConditionDescriptor, Bar, BarSeries, BarViewport, CapabilityId, Color, CompiledScriptBundle, CompiledScriptObject, ComputeContext, ComputeFn, DrawingCounts, InputSchema, IntervalDescriptor, JsonValue, LineStyle, NumberSeriesSlot, PlotLineStyle, PlotOverride, PlotSlotDescriptor, Price, PriceSeries, ScriptManifest, SecurityExpressionDescriptor, Series, Time, Volume, VolumeSeries, } from "./types.js";
|
|
2
2
|
export { isCompiledScriptBundle } from "./types.js";
|
|
3
3
|
export { intervalToSeconds } from "./interval/intervalToSeconds.js";
|
|
4
4
|
export { defineAlert, defineAlertCondition, defineDrawing, defineIndicator, } from "./define/index.js";
|
|
5
5
|
export type { DefineAlertConditionOpts, DefineAlertOpts, DefineDrawingOpts, DefineIndicatorOpts, DependencyDeclaration, OutputDeclaration, ScaleAxis, ScriptOverrides, ValueFormat, } from "./define/index.js";
|
|
6
6
|
export { ta } from "./ta/index.js";
|
|
7
|
-
export type { AdlOpts, AdrOpts, AdxOpts, AlmaOpts, AnchoredVolumeProfileOpts, AnchoredVolumeProfileResult, AnchoredVwapOpts, AoOpts, AroonOpts, AroonOscOpts, AroonResult, AtrOpts, BarssinceOpts, BbOpts, BbPercentBOpts, BbResult, BbwOpts, BopOpts, CciOpts, ChandeKrollStopOpts, ChandeKrollStopResult, ChandelierOpts, ChaikinOscOpts, ChandelierResult, ChangeOpts, ChopOpts, CmfOpts, CmoOpts, ConnorsRsiOpts, CoppockOpts, CrossoverOpts, CrossunderOpts, DemaOpts, DmiOpts, DmiResult, DonchianOpts, DonchianResult, DpoOpts, EmaOpts, EomOpts, EnvelopeOpts, EnvelopeResult, FisherOpts, FisherResult, FixedRangeVolumeProfileOpts, FixedRangeVolumeProfileResult, HighestOpts, HmaOpts, HvOpts, IchimokuOpts, IchimokuResult, KamaOpts, KeltnerOpts, KeltnerResult, KlingerOpts, KlingerResult, KstOpts, KstResult, LowestOpts, LsmaOpts, MacdOpts, MacdResult, MaRibbonOpts, MaRibbonResult, MassIndexOpts, MaTypeNoVolume, McginleyOpts, MedianOpts, MfiOpts, MomentumOpts, NetVolumeOpts, NviOpts, ObvOpts, PivotsHighLowOpts, PivotsHighLowResult, PivotsStandardOpts, PivotsStandardResult, PivotsStandardSystem, PmoOpts, PmoResult, PpoOpts, PpoResult, PsarOpts, PsarResult, PviOpts, PvoOpts, PvoResult, PvtOpts, RocOpts, RsiOpts, RvgiOpts, RvgiResult, RviOpts, SessionVolumeProfileOpts, SessionVolumeProfileResult, SmaOpts, SmiOpts, SmiResult, SmmaOpts, StdevOpts, StochOpts, StochResult, StochRsiOpts, StochRsiResult, SupertrendOpts, SupertrendResult, TaNamespace, TemaOpts, TrendStrengthIndexOpts, TrixOpts, TrixResult, TsiOpts, TsiResult, UlcerIndexOpts, UltimateOscOpts, ValuewhenOpts, VolOpts, VolatilityStopOpts, VolatilityStopResult, VortexOpts, VortexResult, VisibleRangeVolumeProfileOpts, VisibleRangeVolumeProfileResult, VwapOpts, VwmaOpts, WilliamsFractalOpts, WilliamsFractalResult, WilliamsROpts, WmaOpts, ZigZagOpts, ZigZagResult, } from "./ta/ta.js";
|
|
7
|
+
export type { AdlOpts, AdrOpts, AdxOpts, AlmaOpts, AnchoredVolumeProfileOpts, AnchoredVolumeProfileResult, AnchoredVwapOpts, AoOpts, AroonOpts, AroonOscOpts, AroonResult, AtrOpts, BarssinceOpts, BbOpts, BbPercentBOpts, BbResult, BbwOpts, BopOpts, CciOpts, ChandeKrollStopOpts, ChandeKrollStopResult, ChandelierOpts, ChaikinOscOpts, ChandelierResult, ChangeOpts, ChopOpts, CmfOpts, CmoOpts, ConnorsRsiOpts, CoppockOpts, CrossoverOpts, CrossunderOpts, DemaOpts, DmiOpts, DmiResult, DonchianOpts, DonchianResult, DpoOpts, EmaOpts, EomOpts, EnvelopeOpts, EnvelopeResult, FisherOpts, FisherResult, FixedRangeVolumeProfileOpts, FixedRangeVolumeProfileResult, HighestOpts, HighestbarsOpts, HmaOpts, HvOpts, IchimokuOpts, IchimokuResult, KamaOpts, KeltnerOpts, KeltnerResult, KlingerOpts, KlingerResult, KstOpts, KstResult, LowestOpts, LowestbarsOpts, LsmaOpts, MacdOpts, MacdResult, MaRibbonOpts, MaRibbonResult, MassIndexOpts, MaTypeNoVolume, McginleyOpts, MedianOpts, MfiOpts, MomentumOpts, NetVolumeOpts, NviOpts, ObvOpts, PivotsHighLowOpts, PivotsHighLowResult, PivotsStandardOpts, PivotsStandardResult, PivotsStandardSystem, PmoOpts, PmoResult, PpoOpts, PpoResult, PsarOpts, PsarResult, PviOpts, PvoOpts, PvoResult, PvtOpts, RocOpts, RsiOpts, RvgiOpts, RvgiResult, RviOpts, SessionVolumeProfileOpts, SessionVolumeProfileResult, SmaOpts, SmiOpts, SmiResult, SmmaOpts, StdevOpts, StochOpts, StochResult, StochRsiOpts, StochRsiResult, SupertrendOpts, SupertrendResult, TaNamespace, TemaOpts, TrendStrengthIndexOpts, TrixOpts, TrixResult, TsiOpts, TsiResult, UlcerIndexOpts, UltimateOscOpts, ValuewhenOpts, VolOpts, VolatilityStopOpts, VolatilityStopResult, VortexOpts, VortexResult, VisibleRangeVolumeProfileOpts, VisibleRangeVolumeProfileResult, VwapOpts, VwmaOpts, WilliamsFractalOpts, WilliamsFractalResult, WilliamsROpts, WmaOpts, ZigZagOpts, ZigZagResult, } from "./ta/ta.js";
|
|
8
8
|
export type { StatefulPrimitiveEntry } from "./statefulPrimitives.js";
|
|
9
9
|
export { input } from "./input/index.js";
|
|
10
10
|
export type { BoolDescriptor, ColorDescriptor, EnumDescriptor, ExternalSeriesDescriptor, FloatDescriptor, InputDescriptor, InputKind, IntDescriptor, IntervalDescriptorInput, PriceDescriptor, Schema, SourceDescriptor, SourceField, StringDescriptor, SymbolDescriptor, TimeDescriptor, } from "./input/index.js";
|
|
@@ -14,7 +14,7 @@ export type { RunnerSnapshot, StateSnapshot, StateStoreKey, StreamSnapshot, } fr
|
|
|
14
14
|
export { barstate, syminfo, timeframe } from "./views/index.js";
|
|
15
15
|
export type { BarStateView, SymbolType, SymInfoView, TimeframeView } from "./views/index.js";
|
|
16
16
|
export { request } from "./request/index.js";
|
|
17
|
-
export type { RequestLowerTfOpts, RequestNamespace, RequestSecurityOpts, SecurityBar, } from "./request/index.js";
|
|
17
|
+
export type { RequestLowerTfOpts, RequestNamespace, RequestSecurityOpts, SecurityBar, SecurityExpr, } from "./request/index.js";
|
|
18
18
|
export { runtime } from "./runtime/index.js";
|
|
19
19
|
export type { LogLevel, RuntimeNamespace } from "./runtime/index.js";
|
|
20
20
|
export { color, fromGradient, hsl, rgb, withAlpha } from "./color/index.js";
|
|
@@ -25,5 +25,5 @@ export { alert } from "./alert/index.js";
|
|
|
25
25
|
export type { AlertOpts } from "./alert/alert.js";
|
|
26
26
|
export { STATEFUL_PRIMITIVES, STATEFUL_PRIMITIVES_BY_NAME } from "./statefulPrimitives.js";
|
|
27
27
|
export { DRAWING_KINDS, KIND_BUCKET, KIND_CAMELCASE, KIND_KEBABCASE, bucketFor, draw, } from "./draw/index.js";
|
|
28
|
-
export type { AbcdPatternState, AnchorHept, AnchorPair, AnchorQuad, AnchorQuint, AnchorTriple, ArcState, ArrowMarkDownState, ArrowMarkUpState, ArrowMarkerOpts, ArrowMarkerState, ArrowOpts, ArrowState, BrushState, BrushStyle, CircleState, CrossLineState, CurveState, CyclicLinesState, CypherPatternState, DisjointChannelState, DoubleCurveState, DrawNamespace, DrawingBucket, DrawingHandle, DrawingKind, DrawingMeta, DrawingState, ElliottCorrectionWaveState, ElliottDoubleComboState, ElliottImpulseWaveState, ElliottTriangleWaveState, ElliottTripleComboState, EllipseState, FibChannelState, FibCirclesState, FibOpts, FibRetracementState, FibSpeedArcsState, FibSpeedFanState, FibSpiralState, FibTimeZoneState, FibTrendExtensionState, FibTrendTimeState, FibWedgeState, FlatTopBottomState, FrameOpts, FrameState, GannBoxState, GannFanState, GannSquareFixedState, GannSquareState, GroupState, HeadAndShouldersState, HighlighterState, HighlighterStyle, HorizontalLineState, HorizontalRayState, LineDrawStyle, LineState, MarkerState, PathOpts, PathState, PenState, PitchfanState, PitchforkState, PolylineState, RectangleState, RegressionTrendOpts, RegressionTrendState, RotatedRectangleState, ShapeStyle, SineLineState, TableCell, TableOpts, TablePosition, TableState, TextOpts, TextState, ThreeDrivesPatternState, TimeCyclesState, TrendAngleState, TrendChannelState, TriangleState, TrianglePatternState, VerticalLineState, WorldPoint, XabcdPatternState, } from "./draw/index.js";
|
|
28
|
+
export type { AbcdPatternState, AnchorHept, AnchorPair, AnchorQuad, AnchorQuint, AnchorTriple, ArcState, ArrowMarkDownState, ArrowMarkUpState, ArrowMarkerOpts, ArrowMarkerState, ArrowOpts, ArrowState, BrushState, BrushStyle, CircleState, CrossLineState, CurveState, CyclicLinesState, CypherPatternState, DisjointChannelState, DoubleCurveState, DrawNamespace, DrawingBucket, DrawingHandle, DrawingKind, DrawingMeta, DrawingState, ElliottCorrectionWaveState, ElliottDoubleComboState, ElliottImpulseWaveState, ElliottTriangleWaveState, ElliottTripleComboState, EllipseState, FibChannelState, FibCirclesState, FibOpts, FibRetracementState, FibSpeedArcsState, FibSpeedFanState, FibSpiralState, FibTimeZoneState, FibTrendExtensionState, FibTrendTimeState, FibWedgeState, FillBetweenState, FillBetweenStyle, FlatTopBottomState, FrameOpts, FrameState, GannBoxState, GannFanState, GannSquareFixedState, GannSquareState, GroupState, HeadAndShouldersState, HighlighterState, HighlighterStyle, HorizontalLineState, HorizontalRayState, LineDrawStyle, LineState, MarkerState, PathOpts, PathState, PenState, PitchfanState, PitchforkState, PolylineState, RectangleState, RegressionTrendOpts, RegressionTrendState, RotatedRectangleState, ShapeStyle, SineLineState, TableCell, TableOpts, TablePosition, TableState, TextOpts, TextState, ThreeDrivesPatternState, TimeCyclesState, TrendAngleState, TrendChannelState, TriangleState, TrianglePatternState, VerticalLineState, WorldPoint, XabcdPatternState, ZOrdered, } from "./draw/index.js";
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACR,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,GAAG,EACH,WAAW,EACX,YAAY,EACZ,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,KAAK,EACL,cAAc,EACd,MAAM,EACN,IAAI,EACJ,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACR,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,GAAG,EACH,SAAS,EACT,WAAW,EACX,YAAY,EACZ,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,SAAS,EACT,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,KAAK,EACL,WAAW,EACX,cAAc,EACd,4BAA4B,EAC5B,MAAM,EACN,IAAI,EACJ,MAAM,EACN,YAAY,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAC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AU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,OAAO,EACP,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,WAAW,EACX,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,EACR,SAAS,EACT,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,QAAQ,GACX,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAiC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACH,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,eAAe,GAClB,MAAM,mBAAmB,CAAC;AAY3B,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAyInC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAmBzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAQzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAQ7C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EACH,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,SAAS,EACT,IAAI,GACP,MAAM,iBAAiB,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\nexport type {\n AlertSeverity,\n AlertConditionDefinition,\n AlertConditionDescriptor,\n Bar,\n BarSeries,\n BarViewport,\n CapabilityId,\n Color,\n CompiledScriptBundle,\n CompiledScriptObject,\n ComputeContext,\n ComputeFn,\n DrawingCounts,\n InputSchema,\n IntervalDescriptor,\n JsonValue,\n LineStyle,\n NumberSeriesSlot,\n PlotLineStyle,\n PlotOverride,\n PlotSlotDescriptor,\n Price,\n PriceSeries,\n ScriptManifest,\n SecurityExpressionDescriptor,\n Series,\n Time,\n Volume,\n VolumeSeries,\n} from \"./types.js\";\nexport { isCompiledScriptBundle } from \"./types.js\";\nexport { intervalToSeconds } from \"./interval/intervalToSeconds.js\";\nexport {\n defineAlert,\n defineAlertCondition,\n defineDrawing,\n defineIndicator,\n} from \"./define/index.js\";\nexport type {\n DefineAlertConditionOpts,\n DefineAlertOpts,\n DefineDrawingOpts,\n DefineIndicatorOpts,\n DependencyDeclaration,\n OutputDeclaration,\n ScaleAxis,\n ScriptOverrides,\n ValueFormat,\n} from \"./define/index.js\";\nexport { ta } from \"./ta/index.js\";\nexport type {\n AdlOpts,\n AdrOpts,\n AdxOpts,\n AlmaOpts,\n AnchoredVolumeProfileOpts,\n AnchoredVolumeProfileResult,\n AnchoredVwapOpts,\n AoOpts,\n AroonOpts,\n AroonOscOpts,\n AroonResult,\n AtrOpts,\n BarssinceOpts,\n BbOpts,\n BbPercentBOpts,\n BbResult,\n BbwOpts,\n BopOpts,\n CciOpts,\n ChandeKrollStopOpts,\n ChandeKrollStopResult,\n ChandelierOpts,\n ChaikinOscOpts,\n ChandelierResult,\n ChangeOpts,\n ChopOpts,\n CmfOpts,\n CmoOpts,\n ConnorsRsiOpts,\n CoppockOpts,\n CrossoverOpts,\n CrossunderOpts,\n DemaOpts,\n DmiOpts,\n DmiResult,\n DonchianOpts,\n DonchianResult,\n DpoOpts,\n EmaOpts,\n EomOpts,\n EnvelopeOpts,\n EnvelopeResult,\n FisherOpts,\n FisherResult,\n FixedRangeVolumeProfileOpts,\n FixedRangeVolumeProfileResult,\n HighestOpts,\n HighestbarsOpts,\n HmaOpts,\n HvOpts,\n IchimokuOpts,\n IchimokuResult,\n KamaOpts,\n KeltnerOpts,\n KeltnerResult,\n KlingerOpts,\n KlingerResult,\n KstOpts,\n KstResult,\n LowestOpts,\n LowestbarsOpts,\n LsmaOpts,\n MacdOpts,\n MacdResult,\n MaRibbonOpts,\n MaRibbonResult,\n MassIndexOpts,\n MaTypeNoVolume,\n McginleyOpts,\n MedianOpts,\n MfiOpts,\n MomentumOpts,\n NetVolumeOpts,\n NviOpts,\n ObvOpts,\n PivotsHighLowOpts,\n PivotsHighLowResult,\n PivotsStandardOpts,\n PivotsStandardResult,\n PivotsStandardSystem,\n PmoOpts,\n PmoResult,\n PpoOpts,\n PpoResult,\n PsarOpts,\n PsarResult,\n PviOpts,\n PvoOpts,\n PvoResult,\n PvtOpts,\n RocOpts,\n RsiOpts,\n RvgiOpts,\n RvgiResult,\n RviOpts,\n SessionVolumeProfileOpts,\n SessionVolumeProfileResult,\n SmaOpts,\n SmiOpts,\n SmiResult,\n SmmaOpts,\n StdevOpts,\n StochOpts,\n StochResult,\n StochRsiOpts,\n StochRsiResult,\n SupertrendOpts,\n SupertrendResult,\n TaNamespace,\n TemaOpts,\n TrendStrengthIndexOpts,\n TrixOpts,\n TrixResult,\n TsiOpts,\n TsiResult,\n UlcerIndexOpts,\n UltimateOscOpts,\n ValuewhenOpts,\n VolOpts,\n VolatilityStopOpts,\n VolatilityStopResult,\n VortexOpts,\n VortexResult,\n VisibleRangeVolumeProfileOpts,\n VisibleRangeVolumeProfileResult,\n VwapOpts,\n VwmaOpts,\n WilliamsFractalOpts,\n WilliamsFractalResult,\n WilliamsROpts,\n WmaOpts,\n ZigZagOpts,\n ZigZagResult,\n} from \"./ta/ta.js\";\nexport type { StatefulPrimitiveEntry } from \"./statefulPrimitives.js\";\nexport { input } from \"./input/index.js\";\nexport type {\n BoolDescriptor,\n ColorDescriptor,\n EnumDescriptor,\n ExternalSeriesDescriptor,\n FloatDescriptor,\n InputDescriptor,\n InputKind,\n IntDescriptor,\n IntervalDescriptorInput,\n PriceDescriptor,\n Schema,\n SourceDescriptor,\n SourceField,\n StringDescriptor,\n SymbolDescriptor,\n TimeDescriptor,\n} from \"./input/index.js\";\nexport { state } from \"./state/index.js\";\nexport type { MutableSlot, StateNamespace } from \"./state/index.js\";\nexport type {\n RunnerSnapshot,\n StateSnapshot,\n StateStoreKey,\n StreamSnapshot,\n} from \"./state/index.js\";\nexport { barstate, syminfo, timeframe } from \"./views/index.js\";\nexport type { BarStateView, SymbolType, SymInfoView, TimeframeView } from \"./views/index.js\";\nexport { request } from \"./request/index.js\";\nexport type {\n RequestLowerTfOpts,\n RequestNamespace,\n RequestSecurityOpts,\n SecurityBar,\n SecurityExpr,\n} from \"./request/index.js\";\nexport { runtime } from \"./runtime/index.js\";\nexport type { LogLevel, RuntimeNamespace } from \"./runtime/index.js\";\nexport { color, fromGradient, hsl, rgb, withAlpha } from \"./color/index.js\";\nexport type { GradientStop } from \"./color/index.js\";\nexport { hline, plot } from \"./plot/index.js\";\nexport type { HLineOpts, PlotKind, PlotOpts, PlotOptsStyle } from \"./plot/plot.js\";\nexport { alert } from \"./alert/index.js\";\nexport type { AlertOpts } from \"./alert/alert.js\";\nexport { STATEFUL_PRIMITIVES, STATEFUL_PRIMITIVES_BY_NAME } from \"./statefulPrimitives.js\";\nexport {\n DRAWING_KINDS,\n KIND_BUCKET,\n KIND_CAMELCASE,\n KIND_KEBABCASE,\n bucketFor,\n draw,\n} from \"./draw/index.js\";\nexport type {\n AbcdPatternState,\n AnchorHept,\n AnchorPair,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n ArcState,\n ArrowMarkDownState,\n ArrowMarkUpState,\n ArrowMarkerOpts,\n ArrowMarkerState,\n ArrowOpts,\n ArrowState,\n BrushState,\n BrushStyle,\n CircleState,\n CrossLineState,\n CurveState,\n CyclicLinesState,\n CypherPatternState,\n DisjointChannelState,\n DoubleCurveState,\n DrawNamespace,\n DrawingBucket,\n DrawingHandle,\n DrawingKind,\n DrawingMeta,\n DrawingState,\n ElliottCorrectionWaveState,\n ElliottDoubleComboState,\n ElliottImpulseWaveState,\n ElliottTriangleWaveState,\n ElliottTripleComboState,\n EllipseState,\n FibChannelState,\n FibCirclesState,\n FibOpts,\n FibRetracementState,\n FibSpeedArcsState,\n FibSpeedFanState,\n FibSpiralState,\n FibTimeZoneState,\n FibTrendExtensionState,\n FibTrendTimeState,\n FibWedgeState,\n FillBetweenState,\n FillBetweenStyle,\n FlatTopBottomState,\n FrameOpts,\n FrameState,\n GannBoxState,\n GannFanState,\n GannSquareFixedState,\n GannSquareState,\n GroupState,\n HeadAndShouldersState,\n HighlighterState,\n HighlighterStyle,\n HorizontalLineState,\n HorizontalRayState,\n LineDrawStyle,\n LineState,\n MarkerState,\n PathOpts,\n PathState,\n PenState,\n PitchfanState,\n PitchforkState,\n PolylineState,\n RectangleState,\n RegressionTrendOpts,\n RegressionTrendState,\n RotatedRectangleState,\n ShapeStyle,\n SineLineState,\n TableCell,\n TableOpts,\n TablePosition,\n TableState,\n TextOpts,\n TextState,\n ThreeDrivesPatternState,\n TimeCyclesState,\n TrendAngleState,\n TrendChannelState,\n TriangleState,\n TrianglePatternState,\n VerticalLineState,\n WorldPoint,\n XabcdPatternState,\n ZOrdered,\n} from \"./draw/index.js\";\n"]}
|
package/dist/input/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/input/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/input/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,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\nexport { input } from \"./input.js\";\nexport type {\n BoolDescriptor,\n ColorDescriptor,\n EnumDescriptor,\n ExternalSeriesDescriptor,\n FloatDescriptor,\n InputDescriptor,\n InputKind,\n IntDescriptor,\n IntervalDescriptorInput,\n PriceDescriptor,\n Schema,\n SourceDescriptor,\n SourceField,\n StringDescriptor,\n SymbolDescriptor,\n TimeDescriptor,\n} from \"./inputDescriptor.js\";\n"]}
|
package/dist/input/input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/input/input.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAoB/D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B;;;;;;;;OAQG;IACH,GAAG,CACC,YAAoB,EACpB,IAKC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAc,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CACD,YAAoB,EACpB,IAKC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAgB,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAAC,YAAqB,EAAE,IAAkC;QAC1D,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CACF,YAAoB,EACpB,IAAgE;QAEhE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACA,YAAe,EACf,OAAyB,EACzB,IAAkC;QAElC,OAAO,MAAM,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,MAAe;YACrB,YAAY;YACZ,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACvC,GAAG,IAAI;SACV,CAAC,CAAC;IACP,CAAC;IAED;;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IACH,cAAc,CAAI,IAIjB;QACG,OAAO,MAAM,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,iBAA0B;YAChC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;SAC7D,CAAC,CAAC;IACP,CAAC;CACJ,CAAC,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 { Color, Price, Time } from \"../types.js\";\nimport type {\n BoolDescriptor,\n ColorDescriptor,\n EnumDescriptor,\n ExternalSeriesDescriptor,\n FloatDescriptor,\n IntDescriptor,\n IntervalDescriptorInput,\n PriceDescriptor,\n Schema,\n SourceDescriptor,\n SourceField,\n StringDescriptor,\n SymbolDescriptor,\n TimeDescriptor,\n} from \"./inputDescriptor.js\";\n\n/**\n * The `input.*` namespace. Every builder is a compile-time literal: the\n * compiler reads the call expression and serialises the descriptor into\n * `manifest.inputs`.\n *\n * @since 0.4\n * @stable\n * @example\n * import { input } from \"@invinite-org/chartlang-core\";\n * const length = input.int(20, { min: 1, max: 200, title: \"Length\" });\n * void length;\n */\nexport const input = Object.freeze({\n /**\n * Build an integer input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const length = input.int(20, { min: 1, max: 200 });\n * void length;\n */\n int(\n defaultValue: number,\n opts?: {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly title?: string;\n },\n ): IntDescriptor {\n return Object.freeze({ kind: \"int\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a floating-point input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const multiplier = input.float(2.5, { step: 0.5 });\n * void multiplier;\n */\n float(\n defaultValue: number,\n opts?: {\n readonly min?: number;\n readonly max?: number;\n readonly step?: number;\n readonly title?: string;\n },\n ): FloatDescriptor {\n return Object.freeze({ kind: \"float\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a boolean input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const enabled = input.bool(true);\n * void enabled;\n */\n bool(defaultValue: boolean, opts?: { readonly title?: string }): BoolDescriptor {\n return Object.freeze({ kind: \"bool\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a string input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const symbol = input.string(\"AAPL\");\n * void symbol;\n */\n string(\n defaultValue: string,\n opts?: { readonly title?: string; readonly multiline?: boolean },\n ): StringDescriptor {\n return Object.freeze({ kind: \"string\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a string enum input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const mode = input.enum(\"fast\", [\"fast\", \"slow\"]);\n * void mode;\n */\n enum<T extends string>(\n defaultValue: T,\n options: ReadonlyArray<T>,\n opts?: { readonly title?: string },\n ): EnumDescriptor<T> {\n return Object.freeze({\n kind: \"enum\" as const,\n defaultValue,\n options: Object.freeze(options.slice()),\n ...opts,\n });\n },\n\n /**\n * Build a color input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const c = input.color(\"#26a69a\");\n * void c;\n */\n color(defaultValue: Color, opts?: { readonly title?: string }): ColorDescriptor {\n return Object.freeze({ kind: \"color\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a source-field input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const source = input.source(\"close\");\n * void source;\n */\n source(defaultValue: SourceField, opts?: { readonly title?: string }): SourceDescriptor {\n return Object.freeze({ kind: \"source\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a time input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const anchor = input.time(1_700_000_000_000, { pickFromChart: true });\n * void anchor;\n */\n time(\n defaultValue: Time,\n opts?: { readonly title?: string; readonly pickFromChart?: boolean },\n ): TimeDescriptor {\n return Object.freeze({ kind: \"time\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a price input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const level = input.price(101.25);\n * void level;\n */\n price(defaultValue: Price, opts?: { readonly title?: string }): PriceDescriptor {\n return Object.freeze({ kind: \"price\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a symbol input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const ticker = input.symbol(\"AAPL\");\n * void ticker;\n */\n symbol(defaultValue: string, opts?: { readonly title?: string }): SymbolDescriptor {\n return Object.freeze({ kind: \"symbol\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build a main-interval input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const interval = input.interval(\"1D\");\n * void interval;\n */\n interval(defaultValue: string, opts?: { readonly title?: string }): IntervalDescriptorInput {\n return Object.freeze({ kind: \"interval\" as const, defaultValue, ...opts });\n },\n\n /**\n * Build an adapter-supplied external series input descriptor.\n *\n * @since 0.4\n * @stable\n * @example\n * const earnings = input.externalSeries({\n * name: \"earnings\",\n * schema: { kind: \"external-series-schema\" },\n * });\n * void earnings;\n */\n externalSeries<T>(args: {\n readonly name: string;\n readonly schema: Schema<T>;\n readonly title?: string;\n }): ExternalSeriesDescriptor<T> {\n return Object.freeze({\n kind: \"external-series\" as const,\n name: args.name,\n schema: args.schema,\n ...(args.title === undefined ? {} : { title: args.title }),\n });\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputDescriptor.js","sourceRoot":"","sources":["../../src/input/inputDescriptor.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D"}
|
|
1
|
+
{"version":3,"file":"inputDescriptor.js","sourceRoot":"","sources":["../../src/input/inputDescriptor.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D","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 { Color } from \"../types.js\";\n\n/**\n * Wire-tagged discriminator for every `input.*` descriptor. Mirrors the\n * adapter-kit `InputKind` alias; the two live in lockstep.\n *\n * @since 0.4\n * @stable\n * @example\n * const k: InputKind = \"int\";\n * void k;\n */\nexport type InputKind =\n | \"int\"\n | \"float\"\n | \"bool\"\n | \"string\"\n | \"enum\"\n | \"color\"\n | \"source\"\n | \"time\"\n | \"price\"\n | \"symbol\"\n | \"interval\"\n | \"external-series\";\n\n/**\n * Source-field literal for the pre-computed bar sources the runtime\n * populates per close.\n *\n * @since 0.4\n * @stable\n * @example\n * const f: SourceField = \"hlc3\";\n * void f;\n */\nexport type SourceField = \"open\" | \"high\" | \"low\" | \"close\" | \"hl2\" | \"hlc3\" | \"ohlc4\" | \"hlcc4\";\n\n/**\n * Opaque schema wrapper for `input.externalSeries`. Phase 4 ships the type\n * only; runtime validation lands in Phase 5.\n *\n * @since 0.4\n * @stable\n * @example\n * const s: Schema<number> = { kind: \"external-series-schema\" };\n * void s;\n */\nexport type Schema<T> = Readonly<{ kind: \"external-series-schema\"; __brand?: T }>;\n\ntype NumericInputOpts = Readonly<{ min?: number; max?: number; step?: number }>;\n\n/**\n * Typed input descriptor returned by every `input.*` builder. The `kind`\n * discriminator matches {@link InputKind}; remaining fields carry defaults\n * and UI hints.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: InputDescriptor<number> = {\n * kind: \"int\",\n * defaultValue: 14,\n * title: \"Length\",\n * };\n * void d;\n */\nexport type InputDescriptor<T> =\n | IntDescriptor\n | FloatDescriptor\n | BoolDescriptor\n | StringDescriptor\n | EnumDescriptor<string>\n | ColorDescriptor\n | SourceDescriptor\n | TimeDescriptor\n | PriceDescriptor\n | SymbolDescriptor\n | IntervalDescriptorInput\n | ExternalSeriesDescriptor<T>;\n\ntype Common<K extends InputKind, T> = Readonly<{\n kind: K;\n defaultValue: T;\n title?: string;\n}>;\n\n/**\n * Descriptor for `input.int(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: IntDescriptor = { kind: \"int\", defaultValue: 20, min: 1 };\n * void d;\n */\nexport type IntDescriptor = Common<\"int\", number> & NumericInputOpts;\n\n/**\n * Descriptor for `input.float(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: FloatDescriptor = { kind: \"float\", defaultValue: 2.5, step: 0.5 };\n * void d;\n */\nexport type FloatDescriptor = Common<\"float\", number> & NumericInputOpts;\n\n/**\n * Descriptor for `input.bool(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: BoolDescriptor = { kind: \"bool\", defaultValue: true };\n * void d;\n */\nexport type BoolDescriptor = Common<\"bool\", boolean>;\n\n/**\n * Descriptor for `input.string(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: StringDescriptor = { kind: \"string\", defaultValue: \"AAPL\" };\n * void d;\n */\nexport type StringDescriptor = Common<\"string\", string> & Readonly<{ multiline?: boolean }>;\n\n/**\n * Descriptor for `input.enum(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: EnumDescriptor<\"a\" | \"b\"> = {\n * kind: \"enum\",\n * defaultValue: \"a\",\n * options: [\"a\", \"b\"],\n * };\n * void d;\n */\nexport type EnumDescriptor<T extends string> = Common<\"enum\", T> &\n Readonly<{ options: ReadonlyArray<T> }>;\n\n/**\n * Descriptor for `input.color(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: ColorDescriptor = { kind: \"color\", defaultValue: \"#26a69a\" };\n * void d;\n */\nexport type ColorDescriptor = Common<\"color\", Color>;\n\n/**\n * Descriptor for `input.source(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: SourceDescriptor = { kind: \"source\", defaultValue: \"close\" };\n * void d;\n */\nexport type SourceDescriptor = Common<\"source\", SourceField>;\n\n/**\n * Descriptor for `input.time(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: TimeDescriptor = { kind: \"time\", defaultValue: 1_700_000_000_000 };\n * void d;\n */\nexport type TimeDescriptor = Common<\"time\", number> & Readonly<{ pickFromChart?: boolean }>;\n\n/**\n * Descriptor for `input.price(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: PriceDescriptor = { kind: \"price\", defaultValue: 101.25 };\n * void d;\n */\nexport type PriceDescriptor = Common<\"price\", number>;\n\n/**\n * Descriptor for `input.symbol(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: SymbolDescriptor = { kind: \"symbol\", defaultValue: \"AAPL\" };\n * void d;\n */\nexport type SymbolDescriptor = Common<\"symbol\", string>;\n\n/**\n * Descriptor for `input.interval(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: IntervalDescriptorInput = { kind: \"interval\", defaultValue: \"1D\" };\n * void d;\n */\nexport type IntervalDescriptorInput = Common<\"interval\", string>;\n\n/**\n * Descriptor for `input.externalSeries(...)`.\n *\n * @since 0.4\n * @stable\n * @example\n * const d: ExternalSeriesDescriptor<number> = {\n * kind: \"external-series\",\n * name: \"earnings\",\n * schema: { kind: \"external-series-schema\" },\n * };\n * void d;\n */\nexport type ExternalSeriesDescriptor<T> = Readonly<{\n kind: \"external-series\";\n name: string;\n schema: Schema<T>;\n title?: string;\n}>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalToSeconds.js","sourceRoot":"","sources":["../../src/interval/intervalToSeconds.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAI/D,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,EAAE;IACN,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,UAAU;CAChB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAqB;IACnD,IAAI,CAAC,CAAC,eAAe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,GAAG,UAAU,CAAC;AAC1B,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 { IntervalDescriptor } from \"../types.js\";\n\nconst MULTIPLIERS = Object.freeze({\n s: 1,\n \"\": 60,\n m: 60,\n H: 3_600,\n h: 3_600,\n D: 86_400,\n W: 604_800,\n M: 2_592_000,\n Y: 31_536_000,\n});\n\n/**\n * Convert an {@link IntervalDescriptor} to its effective second count.\n *\n * The helper prefers `intervalSeconds` when present. Otherwise it parses\n * `value` as `<positive-integer><suffix>`, where no suffix means Pine-style\n * minutes. Month and year suffixes use fixed 30-day and 365-day\n * approximations; adapters that need calendar-exact durations should provide\n * `intervalSeconds`.\n *\n * @throws Error when the override is non-positive / non-finite, or `value`\n * cannot be parsed.\n * @since 0.6\n * @stable\n * @example\n * intervalToSeconds({ value: \"1D\", label: \"1 day\", group: \"day\" });\n * intervalToSeconds({ value: \"custom\", label: \"custom\", group: \"x\", intervalSeconds: 7 });\n */\nexport function intervalToSeconds(d: IntervalDescriptor): number {\n if (d.intervalSeconds !== undefined) {\n if (!Number.isFinite(d.intervalSeconds) || d.intervalSeconds <= 0) {\n throw new Error(\n `intervalToSeconds: intervalSeconds must be a positive finite number; received ${d.intervalSeconds}`,\n );\n }\n return Math.round(d.intervalSeconds);\n }\n\n const match = /^(\\d+)([smHhDWMY]?)$/.exec(d.value);\n if (match === null) {\n throw new Error(\n `intervalToSeconds: cannot parse interval value ${JSON.stringify(d.value)}`,\n );\n }\n\n const n = Number.parseInt(match[1], 10);\n if (!Number.isFinite(n) || n <= 0) {\n throw new Error(\n `intervalToSeconds: numeric prefix must be a positive integer; received ${JSON.stringify(d.value)}`,\n );\n }\n\n const suffix = match[2] as keyof typeof MULTIPLIERS;\n const multiplier = MULTIPLIERS[suffix];\n return n * multiplier;\n}\n"]}
|
package/dist/plot/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plot/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plot/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,cAAc,WAAW,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\nexport * from \"./plot.js\";\n"]}
|
package/dist/plot/plot.d.ts
CHANGED
|
@@ -228,6 +228,21 @@ export type PlotOpts = Readonly<{
|
|
|
228
228
|
lineStyle?: LineStyle;
|
|
229
229
|
pane?: "overlay" | "new" | string;
|
|
230
230
|
style?: PlotOptsStyle;
|
|
231
|
+
/**
|
|
232
|
+
* Presentation-only render-order key (z-index). Default `0`.
|
|
233
|
+
* Higher `z` renders on top; lower `z` renders behind. Marks with
|
|
234
|
+
* equal `z` keep the default group order (plots below drawings) and,
|
|
235
|
+
* within a group, declaration order. `z` may be any finite number —
|
|
236
|
+
* fractional values (e.g. `1.5`) slot a mark between two layers
|
|
237
|
+
* without renumbering. It affects **only** stacking: `value`,
|
|
238
|
+
* alerts, and `state.*` are unaffected.
|
|
239
|
+
*
|
|
240
|
+
* @since 1.4
|
|
241
|
+
* @stable
|
|
242
|
+
* @example
|
|
243
|
+
* plot(ta.sma(bar.close, 50), { z: -1 }); // behind other plots
|
|
244
|
+
*/
|
|
245
|
+
z?: number;
|
|
231
246
|
}>;
|
|
232
247
|
/**
|
|
233
248
|
* Styling options accepted by `hline(...)`. `pane` follows the same shape as
|
|
@@ -264,7 +279,7 @@ export type HLineOpts = Readonly<{
|
|
|
264
279
|
}>;
|
|
265
280
|
/**
|
|
266
281
|
* Compile-time callable hole for `plot(value, opts?)`. The compiler rewrites
|
|
267
|
-
* every callsite
|
|
282
|
+
* every callsite to dispatch to the runtime's `plot` implementation;
|
|
268
283
|
* calling this outside a compiled runtime throws the sentinel.
|
|
269
284
|
*
|
|
270
285
|
* Accepts `number | Series<number>` — scalars emit a single bar value;
|
package/dist/plot/plot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plot.d.ts","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,QAAQ,GACd,MAAM,GACN,WAAW,GACX,iBAAiB,GACjB,WAAW,GACX,MAAM,GACN,aAAa,GACb,OAAO,GACP,QAAQ,GACR,OAAO,GACP,WAAW,GACX,OAAO,GACP,iBAAiB,GACjB,cAAc,GACd,UAAU,GACV,WAAW,GACX,sBAAsB,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/F;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC9B;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CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;IAClC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;;;;;;;;;;OAaG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;CACrC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,IAAI,CAE5E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAE7D"}
|
package/dist/plot/plot.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// See the LICENSE file in the repo root for full license text.
|
|
3
3
|
/**
|
|
4
4
|
* Compile-time callable hole for `plot(value, opts?)`. The compiler rewrites
|
|
5
|
-
* every callsite
|
|
5
|
+
* every callsite to dispatch to the runtime's `plot` implementation;
|
|
6
6
|
* calling this outside a compiled runtime throws the sentinel.
|
|
7
7
|
*
|
|
8
8
|
* Accepts `number | Series<number>` — scalars emit a single bar value;
|
package/dist/plot/plot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAiR/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAAC,MAA+B,EAAE,KAAgB;IAClE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,MAAc,EAAE,KAAiB;IACnD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC7D,CAAC"}
|
|
1
|
+
{"version":3,"file":"plot.js","sourceRoot":"","sources":["../../src/plot/plot.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAgS/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAAC,MAA+B,EAAE,KAAgB;IAClE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,MAAc,EAAE,KAAiB;IACnD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC7D,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 { Color, LineStyle, Series } from \"../types.js\";\n\n/**\n * Rendered-shape discriminator for `plot` emissions reaching the adapter.\n * The full 0.5 inventory is `line`, `step-line`, `horizontal-line`,\n * `histogram`, `area`, `filled-band`, `label`, `marker`,\n * `shape`, `character`, `arrow`, `candle-override`, `bar-override`,\n * `bg-color`, `bar-color`, and `horizontal-histogram`. Every expansion is\n * additive — the `apiVersion: 1` script header stays unchanged.\n *\n * Typical Phase-2 consumers:\n *\n * - `histogram` → volume bars, MACD histogram, momentum-style oscillators.\n * - `area` → filled region under a polyline (BB midline, regression).\n * - `filled-band` → Bollinger / Keltner / Donchian / Ichimoku envelopes.\n * - `label` → text annotations at a world-space anchor (fractal, pivot).\n * - `marker` → discrete glyph (circle / triangle / square / diamond) for\n * fractals / divergence / supertrend flips.\n *\n * @since 0.1\n * @example\n * const k: PlotKind = \"line\";\n * const histogram: PlotKind = \"histogram\";\n * const shape: PlotKind = \"shape\";\n * void k; void histogram; void shape;\n */\nexport type PlotKind =\n | \"line\"\n | \"step-line\"\n | \"horizontal-line\"\n | \"histogram\"\n | \"area\"\n | \"filled-band\"\n | \"label\"\n | \"marker\"\n | \"shape\"\n | \"character\"\n | \"arrow\"\n | \"candle-override\"\n | \"bar-override\"\n | \"bg-color\"\n | \"bar-color\"\n | \"horizontal-histogram\";\n\n/**\n * Marker glyphs shared by Phase 2 `marker` and Phase 5 `shape` plot styles.\n *\n * @since 0.5\n * @stable\n * @example\n * const shape: PlotGlyphShape = \"circle\";\n * void shape;\n */\nexport type PlotGlyphShape = \"circle\" | \"triangle-up\" | \"triangle-down\" | \"square\" | \"diamond\";\n\n/**\n * Full glyph inventory for Phase 5 `shape` plot styles.\n *\n * @since 0.5\n * @stable\n * @example\n * const shape: PlotShapeGlyph = \"flag\";\n * void shape;\n */\nexport type PlotShapeGlyph = PlotGlyphShape | \"cross\" | \"xcross\" | \"flag\";\n\n/**\n * Vertical anchoring mode for glyph-like Phase 5 plot styles.\n *\n * @since 0.5\n * @stable\n * @example\n * const location: PlotLocation = \"above\";\n * void location;\n */\nexport type PlotLocation = \"above\" | \"below\" | \"absolute\";\n\n/**\n * Single row in a Phase 5 horizontal-histogram plot emission.\n *\n * @since 0.5\n * @stable\n * @example\n * const bucket: HorizontalHistogramBucket = { price: 100, volume: 25 };\n * void bucket;\n */\nexport type HorizontalHistogramBucket = Readonly<{\n readonly price: number;\n readonly volume: number;\n readonly color?: Color;\n}>;\n\n/**\n * Script-author selectable plot style. The runtime maps this to the\n * adapter-kit's wire `PlotStyle` discriminated union and fills in defaults\n * from sibling {@link PlotOpts} fields (`lineWidth` / `lineStyle`) for\n * line-like styles.\n *\n * `histogram.baseline` defaults to `0` when omitted.\n *\n * @formula N/A — script-facing style input\n * @since 0.2\n * @stable\n * @example\n * const lineStyle: PlotOptsStyle = { kind: \"line\" };\n * const histStyle: PlotOptsStyle = { kind: \"histogram\", baseline: 0 };\n * void lineStyle; void histStyle;\n */\nexport type PlotOptsStyle =\n | { readonly kind: \"line\" }\n | { readonly kind: \"step-line\" }\n | { readonly kind: \"horizontal-line\" }\n | { readonly kind: \"histogram\"; readonly baseline?: number }\n | {\n readonly kind: \"marker\";\n readonly shape: PlotGlyphShape;\n readonly size: number;\n }\n /**\n * Glyph at world-anchor — Pine's `plotshape`. Location selects vertical\n * anchoring; `size` is in CSS pixels.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"shape\", shape: \"triangle-up\", size: 8, location: \"below\" } });\n */\n | {\n readonly kind: \"shape\";\n readonly shape: PlotShapeGlyph;\n readonly size: number;\n readonly location?: PlotLocation;\n }\n /**\n * Text glyph at world-anchor — Pine's `plotchar`. `char` may be any\n * non-empty UTF-8 string; `size` is in CSS pixels.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"character\", char: \"▲\", size: 12, location: \"above\" } });\n */\n | {\n readonly kind: \"character\";\n readonly char: string;\n readonly size: number;\n readonly location?: PlotLocation;\n }\n /**\n * Directional marker at world-anchor — Pine's `plotarrow`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.low, { style: { kind: \"arrow\", direction: \"up\", size: 10 } });\n */\n | { readonly kind: \"arrow\"; readonly direction: \"up\" | \"down\"; readonly size: number }\n /**\n * Candle body color override — Pine's `plotcandle`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"candle-override\", bull: \"#26a69a\", bear: \"#ef5350\" } });\n */\n | {\n readonly kind: \"candle-override\";\n readonly bull: Color;\n readonly bear: Color;\n readonly doji?: Color;\n }\n /**\n * OHLC bar outline override — Pine's `plotbar`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"bar-override\", color: \"#f59e0b\" } });\n */\n | { readonly kind: \"bar-override\"; readonly color: Color }\n /**\n * Pane background color band — Pine's `bgcolor`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"bg-color\", color: \"#1d4ed8\", transp: 80 } });\n */\n | { readonly kind: \"bg-color\"; readonly color: Color; readonly transp?: number }\n /**\n * Main candle/bar tint — Pine's `barcolor`.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"bar-color\", color: \"#a855f7\" } });\n */\n | { readonly kind: \"bar-color\"; readonly color: Color }\n /**\n * Right-edge volume-profile bars keyed by price bucket.\n *\n * @since 0.5\n * @stable\n * @example\n * plot(bar.close, { style: { kind: \"horizontal-histogram\", buckets: [{ price: bar.close, volume: bar.volume }] } });\n */\n | {\n readonly kind: \"horizontal-histogram\";\n readonly buckets: ReadonlyArray<HorizontalHistogramBucket>;\n };\n\n/**\n * Styling options accepted by `plot(...)`. `pane: \"overlay\"` (the default) is\n * the only pane the Phase-1 canvas2d adapter renders — `\"new\"` and named\n * panes are reserved for Phase 2+. `style` (Phase 2) lets the script pick\n * a non-line {@link PlotOptsStyle} — defaults to `{ kind: \"line\" }`.\n *\n * @since 0.1\n * @example\n * const opts: PlotOpts = {\n * color: \"#3b82f6\",\n * title: \"EMA(20)\",\n * lineWidth: 2,\n * lineStyle: \"solid\",\n * pane: \"overlay\",\n * style: { kind: \"line\" },\n * };\n */\nexport type PlotOpts = Readonly<{\n color?: Color;\n title?: string;\n lineWidth?: number;\n lineStyle?: LineStyle;\n pane?: \"overlay\" | \"new\" | string;\n style?: PlotOptsStyle;\n /**\n * Presentation-only render-order key (z-index). Default `0`.\n * Higher `z` renders on top; lower `z` renders behind. Marks with\n * equal `z` keep the default group order (plots below drawings) and,\n * within a group, declaration order. `z` may be any finite number —\n * fractional values (e.g. `1.5`) slot a mark between two layers\n * without renumbering. It affects **only** stacking: `value`,\n * alerts, and `state.*` are unaffected.\n *\n * @since 1.4\n * @stable\n * @example\n * plot(ta.sma(bar.close, 50), { z: -1 }); // behind other plots\n */\n z?: number;\n}>;\n\n/**\n * Styling options accepted by `hline(...)`. `pane` follows the same shape as\n * {@link PlotOpts.pane}: omit to fall back to the script's manifest-resolved\n * default (overlay unless `defineIndicator({ overlay: false })` was declared);\n * `\"overlay\"` pins the line to the price pane; `\"new\"` opens / joins the\n * per-script subpane; named panes route to a shared subpane key.\n *\n * @since 0.1\n * @stable\n * @example\n * const opts: HLineOpts = {\n * color: \"#ef4444\",\n * title: \"RSI 70\",\n * lineStyle: \"dashed\",\n * pane: \"new\",\n * };\n */\nexport type HLineOpts = Readonly<{\n color?: Color;\n title?: string;\n lineWidth?: number;\n lineStyle?: LineStyle;\n /**\n * Routes the horizontal line to a pane. Mirrors {@link PlotOpts.pane}:\n * omit to fall back to the script's manifest-resolved default,\n * `\"overlay\"` pins to the price pane, `\"new\"` joins the per-script\n * subpane, and named keys route to a shared subpane (folded to overlay\n * with `unsupported-pane` on `subPanes: 0` adapters).\n *\n * @since 0.2\n */\n pane?: \"overlay\" | \"new\" | string;\n}>;\n\n/**\n * Compile-time callable hole for `plot(value, opts?)`. The compiler rewrites\n * every callsite to dispatch to the runtime's `plot` implementation;\n * calling this outside a compiled runtime throws the sentinel.\n *\n * Accepts `number | Series<number>` — scalars emit a single bar value;\n * series emissions pull from `series.current`.\n *\n * @since 0.1\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // plot(bar.close, { color: \"#3b82f6\" });\n * import { plot } from \"@invinite-org/chartlang-core\";\n * try { plot(0); } catch {}\n */\nexport function plot(_value: number | Series<number>, _opts?: PlotOpts): void {\n throw new Error(\"plot called outside compiled runtime\");\n}\n\n/**\n * Compile-time callable hole for `hline(price, opts?)`. Same semantics as\n * `plot` but pinned to a fixed price across all bars.\n *\n * @since 0.1\n * @stable\n * @example\n * // Inside a compiled `compute`:\n * // hline(70, { color: \"#ef4444\" });\n * import { hline } from \"@invinite-org/chartlang-core\";\n * try { hline(70); } catch {}\n */\nexport function hline(_price: number, _opts?: HLineOpts): void {\n throw new Error(\"hline called outside compiled runtime\");\n}\n"]}
|
package/dist/request/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { request, type RequestNamespace, type RequestLowerTfOpts, type RequestSecurityOpts, type SecurityBar, } from "./request.js";
|
|
1
|
+
export { request, type RequestNamespace, type RequestLowerTfOpts, type RequestSecurityOpts, type SecurityBar, type SecurityExpr, } from "./request.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,OAAO,EACP,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,OAAO,EACP,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,YAAY,GACpB,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/request/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAE/D,OAAO,EACH,OAAO,GAMV,MAAM,cAAc,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\nexport {\n request,\n type RequestNamespace,\n type RequestLowerTfOpts,\n type RequestSecurityOpts,\n type SecurityBar,\n type SecurityExpr,\n} from \"./request.js\";\n"]}
|