import { Nullable } from '../../../types/general';
import { InputStatus, StringFormatStrategy } from './string-format-strategy.abstract';
/**
 * Defines how raw input is transformed into a masked string.
 *
 * Typical use cases:
 * - Phone numbers
 * - Zip or postal codes
 * - Tax ID values
 * - Custom alphanumeric patterns
 *
 * Rendering flow:
 * 1. `accept` filters valid characters from input.
 * 2. `mask` defines the output shape.
 * 3. `slot` marks replaceable mask characters.
 * 4. `insertMode` controls insert vs replace behavior.
 */
export declare type MaskConfig = {
  /**
   * Output template for the final formatted string.
   * Characters matched by `slot` are replaceable placeholders.
   * Examples:
   * - `(999) 999-9999`
   * - `99999`
   * - `99-9999999`
   */
  mask: string;
  /**
   * Placeholder rule used to identify replaceable positions in `mask`.
   * Supported forms:
   * - Literal character, for example `9`
   * - RegExp, for example `/\d/`
   */
  slot: string | RegExp;
  /**
   * RegExp used to filter valid input characters.
   * Only matched characters are allowed to fill `slot` positions.
   * Examples:
   * - `/\d/g` for digits
   * - `/[A-Z]/g` for uppercase letters
   * - `/[a-zA-Z0-9]/g` for alphanumeric input
   */
  accept: RegExp;
  /**
   * Controls how incoming characters are applied.
   * - `true` (default): insert mode
   * - `false`: replace mode
   * Example:
   * Set mask = ****9999, slot = 9, input = 12345678
   * - insertMode = true  -> ****1234
   * - insertMode = false -> ****5678
   */
  insertMode?: boolean;
  /**
   * Whether to override component value on blur.
   *
   * @deprecated Use `overrideValue` in `MaskConfigType` instead.
   * If both are provided, `MaskConfigType.overrideValue` takes precedence.
   */
  overrideValue?: boolean;
  /**
   * Applies mask formatting during component initialization when `true`.
   * Example:
   * - Initial value: `5551234567`
   * - Phone mask: `(999) 999-9999`
   * - Result at init: `(555) 123-4567`
   */
  triggerAtInit?: boolean;
};
/**
 * A class for formatting string with the given mask format
 *
 * @augments StringFormatStrategy
 */
export declare class StringMaskStrategy extends StringFormatStrategy {
  private static readonly DEFAULT_PHONE_MASK_CONFIG;
  private static readonly DEFAULT_ZIPCODE_MASK_CONFIG;
  private static readonly DEFAULT_TAX_ID_MASK_CONFIG;
  private maskConfig;
  private slotRegex;
  private acceptRegex;
  /**
   * The insert mode means adding some special character in the input string, will replace part of input string if insertMode set to false.
   *
   * @example
   * mask: ****9999
   * slot: 9
   * value = 12345678
   *
   * insertMode=true The mask value should be ****1234
   * insertMode=false The mask value should be ****5678
   */
  private insertMode;
  /**
   * It creates a new instance of the Mask class.
   *
   * @param {MaskConfig} maskConfig - MaskConfig
   * @param {boolean} overrideValue - Whether to override the value after blur, default is false
   */
  constructor(maskConfig: MaskConfig, overrideValue?: boolean);
  /**
   * A static method that generates a phone mask strategy based on the provided mask configuration.
   *
   * @param {boolean} overrideValue - The `overrideValue` parameter determines whether the component value should be overridden on blur.
   * @returns {StringMaskStrategy} Returns an instance of the `StringMaskStrategy` class.
   */
  static getPhoneMaskStrategy(overrideValue?: boolean): StringMaskStrategy;
  /**
   * A static method that generates a zipcode mask strategy based on the provided mask configuration.
   *
   * @param {boolean} overrideValue - The `overrideValue` parameter determines whether the component value should be overridden on blur.
   * @returns {StringMaskStrategy} Returns an instance of the `StringMaskStrategy` class.
   */
  static getZipcodeMaskStrategy(overrideValue?: boolean): StringMaskStrategy;
  /**
   * A static method that generates a tax ID mask strategy based on the provided mask configuration.
   *
   * @param {boolean} overrideValue - The `overrideValue` parameter determines whether the component value should be overridden on blur.
   * @returns {StringMaskStrategy} Returns an instance of the `StringMaskStrategy` class.
   */
  static getTaxIdMaskStrategy(overrideValue?: boolean): StringMaskStrategy;
  /**
   * Set the mask config
   *
   * @param {MaskConfig} maskConfig - MaskConfig
   */
  setMaskConfig(maskConfig: MaskConfig): void;
  /**
   * @inheritDoc
   */
  format(input: string, inputStatus?: InputStatus): string;
  /**
   * Get the position of
   *
   * @param {string} input - The input string
   * @param {number} caretPosition - The current position of caret
   * @returns {Nullable<number>} The new position of caret
   */
  calculateCaretPosition(input: string, caretPosition: Nullable<number>): Nullable<number>;
  /**
   * This TypeScript function determines whether a component value should be overridden based on the mask configuration.
   *
   * @returns {boolean} The result overrideValue controls whether the component value same as the internal input value after the input blur
   * return false if property overrideValue is not exist or set to true, return false if maskConfig is not exist
   */
  protected shouldOverrideComponentValueAfterBlur(): boolean;
  /**
   * The function shouldTriggerAtInit returns true if the maskConfig is defined and its triggerAtInit
   * property is set to true, otherwise it returns false.
   *
   * @returns {boolean} The function shouldTriggerAtInit() returns a boolean value. If the condition is met
   * (this.maskConfig is truthy and this.maskConfig.triggerAtInit is true), it returns true. Otherwise,
   * it returns false.
   */
  protected shouldTriggerAtInit(): boolean;
  /**
   * Get the length limit by mask
   *
   * @returns {number} the max limit length
   */
  protected getLengthLimit(): number;
  /**
   * Given a string, return an array of all the digits in that string
   *
   * @param {string} input - The input string to be parsed.
   * @returns {string[]} - An array of strings.
   */
  protected getMatchedInputSlotValue(input: string): string[];
  /**
   * Replace the mask with the matched input slots
   *
   * @param {string} input - The input string that is being typed by the user.
   * @param {string[]} matchedInputSlot - an array of the input slots that were matched by the mask.
   * @returns {string} The result string builder.
   */
  protected replaceMaskWithMatchedInputSlots(input: string, matchedInputSlot: string[]): string;
}
