Release v28.5.0 (from fb6f897f)

This commit is contained in:
jenkins
2024-12-18 12:39:00 +00:00
parent 2d18f294db
commit bff3af11c0
1010 changed files with 2240 additions and 2095 deletions

View File

@@ -4731,6 +4731,12 @@ export interface ChartingLibraryWidgetOptions {
* Custom theme colors to override the default light and dark themes. For more information on custom themes, refer to the [Custom themes API](https://www.tradingview.com/charting-library-docs/latest/customization/styles/custom-themes) article.
*/
custom_themes?: CustomThemes;
/**
* EXPERIMENTAL. Customise the storage of image data for the image drawing tool.
*
* By default images have no size limit and are saved in the chart layout which may not be suitable, depending on your chart storage implementation.
*/
image_storage_adapter?: IImageStorageAdapter;
}
export interface CheckboxFieldMetaInfo extends CustomFieldMetaInfoBase {
/** @inheritDoc */
@@ -4858,6 +4864,8 @@ export interface ColumnStylePreferences {
downColor: string;
/** Color column based on previous close */
barColorsOnPrevClose: boolean;
/** Column baseline position */
baselinePosition: ColumnStyleBaselinePosition;
}
/**
* Override properties for the Comment drawing tool.
@@ -6177,6 +6185,31 @@ export interface DoubleEMAIndicatorOverrides {
"plot.color": string;
[key: string]: StudyOverrideValueType;
}
/**
* Drag start parameters
*/
export interface DragStartParams {
/**
* Prevent default drag event
*/
preventDefault: () => void;
/**
* Hovered source ID
*/
hoveredSourceId: EntityId | null;
/**
* Export data function
*/
exportData: (exportOptions: Partial<ExportDataOptions>) => void;
/**
* Set data function
*/
setData: (format: string, data: string) => void;
/**
* Set drag image
*/
setDragImage: (image: HTMLElement, xOffset: number, yOffset: number) => void;
}
/** Item within a dropdown menu */
export interface DropdownItem {
/** Title of the menu item */
@@ -9792,7 +9825,7 @@ export interface IBrokerWithoutRealtime extends IBrokerCommon, IBrokerAccountInf
reversePosition?(positionId: string): Promise<void>;
/**
* The library calls `closePosition` to request [closing a position](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/trading-concepts/positions#close-positions) by ID.
* You should handle this request on your backend side and provide the library with a new order state. To do this, call the {@link IBrokerConnectionAdapterHost.positionUpdate} method right afterwards.
* You should handle this request on your backend side and provide the library with a new position state. To do this, call the {@link IBrokerConnectionAdapterHost.positionUpdate} method right afterwards.
* Otherwise, the library will return a [timeout issue](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/common-issues#timeout-issue).
*
* `closePosition` is only called if the {@link BrokerConfigFlags.supportClosePosition} or {@link BrokerConfigFlags.supportPartialClosePosition} configuration flag is `true`.
@@ -10662,6 +10695,28 @@ export interface IChartWidgetApi {
* @returns A promise that resolves with the exported data.
*/
exportData(options?: Partial<ExportDataOptions>): Promise<ExportedData>;
/**
* Enable or disable drag-to-export feature.
*
* **Example**
* ```javascript
* // Enable drag-to-export, disable default chart drag to scroll
* widget.activeChart().setDragExportEnabled(true);
* widget.subscribe('dragstart', (params) => {
* // create a HTML element for drag image
* const dragImage = createDragImage();
* // set drag image
* params.setDragImage(dragImage, 0, 0);
* const exportData = widget.activeChart().exportData();
* // transform export data to csv
* const csvData = transformExportDataToCsv(exportData);
* params.setData('text/plain', csvData);
* });
* ```
* To implement drag-to-export, you need to handle the `dragstart` event in your application and set the data to the `dataTransfer` object.
* @param enabled `true` to enable drag-to-export, `false` to disable.
*/
setDragExportEnabled(enabled: boolean): void;
/**
* Check if the chart can be zoomed out using the {@link zoomOut} method.
*
@@ -12166,6 +12221,12 @@ export interface IFormatter<T> {
/** Check if the input value satisfies the logic and return either an error or the result of the parsing */
parse?(value: string, options?: FormatterParseOptions): ErrorFormatterParseResult | SuccessFormatterParseResult<T>;
}
export interface IImageStorageAdapter {
/**
* Return the maximum allowed image size in bytes that will be allowed by the image drawing tool.
*/
getMaxImageSizeInBytes(): number;
}
/**
* Drawing API
*
@@ -14763,14 +14824,10 @@ export interface LibrarySymbolInfo {
*/
variable_tick_size?: string;
/**
* Boolean value showing whether the symbol includes intraday (minutes) historical data.
* A flag indicating whether your datafeed contains intraday (minutes) data for this symbol.
* If `true`, the library requests this data when an intraday resolution is selected. If `false`, _No data here_ is displayed on the chart.
*
* If it's `false` then all buttons for intraday resolutions will be disabled for this particular symbol.
* If it is set to `true`, all intradays resolutions that are supplied directly by the datafeed must be provided in `intraday_multipliers` array.
*
* **WARNING** Any daily, weekly or monthly resolutions cannot be inferred from intraday resolutions.
*
* `false` if DWM only
* This property is required to enable intraday resolutions. Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-minutes-intraday) article for more information.
* @default false
*/
has_intraday?: boolean;
@@ -14798,37 +14855,41 @@ export interface LibrarySymbolInfo {
*/
supported_resolutions?: ResolutionString[];
/**
* Array of resolutions (in minutes) supported directly by the data feed. Each such resolution may be passed to, and should be implemented by, `getBars`. The default of [] means that the data feed supports aggregating by any number of minutes.
* An array of intraday (minutes) resolutions that your datafeed supports. Items in the array should be listed in ascending order, for example: `["1", "2"]`.
*
* If the data feed only supports certain minute resolutions but not the requested resolution, `getBars` will be called (repeatedly if needed) with a higher resolution as a parameter, in order to build the requested resolution.
* This property is required to enable intraday resolutions. Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-minutes-intraday) article for more information.
* Note that each resolution in `intraday_multipliers` should be handled in the {@link IDatafeedChartApi.getBars} implementation.
* Consider the [example](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#example).
*
* For example, if the data feed only supports minute resolution, set `intraday_multipliers` to `['1']`.
* The library also uses resolutions listed in `intraday_multipliers` to display higher resolution that your datafeed does not explicitly support. If `intraday_multipliers` is not specified, the library cannot build additional resolutions.
*
* When the user wants to see 5-minute data, `getBars` will be called with the resolution set to 1 until the library builds all the 5-minute resolution by itself.
* @example (for ex.: "1,5,60") - only these resolutions will be requested, all others will be built using them if possible
* @default []
* Note that the library **cannot** build daily, weekly, or monthly resolutions using intraday data.
* @default [] — specifies that the datafeed can provide data for any requested resolution.
*/
intraday_multipliers?: string[];
/**
* Boolean value showing whether the symbol includes seconds in the historical data.
* A flag indicating whether your datafeed contains seconds data for this symbol.
* If `true`, the library requests this data when a seconds resolution is selected. If `false`, _No data here_ is displayed on the chart.
*
* If it's `false` then all buttons for resolutions that include seconds will be disabled for this particular symbol.
*
* If it is set to `true`, all resolutions that are supplied directly by the data feed must be provided in `seconds_multipliers` array.
* You should set `has_seconds` to `true` to enable seconds resolutions. Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-seconds) article for more information.
* @default false
*/
has_seconds?: boolean;
/**
* Boolean value showing whether the symbol includes ticks in the historical data.
* A flag indicating whether your datafeed contains ticks data for this symbol.
* If `true`, the library requests this data when a resolution in ticks is selected. If `false`, _No data here_ is displayed on the chart.
*
* If it's `false` then all buttons for resolutions that include ticks will be disabled for this particular symbol.
* You should set `has_ticks` to `true` to enable ticks resolutions. Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-ticks) article for more information.
* @default false
*/
has_ticks?: boolean;
/**
* 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 the library build 5S and 15S resolutions by itself.
* An array of seconds resolutions that your datafeed supports. Items in the array should be listed in ascending order and **should not** include letters, for example: `["1", "2"]`.
* This property is required to enable seconds resolutions. Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-seconds) article for more information.
*
* The library also uses resolutions listed in `seconds_multipliers` to display higher resolution that your datafeed does not explicitly support. If `seconds_multipliers` is not specified, the library cannot build additional resolutions.
* Consider the example. You need to enable one-second and five-second resolutions but your datafeed contains only one-second data. In this case, you should set `seconds_multipliers` to `["1"]`.
* The library will build the five-second resolution from one-second data.
*/
seconds_multipliers?: string[];
/**
@@ -14843,54 +14904,44 @@ export interface LibrarySymbolInfo {
*/
build_seconds_from_ticks?: boolean;
/**
* The boolean value specifying whether the datafeed can supply historical data at the daily resolution.
*
* If `has_daily` is set to `false`, all buttons for resolutions that include days are disabled for this particular symbol.
* Otherwise, the library requests daily bars from the datafeed.
* All daily resolutions that the datafeed supplies must be included in the {@link LibrarySymbolInfo.daily_multipliers} array.
* A flag indicating whether your datafeed contains daily data for this symbol.
* If `true`, the library requests this data when a daily resolution is selected. If `false`, _No data here_ is displayed on the chart.
*
* `has_daily` is set to `true` by default. However, you should also specify {@link daily_multipliers} to enable daily resolutions. Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-days) article for more information.
* @default true
*/
has_daily?: boolean;
/**
* Array (of strings) containing the [resolutions](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-format) (in days - without the suffix) supported by the datafeed. {@link ResolutionString}
* An array of daily resolutions that your datafeed supports. Items in the array should be listed in ascending order and **should not** include letters, for example: `["1", "2"]`.
* This property is required to enable daily resolutions. Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-days) article for more information.
*
* For example it could be something like
*
* ```javascript
* daily_multipliers = ['1', '3', '4', '6', '7'];
* ```
* @default ['1']
* The library also uses resolutions listed in `daily_multipliers` to display higher resolution that your datafeed does not explicitly support. If `daily_multipliers` is not specified, the library cannot build additional resolutions.
* @default ["1"]
*/
daily_multipliers?: string[];
/**
* The boolean value showing whether data feed has its own weekly and monthly resolution bars or not.
* A flag indicating whether your datafeed contains weekly or monthly data for this symbol. If `true`, the library requests this data when the corresponding resolution is selected.
* To enable weekly or monthly resolutions, you should also specify the {@link weekly_multipliers} or {@link monthly_multipliers} properties.
* Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-weeks--months) article for more information.
*
* 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.
* If `has_weekly_and_monthly` is set to `false`, the library attempts to build the resolutions using daily bars. Note that building bars requires a large number of requests to your datafeed.
* If the library fails to build bars, _No data here_ is displayed on the chart.
* @default false
*/
has_weekly_and_monthly?: boolean;
/**
* Array (of strings) containing the [resolutions](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-weeks--months) (in weeks - without the suffix) supported by the data feed. {@link ResolutionString}
* An array of weekly resolutions that your datafeed supports. Items in the array should be listed in ascending order and **should not** include letters, for example: `["1", "3"]`.
* This property is required to enable weekly resolutions. Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-weeks--months) article for more information.
*
* For example it could be something like
*
* ```javascript
* weekly_multipliers = ['1', '5', '10'];
* ```
* The library also uses resolutions listed in `weekly_multipliers` to display higher resolution that your datafeed does not explicitly support. If `weekly_multipliers` is not specified, the library cannot build additional resolutions.
* @default ['1']
*/
weekly_multipliers?: string[];
/**
* Array (of strings) containing the [resolutions](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-weeks--months) (in months - without the suffix) supported by the data feed. {@link ResolutionString}
* An array of monthly resolutions that your datafeed supports. Items in the array should be listed in ascending order and **should not** include letters, for example: `["1", "3", "6", "12"]`.
* This property is required to enable monthly resolutions. Refer to the [Resolution](https://www.tradingview.com/charting-library-docs/latest/core_concepts/Resolution#resolution-in-weeks--months) article for more information.
*
* For example it could be something like
*
* ```javascript
* monthly_multipliers = ['1', '3', '4', '12'];
* ```
* The library also uses resolutions listed in `monthly_multipliers` to display higher resolution that your datafeed does not explicitly support. If `monthly_multipliers` is not specified, the library cannot build additional resolutions.
* @default ['1']
*/
monthly_multipliers?: string[];
@@ -26049,6 +26100,15 @@ export interface SubscribeEventsMap {
* @param {RangeOptions} range - Object that represents a selected time frame.
*/
timeframe_interval: (range: RangeOptions) => void;
/**
* Drag start
* @param {boolean} enabled - if drag export is currently enabled
*/
dragStart: (params: DragStartParams) => void;
/**
* Drag end
*/
dragEnd: EmptyCallback;
}
export interface SuccessFormatterParseResult<T> extends FormatterParseResult {
/** @inheritDoc */
@@ -28469,6 +28529,10 @@ export type ColorGradient = [
];
/** These are defining the types for a background */
export type ColorTypes = "solid" | "gradient";
/**
* Determines the baseline position for column series, either at the bottom of the pane or aligned with the price scale's zero value.
*/
export type ColumnStyleBaselinePosition = "bottom" | "zero";
/**
* Context menu items processor signature
* @param {readonlyIActionVariant[]} items - an array of items the library wants to display
@@ -28962,7 +29026,15 @@ export type TradingTerminalFeatureset = ChartingLibraryFeatureset |
* Displays the {@link DatafeedQuoteValues.short_name} value as a symbol name in the [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List) and [Details](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/#details). If disabled, the [`ticker`](@api/interfaces/Charting_Library.LibrarySymbolInfo.md#ticker) value will be used instead.
* @default true
*/
"prefer_quote_short_name";
"prefer_quote_short_name" |
/**
* EXPERIMENTAL. Enables the Image drawing.
*
* By default images have no size limit and are saved in the chart layout which may not be suitable, depending on your chart storage implementation.
*
* @default false
*/
"image_drawingtool";
export type VisiblePlotsSet = "ohlcv" | "ohlc" | "c";
export type WatchListSymbolListAddedCallback = (listId: string, symbols: string[]) => void;
export type WatchListSymbolListChangedCallback = (listId: string) => void;