Shopify / quilt

[⚠️ Deprecated] A loosely related set of packages for JavaScript/TypeScript projects at Shopify
MIT License
1.7k stars 220 forks source link

@shopify/react-i18n | Expose I18nError #2794

Open afonsograca opened 3 months ago

afonsograca commented 3 months ago

Overview

The interface I18nDetails is public and one of its props uses I18nError as an argument and the latter is not publicly available.

For typed situations, it would be good to have access to this type.

Motivation

In TypeScript, currently we are not able to do something like this:

const onError = (error: I18nError) => {
  ...
};

const manager =  I18nManager({locale, onError, currency: currencyCode, fallbackLocale: FALLBACK_LANGUAGE});

Checklist