import { isShadowsTokenType } from '../../../types/type-guard';
import { LogUtility } from '../../../utils/log';
import { StateVariantFormatter } from './state-variant-formatter';
import { ShadowMap, Shadows } from '../../../constants/public-api';
/**
 * The `StateShadowFormatter` class in TypeScript formats a CSS `box-shadow` property based on a
 * ShadowsTokenType input and provides an array of CssStatesType objects.
 */
class StateShadowFormatter extends StateVariantFormatter {
  constructor() {
    super(...arguments);
    this.states = ['default', 'focus-visible', 'hover'];
  }
  /**
   * The `formatToken` function in TypeScript takes a ShadowsTokenType input, validates it, and returns a
   * formatted CSS box-shadow property string or logs a warning if the input is invalid.
   *
   * @param {ShadowsTokenType} input - ShadowsTokenType
   * @returns {string} The `formatToken` function takes a `ShadowsTokenType` input and returns a CSS `box-shadow`
   * property with the corresponding value from the `ShadowMap` object. If the input is not a valid
   * `ShadowsTokenType`, it logs a warning message using `LogUtility.warn` and returns an empty string.
   */
  formatToken(input) {
    if (isShadowsTokenType(input)) {
      const tokenValue = ShadowMap[input];
      return `box-shadow: ${tokenValue};`;
    }
    else {
      LogUtility.warn(`The shadow value ${input} is invalid, it must be a value of: `, Shadows);
      return '';
    }
  }
  /**
   * The function `getStates` returns an array of `CssStatesType` objects.
   *
   * @returns {CssStatesType[]}An array of CssStatesType objects is being returned.
   */
  getStates() {
    return this.states;
  }
}
export default new StateShadowFormatter();
