@uimkit/uikit-react
Version:
<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>
33 lines (30 loc) • 1.86 kB
TypeScript
import React__default from 'react';
import Dayjs from 'dayjs';
import { TFunction } from 'i18next';
import { Moment } from 'moment';
import { UnknownType } from '../types/index.js';
type SupportedTranslations = 'zh' | 'en';
declare const isLanguageSupported: (language: string) => language is SupportedTranslations;
declare const isDayOrMoment: (output: TDateTimeParserOutput) => output is Dayjs.Dayjs | Moment;
declare const isDate: (output: TDateTimeParserOutput) => output is Date;
declare const isNumberOrString: (output: TDateTimeParserOutput) => output is string | number;
type TDateTimeParserInput = string | number | Date;
type TDateTimeParserOutput = string | number | Date | Dayjs.Dayjs | Moment;
type TDateTimeParser = (input?: TDateTimeParserInput) => TDateTimeParserOutput;
type TranslationContextValue = {
t: TFunction;
tDateTimeParser: TDateTimeParser;
userLanguage: string;
};
declare const defaultDateTimeParser: (input?: TDateTimeParserInput) => Dayjs.Dayjs;
declare const TranslationContext: React__default.Context<TranslationContextValue>;
declare const TranslationProvider: ({ children, value, }: React__default.PropsWithChildren<{
value: TranslationContextValue;
}>) => JSX.Element;
declare const useTranslationContext: (componentName?: string) => TranslationContextValue;
declare const withTranslationContext: <P extends UnknownType>(Component: React__default.ComponentType<P>) => {
(props: Omit<P, keyof TranslationContextValue>): JSX.Element;
displayName: string;
};
export { SupportedTranslations, TDateTimeParser, TDateTimeParserInput, TDateTimeParserOutput, TranslationContext, TranslationContextValue, TranslationProvider, defaultDateTimeParser, isDate, isDayOrMoment, isLanguageSupported, isNumberOrString, useTranslationContext, withTranslationContext };
//# sourceMappingURL=TranslationContext.d.ts.map