@ikas/bp-storefront 1.4.0-beta.219 → 1.4.0-beta.220

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,3 +7,17 @@ export declare class I18n {
7
7
  static translate(key: string, params?: Record<string, string>): string;
8
8
  }
9
9
  export declare const i18n: I18n;
10
+ /**
11
+ * A code component project's UI texts, key → base text. Empty here: each project fills it in its generated
12
+ * `src/i18n/index.d.ts`, which makes `t` check its keys and `{{params}}`.
13
+ */
14
+ export interface UiTexts {
15
+ }
16
+ type UiTextParams<T> = T extends `${string}{{${infer P}}}${infer R}` ? P | UiTextParams<R> : never;
17
+ type UiTextArgs<K> = K extends keyof UiTexts ? [UiTextParams<UiTexts[K]>] extends [never] ? [] : [params: Record<UiTextParams<UiTexts[K]>, string | number>] : [params?: Record<string, string | number>];
18
+ /**
19
+ * The project's UI text `key` in the store's language, its `{{param}}`s filled; the key itself when no text has it.
20
+ * Types only: the code component build binds it to the project's own texts (this shared runtime has no `t`).
21
+ */
22
+ export declare function t<K extends [keyof UiTexts] extends [never] ? string : keyof UiTexts>(key: K, ...[params]: UiTextArgs<K>): string;
23
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "1.4.0-beta.219",
3
+ "version": "1.4.0-beta.220",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",