@prezly/theme-kit-nextjs
Version:
Data layer and utility library for developing Prezly themes with NextJS
27 lines (26 loc) • 1.46 kB
TypeScript
import { AsyncResolvable } from '@prezly/theme-kit-core';
import type { IntlDictionary, IntlMessageDescriptor, IntlMessageValues, Locale, Timezone } from '@prezly/theme-kit-intl';
import { FormattedDate as BaseFormattedDate, FormattedTime as BaseFormattedTime } from '@prezly/theme-kit-react';
import type { ReactElement } from 'react';
type Awaitable<T> = T | Promise<T>;
export declare namespace IntlAdapter {
interface Configuration {
resolveDictionary?: (localeCode: Locale.Code) => Awaitable<IntlDictionary>;
timezone: AsyncResolvable<Timezone>;
}
function connect({ resolveDictionary, ...config }: Configuration): {
useIntl: (locale: Locale.Code) => Promise<{
messages: Partial<Record<string, import("@prezly/theme-kit-intl").IntlMessageFormat>>;
formatMessage(descriptor: IntlMessageDescriptor, values?: IntlMessageValues<string>): string;
timezone: string;
}>;
FormattedMessage: (props: {
for: IntlMessageDescriptor;
values?: IntlMessageValues<string | ReactElement>;
locale: Locale.Code;
}) => Promise<import("react/jsx-runtime").JSX.Element>;
FormattedDate: (props: Omit<BaseFormattedDate.Props, "timezone">) => Promise<import("react/jsx-runtime").JSX.Element>;
FormattedTime: (props: Omit<BaseFormattedTime.Props, "timezone">) => Promise<import("react/jsx-runtime").JSX.Element>;
};
}
export {};