@npm-questionpro/wick-ui-lib 1.17.3-next.0 → 1.17.4-next.0

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.
@@ -0,0 +1,2 @@
1
+ import { IWuTranslationContextType } from './types';
2
+ export declare const WuTranslationContext: import('react').Context<IWuTranslationContextType | null>;
@@ -0,0 +1,6 @@
1
+ import { ReactNode, default as React } from 'react';
2
+ interface IProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare const WuTranslationProvider: React.FC<IProps>;
6
+ export {};
@@ -1 +1,4 @@
1
- export { loadTranslations, setFallbackTranslations, translate, useTranslation, } from './WuUseTranslation';
1
+ export { useContext } from 'react';
2
+ export { useTranslation, useTranslationsContext } from './useTranslationContext';
3
+ export { WuTranslationContext } from './WuTranslationContext';
4
+ export { WuTranslationProvider } from './WuTranslationProvider';
@@ -0,0 +1,8 @@
1
+ export type ITranslateFn = (key: string, fallback?: string) => string;
2
+ export interface IWuTranslationContextType {
3
+ useTranslation: () => {
4
+ t: ITranslateFn;
5
+ };
6
+ loadTranslations: (source: string, fallback?: Record<string, string>) => Promise<void>;
7
+ setFallbackTranslations: (fallback: Record<string, string>) => void;
8
+ }
@@ -0,0 +1,3 @@
1
+ import { IWuTranslationContextType } from './types';
2
+ export declare const useTranslation: () => ReturnType<IWuTranslationContextType["useTranslation"]>;
3
+ export declare const useTranslationsContext: () => IWuTranslationContextType;