import { LocalizationProviderProps } from '@mui/x-date-pickers'; import * as React from 'react'; import { Locale } from '../../constant-types'; export type GeneralizedLocale = Locale | string; /** * type for locales with custom adapter taken from the user */ export type FullLocaleAdapterObject = { locale: GeneralizedLocale; adapter: LocalizationProviderProps['dateAdapter']; adapterLocale?: LocalizationProviderProps['adapterLocale']; }; interface Props extends Pick { children?: React.ReactNode; /** locale options array to be available for the project * * first locale in the array would be the default locale * * locale option can be given in two formats: * - locale with default adapter provided by gooni (DateFns Adapter), e.g. `Locale.en`, `Locale.fa` * - locale with custom adapter, e.g. `{locale: 'en', adapter: yourCustomEnAdapter}` * * If you pass different adapters, beware that they should be compatible with each other */ localeOptions: (Locale | FullLocaleAdapterObject)[]; /** default `multiLocale` to be used for all date & date-time pickers in the children tree * unless mentioned otherwise on the component itself */ defaultMultiLocale?: boolean; } export type { Props as MultiLocalizationProviderProps }; export interface MultiLocalizationContextValue { locales: GeneralizedLocale[]; defaultMultiLocale?: boolean; currentLocale: GeneralizedLocale; changeLocale: (value: GeneralizedLocale) => void; } /** Used for wrapping the whole project and provides proper adapters for the locales given as `localeOptions` props */ export declare function MultiLocalizationProvider(props: Props): JSX.Element; export declare const useMultiLocalizationContext: () => MultiLocalizationContextValue;