Example:
/**
* @typedef {"welcome_email" | "email_heading"} EmailLocaleIDs
* @typedef {"footer_title" | "footer_sendoff"} FooterLocaleIDs
* @typedef {`${EmailLocaleIDs | FooterLocaleIDs}_id`} AllLocaleIDs
* @typedef {"en" | "ja" | "pt"} Lang
* @typedef {`${Lang}_${AllLocaleIDs}`} LocaleMessageIDs
*/
These templates literal types produce permutations of all input unions, for example:

More info: https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html