import { OjWebElement } from '../';

/**
 * This is the base class for oj-select-single 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, OjSelectSingle.ts.
 */
export class OjSelectSingleBase extends OjWebElement {
  /**
   * Gets the value of <code>data</code> property.
   * The data for the Select.
   * @return The value of <code>data</code> property.
   * @deprecated Since 14.0.0. Data sets from a DataProvider cannot be sent to WebDriverJS; use ViewModels or page variables instead.
   */
  public getData(): Promise<object | null> {
    return this.getProperty<object | null>('data');
  }

  /**
   * Gets the value of <code>describedBy</code> property.
   * The form component's oj-label automatically sets described-by to make it accessible. It is not meant to be set by application developer.
   * @return The value of <code>describedBy</code> property.
   *
   */
  public getDescribedBy(): Promise<string> {
    return this.getProperty<string>('describedBy');
  }

  /**
   * Gets the value of <code>disabled</code> property.
   * Specifies whether the component is disabled. The default is false.
   * @return The value of <code>disabled</code> property.
   *
   */
  public getDisabled(): Promise<boolean> {
    return this.getProperty<boolean>('disabled');
  }

  /**
   * Gets the value of <code>displayOptions</code> property.
   * Display options for auxiliary content that determines whether it should be displayed.
   * @return The value of <code>displayOptions</code> property.
   *
   */
  public getDisplayOptions(): Promise<DisplayOptions> {
    return this.getProperty<DisplayOptions>('displayOptions');
  }

  /**
   * Gets the value of <code>help</code> property.
   * Form component help information.
   * @return The value of <code>help</code> property.
   *
   */
  public getHelp(): Promise<Help> {
    return this.getProperty<Help>('help');
  }

  /**
   * Gets the value of <code>helpHints</code> property.
   * Represents hints for an oj-form-layout element to render help information on the label of the editable component.
   * @return The value of <code>helpHints</code> property.
   *
   */
  public getHelpHints(): Promise<HelpHints> {
    return this.getProperty<HelpHints>('helpHints');
  }

  /**
   * Gets the value of <code>itemText</code> property.
   * Specifies the text string to render for a data item.
   * @return The value of <code>itemText</code> property.
   *
   */
  public getItemText(): Promise<string | null> {
    return this.getProperty<string | null>('itemText');
  }

  /**
   * Gets the value of <code>labelEdge</code> property.
   * Defines how the label of a component is created. See the Help documentation for more information.
   * @return The value of <code>labelEdge</code> property.
   *
   */
  public getLabelEdge(): Promise<string> {
    return this.getProperty<string>('labelEdge');
  }

  /**
   * Gets the value of <code>labelHint</code> property.
   * Represents a hint for oj-form-layout element to render a label on the editable component.
   * @return The value of <code>labelHint</code> property.
   *
   */
  public getLabelHint(): Promise<string> {
    return this.getProperty<string>('labelHint');
  }

  /**
   * Gets the value of <code>labelledBy</code> property.
   * The oj-label sets the labelledBy property programmatically on the form component.
   * @return The value of <code>labelledBy</code> property.
   *
   */
  public getLabelledBy(): Promise<string | null> {
    return this.getProperty<string | null>('labelledBy');
  }

  /**
   * Gets the value of <code>matchBy</code> property.
   * The ordered list of text filter matching behaviors to use when filtering data.
   * @return The value of <code>matchBy</code> property.
   *
   */
  public getMatchBy(): Promise<Array<string> | null> {
    return this.getProperty<Array<string> | null>('matchBy');
  }

  /**
   * Sets the value of <code>messagesCustom</code> property.
   * A list of messages added by an application to the component. See the Help documentation for more information.
   * @param messagesCustom The value to set for <code>messagesCustom</code>
   *
   */
  public changeMessagesCustom(messagesCustom: Array<object>): Promise<void> {
    return this.setProperty<Array<object>>('messagesCustom', messagesCustom);
  }

  /**
   * Gets the value of <code>messagesCustom</code> property.
   * A list of messages added by an application to the component. See the Help documentation for more information.
   * @return The value of <code>messagesCustom</code> property.
   *
   */
  public getMessagesCustom(): Promise<Array<object>> {
    return this.getProperty<Array<object>>('messagesCustom');
  }

  /**
   * Gets the value of <code>placeholder</code> property.
   * A short hint that can be displayed before user selects or enters a value.
   * @return The value of <code>placeholder</code> property.
   *
   */
  public getPlaceholder(): Promise<string> {
    return this.getProperty<string>('placeholder');
  }

  /**
   * Gets the value of <code>readonly</code> property.
   * Specifies whether a value is readonly
   * @return The value of <code>readonly</code> property.
   *
   */
  public getReadonly(): Promise<boolean> {
    return this.getProperty<boolean>('readonly');
  }

