File tree Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " intl-react" ,
3
- "version" : " 4.0.2 " ,
3
+ "version" : " 4.0.3 " ,
4
4
"type" : " module" ,
5
5
"scripts" : {
6
6
"dev" : " vite" ,
Original file line number Diff line number Diff line change 1
- export interface IntlProps {
1
+ export type IntlProps = {
2
2
languages : Record < string , any > ;
3
3
defaultLanguage : string ;
4
4
detectBrowserLanguage ?: boolean ;
5
- }
6
-
7
- export interface IntlContext {
5
+ } ;
6
+ export type IntlContext = {
8
7
locale : string ;
9
8
setLocale : ( language : string ) => void ;
10
9
languages : Record < string , any > ;
11
10
defaultLanguage : string ;
12
- }
13
-
11
+ } ;
14
12
export type TrContext = Omit < IntlContext , "setLocale" > ;
15
-
16
13
type KeyPrefix < T extends string > = T extends "" ? "" : `.${T } `;
17
-
18
14
type Suffix = "zero" | "one" | "two" | "few" | "many" | "female" | "male" ;
19
15
type DynamicSuffix = Partial < Record < Suffix , string > > ;
20
-
21
16
export type KeyPath < T > = (
22
17
T extends DynamicSuffix
23
18
? ""
@@ -29,14 +24,15 @@ export type KeyPath<T> = (
29
24
) extends infer D
30
25
? Extract < D , string >
31
26
: never ;
32
-
33
- export type TParams = { count ?: number ; [ key : string ] : any } ;
34
-
27
+ export type TParams = {
28
+ count ?: number ;
29
+ [ key : string ] : any ;
30
+ } ;
35
31
export type Autocomplete < schema > = KeyPath < schema > ;
36
-
37
- export interface UseTranslation extends IntlContext {
32
+ export type UseTranslation = {
38
33
T : < Key extends string , Params extends TParams > (
39
34
key : Key ,
40
35
params ?: Params ,
41
36
) => string ;
42
- }
37
+ } & IntlContext ;
38
+ export { } ;
You can’t perform that action at this time.
0 commit comments