# @hua-labs/i18n-formatters - AI Documentation
# Version: 2.2.0
# Auto-generated by generate-docs — do not edit manually

package:
  name: "@hua-labs/i18n-formatters"
  version: "2.2.0"
  description: "HUA Labs - Date, Number, and Currency formatting utilities for i18n"
  license: "MIT"

overview: "Locale-aware formatting utilities that integrate with @hua-labs/i18n-core. Provides React hooks and standalone functions for dates, numbers, and currencies with full Korean/English/Japanese support."

exports:
  main:
    path: "@hua-labs/i18n-formatters"
    provides:
      - name: "useDateFormatter"
        type: "function"
        description: "Date formatting hook — formatDate, formatRelativeTime, monthNames, dayNames"
      - name: "formatDate"
        type: "function"
        description: "Format a Date or ISO string into a localized date string. Accepts DateFormatterOptions (pattern, locale, timezone)."
      - name: "formatDateTime"
        type: "function"
        description: "Format a Date or ISO string into a localized date-and-time string."
      - name: "formatRelativeTime"
        type: "function"
        description: "Return a locale-aware relative time string (e.g. '3 minutes ago', '2일 전'). Accepts RelativeTimeOptions."
      - name: "applyTimezoneOffset"
        type: "function"
        description: "Shift a Date by the given timezone offset in minutes and return the adjusted Date."
      - name: "getKoreanDate"
        type: "function"
        description: "Return a Date object adjusted to Korea Standard Time (UTC+9)."
      - name: "getKoreanDateString"
        type: "function"
        description: "Return a YYYY-MM-DD string in Korea Standard Time for the given date."
      - name: "parseDateAsTimezone"
        type: "function"
        description: "Parse a date string as if it were in the given timezone offset."
      - name: "convertToTimezone"
        type: "function"
        description: "Convert a Date from UTC to the target timezone offset and return the adjusted Date."
      - name: "KST_OFFSET"
        type: "constant"
        description: "Korea Standard Time UTC offset in minutes (540 = UTC+9)."
      - name: "useNumberFormatter"
        type: "function"
        description: "Number formatting hook — formatNumber, formatPercent, formatCompact"
      - name: "formatNumber"
        type: "function"
        description: "Format a number with locale-aware grouping separators and decimal places. Accepts NumberFormatterOptions."
      - name: "formatCompact"
        type: "function"
        description: "Format a large number using compact notation (e.g. 1K, 1.2M). Accepts NumberFormatterOptions."
      - name: "formatPercent"
        type: "function"
        description: "Format a decimal value as a percentage string (e.g. 0.75 → '75%'). Accepts PercentFormatterOptions."
      - name: "useCurrencyFormatter"
        type: "function"
        description: "Currency formatting hook — formatCurrency with 6 currency support"
      - name: "formatCurrency"
        type: "function"
        description: "Format a number as a currency string (e.g. '₩1,000', '$9.99'). Accepts CurrencyFormatterOptions."
      - name: "getDefaultCurrency"
        type: "function"
        description: "Resolve the default ISO 4217 currency code for a given language code using LANGUAGE_TO_CURRENCY."
      - name: "getCurrencyDecimals"
        type: "function"
        description: "Return the standard number of decimal places for a given ISO 4217 currency code using CURRENCY_DECIMALS."
      - name: "LANGUAGE_TO_CURRENCY"
        type: "constant"
        description: "Constant map from BCP 47 language code to ISO 4217 currency code (e.g. 'ko' → 'KRW', 'en' → 'USD')."
      - name: "CURRENCY_DECIMALS"
        type: "constant"
        description: "Constant map from ISO 4217 currency code to standard decimal places (e.g. 'KRW' → 0, 'USD' → 2)."
      - name: "DateFormatterOptions"
        type: "type"
        description: "Options for formatDate / formatDateTime — pattern, locale, timezone offset."
      - name: "TimezoneConfig"
        type: "type"
        description: "Timezone configuration — offset in minutes and optional label."
      - name: "RelativeTimeOptions"
        type: "type"
        description: "Options for formatRelativeTime — locale, numeric style."
      - name: "DateFormatterReturn"
        type: "type"
        description: "Return type of useDateFormatter — formatDate, formatDateTime, formatRelativeTime, monthNames, dayNames."
      - name: "NumberFormatterOptions"
        type: "type"
        description: "Options for formatNumber / formatCompact — locale, minimumFractionDigits, maximumFractionDigits."
      - name: "PercentFormatterOptions"
        type: "type"
        description: "Options for formatPercent — locale, decimal places."
      - name: "NumberFormatterReturn"
        type: "type"
        description: "Return type of useNumberFormatter — formatNumber, formatPercent, formatCompact."
      - name: "CurrencyFormatterOptions"
        type: "type"
        description: "Options for formatCurrency — currency code, locale, symbol display."
      - name: "CurrencyFormatterReturn"
        type: "type"
        description: "Return type of useCurrencyFormatter — formatCurrency."

  subpaths:
    - path: "@hua-labs/i18n-formatters/date"
      description: "Date utilities only"
    - path: "@hua-labs/i18n-formatters/number"
      description: "Number utilities only"
    - path: "@hua-labs/i18n-formatters/currency"
      description: "Currency utilities only"

features:
  - "Date formatting — Custom patterns, relative time, timezone support"
  - "Number formatting — Locale-aware grouping, compact notation (1K, 1M), percentages"
  - "Currency formatting — Symbol positioning, decimal control, 6 currencies (KRW, USD, EUR, GBP, JPY, CNY)"
  - "React hooks — useDateFormatter, useNumberFormatter, useCurrencyFormatter"
  - "React Native — Works in Expo and bare RN projects"
  - "Tree-shakeable — Subpath exports for date, number, currency independently"

related_packages:
  - "@hua-labs/i18n-core"
  - "@hua-labs/i18n-core-zustand"
  - "@hua-labs/i18n-loaders"

compatibility:
  react: ">=19.0.0"
  node: ">=20.0.0"