  /**
   * Gets the value of <code>required</code> property.
   * Specifies whether the component is required or optional. See the Help documentation for more information.
   * @return The value of <code>required</code> property.
   *
   */
  public getRequired(): Promise<boolean> {
    return this.getProperty<boolean>('required');
  }

  /**
   * 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>userAssistanceDensity</code> property.
   * Specifies the density of the form component's user assistance presentation.
   * @return The value of <code>userAssistanceDensity</code> property.
   *
   */
  public getUserAssistanceDensity(): Promise<string> {
    return this.getProperty<string>('userAssistanceDensity');
  }

  /**
   * Gets the value of <code>valid</code> property.
   * The validity state of the component
   * @return The value of <code>valid</code> property.
   *
   */
  public getValid(): Promise<string> {
    return this.getProperty<string>('valid');
  }

  /**
   * Sets the value of <code>value</code> property.
   * The value of the element.
   * @param value The value to set for <code>value</code>
   *
   */
  public changeValue(value: null | any): Promise<void> {
    return this.setProperty<null | any>('value', value);
  }

  /**
   * Gets the value of <code>value</code> property.
   * The value of the element.
   * @return The value of <code>value</code> property.
   *
   */
  public getValue(): Promise<null | any> {
    return this.getProperty<null | any>('value');
  }

  /**
   * Sets the value of <code>valueItem</code> property.
   * The current value of the element and its associated data.
   * @param valueItem The value to set for <code>valueItem</code>
   *
   */
  public changeValueItem(valueItem: null | object): Promise<void> {
    return this.setProperty<null | object>('valueItem', valueItem);
  }

  /**
   * Gets the value of <code>valueItem</code> property.
   * The current value of the element and its associated data.
   * @return The value of <code>valueItem</code> property.
   *
   */
  public getValueItem(): Promise<null | object> {
    return this.getProperty<null | object>('valueItem');
  }

  /**
   * Gets the value of <code>virtualKeyboard</code> property.
   * The type of virtual keyboard to display for entering a value on mobile browsers. See the Help documentation for more information.
   * @return The value of <code>virtualKeyboard</code> property.
   *
   */
  public getVirtualKeyboard(): Promise<string> {
    return this.getProperty<string>('virtualKeyboard');
  }
}
export interface DisplayOptions {
  /**
   * Display options for auxiliary help instruction text that determines whether it should be displayed.
   * @deprecated Since 9.0.0. If you want none, remove help-instruction attribute.
   */
  helpInstruction: Array<string> | string;
  /**
   * Display options for auxiliary message text. The supported attribute values are theme dependent.
   */
  messages: Array<string> | string;
}
export interface Help {
  /**
   * Represents advisory information for the component, such as would be appropriate for a tooltip.
   */
  instruction: string;
}
export interface HelpHints {
  /**
   * Hint for help definition text associated with the label.
   */
  definition: string;
  /**
   * Help source URL associated with the component.
   */
  source: string;
}
export interface Translations {
  /**
   * Label of the cancel button of the mobile dropdown.
   */
  cancel: string;
  /**
   * Label of the clear value icon for screen readers.
   */
  labelAccClearValue: string;
  /**
   * Label of the dropdown arrow for screen readers.
   * @deprecated Since 10.0.0. This option has been deprecated because the dropdown arrow should be ignored by screen readers.
   */
  labelAccOpenDropdown: string;
  /**
   * Screen reader text for the drop down when multiple results are found.
   */
  multipleMatchesFound: string;
  /**
   * Screen reader text for the drop down when N or more results are found.
   */
  nOrMoreMatchesFound: string;
  /**
   * Screen reader text for the drop down when no results are found.
   */
  noMatchesFound: string;
  /**
   * First line of text in the no data template shown in the default listView.
   * @deprecated Since 9.0.0. This option has been deprecated since oj-select-single will no longer show the dropdown when there are no results to show.
   */
  noResultsLine1: string;
  /**
   * Second line of text in the no data template shown in the default listView.
   * @deprecated Since 9.0.0. This option has been deprecated since oj-select-single will no longer show the dropdown when there are no results to show.
   */
  noResultsLine2: string;
  /**
   * Screen reader text for the drop down when one result is found.
   */
  oneMatchFound: string;
  /**
   * Provides properties to customize the summary, detail and hint text used by the implicit required validator associated to any editable component that supports the required option.
   */
  required: TranslationsRequired;
}
export interface TranslationsRequired {
  /**
   * Hint text used by required validation error.
   */
  hint: string;
  /**
   * Message text that describes the details of the required validation error.
   */
  messageDetail: string;
  /**
   * Message text for summarizing a required validation error.
   * @deprecated Since 14.0.0. This is deprecated because in the Redwood design system form components do not show validator summaries, so this is no longer needed.
   */
  messageSummary: string;
}
