@types/react-i18next
Advanced tools
Comparing version 4.6.4 to 4.6.5
@@ -0,0 +0,0 @@ import * as React from "react"; |
// Type definitions for react-i18next 4.6 | ||
// Project: https://github.com/i18next/react-i18next | ||
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas> | ||
// Netanel Gilad <https://github.com/netanelgilad> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -34,5 +35,5 @@ // TypeScript Version: 2.8 | ||
export interface InjectedTranslateProps { | ||
t?: TranslationFunction; | ||
t: TranslationFunction; | ||
} | ||
export as namespace reactI18Next; |
@@ -0,0 +0,0 @@ import * as React from "react"; |
@@ -0,0 +0,0 @@ import * as React from "react"; |
{ | ||
"name": "@types/react-i18next", | ||
"version": "4.6.4", | ||
"version": "4.6.5", | ||
"description": "TypeScript definitions for react-i18next", | ||
@@ -11,2 +11,7 @@ "license": "MIT", | ||
"githubUsername": "GiedriusGrabauskas" | ||
}, | ||
{ | ||
"name": "Netanel Gilad", | ||
"url": "https://github.com/netanelgilad", | ||
"githubUsername": "netanelgilad" | ||
} | ||
@@ -21,7 +26,7 @@ ], | ||
"dependencies": { | ||
"@types/i18next": "*", | ||
"@types/react": "*" | ||
"@types/react": "*", | ||
"@types/i18next": "*" | ||
}, | ||
"typesPublisherContentHash": "b7d54ce2e7bbbe15417753e92e86e243cee2576ca1c2407b1b07189ac0212234", | ||
"typesPublisherContentHash": "70002b5c233451ff75dc5ea5a522c106f49d9ac051cc7feb08d8ad0ce8399647", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,7 +11,7 @@ # Installation | ||
Additional Details | ||
* Last updated: Sat, 04 Aug 2018 00:56:32 GMT | ||
* Dependencies: i18next, react | ||
* Last updated: Fri, 31 Aug 2018 20:06:31 GMT | ||
* Dependencies: react, i18next | ||
* Global values: reactI18Next | ||
# Credits | ||
These definitions were written by Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>. | ||
These definitions were written by Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>, Netanel Gilad <https://github.com/netanelgilad>. |
@@ -0,0 +0,0 @@ import * as React from "react"; |
import * as React from "react"; | ||
import { i18n } from "i18next"; | ||
import { InjectedTranslateProps } from "react-i18next"; | ||
@@ -14,3 +15,12 @@ export interface TranslateOptions { | ||
// Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 | ||
export type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>; | ||
// Injects props and removes them from the prop requirements. | ||
// Adds the new properties t (or whatever the translation function is called) and i18n if needed. | ||
export type InferableComponentEnhancerWithProps<TTranslateFunctionName extends string> = | ||
<P extends { [key: string]: any }>(component: React.ComponentClass<P> | React.StatelessComponent<P>) => | ||
React.ComponentClass<Omit<P, keyof InjectedTranslateProps | TTranslateFunctionName>>; | ||
// tslint:disable-next-line:ban-types | ||
export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): <C extends Function>(WrappedComponent: C) => C; | ||
export default function translate<TKey extends string = string>(namespaces?: TKey[] | TKey, options?: TranslateOptions): InferableComponentEnhancerWithProps<"t">; |
Sorry, the diff of this file is not supported yet
6754
95