From 91d153aca3a6998579ede1fd7b25b8af2b373393 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Fri, 27 Mar 2026 09:29:13 +0100 Subject: [PATCH] doc: add for `sub` in `SubstitutionValue` --- packages/element-web-module-api/src/api/i18n.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/element-web-module-api/src/api/i18n.ts b/packages/element-web-module-api/src/api/i18n.ts index c63bb807b7..030081ae9d 100644 --- a/packages/element-web-module-api/src/api/i18n.ts +++ b/packages/element-web-module-api/src/api/i18n.ts @@ -20,6 +20,11 @@ export type Translations = Record< /** * The value a variable or tag can take for a translation interpolation. + * + * When used as a function, `sub` is the text content wrapped between the tag + * in the translation string. For example, given `"Click here"`, the + * function receives `"here"` and should return a `ReactNode` wrapping it. + * * @public */ export type SubstitutionValue = number | string | ReactNode | ((sub: string) => ReactNode);