@coconut-software/ui
Version:
React components for faster and easier web development.
13 lines (12 loc) • 611 B
TypeScript
import type { Dispatch, PropsWithChildren, SetStateAction } from 'react';
import React from 'react';
import type { AvailableLocales } from '../locales';
interface LocaleProviderProps {
locale?: LocaleState;
}
type LocaleState = keyof AvailableLocales;
type UseLocaleValues = [LocaleState, Dispatch<SetStateAction<LocaleState>>];
export declare const LocaleContext: React.Context<UseLocaleValues | null>;
export declare const useLocale: () => UseLocaleValues;
declare function LocaleProvider({ children, locale, }: PropsWithChildren<LocaleProviderProps>): JSX.Element;
export { LocaleProvider };