Type Alias TranslationParams<TTranslation, TPrefix, _TWords>

TranslationParams: Prettify<
    _TWords extends [
        infer TFirstWord extends string,
        ...(infer TRestWords extends string[]),
    ]
        ? StartsWith<TFirstWord, TPrefix> extends true
            ? TFirstWord extends TPrefix
                ? TRestWords extends EmptyArray
                    ? {}
                    : TranslationParamListToString<TRestWords, TPrefix>
                : Record<TrimEnd<TFirstWord, StopChars>, string> & (
                    TRestWords extends EmptyArray
                        ? {}
                        : TranslationParamListToString<TRestWords, TPrefix>
                )
            : TRestWords extends EmptyArray
                ? {}
                : TranslationParamListToString<TRestWords, TPrefix>
        : {},
>

Type Parameters

  • TTranslation extends string
  • TPrefix extends string = DefaultPrefix
  • _TWords extends string[] = SplitWords<Replace<TTranslation, "\n", " ">>