@trdrs/quickcharts 2.1.0 → 2.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.
- package/CHANGELOG.md +28 -0
- package/README.md +110 -2
- package/dist/adapters/rest.d.ts +1 -1
- package/dist/{assets-DOuBBsOp.d.ts → assets-M5emOz5c.d.ts} +1 -1
- package/dist/chunk-6OLK55Q2.js +145 -0
- package/dist/chunk-6OLK55Q2.js.map +1 -0
- package/dist/chunk-GFQQSY47.js +41 -0
- package/dist/chunk-GFQQSY47.js.map +1 -0
- package/dist/chunk-QYGSDD2Q.js +1868 -0
- package/dist/chunk-QYGSDD2Q.js.map +1 -0
- package/dist/drawings.d.ts +3 -3
- package/dist/feature-manifest.json +1 -1
- package/dist/format.d.ts +37 -0
- package/dist/format.js +7 -0
- package/dist/format.js.map +1 -0
- package/dist/glyphs.d.ts +17 -0
- package/dist/glyphs.js +11 -0
- package/dist/glyphs.js.map +1 -0
- package/dist/index.d.ts +67 -358
- package/dist/index.js +447 -2044
- package/dist/index.js.map +1 -1
- package/dist/{resources-Le6flcEn.d.ts → resources-C0cYryO9.d.ts} +1 -1
- package/dist/symbology-D3SLclrU.d.ts +105 -0
- package/dist/symbols-BL1fD4CS.d.ts +222 -0
- package/dist/symbols.d.ts +2 -0
- package/dist/symbols.js +9 -0
- package/dist/symbols.js.map +1 -0
- package/package.json +13 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,304 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { C as ChartDatafeed, F as FeedBar, S as SymbolRow, a as SearchClassNode } from './symbols-BL1fD4CS.js';
|
|
2
|
+
export { B as BarMark, b as BarsEvent, D as DatafeedConfig, c as DatafeedSearchOptions, d as FeedUnavailableError, H as HistoryPage, M as MarkColorRole, e as MarkPlacement, f as MarkShape, O as OlderPageVerdict, g as SearchPage, h as SubscribeHandlers, i as SymbolNames, T as TimescaleMark, o as olderPageVerdict, s as symbolNames } from './symbols-BL1fD4CS.js';
|
|
3
|
+
import { al as en, C as ChartMessageKey, G as GlyphSourcePort, M as MagnetMode, d as CursorMode, L as LineStyle, I as IDrawing, m as DrawingCounts, D as DrawingStyle, Y as VisibilityPreset, U as ToolPreset, V as ToolTemplate, S as SerializedDrawing, o as DrawingPreferences, l as DrawingAssetPort } from './assets-M5emOz5c.js';
|
|
4
|
+
import { b as ResourceRef, C as ChartSaveLoadAdapter, q as ChartMeta, t as ChartBody, h as DrawingResourceContext, R as ResourceStore, u as DrawingsMeta, j as DrawingsBody, T as TemplateMeta, a as TemplateBody, v as LayoutMeta, w as LayoutBody, e as DrawingContextKind } from './resources-C0cYryO9.js';
|
|
5
|
+
export { c as ChartLocalDrawingContext, D as DRAWING_CONTEXT_VERSION, d as DRAWING_DOCUMENT_VERSION, f as DrawingEntry, g as DrawingGroup, i as DrawingTombstone, L as LayoutSharedDrawingContext, M as MemoryResourcesOptions, x as ResourceAbortError, S as SymbolGlobalDrawingContext, y as TemplateKind, W as WriteOutcome, k as drawingContextKey, l as emptyDrawingDocument, m as liveDrawingEntries, n as liveDrawingGroups, z as memorySaveLoadAdapter, o as mergeDrawingDocuments, p as parseDrawingDocument, r as reviseDrawingDocument, s as sameDrawingContext } from './resources-C0cYryO9.js';
|
|
4
6
|
import { LineData, UTCTimestamp, HistogramData, WhitespaceData, IChartApi, ISeriesApi, CreatePriceLineOptions, PriceLineOptions, ISeriesPrimitive, Time, PriceScaleMode, SeriesType, SeriesAttachedParameter, TickMarkType } from 'lightweight-charts';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* - `pricescale` — price units per whole unit. 100 writes cents, 100000 writes FX pipettes,
|
|
10
|
-
* 100000000 writes satoshis, 32 writes thirty-seconds. It alone sets the decimal column width.
|
|
11
|
-
* - `minmov` — the smallest move, in those units. It declares the grid a price moves on; it never
|
|
12
|
-
* widens or narrows the decimal column (ES at `{100, 25}` writes 4500.25, the same two decimals
|
|
13
|
-
* as `{100, 1}`).
|
|
14
|
-
* - `minmove2` — the further division of one `minmov` step for a fraction-of-a-fraction market:
|
|
15
|
-
* 4 means quarters of a thirty-second.
|
|
16
|
-
* - `fractional` — write the sub-unit part as a counted fraction (110'16) instead of decimals.
|
|
17
|
-
* - `variableTickSize` — an ordered ladder of tick sizes by price band, written as a
|
|
18
|
-
* space-separated string: alternating tick and upper bound, ending with the tick that applies
|
|
19
|
-
* above the last bound. "0.01 10 0.02 100 0.05" means 0.01 below 10, 0.02 below 100, 0.05 at or
|
|
20
|
-
* above 100. The band a price falls in is a DECLARED fact of the symbol, not a guess from its
|
|
21
|
-
* magnitude. */
|
|
22
|
-
interface PriceFormat {
|
|
23
|
-
pricescale: number;
|
|
24
|
-
minmov: number;
|
|
25
|
-
minmove2?: number;
|
|
26
|
-
fractional?: boolean;
|
|
27
|
-
variableTickSize?: string;
|
|
28
|
-
}
|
|
29
|
-
/** How live the served data is, in three states. `delayed_streaming` is a real
|
|
30
|
-
* stream behind a delay, not a degraded `streaming`. */
|
|
31
|
-
type DataStatus = 'streaming' | 'endofday' | 'delayed_streaming';
|
|
32
|
-
/** The subsession ids a symbol may name. `regular` is the weekly `session`; `premarket` and
|
|
33
|
-
* `postmarket` are the extended spans before and after it; `extended` is the whole span from
|
|
34
|
-
* pre-market open through post-market close. */
|
|
35
|
-
type SubsessionId = 'regular' | 'extended' | 'premarket' | 'postmarket';
|
|
36
|
-
/** One named session of a market with extended hours. `session`
|
|
37
|
-
* uses the grammar of `SymbolInfo.session`; `sessionCorrections` uses the grammar of
|
|
38
|
-
* `SymbolInfo.corrections` and lists only the days that shorten THIS subsession. `description`
|
|
39
|
-
* is a label a feed may state; the chart labels a subsession by its `id` from its own catalog. */
|
|
40
|
-
interface Subsession {
|
|
41
|
-
id: SubsessionId;
|
|
42
|
-
session: string;
|
|
43
|
-
description?: string;
|
|
44
|
-
sessionCorrections?: string;
|
|
45
|
-
}
|
|
46
|
-
/** Resolved metadata for ONE symbol: everything the chart needs to title it, page it, session it,
|
|
47
|
-
* and write its prices.
|
|
48
|
-
*
|
|
49
|
-
* `timezone`, `session`, `sessionHolidays`, `corrections` and `subsessions` are the
|
|
50
|
-
* exchange-hours facts and travel with the symbol. The chart's session model (`sessionModel.ts`)
|
|
51
|
-
* is built from them alone: market state, session shading, the regular-hours filter and the
|
|
52
|
-
* status popup all read what the feed said, and a feed that states no extended hours gets none. */
|
|
53
|
-
interface SymbolInfo {
|
|
54
|
-
/** The symbol the datafeed answers to on every later call. */
|
|
55
|
-
ticker: string;
|
|
56
|
-
/** The short display identity, e.g. 'ESZ2026'. */
|
|
57
|
-
name: string;
|
|
58
|
-
/** The long human description, e.g. 'E-mini S&P 500 Dec 2026'. */
|
|
59
|
-
description: string;
|
|
60
|
-
/** The venue a UI attributes the symbol to. */
|
|
61
|
-
exchange: string;
|
|
62
|
-
/** The venue that actually lists it, when it differs from `exchange`. */
|
|
63
|
-
listedExchange: string;
|
|
64
|
-
/** The venue's own type token, e.g. 'futures', 'stock', 'crypto', 'forex'. */
|
|
65
|
-
type: string;
|
|
66
|
-
/** The resolutions this symbol serves, as chart timeframe tokens ('1m', '4h', '1d', '1mo'). An
|
|
67
|
-
* EMPTY list declares no restriction: the feed serves any token the grammar admits (a futures
|
|
68
|
-
* or spread feed says exactly this), and the chart never reads it as "serves nothing". A finite
|
|
69
|
-
* list is a promise the chart may enforce. */
|
|
70
|
-
supportedResolutions: readonly string[];
|
|
71
|
-
/** The exchange's IANA zone, e.g. 'America/New_York'. */
|
|
72
|
-
timezone: string;
|
|
73
|
-
/** The session string, e.g. '1700-1600' or '0930-1600'. */
|
|
74
|
-
session: string;
|
|
75
|
-
/** The session-holidays string: comma-separated 'YYYYMMDD' full closures. */
|
|
76
|
-
sessionHolidays?: string;
|
|
77
|
-
/** The corrections string: `;`-separated `<session>:<dates>` entries, each a session in
|
|
78
|
-
* the grammar of `session` that holds on the `,`-separated 'YYYYMMDD' trading days named. A
|
|
79
|
-
* correction outranks a holiday on the same date. */
|
|
80
|
-
corrections?: string;
|
|
81
|
-
/** The symbol's named sessions, for a market whose exchange keeps extended hours. Absent for a
|
|
82
|
-
* market with one continuous session. */
|
|
83
|
-
subsessions?: readonly Subsession[];
|
|
84
|
-
dataStatus: DataStatus;
|
|
85
|
-
/** ISO 4217 for a money-quoted symbol; absent when the quote unit is not a currency. */
|
|
86
|
-
currencyCode?: string;
|
|
87
|
-
/** The unit a non-currency symbol is quoted in, e.g. an energy or weight unit id. */
|
|
88
|
-
unitId?: string;
|
|
89
|
-
/** Decimal places for a volume value. 0 for a whole-contract market. */
|
|
90
|
-
volumePrecision: number;
|
|
91
|
-
format: PriceFormat;
|
|
92
|
-
}
|
|
93
|
-
/** One band of a `variableTickSize` ladder: `size` is the tick that applies to prices strictly below
|
|
94
|
-
* `below`, and the last band's `below` is `Infinity`. */
|
|
95
|
-
interface TickBand {
|
|
96
|
-
/** The tick size in this band. */
|
|
97
|
-
size: number;
|
|
98
|
-
/** The exclusive upper bound of the band. */
|
|
99
|
-
below: number;
|
|
100
|
-
}
|
|
101
|
-
/** Parse the space-separated variable-tick ladder into ordered bands. Returns an
|
|
102
|
-
* empty array for a string the grammar cannot read, which is how a caller tells "no ladder" from
|
|
103
|
-
* "a ladder I must honour" without guessing at a half-parsed one. */
|
|
104
|
-
declare function parseTickBands(variableTickSize: string): TickBand[];
|
|
105
|
-
/** The band a price falls in, by the ladder's declared bounds (magnitude of the SYMBOL's own
|
|
106
|
-
* declared ladder, never a generic magnitude rule). Negative prices read on their absolute value,
|
|
107
|
-
* so a spread writes both sides in one column. */
|
|
108
|
-
declare function tickBandFor(bands: readonly TickBand[], price: number): TickBand | null;
|
|
109
|
-
|
|
110
|
-
/** The theme roles a mark may wear. A host names a meaning and the mode resolves the color, so a
|
|
111
|
-
* mark stays readable when the viewer switches to light. */
|
|
112
|
-
type MarkColorRole = 'neutral' | 'up' | 'down' | 'info' | 'warning' | 'positive' | 'negative';
|
|
113
|
-
/** Where a bar mark sits relative to its bar. */
|
|
114
|
-
type MarkPlacement = 'above' | 'below';
|
|
115
|
-
/** The glyph a bar mark draws. */
|
|
116
|
-
type MarkShape = 'circle' | 'square' | 'arrowUp' | 'arrowDown';
|
|
117
|
-
/** One mark on a bar. */
|
|
118
|
-
interface BarMark {
|
|
119
|
-
/** Stable within one symbol and window, so a refetch replaces rather than duplicates. */
|
|
120
|
-
id: string;
|
|
121
|
-
/** Epoch SECONDS at the bar's bucket open, the same clock every bar uses. */
|
|
122
|
-
time: number;
|
|
123
|
-
color: MarkColorRole;
|
|
124
|
-
/** The letter or two the glyph carries. */
|
|
125
|
-
text?: string;
|
|
126
|
-
/** The longer words a host would show beside the mark. Carried, never drawn by the chart. */
|
|
127
|
-
label?: string;
|
|
128
|
-
shape?: MarkShape;
|
|
129
|
-
placement?: MarkPlacement;
|
|
130
|
-
}
|
|
131
|
-
/** One mark under the time scale. */
|
|
132
|
-
interface TimescaleMark {
|
|
133
|
-
id: string;
|
|
134
|
-
/** Epoch SECONDS. */
|
|
135
|
-
time: number;
|
|
136
|
-
color: MarkColorRole;
|
|
137
|
-
label?: string;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** One OHLCV bar on the wire: `t` = epoch SECONDS at bucket open (never milliseconds, never an
|
|
141
|
-
* update's wall time), strictly ascending within any batch, one bar per timestamp. */
|
|
142
|
-
interface FeedBar {
|
|
143
|
-
t: number;
|
|
144
|
-
o: number;
|
|
145
|
-
h: number;
|
|
146
|
-
l: number;
|
|
147
|
-
c: number;
|
|
148
|
-
v: number;
|
|
149
|
-
}
|
|
150
|
-
/** A symbol-search result row. `exchange` names the venue the market lists on. `dataSource` names
|
|
151
|
-
* where the market's data comes from, and a row names one only when that source publishes the
|
|
152
|
-
* symbol's data. The row's source cell shows the venue, or the data source for a row with none. */
|
|
153
|
-
interface SymbolRow {
|
|
154
|
-
symbol: string;
|
|
155
|
-
name: string;
|
|
156
|
-
exchange: string;
|
|
157
|
-
type: string;
|
|
158
|
-
dataSource?: string | null;
|
|
159
|
-
/** What the market is priced in, when the feed knows it here. A PAIR market writes itself as
|
|
160
|
-
* `BASE / QUOTE` wherever it is named, and a ticker alone cannot say what the quote is; a row
|
|
161
|
-
* without it keeps the name the feed sent instead. `resolve()` states the same fact for the
|
|
162
|
-
* charted symbol, so a row and the legend that follows it agree. */
|
|
163
|
-
currencyCode?: string;
|
|
164
|
-
}
|
|
165
|
-
interface SearchPage {
|
|
166
|
-
hits: SymbolRow[];
|
|
167
|
-
/** Exact: another page exists at offset + hits.length (never a guess at a page boundary). */
|
|
168
|
-
hasMore: boolean;
|
|
169
|
-
}
|
|
170
|
-
interface HistoryPage {
|
|
171
|
-
bars: FeedBar[];
|
|
172
|
-
/** True when a countBack ask found NOTHING — the "no more history, stop scrolling back" signal.
|
|
173
|
-
* Plain from/to asks never set it (an empty window can be a mid-history gap). */
|
|
174
|
-
noData: boolean;
|
|
175
|
-
/** OPTIONAL gap hint on an EMPTY page that is not the end of history: the epoch-seconds time of
|
|
176
|
-
* the closest bar older than the asked window (a market holiday between `to` and the data).
|
|
177
|
-
* A consumer may retry ONCE with `to = nextTime` to jump the gap instead of dead-ending —
|
|
178
|
-
* {@link olderPageVerdict} is that rule. Feeds without the concept simply never set it. */
|
|
179
|
-
nextTime?: number;
|
|
180
|
-
}
|
|
181
|
-
type OlderPageVerdict = {
|
|
182
|
-
kind: 'bars';
|
|
183
|
-
} | {
|
|
184
|
-
kind: 'hop';
|
|
185
|
-
to: number;
|
|
186
|
-
} | {
|
|
187
|
-
kind: 'end';
|
|
188
|
-
} | {
|
|
189
|
-
kind: 'stop';
|
|
190
|
-
};
|
|
191
|
-
/** The one scroll-back rule for an older-history page, shared by every paging consumer so the gap
|
|
192
|
-
* semantics can't drift between them:
|
|
193
|
-
* - `bars` — the page has data; prepend it (bars are never discarded, whatever flags ride along).
|
|
194
|
-
* - `hop` — empty but `nextTime` points strictly older and this ask wasn't already a hop: re-ask
|
|
195
|
-
* once anchored there (the session-gap answer). One hop per gap keeps a lying feed bounded —
|
|
196
|
-
* an honest hint names a real bar, so the hop can't come back empty.
|
|
197
|
-
* - `end` — empty, `noData`, and no hint: feed inception, the one verdict that seals scroll-back.
|
|
198
|
-
* - `stop` — every other empty page (a transient, or an unusable hint): end this flight WITHOUT
|
|
199
|
-
* sealing; the next gesture asks again. */
|
|
200
|
-
declare function olderPageVerdict(page: HistoryPage, askedTo: number, alreadyHopped: boolean): OlderPageVerdict;
|
|
201
|
-
/** Push events from a live bar subscription. A `snapshot` REPLACES the recent window (delivered on
|
|
202
|
-
* connect and on every transport reconnect — the feed's self-healing re-sync); a `bar` mutates the
|
|
203
|
-
* last bar or appends the next one (bucket-open time). */
|
|
204
|
-
type BarsEvent = {
|
|
205
|
-
kind: 'snapshot';
|
|
206
|
-
bars: FeedBar[];
|
|
207
|
-
} | {
|
|
208
|
-
kind: 'bar';
|
|
209
|
-
bar: FeedBar;
|
|
210
|
-
};
|
|
211
|
-
interface SubscribeHandlers {
|
|
212
|
-
onBars(e: BarsEvent): void;
|
|
213
|
-
/** Feed status codes: 'live' | 'no-data' | server codes ('not_entitled', 'feed_down', …). */
|
|
214
|
-
onStatus?(status: string): void;
|
|
215
|
-
}
|
|
216
|
-
/** Thrown by `history` when the backend has NO feed configured for the symbol — a TERMINAL state
|
|
217
|
-
* (the chart shows "market data unavailable" and closes the live subscription), unlike a transient
|
|
218
|
-
* fetch failure which is retried. */
|
|
219
|
-
declare class FeedUnavailableError extends Error {
|
|
220
|
-
/** The server's typed refusal (e.g. not_entitled / feed_down),
|
|
221
|
-
* when it sent one — lets the host name the actual cause instead of a generic "unavailable". */
|
|
222
|
-
readonly code: string | null;
|
|
223
|
-
constructor(message?: string,
|
|
224
|
-
/** The server's typed refusal (e.g. not_entitled / feed_down),
|
|
225
|
-
* when it sent one — lets the host name the actual cause instead of a generic "unavailable". */
|
|
226
|
-
code?: string | null);
|
|
227
|
-
}
|
|
228
|
-
/** One class in a feed's catalog that holds narrower classes: a `spot` class over its `usdc` and
|
|
229
|
-
* `usdt` quotes, say. `id` is the token the feed is searched with, as a plain string entry is, and
|
|
230
|
-
* `children` are the narrower classes, as tokens or nodes of their own. The search renders two
|
|
231
|
-
* levels, a top-level class and its children: a child's own `children` are not offered, and the
|
|
232
|
-
* child narrows by its `id` alone. */
|
|
233
|
-
interface SearchClassNode {
|
|
234
|
-
readonly id: string;
|
|
235
|
-
readonly children?: readonly (string | SearchClassNode)[];
|
|
236
|
-
}
|
|
237
|
-
/** What a feed's `search` is asked with. `cls` and `classes` say which classes to narrow to; both
|
|
238
|
-
* absent is every class. */
|
|
239
|
-
interface DatafeedSearchOptions {
|
|
240
|
-
/** One class to narrow to. When the viewer may select several classes it is set only while
|
|
241
|
-
* exactly one is selected, so a feed that reads `cls` alone still narrows a single chip. */
|
|
242
|
-
cls?: string;
|
|
243
|
-
/** Every class to narrow to, sent only when the search lets the viewer select several classes at
|
|
244
|
-
* once: a row matches when it is in any of them. A feed may ignore it and read `cls` alone. */
|
|
245
|
-
classes?: readonly string[];
|
|
246
|
-
limit?: number;
|
|
247
|
-
offset?: number;
|
|
248
|
-
}
|
|
249
|
-
/** A feed's coarse, feed-LEVEL capability declaration. Everything optional and the method itself
|
|
250
|
-
* optional: an ABSENT declaration means unconstrained, and a feed must only
|
|
251
|
-
* declare what is true — a finite `resolutions` list from a feed that serves any timeframe would
|
|
252
|
-
* be a lie the chart then enforces. Symbol-level truth (price format, resolutions, session) stays
|
|
253
|
-
* on {@link SymbolInfo}. */
|
|
254
|
-
interface DatafeedConfig {
|
|
255
|
-
/** The wire timeframe tokens this feed can serve ('1m', '4h', '1d', …). Absent = any. */
|
|
256
|
-
resolutions?: readonly string[];
|
|
257
|
-
/** Asset-class tokens the catalog carries, in the order the search offers them. An entry is a
|
|
258
|
-
* token, or a {@link SearchClassNode} whose children the search offers beneath it once it is
|
|
259
|
-
* selected. Absent = unspecified. */
|
|
260
|
-
classes?: readonly (string | SearchClassNode)[];
|
|
261
|
-
}
|
|
262
|
-
/** The datafeed a chart consumes. Implementations must follow the bar rules on {@link FeedBar} and
|
|
263
|
-
* {@link BarsEvent}; everything else (transport, caching, auth) is the implementation's business. */
|
|
264
|
-
interface ChartDatafeed {
|
|
265
|
-
/** OPTIONAL capability negotiation, read once at mount: the widget constrains itself to what the
|
|
266
|
-
* feed declares (e.g. its initial timeframe must be servable). Omit it entirely when the feed
|
|
267
|
-
* has no fixed capability set. */
|
|
268
|
-
config?(): Promise<DatafeedConfig>;
|
|
269
|
-
/** Server-side symbol search, paged. `cls` narrows to one asset class ('' / absent = all), and
|
|
270
|
-
* `classes`, when present, to any of several (see {@link DatafeedSearchOptions}). */
|
|
271
|
-
search(q: string, opts?: DatafeedSearchOptions): Promise<SearchPage>;
|
|
272
|
-
/** Resolve one symbol's metadata; null when the symbol is unknown to the feed's catalogs. */
|
|
273
|
-
resolve(symbol: string): Promise<SymbolInfo | null>;
|
|
274
|
-
/** Historical sealed bars: a [from,to] window (epoch seconds, INCLUSIVE of both ends — the chart
|
|
275
|
-
* pages with `to = oldest − 1` and never re-requests a bar it holds), or `countBack` = the LAST
|
|
276
|
-
* N bars at/before `to` (outranks `from`; the count is an obligation — reach across closures).
|
|
277
|
-
* No range = the feed's default recent window. Throws {@link FeedUnavailableError} when no feed
|
|
278
|
-
* serves the symbol. */
|
|
279
|
-
history(symbol: string, tf: string, range?: {
|
|
280
|
-
from?: number;
|
|
281
|
-
to?: number;
|
|
282
|
-
countBack?: number;
|
|
283
|
-
}): Promise<HistoryPage>;
|
|
284
|
-
/** Live bar push for one (symbol, timeframe). Returns the unsubscribe. The transport owns
|
|
285
|
-
* reconnection and re-syncs by emitting a fresh `snapshot`. */
|
|
286
|
-
subscribeBars(symbol: string, tf: string, handlers: SubscribeHandlers): () => void;
|
|
287
|
-
/** Server clock (epoch seconds) — countdown skew correction. Optional: a feed without one leaves
|
|
288
|
-
* the chart on the client clock. */
|
|
289
|
-
serverTime?(): Promise<number>;
|
|
290
|
-
/** OPTIONAL depth of history for a symbol: the epoch seconds of its earliest available bar, or
|
|
291
|
-
* null when the feed does not know. The range presets read it (a listing from last year offers
|
|
292
|
-
* no five-year range); the chart never probes for it. Omit it entirely when the feed cannot
|
|
293
|
-
* say, and every preset is offered. */
|
|
294
|
-
earliestBar?(symbol: string): Promise<number | null>;
|
|
295
|
-
/** OPTIONAL neutral bar marks over a window (epoch seconds, inclusive of both ends). A mark is a
|
|
296
|
-
* note about a moment: its color is a theme role, its words are the host's, and the chart
|
|
297
|
-
* draws it as given. Omit it entirely when the feed serves none. */
|
|
298
|
-
marks?(symbol: string, from: number, to: number, resolution: string): Promise<readonly BarMark[]>;
|
|
299
|
-
/** OPTIONAL neutral time-scale marks over the same window. */
|
|
300
|
-
timescaleMarks?(symbol: string, from: number, to: number, resolution: string): Promise<readonly TimescaleMark[]>;
|
|
301
|
-
}
|
|
7
|
+
import { D as DataStatus, S as SymbolInfo, P as PriceFormat } from './symbology-D3SLclrU.js';
|
|
8
|
+
export { a as Subsession, b as SubsessionId, T as TickBand, p as parseTickBands, t as tickBandFor } from './symbology-D3SLclrU.js';
|
|
9
|
+
import { PriceFormatter } from './format.js';
|
|
10
|
+
export { NumericPunctuation, PriceFormatterOptions, createPriceFormatter } from './format.js';
|
|
302
11
|
|
|
303
12
|
/** A feed that answers coarser grains than the one it wraps.
|
|
304
13
|
*
|
|
@@ -1458,39 +1167,6 @@ declare function arrangementName(t: ChartTranslate, code: string, fallback: stri
|
|
|
1458
1167
|
* of the built-in codes, or a code the `locales` option registers. */
|
|
1459
1168
|
declare function createChartI18n(initial?: string, options?: ChartI18nOptions): ChartI18n;
|
|
1460
1169
|
|
|
1461
|
-
/** How a formatted price is punctuated. A price localizes the decimal sign only, so
|
|
1462
|
-
* `groupSign` defaults to '' (no thousands separator) and a host that wants grouping asks for it
|
|
1463
|
-
* explicitly. */
|
|
1464
|
-
interface NumericPunctuation {
|
|
1465
|
-
/** What separates the whole part from the decimals. Default '.', or the locale's sign when a
|
|
1466
|
-
* `locale` is given. */
|
|
1467
|
-
decimalSign?: string;
|
|
1468
|
-
/** What separates thousands in the whole part. Default '': a price is written ungrouped, because
|
|
1469
|
-
* a grouped price is harder to compare against the axis beside it. */
|
|
1470
|
-
groupSign?: string;
|
|
1471
|
-
}
|
|
1472
|
-
interface PriceFormatterOptions {
|
|
1473
|
-
/** A BCP 47 tag used ONCE, at construction, to derive the decimal sign. Anything explicit in
|
|
1474
|
-
* `numericPunctuation` wins over it. */
|
|
1475
|
-
locale?: string;
|
|
1476
|
-
numericPunctuation?: NumericPunctuation;
|
|
1477
|
-
}
|
|
1478
|
-
/** A resolved formatter for one symbol. `format` and `parse` are exact inverses over every price
|
|
1479
|
-
* that lands on the symbol's own grid. */
|
|
1480
|
-
interface PriceFormatter {
|
|
1481
|
-
/** The price as the symbol writes it. */
|
|
1482
|
-
format(price: number): string;
|
|
1483
|
-
/** The number a viewer typed, or null when the text is not a price in this symbol's format. */
|
|
1484
|
-
parse(text: string): number | null;
|
|
1485
|
-
/** How many digits `format` writes after the decimal sign. 0 for a fractional format, which
|
|
1486
|
-
* writes none; the widest band's width for a variable-tick format, so a column sized from it
|
|
1487
|
-
* never has to reflow. */
|
|
1488
|
-
precision(): number;
|
|
1489
|
-
}
|
|
1490
|
-
/** Build the formatter for one symbol's price format. The result is stateless and reusable; a host
|
|
1491
|
-
* resolves a symbol once and keeps its formatter for as long as the symbol is on screen. */
|
|
1492
|
-
declare function createPriceFormatter(format: PriceFormat, options?: PriceFormatterOptions): PriceFormatter;
|
|
1493
|
-
|
|
1494
1170
|
/** The session an instant classifies into. `extended` is trading outside regular hours when the
|
|
1495
1171
|
* symbol does not split it into pre-market and after-hours. */
|
|
1496
1172
|
type SessionState = 'pre' | 'open' | 'extended' | 'after' | 'closed';
|
|
@@ -2772,6 +2448,22 @@ declare const MIRRORED_ICONS: ReadonlySet<ChartIconId>;
|
|
|
2772
2448
|
/** Every published icon id, in catalog order: the controls, then the styles, the tools and the
|
|
2773
2449
|
* layouts in their registries' orders. */
|
|
2774
2450
|
declare const CHART_ICON_IDS: readonly ChartIconId[];
|
|
2451
|
+
/** The chart's own drawing of an icon, as markup a host draws without the chart: a toolbar of its
|
|
2452
|
+
* own, a native view. */
|
|
2453
|
+
interface ChartIconArtwork {
|
|
2454
|
+
/** The grid the drawing is on. */
|
|
2455
|
+
viewBox: string;
|
|
2456
|
+
/** The markup inside the svg, every ink on `currentColor`. */
|
|
2457
|
+
body: string;
|
|
2458
|
+
/** The whole drawing as one standalone svg: the grid, no fill of its own (as the chart draws it),
|
|
2459
|
+
* and the body. */
|
|
2460
|
+
svg: string;
|
|
2461
|
+
}
|
|
2462
|
+
/** Every drawing the chart paints for an icon, in the order its controls use them, each on its own
|
|
2463
|
+
* grid, so a host picks the one whose grid suits its box (the drawing toolbar's are on a 28 grid).
|
|
2464
|
+
* The chart's own artwork, whatever a host's `icons` draw instead. An icon the chart draws in its
|
|
2465
|
+
* theme's roles, an illustration, answers none, and so does an id it does not draw. */
|
|
2466
|
+
declare function chartIconArtwork(id: ChartIconId): readonly ChartIconArtwork[];
|
|
2775
2467
|
|
|
2776
2468
|
/** A declared numeric input: `int`/`float` bound by min/max, `enum` an index into `options`. */
|
|
2777
2469
|
interface ManifestInput {
|
|
@@ -3736,6 +3428,19 @@ interface LogicalRange {
|
|
|
3736
3428
|
to: number;
|
|
3737
3429
|
}
|
|
3738
3430
|
|
|
3431
|
+
/** The plot's box: the four distances an absolutely positioned element takes, each measured in from
|
|
3432
|
+
* the matching edge of the host's element, and the box's size. `right` is how far the plot's right
|
|
3433
|
+
* edge stands in from the element's right edge, which is the right price scale and anything beside
|
|
3434
|
+
* the chart; `bottom` is the time scale, any panes below the main one and anything beneath. */
|
|
3435
|
+
interface PlotArea {
|
|
3436
|
+
top: number;
|
|
3437
|
+
right: number;
|
|
3438
|
+
bottom: number;
|
|
3439
|
+
left: number;
|
|
3440
|
+
width: number;
|
|
3441
|
+
height: number;
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3739
3444
|
/** What went wrong, as a machine-readable code. */
|
|
3740
3445
|
type ThemeDiagnosticCode = 'unknown-role' | 'empty-value' | 'invalid-value';
|
|
3741
3446
|
/** One rejected entry of a host's custom palette. */
|
|
@@ -4357,8 +4062,18 @@ interface ChartHandle {
|
|
|
4357
4062
|
zoom(factor: number): void;
|
|
4358
4063
|
/** Fit the loaded data. */
|
|
4359
4064
|
reset(): void;
|
|
4360
|
-
/** Return to the live edge, keeping the current span
|
|
4065
|
+
/** Return to the live edge, keeping the current span: a glide that eases into place, moving the
|
|
4066
|
+
* view sideways and never the zoom. A touch, a drag, a wheel or any other navigation ends it
|
|
4067
|
+
* where it stands. */
|
|
4361
4068
|
goLive(): void;
|
|
4069
|
+
/** Whether the view sits back from the live edge, scrolled more than a bar behind its resting
|
|
4070
|
+
* place, which is what a control offering the way back reads. A glide under way reads as
|
|
4071
|
+
* returned from its first frame, and bar replay, which has its own way back, reads as returned
|
|
4072
|
+
* throughout. The `liveEdge` event reports each change. */
|
|
4073
|
+
awayFromLiveEdge(): boolean;
|
|
4074
|
+
/** Where the main pane draws its bars, in the pixels of the element the host handed the widget,
|
|
4075
|
+
* or null before the chart has laid out. The `plotArea` event reports each change. */
|
|
4076
|
+
plotArea(): PlotArea | null;
|
|
4362
4077
|
scaleMode(): ScaleMode;
|
|
4363
4078
|
setScaleMode(mode: ScaleMode): void;
|
|
4364
4079
|
/** The viewer's display-timezone CHOICE: an IANA id from the chart's registry, or `exchange` to
|
|
@@ -4487,6 +4202,11 @@ interface ChartEvents {
|
|
|
4487
4202
|
visibleRange(range: TimeRange): void;
|
|
4488
4203
|
/** The visible logical (bar index) range moved. */
|
|
4489
4204
|
logicalRange(range: LogicalRange): void;
|
|
4205
|
+
/** The view left the live edge or came back to it: true while it sits back from it. Reported only
|
|
4206
|
+
* when the answer changes, so a scroll that stays away says nothing more. */
|
|
4207
|
+
liveEdge(away: boolean): void;
|
|
4208
|
+
/** The main pane's plot moved or resized within the host's element. */
|
|
4209
|
+
plotArea(area: PlotArea): void;
|
|
4490
4210
|
/** The chosen range preset changed, or navigation left the preset view. */
|
|
4491
4211
|
rangePreset(key: string | null): void;
|
|
4492
4212
|
/** A load, a page back or a live snapshot reshaped the bar series. */
|
|
@@ -4898,6 +4618,16 @@ interface SearchDisplayOptions {
|
|
|
4898
4618
|
* while exactly one is selected. */
|
|
4899
4619
|
classSelection?: 'single' | 'multiple';
|
|
4900
4620
|
}
|
|
4621
|
+
/** How the chart answers a finger, beyond what every chart does. */
|
|
4622
|
+
interface TouchOptions {
|
|
4623
|
+
/** The chart as a canvas under the finger: a one-finger drag on the plot releases the main price
|
|
4624
|
+
* scale's framing, as a drag on the price scale does, so the price follows the finger as freely
|
|
4625
|
+
* as the time, and nothing re-frames while the viewer pans, flicks or pinches; a pinch zooms the
|
|
4626
|
+
* time and leaves the price where it stands. A double-tap on the price scale, a new market or
|
|
4627
|
+
* timeframe, and `goLive` frame the bars again. Off by default: a drag moves the time alone while
|
|
4628
|
+
* the price scale frames the bars on screen. */
|
|
4629
|
+
freePan?: boolean;
|
|
4630
|
+
}
|
|
4901
4631
|
/** Everything needed to construct a widget. `container` and `datafeed` are the two hard
|
|
4902
4632
|
* requirements; every other field has a working default. */
|
|
4903
4633
|
interface ChartWidgetOptions extends MarkPainterHooks {
|
|
@@ -5143,6 +4873,8 @@ interface ChartWidgetOptions extends MarkPainterHooks {
|
|
|
5143
4873
|
/** Neutral bar marks and time-scale marks from the datafeed. On by default; `false` draws none
|
|
5144
4874
|
* even from a feed that serves them. */
|
|
5145
4875
|
marks?: boolean;
|
|
4876
|
+
/** How the chart answers a finger, beyond what every chart does. */
|
|
4877
|
+
touch?: TouchOptions;
|
|
5146
4878
|
}
|
|
5147
4879
|
|
|
5148
4880
|
/** Host-owned activity, displayed with indicators but never saved as an indicator or plotted. */
|
|
@@ -5538,29 +5270,6 @@ declare function openInputsEditor(container: HTMLElement, rect: {
|
|
|
5538
5270
|
* field's name and an enum's options are the manifest's own vocabulary and are not translated. */
|
|
5539
5271
|
strings?: ChartI18n): void;
|
|
5540
5272
|
|
|
5541
|
-
/** The three ways one market is written, from one rule. */
|
|
5542
|
-
interface SymbolNames {
|
|
5543
|
-
/** The compact mark a label wears at a glance: a pair closed up (`BTCUSDC`, `EURUSD`), otherwise
|
|
5544
|
-
* the bare ticker (`ES1!`, `AAPL`). A spread expression is its own mark, operators and all. */
|
|
5545
|
-
mark: string;
|
|
5546
|
-
/** The title a reading wears: a pair spaced (`BTC / USDC`), otherwise the feed's short name where
|
|
5547
|
-
* it stated one apart from the description, otherwise the bare ticker. */
|
|
5548
|
-
title: string;
|
|
5549
|
-
/** The description beside a mark: a pair spaced, otherwise the feed's long description, otherwise
|
|
5550
|
-
* the bare ticker, so a market never repeats its own mark for want of a name. */
|
|
5551
|
-
description: string;
|
|
5552
|
-
}
|
|
5553
|
-
/** How a market is named, from a resolved `SymbolInfo`, a search row, or the feed symbol alone
|
|
5554
|
-
* before either has landed.
|
|
5555
|
-
*
|
|
5556
|
-
* A pair market reads as `BTC / USDC` or `EUR / USD`, both sides in the codes the market itself
|
|
5557
|
-
* trades in, never a spelled-out currency name. The quote comes from `currencyCode`, and a ticker
|
|
5558
|
-
* written as a slash pair (`BTC/USD`) needs no currency to say so. Before a symbol resolves there
|
|
5559
|
-
* is no pair to write, so the bare ticker stands on its own rather than guessing at a quote. A
|
|
5560
|
-
* market that is not a pair keeps the feed's own words: the short name as its title, the long
|
|
5561
|
-
* description beside its mark. */
|
|
5562
|
-
declare function symbolNames(symbol: SymbolInfo | SymbolRow | string): SymbolNames;
|
|
5563
|
-
|
|
5564
5273
|
/** The `/symbols` fields this mapping reads. A server may send more; anything not listed here has
|
|
5565
5274
|
* no place in symbology. */
|
|
5566
5275
|
interface UdfSymbolResponse {
|
|
@@ -5885,4 +5594,4 @@ declare function mountTimeframePicker(options: TimeframePickerOptions & {
|
|
|
5885
5594
|
container: HTMLElement;
|
|
5886
5595
|
}): MountedTimeframePicker;
|
|
5887
5596
|
|
|
5888
|
-
export { ARRANGEMENTS, type AccessPolicy, type ActiveSubsession, type Arrangement, type AttachDrawingsOptions, BRAND_DOWN, BRAND_UP, BUILT_IN_INDICATORS, BUILT_IN_LOCALES, type
|
|
5597
|
+
export { ARRANGEMENTS, type AccessPolicy, type ActiveSubsession, type Arrangement, type AttachDrawingsOptions, BRAND_DOWN, BRAND_UP, BUILT_IN_INDICATORS, BUILT_IN_LOCALES, type BuiltInIndicator, CHART_ICON_IDS, CHART_STYLES, COLLAPSED_H, COMPARE_COLORS, type CanvasTheme, type Capabilities, ChartBody, type ChartChrome, type ChartCompareApi, type ChartCustomLocale, ChartDatafeed, type ChartDictionary, type ChartDrawingsApi, type ChartEvents, type ChartExtension, type ChartExtensionChart, type ChartExtensionCommand, type ChartExtensionContext, type ChartExtensionHandle, type ChartExtensionIcon, type ChartExtensionIconPath, type ChartExtensionMenuBuilder, type ChartExtensionMenuContext, type ChartExtensionMenuItem, type ChartExtensionPane, type ChartExtensionPriceLine, type ChartExtensionReplayState, type ChartExtensionScope, type ChartExtensionSeries, type ChartHandle, type ChartHistoryApi, type ChartI18n, type ChartI18nOptions, type ChartIconArtwork, type ChartIconContext, type ChartIconDiagnostic, type ChartIconFactory, type ChartIconFailure, type ChartIconId, type ChartIcons, type ChartLegendRow, type ChartLocale, type ChartLocaleCode, type ChartMenuAction, type ChartMenuContext, type ChartMenuIcon, type ChartMenuRow, ChartMessageKey, ChartMeta, type ChartOverrides, type ChartPaneSyncApi, type ChartPreferences, type ChartPriceFormatter, type ChartReplayApi, ChartSaveLoadAdapter, type ChartSaveLoadApi, type ChartStorage, type ChartStyleId, type ChartTimezone, type ChartTranslate, type ChartWidget, type ChartWidgetOptions, type CommandRegistry, type CommandResult, type CommandScope, type CommandSpec, type CompareDeps, type CompareEntry, type CompareHandle, type ComparePlacement, type CompareSnapshot, type CompareSymbol, type ContextMenuHandle, type CustomThemes, DEFAULT_OVERRIDES, DEFAULT_SUBSESSION, DEFAULT_TIMEZONE, type DataSourceMarkPainter, DataStatus, type DrawingApplyOutcome, DrawingAssetPort, DrawingContextKind, type DrawingDocumentApi, type DrawingDocumentPort, type DrawingDocumentRefusal, type DrawingEvent, type DrawingOwner, DrawingPreferences, type DrawingPresets, type DrawingReadOutcome, type DrawingRejection, type DrawingRejectionReason, DrawingResourceContext, DrawingsBody, type DrawingsEvents, type DrawingsHandle, DrawingsMeta, type DrawingsWorkflow, EXCHANGE_TIMEZONE, type FeatureConfig, FeedBar, type FetchLike, FillBetweenPrimitive, type FullscreenApi, type FullscreenOptions, type HistoryChange, type HistoryEventState, IMAGE_HEADER_H, type ImageApi, type ImageEvent, type ImageHeader, type ImageOptions, type ImageTextRun, type ImageTile, type IndicatorCategory, type IndicatorDefinition, type IndicatorEvent, type IndicatorFill, type IndicatorInstance, type IndicatorLevel, type IndicatorManifest, type IndicatorOverrides, type IndicatorPickerAction, type IndicatorPickerBuiltInState, type IndicatorPickerCollection, type IndicatorPickerItem, type IndicatorPickerSource, type IndicatorPlot, type IndicatorPlots, type IndicatorsApi, type IndicatorsRenderer, LAYOUT_MENU_ROWS, type LayoutApi, LayoutBody, type LayoutEvent, LayoutMeta, type LayoutOptions, type LayoutSaveLoadApi, type LayoutSyncFlags, type LegendUi, type LogicalRange, MAIN_MIN_H, MIN_BAR_SPACING, MIRRORED_ICONS, type ManifestFill, type ManifestInput, type ManifestLevel, type ManifestPlot, type ManifestRun, type MarkPainters, type MarketStatus, type MatchSegment, type MountedSymbolSearch, type MountedTimeframePicker, type OpenResource, PRICE_SCALE_MODE, type PaneOp, type PanePlan, type PaneRect, type PaneState, type PartialOverrides, type PlacedImage, type PlotArea, type PlotPoint, PriceFormat, PriceFormatter, RANGE_PRESETS, RECENT_SYMBOLS_CAP, REPLAY_SPEEDS, type RangeFrameTarget, type RangePreset, type RangeSpan, type RecentsPort, type ReplayEventState, type ReplaySpeed, type ResourceLoadOutcome, ResourceRef, type ResourceRemoveOutcome, type ResourceSaveOutcome, ResourceStore, SCALE_MODES, SCALE_MODE_OPTIONS, SCROLL_STEP_BARS, SESSION_DOT, SESSION_LABEL, SESSION_STATE_TITLE, SPREAD_OPERATORS, type SaveConflictInfo, type ScaleMode, type SearchClassFilter, SearchClassNode, type SearchController, type SearchControllerOptions, type SearchDisplayOptions, type SearchScope, type SearchState, type SelectedDrawing, type SemanticTheme, type SessionBandsPrimitive, type SessionModel, type SessionSchedule, type SessionSegment, type SessionSource, type SessionState, type SessionTimeline, type SettingsMenuUi, ShadePrimitive, type SpreadOperator, type SpreadOperatorId, type SubsessionSource, SymbolInfo, type SymbolMarkPainter, type SymbolPriceFormat, SymbolRow, type SymbolSearchCache, type SymbolSearchHandle, type SymbolSearchOptions, THEME_ROLES, TIMEFRAME_MAX, TIMEFRAME_PRESETS, TIMEFRAME_PRESET_TOKENS, TIMEFRAME_UNITS, TIMEFRAME_UNIT_NAME, TIMEFRAME_UNIT_SECONDS, TIMEZONES, TOP_BAR_SLOTS, TemplateBody, TemplateMeta, type TextEditSession, type ThemeChangeListener, type ThemeController, type ThemeControllerOptions, type ThemeDeclaration, type ThemeDiagnostic, type ThemeDiagnosticCode, type ThemeMode, type ThemeOptions, type ThemeRole, type ThemeRoleFamily, type ThemeRoleId, type ThemeRoleKind, type ThemeRootStyle, type TimeRange, type Timeframe, type TimeframeGroup, type TimeframePickerHandle, type TimeframePickerOptions, type TimeframeRestrictions, type TimeframeUnit, type TimezoneRow, type ToolbarButton, type ToolbarButtonOptions, type ToolbarButtonState, type TopBarSlot, type TopBarUi, type TouchOptions, type UdfDatafeedOptions, type UdfSymbolResponse, type UiConfig, type VenueMarkPainter, type WidgetEvents, ZOOM_FACTOR, type ZoneClock, allowedTimeframes, applyBar, applyPlotOverrides, arrangementName, arrangementOf, attachCompare, attachDrawings, attachIndicators, autoTimeframeFor, buildManifestPlots, canvasTheme, canvasToBlob, chartContextMenu, chartDictionaries, chartIconArtwork, clipToWindow, coerceChartStyle, coerceScaleMode, compareTimeframes, composeFormingBar, composeImage, createChart, createChartI18n, createSearchController, createSessionBands, createSymbolSearchCache, createThemeController, createUdfDatafeed, effectivePlotColor, exchangeTimezoneText, formatClock, formatDuration, formatTimeframe, frameRange, hasExtendedHours, imageFileName, imageHeaderRuns, imageLayoutHeaderRuns, imageTileRuns, indicatorHidden, isChartStyle, isCollapsed, isIntradayTimeframe, isSymbolPair, isTimezoneChoice, latestPlotValue, layerOverrides, looksLikeSpread, makeCrosshairTimeFormatter, makeTickMarkFormatter, manifestInputDefaults, marketStatus, marketStatusFor, marketStatusText, marketStatusTitle, matchSegments, memoryChartStorage, memoryRecents, mergeOverrides, mountContextMenu, mountSymbolSearch, mountTimeframePicker, nextSessionChange, openInputsEditor, openSymbolSearch, openTimeframePicker, overriddenManifest, parseSessionModel, parseTimeframe, pickCompareColor, placeableByWidget, planPaneOp, promoteRecent, rangeAvailable, rangePresetTip, rangeSpanSeconds, resolveDisplayTimezone, resolveInitialTf, scrolledPosition, seriesTargetOf, sessionStateAt, sessionTimeline, spreadExpression, spreadSearchQuery, subTimeframesFor, subsessionBarFilter, tfSeconds, tfToUdfResolution, timeframeAllowed, timeframeGroupUnit, timeframeLabel, timeframeOrder, timeframeSeconds, timezoneCity, timezoneLabel, timezoneListing, toolName, tzOffsetLabel, tzOffsetMinutes, udfPriceFormat, udfResolutionToTf, udfSymbolInfo, valueShaped, withFoldedHistory, zoneClock, zoomedBarSpacing };
|