Release v25.002 (from ea00b60e)
Fixes tradingview/charting_library#4226 Fixes tradingview/charting_library#7466 Fixes tradingview/charting_library#7722 Fixes tradingview/charting_library#7732
This commit is contained in:
47
charting_library/datafeed-api.d.ts
vendored
47
charting_library/datafeed-api.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Datafeed JS API for TradingView Charting Library
|
||||
* Datafeed JS API for TradingView Advanced Charts
|
||||
* @packageDocumentation
|
||||
* @module Datafeed
|
||||
*/
|
||||
@@ -28,7 +28,7 @@ export interface Bar {
|
||||
/** Bar time.
|
||||
* Amount of **milliseconds** since Unix epoch start in **UTC** timezone.
|
||||
* `time` for daily, weekly, and monthly bars is expected to be a trading day (not session start day) at 00:00 UTC.
|
||||
* Charting Library adjusts time according to `session` from {@link LibrarySymbolInfo}.
|
||||
* The library adjusts time according to `session` from {@link LibrarySymbolInfo}.
|
||||
*/
|
||||
time: number;
|
||||
/** Opening price */
|
||||
@@ -208,8 +208,8 @@ export interface HistoryMetadata {
|
||||
}
|
||||
export interface IDatafeedChartApi {
|
||||
/**
|
||||
* The Library calls this function to get marks for visible bars range.
|
||||
* The Library assumes that you will call `onDataCallback` only once per `getMarks` call.
|
||||
* The library calls this function to get marks for visible bars range.
|
||||
* The library assumes that you will call `onDataCallback` only once per `getMarks` call.
|
||||
*
|
||||
* A few marks per bar are allowed (for now, the maximum is 10). The time of each mark must match the time of a bar. For example, if the bar times are `2023-01-01`, `2023-01-08`, and `2023-01-15`, then a mark cannot have the time `2023-01-05`.
|
||||
*
|
||||
@@ -223,8 +223,8 @@ export interface IDatafeedChartApi {
|
||||
*/
|
||||
getMarks?(symbolInfo: LibrarySymbolInfo, from: number, to: number, onDataCallback: GetMarksCallback<Mark>, resolution: ResolutionString): void;
|
||||
/**
|
||||
* The Library calls this function to get timescale marks for visible bars range.
|
||||
* The Library assumes that you will call `onDataCallback` only once per `getTimescaleMarks` call.
|
||||
* The library calls this function to get timescale marks for visible bars range.
|
||||
* The library assumes that you will call `onDataCallback` only once per `getTimescaleMarks` call.
|
||||
*
|
||||
* **Remark:** This function will be called only if you confirmed that your back-end is supporting marks ({@link DatafeedConfiguration.supports_timescale_marks}).
|
||||
*
|
||||
@@ -237,7 +237,7 @@ export interface IDatafeedChartApi {
|
||||
getTimescaleMarks?(symbolInfo: LibrarySymbolInfo, from: number, to: number, onDataCallback: GetMarksCallback<TimescaleMark>, resolution: ResolutionString): void;
|
||||
/**
|
||||
* This function is called if configuration flag supports_time is set to true when chart needs to know the server time.
|
||||
* The charting library expects callback to be called once.
|
||||
* The library expects callback to be called once.
|
||||
* The time is provided without milliseconds. Example: `1445324591`. It is used to display Countdown on the price scale.
|
||||
*/
|
||||
getServerTime?(callback: ServerTimeCallback): void;
|
||||
@@ -270,8 +270,8 @@ export interface IDatafeedChartApi {
|
||||
*/
|
||||
getBars(symbolInfo: LibrarySymbolInfo, resolution: ResolutionString, periodParams: PeriodParams, onResult: HistoryCallback, onError: ErrorCallback): void;
|
||||
/**
|
||||
* Charting Library calls this function when it wants to receive real-time updates for a symbol.
|
||||
* The Library assumes that you will call the callback provided by the `onTick` parameter every time you want to update the most recent bar or to add a new one.
|
||||
* The library calls this function when it wants to receive real-time updates for a symbol.
|
||||
* The library assumes that you will call the callback provided by the `onTick` parameter every time you want to update the most recent bar or to add a new one.
|
||||
*
|
||||
* @param symbolInfo A SymbolInfo object
|
||||
* @param resolution Resolution of the symbol
|
||||
@@ -319,7 +319,7 @@ export interface IDatafeedChartApi {
|
||||
export interface IDatafeedQuotesApi {
|
||||
/**
|
||||
* This function is called when the library needs quote data.
|
||||
* The charting library assumes that `onDataCallback` is called once when all the requested data is received.
|
||||
* The library assumes that `onDataCallback` is called once when all the requested data is received.
|
||||
* @param {string[]} symbols - symbol names.
|
||||
* @param {QuotesCallback} onDataCallback - callback to return the requested data.
|
||||
* @param {QuotesErrorCallback} onErrorCallback - callback for responding with an error.
|
||||
@@ -344,7 +344,7 @@ export interface IDatafeedQuotesApi {
|
||||
export interface IExternalDatafeed {
|
||||
/**
|
||||
* This call is intended to provide the object filled with the configuration data.
|
||||
* Charting Library assumes that you will call the callback function and pass your datafeed {@link DatafeedConfiguration} as an argument.
|
||||
* The lib assumes that you will call the callback function and pass your datafeed {@link DatafeedConfiguration} as an argument.
|
||||
*
|
||||
* @param {OnReadyCallback} callback - callback to return your datafeed configuration ({@link DatafeedConfiguration}) to the library.
|
||||
*/
|
||||
@@ -567,13 +567,13 @@ export interface LibrarySymbolInfo {
|
||||
/**
|
||||
* It is an array containing resolutions that include seconds (excluding postfix) that the data feed provides.
|
||||
* E.g., if the data feed supports resolutions such as `["1S", "5S", "15S"]`, but has 1-second bars for some symbols then you should set `seconds_multipliers` of this symbol to `[1]`.
|
||||
* This will make Charting Library build 5S and 15S resolutions by itself.
|
||||
* This will make the library build 5S and 15S resolutions by itself.
|
||||
*/
|
||||
seconds_multipliers?: string[];
|
||||
/**
|
||||
* The boolean value showing whether data feed has its own daily resolution bars or not.
|
||||
*
|
||||
* If `has_daily` = `false` then Charting Library will build the respective resolutions using 1-minute bars by itself.
|
||||
* If `has_daily` = `false` then the library will build the respective resolutions using 1-minute bars by itself.
|
||||
* If not, then it will request those bars from the data feed only if specified resolution belongs to `daily_multipliers`, otherwise an error will be thrown.
|
||||
* @default true
|
||||
*/
|
||||
@@ -592,7 +592,7 @@ export interface LibrarySymbolInfo {
|
||||
/**
|
||||
* The boolean value showing whether data feed has its own weekly and monthly resolution bars or not.
|
||||
*
|
||||
* If `has_weekly_and_monthly` = `false` then Charting Library will build the respective resolutions using daily bars by itself.
|
||||
* If `has_weekly_and_monthly` = `false` then the library will build the respective resolutions using daily bars by itself.
|
||||
* If not, then it will request those bars from the data feed using either the `weekly_multipliers` or `monthly_multipliers` if specified.
|
||||
* If resolution is not within either list an error will be raised.
|
||||
* @default false
|
||||
@@ -671,7 +671,7 @@ export interface LibrarySymbolInfo {
|
||||
expired?: boolean;
|
||||
/**
|
||||
* Unix timestamp of the expiration date. One must set this value when `expired` = `true`.
|
||||
* Charting Library will request data for this symbol starting from that time point.
|
||||
* The library will request data for this symbol starting from that time point.
|
||||
*/
|
||||
expiration_date?: number;
|
||||
/** Sector for stocks to be displayed in the Symbol Info. */
|
||||
@@ -732,7 +732,7 @@ export interface LibrarySymbolInfo {
|
||||
* the browser supports natively.
|
||||
*
|
||||
* Examples:
|
||||
* - `https://s3-symbol-logo.tradingview.com/apple.svg`
|
||||
* - `https://yourserver.com/apple.svg`
|
||||
* - `/images/myImage.png`
|
||||
* - `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...`
|
||||
* - `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...`
|
||||
@@ -743,6 +743,19 @@ export interface LibrarySymbolInfo {
|
||||
string,
|
||||
string
|
||||
];
|
||||
/**
|
||||
* URL of image to be displayed as the logo for the exchange. The `show_exchange_logos` featureset needs to be enabled for this to be visible in the UI.
|
||||
*
|
||||
* The image should ideally be square in dimension. You can use any image type which
|
||||
* the browser supports natively. Simple SVG images are recommended.
|
||||
*
|
||||
* Examples:
|
||||
* - `https://yourserver.com/exchangeLogo.svg`
|
||||
* - `/images/myImage.png`
|
||||
* - `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3...`
|
||||
* - `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4...`
|
||||
*/
|
||||
exchange_logo?: string;
|
||||
}
|
||||
export interface Mark {
|
||||
/** ID of the mark */
|
||||
@@ -1001,7 +1014,7 @@ export type QuotesCallback = (data: QuoteData[]) => void;
|
||||
*/
|
||||
export type QuotesErrorCallback = (reason: string) => void;
|
||||
/**
|
||||
* Resolution or time interval is a time period of one bar. Charting Library supports tick, intraday (seconds, minutes, hours), and DWM (daily, weekly, monthly) resolutions. The table below describes how to specify different types of resolutions:
|
||||
* Resolution or time interval is a time period of one bar. Advanced Charts supports tick, intraday (seconds, minutes, hours), and DWM (daily, weekly, monthly) resolutions. The table below describes how to specify different types of resolutions:
|
||||
*
|
||||
* Resolution | Format | Example
|
||||
* ---------|----------|---------
|
||||
|
||||
Reference in New Issue
Block a user