generaltranslation 8.1.21 → 8.1.22

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.
package/dist/index.d.ts CHANGED
@@ -61,10 +61,14 @@ type JsxElement = {
61
61
  c?: JsxChildren;
62
62
  };
63
63
  type JsxChild = string | JsxElement | Variable;
64
+ /**
65
+ * The format of the string content
66
+ */
67
+ type StringFormat = 'ICU' | 'I18NEXT' | 'STRING';
64
68
  /**
65
69
  * The format of the content
66
70
  */
67
- type DataFormat = 'JSX' | 'ICU' | 'I18NEXT' | 'STRING';
71
+ type DataFormat = 'JSX' | StringFormat;
68
72
  /**
69
73
  * A content type representing JSX, ICU, and I18next messages
70
74
  */
@@ -928,6 +932,7 @@ declare class GT {
928
932
  * @param {string} message - The message to format.
929
933
  * @param {string | string[]} [locales='en'] - The locales to use for formatting.
930
934
  * @param {FormatVariables} [variables={}] - The variables to use for formatting.
935
+ * @param {StringFormat} [dataFormat='ICU'] - The format of the message.
931
936
  * @returns {string} The formatted message.
932
937
  *
933
938
  * @example
@@ -940,6 +945,7 @@ declare class GT {
940
945
  formatMessage(message: string, options?: {
941
946
  locales?: string | string[];
942
947
  variables?: FormatVariables;
948
+ dataFormat?: StringFormat;
943
949
  }): string;
944
950
  /**
945
951
  * Formats a number according to the specified locales and options.
@@ -1303,6 +1309,7 @@ declare function formatCutoff(value: string, options?: {
1303
1309
  * @param {string} message - The message to format.
1304
1310
  * @param {string | string[]} [locales='en'] - The locales to use for formatting.
1305
1311
  * @param {FormatVariables} [variables={}] - The variables to use for formatting.
1312
+ * @param {StringFormat} [dataFormat='ICU'] - The format of the message. (When STRING, the message is returned as is)
1306
1313
  * @returns {string} The formatted message.
1307
1314
  *
1308
1315
  * @example
@@ -1315,6 +1322,7 @@ declare function formatCutoff(value: string, options?: {
1315
1322
  declare function formatMessage(message: string, options?: {
1316
1323
  locales?: string | string[];
1317
1324
  variables?: FormatVariables;
1325
+ dataFormat?: StringFormat;
1318
1326
  }): string;
1319
1327
  /**
1320
1328
  * Formats a number according to the specified locales and options.