@zonos/amino 5.6.1 → 5.6.2

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.
@@ -1,18 +1,4 @@
1
1
  import { type ReactNode } from 'react';
2
- import type { ExtractVariables } from './_handleTranslationVariables';
3
- import type { SupportedLanguageCode } from './supportedLanguages';
4
- /**
5
- * Require variables argument to be an object with keys that match the variables in the string.
6
- * If no variables are present, variables argument is optional.
7
- */
8
- export type TranslateProps<T extends string> = {
9
- languageCode?: SupportedLanguageCode;
10
- text: T;
11
- } & (ExtractVariables<T> extends never ? {
12
- variables?: never;
13
- } : {
14
- variables: Record<ExtractVariables<T>, ReactNode>;
15
- });
16
2
  export declare const handleTranslateComponentText: ({ translatedTextNoJsx, variables, }: {
17
3
  translatedTextNoJsx: string;
18
4
  variables: Record<string, ReactNode>;
@@ -1,10 +1,4 @@
1
- /**
2
- * Extracts variables pattern "[pattern]" from a string
3
- * @example
4
- * type Variables = ExtractVariables<'[percentage] GST due on any order above [threshold].'>
5
- * // Variables = 'percentage' | 'threshold'
6
- */
7
- export type ExtractVariables<TString extends string> = TString extends `${string}[${infer Var}]${infer End}` ? Var | ExtractVariables<End> : never;
1
+ import type { ExtractVariables } from './translate';
8
2
  /**
9
3
  * AMINO UTILITY: Handles variable interpolation in translated text
10
4
  *
@@ -1,6 +1,12 @@
1
- import { type ExtractVariables } from "./_handleTranslationVariables";
2
1
  import type { SupportedLanguageCode } from './supportedLanguages';
3
2
  export type { AminoTranslationStrings } from "./AminoTranslationStore";
3
+ /**
4
+ * Extracts variables pattern "[pattern]" from a string
5
+ * @example
6
+ * type Variables = ExtractVariables<'[percentage] GST due on any order above [threshold].'>
7
+ * // Variables = 'percentage' | 'threshold'
8
+ */
9
+ export type ExtractVariables<TString extends string> = TString extends `${string}[${infer Var}]${infer End}` ? Var | ExtractVariables<End> : never;
4
10
  /**
5
11
  * Strips the --context: suffix from a translation string type
6
12
  */