@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
|
@@ -225,4 +225,4 @@ interface MemoryResourcesOptions {
|
|
|
225
225
|
* own store, created on first ask and kept, so two calls for one context see the same document. */
|
|
226
226
|
declare function memorySaveLoadAdapter(options?: MemoryResourcesOptions): ChartSaveLoadAdapter;
|
|
227
227
|
|
|
228
|
-
export { type ChartSaveLoadAdapter as C, DRAWING_CONTEXT_VERSION as D, type LayoutSharedDrawingContext as L, type MemoryResourcesOptions as M, type
|
|
228
|
+
export { type ChartSaveLoadAdapter as C, DRAWING_CONTEXT_VERSION as D, type LayoutSharedDrawingContext as L, type MemoryResourcesOptions as M, type ResourceStore as R, type SymbolGlobalDrawingContext as S, type TemplateMeta as T, type WriteOutcome as W, type TemplateBody as a, type ResourceRef as b, type ChartLocalDrawingContext as c, DRAWING_DOCUMENT_VERSION as d, type DrawingContextKind as e, type DrawingEntry as f, type DrawingGroup as g, type DrawingResourceContext as h, type DrawingTombstone as i, type DrawingsBody as j, drawingContextKey as k, emptyDrawingDocument as l, liveDrawingEntries as m, liveDrawingGroups as n, mergeDrawingDocuments as o, parseDrawingDocument as p, type ChartMeta as q, reviseDrawingDocument as r, sameDrawingContext as s, type ChartBody as t, type DrawingsMeta as u, type LayoutMeta as v, type LayoutBody as w, ResourceAbortError as x, type TemplateKind as y, memorySaveLoadAdapter as z };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/** How one symbol's prices are WRITTEN, in five facts. Together they express
|
|
2
|
+
* every supported form: decimal, pip, fractional, fraction of a fraction, and variable tick.
|
|
3
|
+
*
|
|
4
|
+
* - `pricescale` — price units per whole unit. 100 writes cents, 100000 writes FX pipettes,
|
|
5
|
+
* 100000000 writes satoshis, 32 writes thirty-seconds. It alone sets the decimal column width.
|
|
6
|
+
* - `minmov` — the smallest move, in those units. It declares the grid a price moves on; it never
|
|
7
|
+
* widens or narrows the decimal column (ES at `{100, 25}` writes 4500.25, the same two decimals
|
|
8
|
+
* as `{100, 1}`).
|
|
9
|
+
* - `minmove2` — the further division of one `minmov` step for a fraction-of-a-fraction market:
|
|
10
|
+
* 4 means quarters of a thirty-second.
|
|
11
|
+
* - `fractional` — write the sub-unit part as a counted fraction (110'16) instead of decimals.
|
|
12
|
+
* - `variableTickSize` — an ordered ladder of tick sizes by price band, written as a
|
|
13
|
+
* space-separated string: alternating tick and upper bound, ending with the tick that applies
|
|
14
|
+
* 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
|
|
15
|
+
* above 100. The band a price falls in is a DECLARED fact of the symbol, not a guess from its
|
|
16
|
+
* magnitude. */
|
|
17
|
+
interface PriceFormat {
|
|
18
|
+
pricescale: number;
|
|
19
|
+
minmov: number;
|
|
20
|
+
minmove2?: number;
|
|
21
|
+
fractional?: boolean;
|
|
22
|
+
variableTickSize?: string;
|
|
23
|
+
}
|
|
24
|
+
/** How live the served data is, in three states. `delayed_streaming` is a real
|
|
25
|
+
* stream behind a delay, not a degraded `streaming`. */
|
|
26
|
+
type DataStatus = 'streaming' | 'endofday' | 'delayed_streaming';
|
|
27
|
+
/** The subsession ids a symbol may name. `regular` is the weekly `session`; `premarket` and
|
|
28
|
+
* `postmarket` are the extended spans before and after it; `extended` is the whole span from
|
|
29
|
+
* pre-market open through post-market close. */
|
|
30
|
+
type SubsessionId = 'regular' | 'extended' | 'premarket' | 'postmarket';
|
|
31
|
+
/** One named session of a market with extended hours. `session`
|
|
32
|
+
* uses the grammar of `SymbolInfo.session`; `sessionCorrections` uses the grammar of
|
|
33
|
+
* `SymbolInfo.corrections` and lists only the days that shorten THIS subsession. `description`
|
|
34
|
+
* is a label a feed may state; the chart labels a subsession by its `id` from its own catalog. */
|
|
35
|
+
interface Subsession {
|
|
36
|
+
id: SubsessionId;
|
|
37
|
+
session: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
sessionCorrections?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Resolved metadata for ONE symbol: everything the chart needs to title it, page it, session it,
|
|
42
|
+
* and write its prices.
|
|
43
|
+
*
|
|
44
|
+
* `timezone`, `session`, `sessionHolidays`, `corrections` and `subsessions` are the
|
|
45
|
+
* exchange-hours facts and travel with the symbol. The chart's session model (`sessionModel.ts`)
|
|
46
|
+
* is built from them alone: market state, session shading, the regular-hours filter and the
|
|
47
|
+
* status popup all read what the feed said, and a feed that states no extended hours gets none. */
|
|
48
|
+
interface SymbolInfo {
|
|
49
|
+
/** The symbol the datafeed answers to on every later call. */
|
|
50
|
+
ticker: string;
|
|
51
|
+
/** The short display identity, e.g. 'ESZ2026'. */
|
|
52
|
+
name: string;
|
|
53
|
+
/** The long human description, e.g. 'E-mini S&P 500 Dec 2026'. */
|
|
54
|
+
description: string;
|
|
55
|
+
/** The venue a UI attributes the symbol to. */
|
|
56
|
+
exchange: string;
|
|
57
|
+
/** The venue that actually lists it, when it differs from `exchange`. */
|
|
58
|
+
listedExchange: string;
|
|
59
|
+
/** The venue's own type token, e.g. 'futures', 'stock', 'crypto', 'forex'. */
|
|
60
|
+
type: string;
|
|
61
|
+
/** The resolutions this symbol serves, as chart timeframe tokens ('1m', '4h', '1d', '1mo'). An
|
|
62
|
+
* EMPTY list declares no restriction: the feed serves any token the grammar admits (a futures
|
|
63
|
+
* or spread feed says exactly this), and the chart never reads it as "serves nothing". A finite
|
|
64
|
+
* list is a promise the chart may enforce. */
|
|
65
|
+
supportedResolutions: readonly string[];
|
|
66
|
+
/** The exchange's IANA zone, e.g. 'America/New_York'. */
|
|
67
|
+
timezone: string;
|
|
68
|
+
/** The session string, e.g. '1700-1600' or '0930-1600'. */
|
|
69
|
+
session: string;
|
|
70
|
+
/** The session-holidays string: comma-separated 'YYYYMMDD' full closures. */
|
|
71
|
+
sessionHolidays?: string;
|
|
72
|
+
/** The corrections string: `;`-separated `<session>:<dates>` entries, each a session in
|
|
73
|
+
* the grammar of `session` that holds on the `,`-separated 'YYYYMMDD' trading days named. A
|
|
74
|
+
* correction outranks a holiday on the same date. */
|
|
75
|
+
corrections?: string;
|
|
76
|
+
/** The symbol's named sessions, for a market whose exchange keeps extended hours. Absent for a
|
|
77
|
+
* market with one continuous session. */
|
|
78
|
+
subsessions?: readonly Subsession[];
|
|
79
|
+
dataStatus: DataStatus;
|
|
80
|
+
/** ISO 4217 for a money-quoted symbol; absent when the quote unit is not a currency. */
|
|
81
|
+
currencyCode?: string;
|
|
82
|
+
/** The unit a non-currency symbol is quoted in, e.g. an energy or weight unit id. */
|
|
83
|
+
unitId?: string;
|
|
84
|
+
/** Decimal places for a volume value. 0 for a whole-contract market. */
|
|
85
|
+
volumePrecision: number;
|
|
86
|
+
format: PriceFormat;
|
|
87
|
+
}
|
|
88
|
+
/** One band of a `variableTickSize` ladder: `size` is the tick that applies to prices strictly below
|
|
89
|
+
* `below`, and the last band's `below` is `Infinity`. */
|
|
90
|
+
interface TickBand {
|
|
91
|
+
/** The tick size in this band. */
|
|
92
|
+
size: number;
|
|
93
|
+
/** The exclusive upper bound of the band. */
|
|
94
|
+
below: number;
|
|
95
|
+
}
|
|
96
|
+
/** Parse the space-separated variable-tick ladder into ordered bands. Returns an
|
|
97
|
+
* empty array for a string the grammar cannot read, which is how a caller tells "no ladder" from
|
|
98
|
+
* "a ladder I must honour" without guessing at a half-parsed one. */
|
|
99
|
+
declare function parseTickBands(variableTickSize: string): TickBand[];
|
|
100
|
+
/** The band a price falls in, by the ladder's declared bounds (magnitude of the SYMBOL's own
|
|
101
|
+
* declared ladder, never a generic magnitude rule). Negative prices read on their absolute value,
|
|
102
|
+
* so a spread writes both sides in one column. */
|
|
103
|
+
declare function tickBandFor(bands: readonly TickBand[], price: number): TickBand | null;
|
|
104
|
+
|
|
105
|
+
export { type DataStatus as D, type PriceFormat as P, type SymbolInfo as S, type TickBand as T, type Subsession as a, type SubsessionId as b, parseTickBands as p, tickBandFor as t };
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { S as SymbolInfo } from './symbology-D3SLclrU.js';
|
|
2
|
+
|
|
3
|
+
/** The theme roles a mark may wear. A host names a meaning and the mode resolves the color, so a
|
|
4
|
+
* mark stays readable when the viewer switches to light. */
|
|
5
|
+
type MarkColorRole = 'neutral' | 'up' | 'down' | 'info' | 'warning' | 'positive' | 'negative';
|
|
6
|
+
/** Where a bar mark sits relative to its bar. */
|
|
7
|
+
type MarkPlacement = 'above' | 'below';
|
|
8
|
+
/** The glyph a bar mark draws. */
|
|
9
|
+
type MarkShape = 'circle' | 'square' | 'arrowUp' | 'arrowDown';
|
|
10
|
+
/** One mark on a bar. */
|
|
11
|
+
interface BarMark {
|
|
12
|
+
/** Stable within one symbol and window, so a refetch replaces rather than duplicates. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Epoch SECONDS at the bar's bucket open, the same clock every bar uses. */
|
|
15
|
+
time: number;
|
|
16
|
+
color: MarkColorRole;
|
|
17
|
+
/** The letter or two the glyph carries. */
|
|
18
|
+
text?: string;
|
|
19
|
+
/** The longer words a host would show beside the mark. Carried, never drawn by the chart. */
|
|
20
|
+
label?: string;
|
|
21
|
+
shape?: MarkShape;
|
|
22
|
+
placement?: MarkPlacement;
|
|
23
|
+
}
|
|
24
|
+
/** One mark under the time scale. */
|
|
25
|
+
interface TimescaleMark {
|
|
26
|
+
id: string;
|
|
27
|
+
/** Epoch SECONDS. */
|
|
28
|
+
time: number;
|
|
29
|
+
color: MarkColorRole;
|
|
30
|
+
label?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** One OHLCV bar on the wire: `t` = epoch SECONDS at bucket open (never milliseconds, never an
|
|
34
|
+
* update's wall time), strictly ascending within any batch, one bar per timestamp. */
|
|
35
|
+
interface FeedBar {
|
|
36
|
+
t: number;
|
|
37
|
+
o: number;
|
|
38
|
+
h: number;
|
|
39
|
+
l: number;
|
|
40
|
+
c: number;
|
|
41
|
+
v: number;
|
|
42
|
+
}
|
|
43
|
+
/** A symbol-search result row. `exchange` names the venue the market lists on. `dataSource` names
|
|
44
|
+
* where the market's data comes from, and a row names one only when that source publishes the
|
|
45
|
+
* symbol's data. The row's source cell shows the venue, or the data source for a row with none. */
|
|
46
|
+
interface SymbolRow {
|
|
47
|
+
symbol: string;
|
|
48
|
+
name: string;
|
|
49
|
+
exchange: string;
|
|
50
|
+
type: string;
|
|
51
|
+
dataSource?: string | null;
|
|
52
|
+
/** What the market is priced in, when the feed knows it here. A PAIR market writes itself as
|
|
53
|
+
* `BASE / QUOTE` wherever it is named, and a ticker alone cannot say what the quote is; a row
|
|
54
|
+
* without it keeps the name the feed sent instead. `resolve()` states the same fact for the
|
|
55
|
+
* charted symbol, so a row and the legend that follows it agree. */
|
|
56
|
+
currencyCode?: string;
|
|
57
|
+
}
|
|
58
|
+
interface SearchPage {
|
|
59
|
+
hits: SymbolRow[];
|
|
60
|
+
/** Exact: another page exists at offset + hits.length (never a guess at a page boundary). */
|
|
61
|
+
hasMore: boolean;
|
|
62
|
+
}
|
|
63
|
+
interface HistoryPage {
|
|
64
|
+
bars: FeedBar[];
|
|
65
|
+
/** True when a countBack ask found NOTHING — the "no more history, stop scrolling back" signal.
|
|
66
|
+
* Plain from/to asks never set it (an empty window can be a mid-history gap). */
|
|
67
|
+
noData: boolean;
|
|
68
|
+
/** OPTIONAL gap hint on an EMPTY page that is not the end of history: the epoch-seconds time of
|
|
69
|
+
* the closest bar older than the asked window (a market holiday between `to` and the data).
|
|
70
|
+
* A consumer may retry ONCE with `to = nextTime` to jump the gap instead of dead-ending —
|
|
71
|
+
* {@link olderPageVerdict} is that rule. Feeds without the concept simply never set it. */
|
|
72
|
+
nextTime?: number;
|
|
73
|
+
}
|
|
74
|
+
type OlderPageVerdict = {
|
|
75
|
+
kind: 'bars';
|
|
76
|
+
} | {
|
|
77
|
+
kind: 'hop';
|
|
78
|
+
to: number;
|
|
79
|
+
} | {
|
|
80
|
+
kind: 'end';
|
|
81
|
+
} | {
|
|
82
|
+
kind: 'stop';
|
|
83
|
+
};
|
|
84
|
+
/** The one scroll-back rule for an older-history page, shared by every paging consumer so the gap
|
|
85
|
+
* semantics can't drift between them:
|
|
86
|
+
* - `bars` — the page has data; prepend it (bars are never discarded, whatever flags ride along).
|
|
87
|
+
* - `hop` — empty but `nextTime` points strictly older and this ask wasn't already a hop: re-ask
|
|
88
|
+
* once anchored there (the session-gap answer). One hop per gap keeps a lying feed bounded —
|
|
89
|
+
* an honest hint names a real bar, so the hop can't come back empty.
|
|
90
|
+
* - `end` — empty, `noData`, and no hint: feed inception, the one verdict that seals scroll-back.
|
|
91
|
+
* - `stop` — every other empty page (a transient, or an unusable hint): end this flight WITHOUT
|
|
92
|
+
* sealing; the next gesture asks again. */
|
|
93
|
+
declare function olderPageVerdict(page: HistoryPage, askedTo: number, alreadyHopped: boolean): OlderPageVerdict;
|
|
94
|
+
/** Push events from a live bar subscription. A `snapshot` REPLACES the recent window (delivered on
|
|
95
|
+
* connect and on every transport reconnect — the feed's self-healing re-sync); a `bar` mutates the
|
|
96
|
+
* last bar or appends the next one (bucket-open time). */
|
|
97
|
+
type BarsEvent = {
|
|
98
|
+
kind: 'snapshot';
|
|
99
|
+
bars: FeedBar[];
|
|
100
|
+
} | {
|
|
101
|
+
kind: 'bar';
|
|
102
|
+
bar: FeedBar;
|
|
103
|
+
};
|
|
104
|
+
interface SubscribeHandlers {
|
|
105
|
+
onBars(e: BarsEvent): void;
|
|
106
|
+
/** Feed status codes: 'live' | 'no-data' | server codes ('not_entitled', 'feed_down', …). */
|
|
107
|
+
onStatus?(status: string): void;
|
|
108
|
+
}
|
|
109
|
+
/** Thrown by `history` when the backend has NO feed configured for the symbol — a TERMINAL state
|
|
110
|
+
* (the chart shows "market data unavailable" and closes the live subscription), unlike a transient
|
|
111
|
+
* fetch failure which is retried. */
|
|
112
|
+
declare class FeedUnavailableError extends Error {
|
|
113
|
+
/** The server's typed refusal (e.g. not_entitled / feed_down),
|
|
114
|
+
* when it sent one — lets the host name the actual cause instead of a generic "unavailable". */
|
|
115
|
+
readonly code: string | null;
|
|
116
|
+
constructor(message?: string,
|
|
117
|
+
/** The server's typed refusal (e.g. not_entitled / feed_down),
|
|
118
|
+
* when it sent one — lets the host name the actual cause instead of a generic "unavailable". */
|
|
119
|
+
code?: string | null);
|
|
120
|
+
}
|
|
121
|
+
/** One class in a feed's catalog that holds narrower classes: a `spot` class over its `usdc` and
|
|
122
|
+
* `usdt` quotes, say. `id` is the token the feed is searched with, as a plain string entry is, and
|
|
123
|
+
* `children` are the narrower classes, as tokens or nodes of their own. The search renders two
|
|
124
|
+
* levels, a top-level class and its children: a child's own `children` are not offered, and the
|
|
125
|
+
* child narrows by its `id` alone. */
|
|
126
|
+
interface SearchClassNode {
|
|
127
|
+
readonly id: string;
|
|
128
|
+
readonly children?: readonly (string | SearchClassNode)[];
|
|
129
|
+
}
|
|
130
|
+
/** What a feed's `search` is asked with. `cls` and `classes` say which classes to narrow to; both
|
|
131
|
+
* absent is every class. */
|
|
132
|
+
interface DatafeedSearchOptions {
|
|
133
|
+
/** One class to narrow to. When the viewer may select several classes it is set only while
|
|
134
|
+
* exactly one is selected, so a feed that reads `cls` alone still narrows a single chip. */
|
|
135
|
+
cls?: string;
|
|
136
|
+
/** Every class to narrow to, sent only when the search lets the viewer select several classes at
|
|
137
|
+
* once: a row matches when it is in any of them. A feed may ignore it and read `cls` alone. */
|
|
138
|
+
classes?: readonly string[];
|
|
139
|
+
limit?: number;
|
|
140
|
+
offset?: number;
|
|
141
|
+
}
|
|
142
|
+
/** A feed's coarse, feed-LEVEL capability declaration. Everything optional and the method itself
|
|
143
|
+
* optional: an ABSENT declaration means unconstrained, and a feed must only
|
|
144
|
+
* declare what is true — a finite `resolutions` list from a feed that serves any timeframe would
|
|
145
|
+
* be a lie the chart then enforces. Symbol-level truth (price format, resolutions, session) stays
|
|
146
|
+
* on {@link SymbolInfo}. */
|
|
147
|
+
interface DatafeedConfig {
|
|
148
|
+
/** The wire timeframe tokens this feed can serve ('1m', '4h', '1d', …). Absent = any. */
|
|
149
|
+
resolutions?: readonly string[];
|
|
150
|
+
/** Asset-class tokens the catalog carries, in the order the search offers them. An entry is a
|
|
151
|
+
* token, or a {@link SearchClassNode} whose children the search offers beneath it once it is
|
|
152
|
+
* selected. Absent = unspecified. */
|
|
153
|
+
classes?: readonly (string | SearchClassNode)[];
|
|
154
|
+
}
|
|
155
|
+
/** The datafeed a chart consumes. Implementations must follow the bar rules on {@link FeedBar} and
|
|
156
|
+
* {@link BarsEvent}; everything else (transport, caching, auth) is the implementation's business. */
|
|
157
|
+
interface ChartDatafeed {
|
|
158
|
+
/** OPTIONAL capability negotiation, read once at mount: the widget constrains itself to what the
|
|
159
|
+
* feed declares (e.g. its initial timeframe must be servable). Omit it entirely when the feed
|
|
160
|
+
* has no fixed capability set. */
|
|
161
|
+
config?(): Promise<DatafeedConfig>;
|
|
162
|
+
/** Server-side symbol search, paged. `cls` narrows to one asset class ('' / absent = all), and
|
|
163
|
+
* `classes`, when present, to any of several (see {@link DatafeedSearchOptions}). */
|
|
164
|
+
search(q: string, opts?: DatafeedSearchOptions): Promise<SearchPage>;
|
|
165
|
+
/** Resolve one symbol's metadata; null when the symbol is unknown to the feed's catalogs. */
|
|
166
|
+
resolve(symbol: string): Promise<SymbolInfo | null>;
|
|
167
|
+
/** Historical sealed bars: a [from,to] window (epoch seconds, INCLUSIVE of both ends — the chart
|
|
168
|
+
* pages with `to = oldest − 1` and never re-requests a bar it holds), or `countBack` = the LAST
|
|
169
|
+
* N bars at/before `to` (outranks `from`; the count is an obligation — reach across closures).
|
|
170
|
+
* No range = the feed's default recent window. Throws {@link FeedUnavailableError} when no feed
|
|
171
|
+
* serves the symbol. */
|
|
172
|
+
history(symbol: string, tf: string, range?: {
|
|
173
|
+
from?: number;
|
|
174
|
+
to?: number;
|
|
175
|
+
countBack?: number;
|
|
176
|
+
}): Promise<HistoryPage>;
|
|
177
|
+
/** Live bar push for one (symbol, timeframe). Returns the unsubscribe. The transport owns
|
|
178
|
+
* reconnection and re-syncs by emitting a fresh `snapshot`. */
|
|
179
|
+
subscribeBars(symbol: string, tf: string, handlers: SubscribeHandlers): () => void;
|
|
180
|
+
/** Server clock (epoch seconds) — countdown skew correction. Optional: a feed without one leaves
|
|
181
|
+
* the chart on the client clock. */
|
|
182
|
+
serverTime?(): Promise<number>;
|
|
183
|
+
/** OPTIONAL depth of history for a symbol: the epoch seconds of its earliest available bar, or
|
|
184
|
+
* null when the feed does not know. The range presets read it (a listing from last year offers
|
|
185
|
+
* no five-year range); the chart never probes for it. Omit it entirely when the feed cannot
|
|
186
|
+
* say, and every preset is offered. */
|
|
187
|
+
earliestBar?(symbol: string): Promise<number | null>;
|
|
188
|
+
/** OPTIONAL neutral bar marks over a window (epoch seconds, inclusive of both ends). A mark is a
|
|
189
|
+
* note about a moment: its color is a theme role, its words are the host's, and the chart
|
|
190
|
+
* draws it as given. Omit it entirely when the feed serves none. */
|
|
191
|
+
marks?(symbol: string, from: number, to: number, resolution: string): Promise<readonly BarMark[]>;
|
|
192
|
+
/** OPTIONAL neutral time-scale marks over the same window. */
|
|
193
|
+
timescaleMarks?(symbol: string, from: number, to: number, resolution: string): Promise<readonly TimescaleMark[]>;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** The ticker inside a feed symbol. Only a well-formed `VENUE:TICKER` sheds its prefix; a spread
|
|
197
|
+
* expression, or anything else the pattern does not admit, is its own label and passes through. */
|
|
198
|
+
declare function bareTicker(symbol: string): string;
|
|
199
|
+
/** The three ways one market is written, from one rule. */
|
|
200
|
+
interface SymbolNames {
|
|
201
|
+
/** The compact mark a label wears at a glance: a pair closed up (`BTCUSDC`, `EURUSD`), otherwise
|
|
202
|
+
* the bare ticker (`ES1!`, `AAPL`). A spread expression is its own mark, operators and all. */
|
|
203
|
+
mark: string;
|
|
204
|
+
/** The title a reading wears: a pair spaced (`BTC / USDC`), otherwise the feed's short name where
|
|
205
|
+
* it stated one apart from the description, otherwise the bare ticker. */
|
|
206
|
+
title: string;
|
|
207
|
+
/** The description beside a mark: a pair spaced, otherwise the feed's long description, otherwise
|
|
208
|
+
* the bare ticker, so a market never repeats its own mark for want of a name. */
|
|
209
|
+
description: string;
|
|
210
|
+
}
|
|
211
|
+
/** How a market is named, from a resolved `SymbolInfo`, a search row, or the feed symbol alone
|
|
212
|
+
* before either has landed.
|
|
213
|
+
*
|
|
214
|
+
* A pair market reads as `BTC / USDC` or `EUR / USD`, both sides in the codes the market itself
|
|
215
|
+
* trades in, never a spelled-out currency name. The quote comes from `currencyCode`, and a ticker
|
|
216
|
+
* written as a slash pair (`BTC/USD`) needs no currency to say so. Before a symbol resolves there
|
|
217
|
+
* is no pair to write, so the bare ticker stands on its own rather than guessing at a quote. A
|
|
218
|
+
* market that is not a pair keeps the feed's own words: the short name as its title, the long
|
|
219
|
+
* description beside its mark. */
|
|
220
|
+
declare function symbolNames(symbol: SymbolInfo | SymbolRow | string): SymbolNames;
|
|
221
|
+
|
|
222
|
+
export { type BarMark as B, type ChartDatafeed as C, type DatafeedConfig as D, type FeedBar as F, type HistoryPage as H, type MarkColorRole as M, type OlderPageVerdict as O, type SymbolRow as S, type TimescaleMark as T, type SearchClassNode as a, type BarsEvent as b, type DatafeedSearchOptions as c, FeedUnavailableError as d, type MarkPlacement as e, type MarkShape as f, type SearchPage as g, type SubscribeHandlers as h, type SymbolNames as i, bareTicker as j, olderPageVerdict as o, symbolNames as s };
|
package/dist/symbols.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trdrs/quickcharts",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Quick Charts: a datafeed-driven charting library with drawings, indicators, layouts and replay over host-supplied data and storage ports.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"charts",
|
|
@@ -41,6 +41,18 @@
|
|
|
41
41
|
"types": "./dist/adapters/rest.d.ts",
|
|
42
42
|
"import": "./dist/adapters/rest.js"
|
|
43
43
|
},
|
|
44
|
+
"./format": {
|
|
45
|
+
"types": "./dist/format.d.ts",
|
|
46
|
+
"import": "./dist/format.js"
|
|
47
|
+
},
|
|
48
|
+
"./glyphs": {
|
|
49
|
+
"types": "./dist/glyphs.d.ts",
|
|
50
|
+
"import": "./dist/glyphs.js"
|
|
51
|
+
},
|
|
52
|
+
"./symbols": {
|
|
53
|
+
"types": "./dist/symbols.d.ts",
|
|
54
|
+
"import": "./dist/symbols.js"
|
|
55
|
+
},
|
|
44
56
|
"./styles.css": "./dist/quickcharts.css"
|
|
45
57
|
},
|
|
46
58
|
"files": [
|