Open rodrigofariow opened 2 years ago
Hi @rodrigofariow thanks for raising this. This seems like a relevant request. I'm trying to think what could go wrong by exporting this interface and if we would need to remove/change some of the keys there or only add new ones (to avoid breaking changes). I don't think we had a case where we needed to change/remove a key so I don't think it will be a problem.
The most important interface is GridLocaleText
which contains all the keys. This interface is already exported because it is the type of prop localeText
Localization
is just a wrapper that allows you to add translations to the theme with const theme = createTheme(ptBR, corePtBR, ...);
So as long a core team does not modify how default props are defined, this should not be modified
Duplicates
Latest version
Summary 💡
I'm currently extending material-ui components into a design system used in my company. To better type our locales custom object, it would be nice if you exported the
Localization
interfaces used on@mui/x-data-grid
and@mui/x-date-pickers
.Examples 🌈
Here is the content of
@mui/x-data-grid/utils/getGridLocalization.d.ts
:I would like to use this
Localization
interface but according to your guidelines, we should not import stuff from more than 2 levels deep since those exports might be private:To be honest I could just import a locale and do:
But honestly we might as well have these interfaces be exported at a public level :P The same applies for
@mui/x-date-pickers
.Thank your for your time 🙏
Motivation 🔦
No response
Order ID 💳 (optional)
33240