import { OjWebElement } from '../';

/**
 * This is the base class for oj-legend WebElement, and is generated from the
 * component's metadata. Do not modify these contents since they'll be replaced
 * during the next generation.
 * Put overrides into the WebElements's subclass, OjLegend.ts.
 */
export class OjLegendBase extends OjWebElement {
  /**
   * Gets the value of <code>as</code> property.
   * An alias for the '$current' context variable passed to slot content for the nodeTemplate slot.
   * @return The value of <code>as</code> property.
   * @deprecated Since 6.2.0. Set the alias directly on the template element using the data-oj-as attribute instead.
   */
  public getAs(): Promise<string> {
    return this.getProperty<string>('as');
  }

  /**
   * Gets the value of <code>drilling</code> property.
   * Specifies whether drilling is enabled. Drillable objects will show a pointer cursor on hover and fire an ojDrill event on click. See the Help documentation for more information.
   * @return The value of <code>drilling</code> property.
   *
   */
  public getDrilling(): Promise<string> {
    return this.getProperty<string>('drilling');
  }

  /**
   * Sets the value of <code>expanded</code> property.
   * Specifies the key set containing the ids of sections that should be expanded on initial render. See the Help documentation for more information.
   * @param expanded The value to set for <code>expanded</code>
   *
   */
  public changeExpanded(expanded: null): Promise<void> {
    return this.setProperty<null>('expanded', expanded);
  }

  /**
   * Gets the value of <code>expanded</code> property.
   * Specifies the key set containing the ids of sections that should be expanded on initial render. See the Help documentation for more information.
   * @return The value of <code>expanded</code> property.
   *
   */
  public getExpanded(): Promise<null> {
    return this.getProperty<null>('expanded');
  }

  /**
   * Gets the value of <code>halign</code> property.
   * Defines the horizontal alignment of the legend contents.
   * @return The value of <code>halign</code> property.
   *
   */
  public getHalign(): Promise<string> {
    return this.getProperty<string>('halign');
  }

  /**
   * Sets the value of <code>hiddenCategories</code> property.
   * An array of categories that will be hidden.
   * @param hiddenCategories The value to set for <code>hiddenCategories</code>
   *
   */
  public changeHiddenCategories(hiddenCategories: Array<string>): Promise<void> {
    return this.setProperty<Array<string>>('hiddenCategories', hiddenCategories);
  }

  /**
   * Gets the value of <code>hiddenCategories</code> property.
   * An array of categories that will be hidden.
   * @return The value of <code>hiddenCategories</code> property.
   *
   */
  public getHiddenCategories(): Promise<Array<string>> {
    return this.getProperty<Array<string>>('hiddenCategories');
  }

  /**
   * Gets the value of <code>hideAndShowBehavior</code> property.
   * Defines whether the legend can be used to initiate hide and show behavior on referenced data items.
   * @return The value of <code>hideAndShowBehavior</code> property.
   *
   */
  public getHideAndShowBehavior(): Promise<string> {
    return this.getProperty<string>('hideAndShowBehavior');
  }

  /**
   * Sets the value of <code>highlightedCategories</code> property.
   * An array of categories that will be highlighted.
   * @param highlightedCategories The value to set for <code>highlightedCategories</code>
   *
   */
  public changeHighlightedCategories(highlightedCategories: Array<string>): Promise<void> {
    return this.setProperty<Array<string>>('highlightedCategories', highlightedCategories);
  }

  /**
   * Gets the value of <code>highlightedCategories</code> property.
   * An array of categories that will be highlighted.
   * @return The value of <code>highlightedCategories</code> property.
   *
   */
  public getHighlightedCategories(): Promise<Array<string>> {
    return this.getProperty<Array<string>>('highlightedCategories');
  }

  /**
   * Gets the value of <code>hoverBehavior</code> property.
   * Defines the behavior applied when hovering over a legend item.
   * @return The value of <code>hoverBehavior</code> property.
   *
   */
  public getHoverBehavior(): Promise<string> {
    return this.getProperty<string>('hoverBehavior');
  }

  /**
   * Gets the value of <code>hoverBehaviorDelay</code> property.
   * Specifies initial hover delay in milliseconds for highlighting items in legend.
   * @return The value of <code>hoverBehaviorDelay</code> property.
   * @deprecated Since 14.1.0. This is not recommended in the Redwood design system.
   */
  public getHoverBehaviorDelay(): Promise<number> {
    return this.getProperty<number>('hoverBehaviorDelay');
  }

  /**
   * Gets the value of <code>orientation</code> property.
   * Defines the orientation of the legend, which determines the direction in which the legend items are laid out.
   * @return The value of <code>orientation</code> property.
   *
   */
  public getOrientation(): Promise<string> {
    return this.getProperty<string>('orientation');
  }

  /**
   * Gets the value of <code>scrolling</code> property.
   * Defines whether scrolling is enabled for the legend.
   * @return The value of <code>scrolling</code> property.
   * @deprecated Since 12.1.0. Setting scrolling to off is not supported in Redwood theme and it is not recommended. As such, this attribute is deprecated.
   */
  public getScrolling(): Promise<string> {
    return this.getProperty<string>('scrolling');
  }

