@barchart/chart-lib 2.215.1 → 2.215.3

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.
@@ -506,7 +506,7 @@ declare module "@barchart/chart-lib" {
506
506
  | "MCCLO"
507
507
  | "NHLAI";
508
508
 
509
- type PlotType =
509
+ export type PlotType =
510
510
  | "Symbol"
511
511
  | "Expression"
512
512
  | "Study"
@@ -1254,7 +1254,16 @@ declare module "@barchart/chart-lib" {
1254
1254
  | MovePaneAccessor
1255
1255
  | TemplateAccessor
1256
1256
  | OutlineAccessor
1257
- | ThemeAccessor;
1257
+ | ThemeAccessor
1258
+ | ClearAccessor;
1259
+
1260
+ export interface ClearAccessor {
1261
+ id: "Clear";
1262
+ context: {
1263
+ studies: boolean;
1264
+ annotations: boolean;
1265
+ };
1266
+ }
1258
1267
 
1259
1268
  export interface MainPlotAccessor {
1260
1269
  id: string;
@@ -1753,6 +1762,13 @@ declare module "@barchart/chart-lib" {
1753
1762
  */
1754
1763
  export function setAttributesDOMElement(element: HTMLElement, attributes: object): void;
1755
1764
 
1765
+ export type MainPlotType = Exclude<PlotType, "BalanceSheet" | "IncomeStatement" | "Study">;
1766
+ export type MainPlotTypeLower = Lowercase<MainPlotType>;
1767
+
1768
+ export type MainPlotApiModel = {
1769
+ [Property in MainPlotTypeLower]?: string;
1770
+ } & { template?: string };
1771
+
1756
1772
  /** Chart accessor is the main API entry point, it essentially _is_ the chart. */
1757
1773
  export class ChartAccessor {
1758
1774
  /** 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 +1780,7 @@ declare module "@barchart/chart-lib" {
1764
1780
  /** 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
1781
  model: ChartModel;
1766
1782
  /** 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;
1783
+ initialize(renderTo: RenderTo, init: MainPlotApiModel): void;
1768
1784
  /** 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
1785
  shutdown(): boolean;
1770
1786
  /** Call this method when you need to place an annotation on the chart. Detailed information can be found in the online documentation. */