<commit_before>import Compiler from './compiler';
import {
  getAllPlurals,
  getPlural,
  hasPlural,
  PluralFunction,
  PluralObject
} from './plurals';

export { PluralFunction };

/**
 * A compiled message function, which may accept an object parameter
 *
 * @public
 */
export type MessageFunction<ReturnType extends 'string' | 'values'> = (
  param?: Record<string, unknown>
) => ReturnType extends 'string' ? string : unknown[];

export type CustomFormatter = (
  value: unknown,
  locale: string,
  arg: string | null
) => unknown;

/**
 * Options for the MessageFormat constructor
 *
 * @public
 */
export interface MessageFormatOptions<
  ReturnType extends 'string' | 'values' = 'string' | 'values'
> {
  /**
   * Add Unicode control characters to all input parts to preserve the
   * integrity of the output when mixing LTR and RTL text
   *
   * Default: `false`
   */
  biDiSupport?: boolean;

  /**
   * The currency to use when formatting `{V, number, currency}`
   *
   * Default: `USD`
   */
  currency?: string;
<commit_msg>fix: Relax MessageFunction argument type (#351)<commit_after>import Compiler from './compiler';
import {
  getAllPlurals,
  getPlural,
  hasPlural,
  PluralFunction,
  PluralObject
} from './plurals';

export { PluralFunction };

/**
 * A compiled message function, which may accept an object parameter
 *
 * @public
 */
export type MessageFunction<ReturnType extends 'string' | 'values'> = (
  param?: Record<string, unknown> | unknown[]
) => ReturnType extends 'string' ? string : unknown[];

export type CustomFormatter = (
  value: unknown,
  locale: string,
  arg: string | null
) => unknown;

/**
 * Options for the MessageFormat constructor
 *
 * @public
 */
export interface MessageFormatOptions<
  ReturnType extends 'string' | 'values' = 'string' | 'values'
> {
  /**
   * Add Unicode control characters to all input parts to preserve the
   * integrity of the output when mixing LTR and RTL text
   *
   * Default: `false`
   */
  biDiSupport?: boolean;

  /**
   * The currency to use when formatting `{V, number, currency}`
   *
   * Default: `USD`
   */
  currency?: string;

{'fraction_non_alphanumeric': 0.12148217636022514, 'fraction_numerical': 0.0014071294559099437, 'mean_word_length': 3.6572052401746724, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7371930', 'n_tokens_mistral': 639, 'n_tokens_neox': 630, 'n_words': 212}