import { Component, JSX, ParentComponent } from 'solid-js' import type { TransRenderCallbackOrComponent, I18nContext } from "@lingui-solid/solid" import type { MacroMessageDescriptor } from "@lingui/core/macro" type CommonProps = TransRenderCallbackOrComponent & { id?: string comment?: string context?: string } type TransProps = { children: JSX.Element } & CommonProps type PluralChoiceProps = { value: string | number /** Offset of value when calculating plural forms */ offset?: number zero?: JSX.Element one?: JSX.Element two?: JSX.Element few?: JSX.Element many?: JSX.Element /** Catch-all option */ other: JSX.Element /** Exact match form, corresponds to =N rule */ [digit: `_${number}`]: JSX.Element } & CommonProps type SelectChoiceProps = { value: string /** Catch-all option */ other: JSX.Element [option: `_${string}`]: JSX.Element } & 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: ParentComponent /** * Props of Plural macro are transformed into plural format. * * @example * ``` * import { Plural } from "@lingui/core/macro" * * * // ↓ ↓ ↓ ↓ ↓ ↓ * import { Trans } from "@lingui-solid/solid" * * ``` */ export const Plural: Component /** * 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: Component /** * Props of Select macro are transformed into select format * * @example * ``` * // gender == "female" -> Her book * // gender == "male" -> His book * // gender == "non-binary" -> Their book * *