import type { ReactNode } from "react" import type { TransRenderCallbackOrComponent, I18nContext } from "@lingui/react" import type { MacroMessageDescriptor, LabeledExpression, } from "@lingui/core/macro" import type { MessageId } from "@lingui/core" type CommonProps = TransRenderCallbackOrComponent & { id?: MessageId comment?: string context?: string } type TransChildren = ReactNode | LabeledExpression type TransProps = { children: TransChildren | TransChildren[] } & CommonProps type PluralChoiceProps = { value: string | number | LabeledExpression /** Offset of value when calculating plural forms */ offset?: number zero?: ReactNode one?: ReactNode two?: ReactNode few?: ReactNode many?: ReactNode /** Catch-all option */ other: ReactNode /** Exact match form, corresponds to =N rule */ [digit: `_${number}`]: ReactNode } & CommonProps type SelectChoiceProps = { value: string | LabeledExpression /** Catch-all option */ other: ReactNode [option: `_${string}`]: ReactNode } & CommonProps /** * Trans is the basic macro for static messages, * messages with variables, but also for messages with inline markup * * @example * ``` * Hello {username}. Read the docs. * ``` * @example * ``` * Hello {username}. * ``` */ export const Trans: (props: TransProps) => ReactNode /** * Props of Plural macro are transformed into plural format. * * @example * ``` * import { Plural } from "@lingui/core/macro" * * * // ↓ ↓ ↓ ↓ ↓ ↓ * import { Trans } from "@lingui/react" * * ``` */ export const Plural: (props: PluralChoiceProps) => ReactNode /** * Props of SelectOrdinal macro are transformed into selectOrdinal format. * * @example * ``` * // count == 1 -> 1st * // count == 2 -> 2nd * // count == 3 -> 3rd * // count == 4 -> 4th * * ``` */ export const SelectOrdinal: (props: PluralChoiceProps) => ReactNode /** * Props of Select macro are transformed into select format * * @example * ``` * // gender == "female" -> Her book * // gender == "male" -> His book * // gender == "non-binary" -> Their book * *