  /**
   * Gets the value of <code>sections</code> property.
   * An array of objects specifying the legend sections.
   * @return The value of <code>sections</code> property.
   *
   */
  public getSections(): Promise<Array<Sections> | null> {
    return this.getProperty<Array<Sections> | null>('sections');
  }

  /**
   * Gets the value of <code>symbolHeight</code> property.
   * The height of the legend symbol in pixels. See the Help documentation for more information.
   * @return The value of <code>symbolHeight</code> property.
   *
   */
  public getSymbolHeight(): Promise<number> {
    return this.getProperty<number>('symbolHeight');
  }

  /**
   * Gets the value of <code>symbolWidth</code> property.
   * The width of the legend symbol in pixels. See the Help documentation for more information.
   * @return The value of <code>symbolWidth</code> property.
   *
   */
  public getSymbolWidth(): Promise<number> {
    return this.getProperty<number>('symbolWidth');
  }

  /**
   * Gets the value of <code>textStyle</code> property.
   * The CSS style object defining the style of the legend item text.
   * @return The value of <code>textStyle</code> property.
   *
   */
  public getTextStyle(): Promise<object> {
    return this.getProperty<object>('textStyle');
  }

  /**
   * Gets the value of <code>trackResize</code> property.
   * Defines whether the element will automatically render in response to changes in size. See the Help documentation for more information.
   * @return The value of <code>trackResize</code> property.
   * @deprecated Since 15.0.0. With the track resize optimized, this API is no longer required. track-resize on will be the default behavior.
   */
  public getTrackResize(): Promise<string> {
    return this.getProperty<string>('trackResize');
  }

  /**
   * Gets the value of <code>translations</code> property.
   * A collection of translated resources from the translation bundle, or null if this component has no resources.
   * @return The value of <code>translations</code> property.
   *
   */
  public getTranslations(): Promise<Translations | null> {
    return this.getProperty<Translations | null>('translations');
  }

  /**
   * Gets the value of <code>valign</code> property.
   * Defines the vertical alignment of the legend contents.
   * @return The value of <code>valign</code> property.
   *
   */
  public getValign(): Promise<string> {
    return this.getProperty<string>('valign');
  }
}
export interface Sections {
  /**
   * Whether the section is collapsible. Only applies if the legend orientation is vertical.
   */
  collapsible: string;
  /**
   * Whether the section is initially expanded. Only applies if the section is collapsible.
   * @deprecated Since 14.1.0. This attribute is deprecated. Applications should use the expanded API on oj-legend instead
   */
  expanded: string;
  /**
   * The id of the legend section. For the DataProvider case, the key for the node will be used as the id.
   */
  id: string;
  /**
   * An array of objects with the following properties defining the legend items. Also accepts a Promise for deferred data rendering. No data will be rendered if the Promise is rejected.
   */
  items: Array<object>;
  /**
   * An array of nested legend sections.
   */
  sections: Array<object>;
  /**
   * The title of the legend section.
   */
  title: string;
  /**
   * The horizontal alignment of the section title. If the section is collapsible or nested, only start alignment is supported.
   */
  titleHalign: string;
  /**
   * The CSS style object defining the style of the section title. The following style properties are supported: color, cursor, fontFamily, fontSize, fontStyle, fontWeight, textDecoration.
   */
  titleStyle: object;
}
export interface Translations {
  /**
   * Used to describe a container that contains controls.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  accessibleContainsControls: string;
  /**
   * Used to describe the data visualization type for accessibility.
   */
  componentName: string;
  /**
   * Used to display a label and its value.
   */
  labelAndValue: string;
  /**
   * Text shown for clearing multiple selection on touch devices.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  labelClearSelection: string;
  /**
   * Used to display a count out of a total.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  labelCountWithTotal: string;
  /**
   * Label for data visualizations used for accessibility.
   */
  labelDataVisualization: string;
  /**
   * Text shown when the component receives invalid data.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  labelInvalidData: string;
  /**
   * Text shown when the component receives no data.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  labelNoData: string;
  /**
   * Used to describe the collapsed state for accessibility.
   */
  stateCollapsed: string;
  /**
   * Used to describe a drillable object for accessibility.
   */
  stateDrillable: string;
  /**
   * Used to describe the expanded state for accessibility.
   */
  stateExpanded: string;
  /**
   * Used to describe the hidden state for accessibility.
   */
  stateHidden: string;
  /**
   * Used to describe the isolated state for accessibility.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  stateIsolated: string;
  /**
   * Used to describe the maximized state for accessibility.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  stateMaximized: string;
  /**
   * Used to describe the minimized state for accessibility.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  stateMinimized: string;
  /**
   * Used to describe the selected state for accessibility.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  stateSelected: string;
  /**
   * Used to describe the unselected state for accessibility.
   * @deprecated Since 15.0.0. This is deprecated because it is not used by the oj-legend
   */
  stateUnselected: string;
  /**
   * Used to describe the visible state for accessibility.
   */
  stateVisible: string;
  /**
   * Used for the collapse tooltip.
   */
  tooltipCollapse: string;
  /**
   * Used for the expand tooltip.
   */
  tooltipExpand: string;
}
