react-i18next 11.15.1 → 11.15.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 11.15.2
2
+
3
+ - types: TypeScript interface for the Trans component does now accept react-native props [1418](https://github.com/i18next/react-i18next/pull/1418)
4
+
1
5
  ### 11.15.1
2
6
 
3
7
  - add missing types for shouldUnescape and useTranslation [1429](https://github.com/i18next/react-i18next/pull/1429)
package/README.md CHANGED
@@ -4,15 +4,9 @@
4
4
  [![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/i18next/react-i18next)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/i18next/react-i18next/badge.svg)](https://coveralls.io/github/i18next/react-i18next)
6
6
  [![Quality][quality-badge] ][quality-url]
7
- [![dependencies][dependencies-image] ][dependencies-url]
8
- [![devdependencies][devdependencies-image] ][devdependencies-url]
9
7
 
10
8
  [npm-icon]: https://nodei.co/npm/react-i18next.png?downloads=true
11
9
  [npm-url]: https://npmjs.org/package/react-i18next
12
- [dependencies-image]: https://david-dm.org/i18next/react-i18next.png
13
- [dependencies-url]: https://david-dm.org/i18next/react-i18next
14
- [devdependencies-image]: https://david-dm.org/i18next/react-i18next/dev-status.png
15
- [devdependencies-url]: https://david-dm.org/i18next/react-i18next#info=devDependencies
16
10
  [quality-badge]: http://npm.packagequality.com/shield/react-i18next.svg
17
11
  [quality-url]: http://packagequality.com/#?package=react-i18next
18
12
 
@@ -36,8 +30,9 @@ npm i react-i18next@legacy
36
30
 
37
31
  ### Documentation
38
32
 
39
- The documentation is published on [react.i18next.com](https://react.i18next.com)
40
- The general i18next documentation is published on [www.i18next.com](https://www.i18next.com)
33
+ The documentation is published on [react.i18next.com](https://react.i18next.com) and PR changes can be supplied [here](https://github.com/i18next/react-i18next-gitbook).
34
+
35
+ The general i18next documentation is published on [www.i18next.com](https://www.i18next.com) and PR changes can be supplied [here](https://github.com/i18next/i18next-gitbook).
41
36
 
42
37
  ### What will my code look like?
43
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-i18next",
3
- "version": "11.15.1",
3
+ "version": "11.15.2",
4
4
  "description": "Internationalization for react done right. Using the i18next i18n ecosystem.",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "types": "./index.d.ts",
@@ -49,6 +49,7 @@
49
49
  "@testing-library/jest-dom": "^5.11.6",
50
50
  "@testing-library/react": "^11.2.7",
51
51
  "@testing-library/react-hooks": "^3.4.2",
52
+ "@types/react-native": "^0.66.6",
52
53
  "all-contributors-cli": "^6.20.0",
53
54
  "babel-core": "^7.0.0-bridge.0",
54
55
  "babel-eslint": "^10.0.3",
@@ -93,6 +94,14 @@
93
94
  "i18next": ">= 19.0.0",
94
95
  "react": ">= 16.8.0"
95
96
  },
97
+ "peerDependenciesMeta": {
98
+ "react-dom": {
99
+ "optional": true
100
+ },
101
+ "react-native": {
102
+ "optional": true
103
+ }
104
+ },
96
105
  "scripts": {
97
106
  "clean": "rimraf dist && mkdirp dist",
98
107
  "copy": "cp-cli ./dist/umd/react-i18next.min.js ./react-i18next.min.js && cp-cli ./dist/umd/react-i18next.js ./react-i18next.js",
@@ -109,9 +118,9 @@
109
118
  "test:watch": "cross-env BABEL_ENV=development jest --no-cache --watch",
110
119
  "test:coverage": "cross-env BABEL_ENV=development jest --no-cache --coverage",
111
120
  "test:lint": "eslint ./src ./test",
112
- "test:typescript": "tslint --project tsconfig.json",
113
- "test:typescript:noninterop": "tslint --project tsconfig.nonEsModuleInterop.json",
114
- "test:typescript:customtypes": "tslint --project ./test/typescript/custom-types/tsconfig.json",
121
+ "test:typescript": "tslint --project tsconfig.json '**/*.ts'",
122
+ "test:typescript:noninterop": "tslint --project tsconfig.nonEsModuleInterop.json '**/*.ts'",
123
+ "test:typescript:customtypes": "tslint --project ./test/typescript/custom-types/tsconfig.json '**/*.ts'",
115
124
  "contributors:add": "all-contributors add",
116
125
  "contributors:generate": "all-contributors generate",
117
126
  "prettier": "prettier --write \"{,**/}*.{ts,tsx,js,json,md}\""
package/ts4.1/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import i18next, {
8
8
  TFunctionResult,
9
9
  } from 'i18next';
10
10
  import * as React from 'react';
11
+ import { TextProps } from 'react-native';
11
12
 
12
13
  type Subtract<T extends K, K> = Omit<T, keyof K>;
13
14
 
@@ -130,10 +131,10 @@ type NormalizeMulti<T, U extends keyof T, L = LastOf<U>> = L extends U
130
131
  ? AppendNS<L, Normalize<T[L]>> | NormalizeMulti<T, Exclude<U, L>>
131
132
  : never;
132
133
 
133
- type CustomTypeParameters = {
134
+ interface CustomTypeParameters {
134
135
  returnNull?: boolean;
135
136
  returnEmptyString?: boolean;
136
- };
137
+ }
137
138
 
138
139
  type TypeOptionsFallback<TranslationValue, Option, MatchingValue> = Option extends false
139
140
  ? TranslationValue extends MatchingValue
@@ -234,12 +235,12 @@ export interface TFunction<N extends Namespace = DefaultNamespace, TKPrefix = un
234
235
  ): TFuncReturn<N, TKeys, TDefaultResult, TKPrefix>;
235
236
  }
236
237
 
237
- export interface TransProps<
238
+ export type TransProps<
238
239
  K extends TFuncKey<N, TKPrefix> extends infer A ? A : never,
239
240
  N extends Namespace = DefaultNamespace,
240
241
  TKPrefix = undefined,
241
- E extends Element = HTMLDivElement
242
- > extends React.HTMLProps<E> {
242
+ E extends React.HTMLProps<HTMLDivElement> | TextProps
243
+ > = E & {
243
244
  children?: React.ReactNode;
244
245
  components?: readonly React.ReactNode[] | { readonly [tagName: string]: React.ReactNode };
245
246
  count?: number;
@@ -252,13 +253,13 @@ export interface TransProps<
252
253
  values?: {};
253
254
  shouldUnescape?: boolean;
254
255
  t?: TFunction<N, TKPrefix>;
255
- }
256
+ };
256
257
 
257
258
  export function Trans<
258
259
  K extends TFuncKey<N, TKPrefix> extends infer A ? A : never,
259
260
  N extends Namespace = DefaultNamespace,
260
261
  TKPrefix extends KeyPrefix<N> = undefined,
261
- E extends Element = HTMLDivElement
262
+ E extends React.HTMLProps<HTMLDivElement> | TextProps = React.HTMLProps<HTMLDivElement>
262
263
  >(props: TransProps<K, N, TKPrefix, E>): React.ReactElement;
263
264
 
264
265
  export function useSSR(initialI18nStore: Resource, initialLanguage: string): void;
package/tslint.json CHANGED
@@ -2,6 +2,14 @@
2
2
  "defaultSeverity": "error",
3
3
  "extends": "dtslint/dtslint.json",
4
4
  "rules": {
5
- "semicolon": false
5
+ "array-type": [true, "array"],
6
+ "no-empty-interface": false,
7
+ "no-redundant-jsdoc": false,
8
+ "no-unnecessary-generics": false,
9
+ "semicolon": false,
10
+ "strict-export-declare-modifiers": false
11
+ },
12
+ "linterOptions": {
13
+ "exclude": ["node_modules/**/*"]
6
14
  }
7
15
  }