@connectedcars/react-i18n
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -5,2 +5,3 @@ /// <reference types="react" /> | ||
import { Translations } from '../translate'; | ||
import { TranslateFunc, TranslatePluralFunc } from '../types'; | ||
export interface ProviderProps { | ||
@@ -26,8 +27,8 @@ lang?: string; | ||
getChildContext(): { | ||
t: (text: string, data?: Object, context?: string) => string; | ||
tn: (n: number, text: string, textPlural: string, data?: Object, context?: string) => string; | ||
t: TranslateFunc; | ||
tn: TranslatePluralFunc; | ||
}; | ||
translate: (translations: Translations, lang?: string) => (text: string, data?: Object, context?: string) => string; | ||
ntranslate: (translations: Translations, lang?: string) => (n: number, text: string, textPlural: string, data?: Object, context?: string) => string; | ||
translate: (translations: Translations, lang?: string) => TranslateFunc; | ||
ntranslate: (translations: Translations, lang?: string) => TranslatePluralFunc; | ||
render(): React.ReactNode; | ||
} |
/// <reference types="react" /> | ||
import React, { ComponentType } from 'react'; | ||
import * as PropTypes from 'prop-types'; | ||
import { TranslateFunc, TranslatePluralFunc } from '../types'; | ||
export interface WithTranslateProps { | ||
t(text: string, data?: Object, context?: string): string; | ||
tn(n: number, text: string, textPlural: string, data?: Object, context?: string | null): string; | ||
t: TranslateFunc; | ||
tn: TranslatePluralFunc; | ||
} | ||
export declare function withTranslate<T>(WrappedComponent: ComponentType<T>): { | ||
export declare function withTranslate<T>(WrappedComponent: ComponentType<T & WithTranslateProps>): { | ||
new (props: T, context?: any): { | ||
addExtraProps(props: any): any; | ||
render(): React.ReactElement<T>; | ||
render(): React.ReactElement<T & WithTranslateProps>; | ||
setState<K extends never>(f: (prevState: Readonly<{}>, props: T) => Pick<{}, K>, callback?: () => any): void; | ||
@@ -13,0 +14,0 @@ setState<K extends never>(state: Pick<{}, K>, callback?: () => any): void; |
{ | ||
"name": "@connectedcars/react-i18n", | ||
"author": "Connected Cars <oss@connectedcars.io>", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Translations!", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25336
32
604