@barchart/chart-lib 2.215.1 → 2.215.2

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.
@@ -1753,6 +1753,13 @@ declare module "@barchart/chart-lib" {
1753
1753
  */
1754
1754
  export function setAttributesDOMElement(element: HTMLElement, attributes: object): void;
1755
1755
 
1756
+ export type MainPlotType = Exclude<PlotType, "BalanceSheet" | "IncomeStatement" | "Study">;
1757
+ export type MainPlotTypeLower = Lowercase<MainPlotType>;
1758
+
1759
+ export type MainPlotApiModel = {
1760
+ [Property in MainPlotTypeLower]?: string;
1761
+ } & { template?: string };
1762
+
1756
1763
  /** Chart accessor is the main API entry point, it essentially _is_ the chart. */
1757
1764
  export class ChartAccessor {
1758
1765
  /** The only parameter for construction is `headless` which if set to `true` will create a chart without any kind of visual representation. This form of a chart is useful for template editors which don't render any content. */
@@ -1764,7 +1771,7 @@ declare module "@barchart/chart-lib" {
1764
1771
  /** Always up-to-date model of the chart at any given moment. If you need to restore the chart later, take the model and save it somewhere, then @see load the model later. */
1765
1772
  model: ChartModel;
1766
1773
  /** You don't need to call this method, it is called by the @see BaseDataFeed for you when you call the @see addChart method. */
1767
- initialize(renderTo: RenderTo, config: ChartConfig): void;
1774
+ initialize(renderTo: RenderTo, init: MainPlotApiModel): void;
1768
1775
  /** If you are going to be creating and removing a lot of charts during the host page's lifetime, you should always call the `shutdown` method when you no longer need the chart. Please note that if you are simply going to @see load another chart's definition into the same chart instance, you don't need to call this method. In other words, this method applies if you are tearing down chart completely, and clearing the @see elementId (and @see hostElement) completely. */
1769
1776
  shutdown(): boolean;
1770
1777
  /** Call this method when you need to place an annotation on the chart. Detailed information can be found in the online documentation. */